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

large spatial dataset processing #12

Open
TheSingleCell opened this issue Jan 23, 2025 · 1 comment
Open

large spatial dataset processing #12

TheSingleCell opened this issue Jan 23, 2025 · 1 comment

Comments

@TheSingleCell
Copy link

Dear Team,
Great work! I’m using CAST to align my Xenium data, which typically contains over 200,000 cells per tissue section. However, I ran into a GPU memory issue, even though my GPU has 96GB of RAM. Do you have any suggestions for handling CUDA "out of memory" errors with large spatial datasets like Xenium or MERFISH? I noticed in your tutorial that the data is downsampled to 20,000 cells, but I’d prefer not to do that since I want to align all the cells in my dataset. Thanks so much for your help!

@luosc
Copy link
Collaborator

luosc commented Jan 25, 2025

Hello TheSingleCell,

Thank you for your note. We are delighted to see CAST applied on such big datasets. Our current implementation is based on DGL and PyTorch. Currently, it is obvious that it is almost impossible to feed such large graphs into your VRAM. Maybe in the near future there will be optimization in DGL and/or PyTorch in this respect. For the CAST Mark part, we haven't tested mini-batching strategies that breaks tissues into small subgraphs. But if you manage to succeed in mini batch strategies, there will not be any issue with VRAM. It is unclear to what extent mini batch strategies influence the performance of CAST Mark. We will be very happy to test and incorporate your solution into our code base. For the CAST Stack part, it is important to have the entirety of the tissue maintained during the alignment optimization (I mean here you cannot cut your slices into patches or subgraphs). So random downsampling strategies is the way to go. We run optimization on subsampled coordinates but CAST will apply the calculated transformation on the original sample with full resolution (same number of cells as your raw data). All above is said for the GPU. We also tested that CAST works in the CPU mode as well, albeit at a cost of speed.

Finally, since you have large datasets, do you also have a large number of tissue samples? Please let me know if you publish your dataset. If we ended up improving the alignment tool, we would be interested to test it out on your data. Please feel free to email me at [email protected]

Thank you,
Shuchen Luo

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

No branches or pull requests

2 participants