GPU Requirement for Cell State Classifier

#360
by cparsonage - opened

I am interested in using cell state classifier without a GPU. I know that the documentation recommends the usage of a GPU for "efficient usage of Geneformer" but it was my understanding that it is still doable without one. Currently when running the cc.validate function I get an error. The code and error are below.

all_metrics = cc.validate(model_directory="Geneformer/geneformer-12L-30M",
                          prepared_input_data_file=f"{output_dir}/{output_prefix}_labeled_train.dataset",
                          id_class_dict_file=f"{output_dir}/{output_prefix}_id_class_dict.pkl",
                          output_directory=output_dir,
                          output_prefix=output_prefix)

RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

I don't have easy access to a GPU currently so I am wondering if there is a way around this issue that doesn't involve using a machine with a GPU.

Thank you for your question and interest in Geneformer! Geneformer is a pytorch model that can be used with CPU resources, but we have not tested the provided classifier code with CPUs and you likely will need to adjust the code for CPUs. You can start by looking at the code to identify areas where data or models are moved to the GPU (search for cuda for example) and adjust those. You can also look at examples we have in earlier versions of this repository before we added the classifier module to see how to use the Hugging Face classification modules directly and use those as our classifier code is a wrapper to facilitate easy use but is based on the Hugging Face modules.

ctheodoris changed discussion status to closed

Sign up or log in to comment