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

parallelize #36

Open
maxcw opened this issue Apr 30, 2020 · 4 comments
Open

parallelize #36

maxcw opened this issue Apr 30, 2020 · 4 comments
Assignees
Labels
enhancement New feature of request on hold This issue to be resolved at a later time

Comments

@maxcw
Copy link

maxcw commented Apr 30, 2020

It would be great if there's an option for embarrassingly parallel computations, especially if all N^2 distances are calculated.

@vc1492a
Copy link
Owner

vc1492a commented May 1, 2020

@maxcw Thanks for opening the issue, I agree that it would be a nice option to provide parallelism as part of the available options for computation. I believe this is available via numba, the JIT-compilation library that's an option when using PyNomaly.

Since parallel computation is an option when using numba, it may be pretty straight-forward to try and test the following implementation, more specifically take this line:

compute = numba.jit(self._compute_distance_and_neighbor_matrix,

In pass the parameter parallel in the following way:

# parallel is some boolean parameter set earlier, e.g. 
parallel = True
compute = numba.jit(self._compute_distance_and_neighbor_matrix,
                            cache=True, parallel=parallel) if self.use_numba else \
            self._compute_distance_and_neighbor_matrix

I'll mark this as an enhancement to take a look at for a future release (or please feel free to try it yourself and submit a PR). Thanks!

@vc1492a vc1492a added the enhancement New feature of request label May 1, 2020
@vc1492a vc1492a added the in progress This issue is being actively worked on label Sep 4, 2020
@vc1492a vc1492a self-assigned this Sep 4, 2020
@vc1492a
Copy link
Owner

vc1492a commented Sep 17, 2020

Work on this issue can now be tracked in #43.

@vc1492a
Copy link
Owner

vc1492a commented Oct 20, 2020

May be helpful to use a tracing tool like pyinstrument to gauge the effect of certain code changes.

@vc1492a vc1492a added on hold This issue to be resolved at a later time and removed in progress This issue is being actively worked on labels Jun 28, 2022
@vc1492a
Copy link
Owner

vc1492a commented Jun 28, 2022

Implemented in the branch feature/numba parallel but performance is not improved.

@vc1492a vc1492a added this to the Lightning Speed milestone Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature of request on hold This issue to be resolved at a later time
Projects
None yet
Development

No branches or pull requests

3 participants