snap-stanford / GEARS

GEARS is a geometric deep learning model that predicts outcomes of novel multi-gene perturbations
MIT License
189 stars 38 forks source link

Moving `torch.device` to work in Google Colab #66

Closed jamesbraza closed 4 months ago

jamesbraza commented 4 months ago

In https://github.com/snap-stanford/GEARS/blob/719328bd56745ab5f38c80dfca55cfd466ee356f/demo/model_tutorial.ipynb

device = 'cuda:7'

Running the notebook will fail with:

RuntimeError: CUDA error: invalid device ordinal
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

Can we adjust the demo notebook to use cuda:0? That way it will work on Google Colab, which only gives one CUDA device by default

yhr91 commented 4 months ago

Sure, feel free to make the changes on your end. Will add it to the next commit