14 research outputs found
Towards a Pythonic framework for control and analysis of magnetic levitation systems
openLa levitazione magnetica rappresenta una tecnologia affascinante con applicazioni
in diversi settori, dalla ricerca scientifica all’industria. Questa tesi si concentra sulla
creazione di un software in Python per il controllo e l’analisi della levitazione magnetica.
Verranno presentati i fondamenti matematici che governano la levitazione
magnetica e verr`a fornita un’implementazione Python open-source disponibile su
GitHub. Saranno discussi i principali ostacoli nell’implementazione del software in
Python, evidenziando le differenze rispetto all’uso di MATLAB. Verranno eseguite
comparazioni tra le simulazioni effettuate con il software e i risultati ottenuti con
MATLAB, con un’analisi delle differenze di velocit`a tra le due piattaforme. Uno
dei principali risultati emersi dalla ricerca `e che Python risulta pi`u lento rispetto a
MATLAB nell’esecuzione delle simulazioni di levitazione magnetica. Questo problema
sar`a esaminato in dettaglio e saranno proposte soluzioni per migliorare le
prestazioni del software Python. In particolare, verranno considerate le tecniche di
compilazione Just-in-time (JIT) per accelerare l’esecuzione del codice. Questa tesi
analizzer`a diverse approssimazioni per le funzioni ellittiche ellipk ed ellipe utilizzate
nel software e ne comparer`a l’accuratezza e le prestazioni.
Infine sono state eseguite simulazioni del controllore LQR in MATLAB e in Python.
L’obiettivo principale di questo lavoro `e costruire un framework completo in Python
per il controllo e l’analisi della levitazione magnetica, con l’ambizione di contribuire
al progresso della ricerca in questo campo.Magnetic levitation represents a fascinating technology with applications in various
fields, from scientific research to industry. This thesis focuses on the development of
a Python software framework for the control and analysis of magnetic levitation systems.
We will present the mathematical foundations governing magnetic levitation
and provide an open-source Python implementation available on GitHub. We will
discuss the major challenges in implementing the software in Python, highlighting
the differences compared to MATLAB. Comparisons will be made between simulations
performed using the software and results obtained with MATLAB, with an
analysis of the speed differences between the two platforms. One of the key findings
of this research is that Python is fundamentally slower than MATLAB in executing
magnetic levitation simulations. This issue will be examined in detail, and solutions
will be proposed to enhance the performance of the Python software. In particular,
Just-in-time (JIT) compilation techniques will be considered to accelerate code execution.
This thesis will analyze different approximations for the elliptic functions
ellipk and ellipe used in the software, and compare their accuracy and performance.
In the end, the LQR controller was simulated using MATLAB and Python.
The primary objective of this work is to construct a comprehensive Python framework
for the control and analysis of magnetic levitation, with the ambition of contributing
to the advancement of research in this field
ALPyNA: Acceleration of Loops in Python for Novel Architectures
We present ALPyNA, an automatic loop parallelization framework for Python, which analyzes data dependences within nested loops and dynamically generates CUDA kernels for GPU execution. The ALPyNA system applies classical dependence analysis techniques to discover and exploit potential parallelism. The skeletal structure of the dependence graph is determined statically (if possible) or at runtime; this is combined with type and bounds information discovered at runtime, to auto-generate high-performance kernels for offload to GPU.
We demonstrate speedups of up to 1000x relative to the native CPython interpreter across four array-intensive numerical Python benchmarks. Performance improvement is related to both iteration domain size and dependence graph complexity. Nevertheless, this approach promises to bring the benefits of manycore parallelism to application developers
Integrals over Gaussians under Linear Domain Constraints
Integrals of linearly constrained multivariate Gaussian densities are a
frequent problem in machine learning and statistics, arising in tasks like
generalized linear models and Bayesian optimization. Yet they are notoriously
hard to compute, and to further complicate matters, the numerical values of
such integrals may be very small. We present an efficient black-box algorithm
that exploits geometry for the estimation of integrals over a small, truncated
Gaussian volume, and to simulate therefrom. Our algorithm uses the
Holmes-Diaconis-Ross (HDR) method combined with an analytic version of
elliptical slice sampling (ESS). Adapted to the linear setting, ESS allows for
rejection-free sampling, because intersections of ellipses and domain
boundaries have closed-form solutions. The key idea of HDR is to decompose the
integral into easier-to-compute conditional probabilities by using a sequence
of nested domains. Remarkably, it allows for direct computation of the
logarithm of the integral value and thus enables the computation of extremely
small probability masses. We demonstrate the effectiveness of our tailored
combination of HDR and ESS on high-dimensional integrals and on entropy search
for Bayesian optimization
High-speed processing of X-ray wavefront marking data with the Unified Modulated Pattern Analysis (UMPA) model
Wavefront-marking X-ray imaging techniques use e.g., sandpaper or a grating
to generate intensity fluctuations, and analyze their distortion by the sample
in order to retrieve attenuation, phase-contrast, and dark-field information.
Phase contrast yields an improved visibility of soft-tissue specimens, while
dark-field reveals small-angle scatter from sub-resolution structures. Both
have found many biomedical and engineering applications. The previously
developed Unified Modulated Pattern Analysis (UMPA) model extracts these
modalities from wavefront-marking data. We here present a new UMPA
implementation, capable of rapidly processing large datasets and featuring
capabilities to greatly extend the field of view. We also discuss possible
artifacts and additional new features.Comment: 18 pages, 7 figures, submitted to Optics Expres
PULSEE: A software for the quantum simulation of an extensive set of magnetic resonance observables
We present an open-source software for the simulation of observables in
magnetic resonance experiments, including nuclear magnetic/quadrupole resonance
NMR/NQR and electron spin resonance (ESR), developed to assist experimental
research in the design of new strategies for the investigation of fundamental
quantum properties of materials, as inspired by magnetic resonance protocols
that emerged in the context of quantum information science (QIS). The package
introduced here enables the simulation of both standard NMR spectroscopic
observables and the time-evolution of an interacting single-spin system subject
to complex pulse sequences, i.e. quantum gates. The main purpose of this
software is to facilitate in the development of much needed novel NMR-based
probes of emergent quantum orders, which can be elusive to standard
experimental probes. The software is based on a quantum mechanical description
of nuclear spin dynamics in NMR/NQR experiments and has been widely tested on
available theoretical and experimental results. Moreover, the structure of the
software allows for basic experiments to easily be generalized to more
sophisticated ones, as it includes all the libraries required for the numerical
simulation of generic spin systems. In order to make the program easily
accessible to a large user base, we developed a user-friendly graphical
interface, Jupyter notebooks, and fully-detailed documentation. Lastly, we
portray several examples of the execution of the code that illustrate the
potential of a novel NMR paradigm, inspired by QIS, for efficient investigation
of emergent phases in strongly correlated materials.Comment: 51 page
Truly Sparse Neural Networks at Scale
Recently, sparse training methods have started to be established as a de
facto approach for training and inference efficiency in artificial neural
networks. Yet, this efficiency is just in theory. In practice, everyone uses a
binary mask to simulate sparsity since the typical deep learning software and
hardware are optimized for dense matrix operations. In this paper, we take an
orthogonal approach, and we show that we can train truly sparse neural networks
to harvest their full potential. To achieve this goal, we introduce three novel
contributions, specially designed for sparse neural networks: (1) a parallel
training algorithm and its corresponding sparse implementation from scratch,
(2) an activation function with non-trainable parameters to favour the gradient
flow, and (3) a hidden neurons importance metric to eliminate redundancies. All
in one, we are able to break the record and to train the largest neural network
ever trained in terms of representational power -- reaching the bat brain size.
The results show that our approach has state-of-the-art performance while
opening the path for an environmentally friendly artificial intelligence era.Comment: 30 pages, 17 figure
Programação paralela do método dos elementos de contorno
Trabalho de Conclusão de Curso (graduação)—Universidade de BrasÃlia, Faculdade de Tecnologia, Departamento de Engenharia Mecânica, 2020.O presente trabalho explora técnicas de programação de alto desempenho para
aperfeiçoar um código de método dos elementos de contorno (MEC). Serão discutidas
as vantagens da implementação da programação em paralelo, passando por uma revisão
teórica sobre vetorização, multi-threading e programação paralela em clusters. A implementação
do MEC foi escrita em Python devido a facilidade de programação que reduz
o tempo gasto na etapa de desenvolvimento. Serão avaliadas as partes que mais consomem
tempo de processamento para uma otimização utilizando a biblioteca Cython, que
transforma trechos do programa em extensões em C. Foi explorado o uso de Softwares
livres, Open Source, para soluções de geração de CAD (FreeCad, Designspark Mechanical),
geração de malha (GMSH), leitura e conversão de malha (Meshio), visualização e
pós-processamento (ParaView). Por fim, foi analisado o impacto da implementação de paralelismo,
com memória compartilhada, em um dos trechos crÃticos da rotina de cálculo e
foram discutidos os aspectos práticos e dificuldades técnicas, deste método, com o intuito
de fomentar o uso de novas práticas mais eficientes de programação. A paralelização da
rotina de integração, existente no código, aumentou a velocidade por um fator igual ao
número de processadores utilizados.The present work explore high performance programming techniques to enhance
a boundary element method (BEM) code. It was discussed the advantages of implementing
parallel programming, throughout the concept of vectorization, multi-threading and
parallel programming on clusters. The BEM implementation has been written in Python
due to the ease of programming that reduces the time spent in the development stage.
The most time consuming parts will be evaluated for a optimization utilizing the Cython
library, that turns program snippets into C extensions. Free Open Source Softwares will
be explored for solutions of CAD generation (FreeCad, Designspark Mechanical), Mesh
generation (GMSH), Mesh reading and conversion (Meshio), visualization and post processing
(ParaView).Finally, it was analised the impact of a parallel implementation, with
shared memory, on a critical section of the calculation routine and it was discussed the
practical aspects and technical dificulties of such method, with the intention of fomenting
the use of new and more efficient programming practices. The paralelization of the
integration routine, that exist in the code, enhanced the speed by a factor equal to the
number of processors utilized