Guidance on speeding up Geneformer ISP on CPU
Dear Christina,
Thank you for your fantastic work on Geneformer — it’s been very useful for us, with remarkably meaningful predictions.
I’m reaching out for advice on performance. We’re planning many InSilicoPerturber (ISP) runs and need faster turnaround, but our GPU access is intermittent.
What’s the best way to parallelize ISP on CPU?
For context:
We precomputed embeddings and load them from a pickle file.
GPU is not always available, so we’d like a robust CPU-only path.
I’ve experimented with CPU parallelism but still see mostly serial execution.
If you have recommended settings or patterns (e.g., num_proc usage, safe ways to shard genes/targets across processes or jobs, etc), I’d be very grateful. I’m happy to share a minimal script and logs if helpful.
Many thanks for your time and guidance!
Warm regards,
Bogdan
Thank you for your question! We have not tried running the in silico perturbation on CPU so may not have that much specific advice. One option if the access to GPUs is limited is to try the quantized version of in silico perturbation so that it may run faster to finish within your allotted access time. In terms of parallelizing, it's most efficient to run separate processes per gene target if there are a few targets. If running for all gene targets, it is more efficient to parallelize by cell batches, which can be split with cell indices.