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

Enable GPU #37

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Enable GPU #37

wants to merge 4 commits into from

Conversation

rilango
Copy link

@rilango rilango commented Nov 11, 2024

No description provided.

@slowkow
Copy link
Owner

slowkow commented Nov 12, 2024

Hey Rajesh, thanks for the pull request! This looks interesting.

Have you tested that it works as expected? Do you get similar results with GPU set to True or False? Could you share any benchmarking results that might help users understand the expected benefit from using GPU? Thanks again!

@rilango rilango changed the title Enable GPU DRAFT: Enable GPU Nov 12, 2024
@rilango
Copy link
Author

rilango commented Nov 12, 2024

Sorry, I have not yet completely tested. I should have marked the MR as Draft. I will get back to you soon.

@rilango
Copy link
Author

rilango commented Nov 12, 2024

It is still failing a test.

All such imports are appended with an underscore.

Other changes include a pytest to measure performance.
@rilango rilango changed the title DRAFT: Enable GPU Enable GPU Dec 21, 2024
@rilango
Copy link
Author

rilango commented Dec 21, 2024

@slowkow please find a unit test for perf committed(marked skip). While testing with data/pbmc_3500_pcs.tsv.gz the difference is 3 vs 5 secs.

While testing with larger datasets the difference is very noticeable. When the input size is (35922, 25101) it is 10sec vs 73sec.

The results are very similar. The difference starts appearing after 2nd decimal place. Please find attached the first 100 lines from the following code.

harmonized = hm.run_harmony(adata.obsm['X_pca'], adata.obs, 'old.ident')
df_harmonized = pd.DataFrame(harmonized.Z_corr)
df_harmonized.columns = adata.obs_names
adata.obsm['X_harmony'] = df_harmonized.T

harmonized_cpu.csv
harmonized_gpu.csv

Please also find the statistical differences below:
image

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.

2 participants