trying to make RAGGraphBuilder faster #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
Thank you again for this package and all your work on it.
I was dabbling with the RAGGraphBuilder for my dataset and I wanted to try and make the tissue graph processing faster.
I tried implementing multiprocessing on _set_node_labels and _build_topology with the pathos.multiprocessing ProcessPool. It works fine on my machine (maybe a 2-4x speedup), but it is far from an elegant solution.
I am sure there is a cleaner way to write this, maybe with joblib?
https://joblib.readthedocs.io/en/latest/parallel.html
One problem is that the memory consumption can spike fairly high above 50GB depending on the data and num_workers, so that might crash a job if someone isn't expecting it... Not sure what the work around is in Python, maybe using numba or something similar?
Anyways, thought I would pass it along. Thanks again!
Best,
Jack