Skip to content

Update/parallel #150

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

Closed
wants to merge 3 commits into from
Closed

Update/parallel #150

wants to merge 3 commits into from

Conversation

selmanozleyen
Copy link
Collaborator

@selmanozleyen selmanozleyen commented Feb 25, 2025

I added a script to measure the speedup. I didn't spend much time on this script tbh. So I am not sure if this is how the dataset would scale up but it is now parallel without copying data so there should be an improvement. Here is how you run the script

pytest tests/test_speedup.py -vs 

And here are the results I got

tests/test_speedup.py::test_scaling 
Testing with 500000 cells (scale factor: 1000)
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 77/77 [00:01<00:00, 45.74it/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 77/77 [00:01<00:00, 47.40it/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 71/71 [00:01<00:00, 51.67it/s]
Sequential: 5.0808 seconds
Parallel (30 workers): 4.3786 seconds
-------------------------------------------

I also updated the tests so it tests for both parallel and non parallel.
To use this code in your existing code you should do the change like:

_ = dm.get_train_data(
      test_adata, 
      parallelize=True,
      n_workers=n_workers
  )

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