scnym icon indicating copy to clipboard operation
scnym copied to clipboard

scNym Will Not Install

Open Kwasi-Scientist opened this issue 1 year ago • 5 comments

The scNym package (and tutorials) are broken as it attempts to install leidenalg==0.8.0 from cache and fails. Please see the below error message. Please fix the scNym package requirements.

Collecting scnym Using cached scnym-0.3.2-py2.py3-none-any.whl (68 kB) Collecting anndata==0.7.4 (from scnym) Using cached anndata-0.7.4-py3-none-any.whl (118 kB) Collecting ConfigArgParse==1.1 (from scnym) Using cached ConfigArgParse-1.1.tar.gz (41 kB) Preparing metadata (setup.py) ... done Collecting h5py==2.10.0 (from scnym) Using cached h5py-2.10.0.tar.gz (301 kB) Preparing metadata (setup.py) ... done Collecting leidenalg==0.8.0 (from scnym) Using cached leidenalg-0.8.0.tar.gz (4.1 MB) Installing build dependencies ... done Getting requirements to build wheel ... done error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. Preparing metadata (pyproject.toml) ... error error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

Kwasi-Scientist avatar May 10 '23 00:05 Kwasi-Scientist

Also note that this was run using python 3.10.11 which is the default python version on google colab. Switching to lower version of python such as 3.8 will break other packages such as scanpy.

Kwasi-Scientist avatar May 10 '23 00:05 Kwasi-Scientist

Hi @Kwasi-Scientist, sorry for the delayed response. I made some updates to the dependency version requirements. If you still wanna try out scnym, could you follow the installation instructions to create a new conda environment with python 3.8 and try installing again from github (by pip install -e scnym/) rather than PyPI?

hy395 avatar Dec 16 '23 04:12 hy395

Hi, I ran scnym exactly following the installation tutorial on github and got the following error RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc)

The GPU model is A100 Thanks for help

weir12 avatar Dec 25 '23 08:12 weir12

hey @weir12 -- the error above could stem from either:

  1. A CUDA installation issue. To check that, try to do a matrix multiply on the CUDA device and ensure it passes.

e.g.

import torch


def main():
  A = torch.randn(3,4).cuda()
  B = torch.randn(4,4).cuda()
  
  C = A @ B
  print(C)

main()
  1. A shape mismatch issue in CUDA. This typically happens if the input and output shapes you specify for the model don't match the data you pass in. For example, if you set n_cell_types to 5, but the actual number in your data is 6, or if you set the number of genes to a different number than you passed in. If you used scnym.api.scnym_api, you wouldn't be touching those directly, so the most likely cause is that the object you trained on has a different number of genes present than the object you predicted on.

I hope that helps!

jacobkimmel avatar Dec 25 '23 17:12 jacobkimmel

Hello @jacobkimmel,

I've managed to resolve the issue by transitioning to a V100 compute cluster. It appears that the A100 is incompatible with older versions of CUDA. If feasible, could you please update the PyTorch version in the dependency file? This change would prompt Conda to install a newer version of CUDA, ensuring compatibility with more recent graphics cards. https://github.com/calico/scnym/blob/77310272e3b755d1a263c0162fbb421f78305fb7/requirements.txt#L26C1-L26C1 Thank you for your prompt assistance!

Best regards,

weir12 avatar Dec 26 '23 10:12 weir12