scverse / scvi-tools

Deep probabilistic analysis of single-cell and spatial omics data
http://scvi-tools.org/
BSD 3-Clause "New" or "Revised" License
1.21k stars 344 forks source link

Device management #2992

Open canergen opened 2 hours ago

canergen commented 2 hours ago
  1. Use TOTALVI.train(accelerator = 'cpu', devices = 1), the program detects the GPU environment, and still uses the GPU for training. As shown in the figure below, due to my GPU driver, the GPU reports an error, indicating that the program still uses GPU resources for training instead of CPU resources 30F79B4C-0EEC-47af-B4FF-9B3CE725E988

  2. How to use multi-core CPU for model training

Originally posted by @raozuming in https://github.com/scverse/scvi-tools/issues/2889#issuecomment-2367582829

canergen commented 2 hours ago

Please don't post issues that are unrelated. Especially not in releases. Torch uses by default multiple workers. I can't reproduce that using accelerator='cpu' doesn't disable the GPU. Which version of scvi-tools are you using? You can also set cuda visible devices to os.environ["CUDA_VISIBLE_DEVICES"]="" at the top of your script. Lastly, I would not recommend installing a CUDA version of torch and don't install correct drivers and would recommend updating CUDA drivers to a more recent version.