Comments (3)
I know that OCTOPUS (developed by ESO) also takes several days for the largest systems (https://www.eso.org/sci/facilities/develop/ao/tecno/octopus.html) to simulate. And this a is custom piece of software that has been developed to take advantage of multi-processing on large clusters. Even in those cases it still takes some time to run simulations.
We check if there are parts of the code that can be speed up, but usually it is not easy to create higher performance code. This is mainly because hcipy has more of a focused on flexibility and correctness. And depending on how you setup things it chooses the best method available which may not be the fastest method.
What are you trying to simulate with which parameter set? And have you tried to profile your code? Then we have an indication which part is actually slowing down the calculations and we could provide some suggestions.
from hcipy.
Indeed, HCIPy is focused on correctness and flexibility/ease-of-use, rather than speed. That being said, we take care to not sacrifice performance unnecessarily. In a typical application, most of the time (think >80%) is spent inside numpy functions, primarily np.dot()
, which are highly optimized. Some specific examples of potential speed improvements that are on my radar:
- For the
FraunhoferPropagator
propagations, there might be a speedup with numba of about 10-20% based on experiences of people developing other packages. I tried replicating their benchmarks but didn't see the same improvement, so I never looked into this further. A GPU implementation would improve performance by ~3-5x. I had one student working on an implementation which indicated that integration into HCIPy was not as simple as we expected. I'm currently interested in an implemention using TensorFlow or pyTorch, which is super interesting for other reasons as well. - For the
FresnelPropagator
propagations, there is a speedup of ~3x by removing unnecessary (i)fftshifts. This would be a relatively easy implementation. There could be another independent ~3x improvement when transitioning to a GPU implementation, but I never benchmarked this sufficiently well.
My own simulations are generally limited by Fraunhofer propagations, so at maximum a 3-5x speed improvement can be obtained. Your ATLAS/BLAS implementation is ~10-20% typically. Using Anaconda should install this correctly. Tuning your sampling can yield more improvement than these. Multiprocessing is something to look at if you are doing broadband simulations, though most BLAS implementations already try to use multithreading to some degree for speedup. I never looked closely at numba so it might be that I missed something there.
You should really do a profile to see what part of your simulation is actually limiting you. That gives you an indication where the most gain can be made.
from hcipy.
Last week I saw a presentation of compass (https://anr-compass.github.io/compass/index.html). This is a GPU accelerated end-to-end AO simulation. There is a python interface for compass. And I learned that there is interest in adding HCIPy functionality with compass. So we could always write a HCIPy interface to communicate with compass. The downside of compass is that it only works on LINUX+NVIDIA.
from hcipy.
Related Issues (20)
- `VectorVortexCoronagraph.backward()` is broken HOT 3
- Deterministic atmospheric phase screens #173 HOT 2
- 'gaussian_mode' is not defined HOT 8
- Is it possible to remove specific modes in atmospher layer using HCIPy? HOT 4
- Add a function to pad regularly-spaced grids HOT 4
- Observing a Satellite (e.g. ISS) HOT 2
- `utcnow` is deprecated in Python 3.12
- Add support for Python 3.11.
- Drop support for Python 3.7. HOT 1
- The random function in the deformable mirror is not functioning properly HOT 2
- Matplotlib 3.7 `get_cmap()` deprecation warning
- Numpy 1.25 deprecation warning
- Imageio v3 API changes.
- Add support for Python 3.12.
- Add support for geometric operations
- pip install hcipy not complete? HOT 2
- Add grid indexing support when indexing or slicing a Field HOT 2
- docstring error in FraunhoferPropagator (?) HOT 2
- Non ideal optics to emulate manufacturing errors?
- FraunhoferPropagator total power not conserved HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hcipy.