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

Allow for specifying a tensor device in AnnLoader #1240

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

austinv11
Copy link

Currently AnnLoader only supports transferring tensors to cuda devices. However, PyTorch as of late has much improved its support of other devices such as mps (Mac GPUs) and XLA (Google TPUs). So I added a device argument that is more semantically similar to other PyTorch APIs to defer to the user to decide which accelerator device (if any) to load the data onto.

  • Closes N/A
  • Tests added: There are currently no tests for AnnLoader. So I am not sure how to add tests for this.
  • Release note added (or unnecessary)

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Merging #1240 (91f66fb) into main (3e340e1) will decrease coverage by 2.27%.
The diff coverage is 22.22%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1240      +/-   ##
==========================================
- Coverage   85.27%   83.00%   -2.27%     
==========================================
  Files          34       34              
  Lines        5404     5408       +4     
==========================================
- Hits         4608     4489     -119     
- Misses        796      919     +123     
Flag Coverage Δ
gpu-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
anndata/experimental/pytorch/_annloader.py 22.11% <22.22%> (+0.11%) ⬆️

... and 8 files with indirect coverage changes

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.

None yet

1 participant