Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel fitting #17

Merged
merged 6 commits into from
Jul 22, 2021
Merged

Parallel fitting #17

merged 6 commits into from
Jul 22, 2021

Conversation

HannoSpreeuw
Copy link
Collaborator

This parallellisation of the fitting of sources should be the last part of the parallellisation of pyse.
This does not mean that it is as fast as it could be.
That would require translation of some routines to C-libraries.

But I think all the low-hanging fruit wrt straightforward parallellisation has been picked with this last merge.

…longest time within _pyse, so we want to parallellize the fitting loop over all the CPU cores. It does not make sense to distribute all islands over threads separately, because it will impose too much overhead. We encountered this before when kappa, sigma clipping subimages: rows of subimages turned out to be preferable. Now we are doing something similar as rows of subimages: island_block, i.e. a list of islands of a size convenient for a single CPU core. This commit is an intermediate step and does not invoke parallellisation yet.
…ction will get a dask.delayed and staticmethod decorator and then it should work. Now it is still an instance method, so some refactoring will be needed.
…mewhat "cleaner". However, the fitting time has increased and the resulting island map is empty.
…and in island_list:' loop in ImageData._pyse. It seemed hard to construct a static or class method for e.g. dask.delayed or dask.bag since there were no many dependencies on the instance. Then I decided to try to parallellize the first part of this loop - i.e. fit_results = island.fit(fixed=fixed), no instance dependencies - only and leave the rest as serial code. This worked out really well, because the rest of the 'for island in island_list:' turned out to take a short time. This parallellisation of the fitting loop should conclude all pyse parallellisations. Any significant additional speedups can only come from translating Python code to e.g. C, I reckon.
@HannoSpreeuw HannoSpreeuw self-assigned this Jul 22, 2021
@HannoSpreeuw HannoSpreeuw merged commit e5812c3 into accelerated Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant