bonito
bonito copied to clipboard
bonito on CPU (AMD)
Can bonito be used on CPU (AMD)? I'm interested in using pretrained fast model, so Intel (openvino) optimizations may not be needed. I'd really appreciate some installation guidance of CPU-only version :)
My error when I try --device cpu
File "/lib/python3.7/site-packages/koi/ctc.py", line 201, in logZ_fwd_cu
assert Ms.device.index is not None
AssertionError
I have got the same error. File "/lib/python3.8/site-packages/koi/ctc.py", line 201, in logZ_fwd_cu assert Ms.device.index is not None AssertionError
Hi @lpryszcz - What is the full command you are running?
It looks like CPU support may not be working for your use-case, CPU training/basecalling is not something we ever run internally so these issue can creep in.
I would strongly advise against using CPU with Bonito - It is a GPU-first application and even when this issue is resolved, for anything but the smallest workloads performance will likely be unsatisfactory.
Hi, I'm only using fast
models. We're developing an app and providing only CPU-mode should be enough for our use cases (and cheaper to deploy for end users :) ), so having working CPU version would be fantastic.
To me it seems that assert Ms.device.index is not None
requires cuda device ID ie 1 for cuda:1, that's why it fails with CPU. Am I right?
Yes, I think your theory is correct. Can you try using Guppy? For your use case of AMD CPU-based basecalling this may be a more appropriate solution.
so I've edited koi/ctc.py
- commented out
assert Ms.device.index is not None
- and replaced
Ms.device.index
withMs.device.index if Ms.device.type=='cuda' else None
and it was executing on CPU, but there were some errors about wrong data placement.
But at least it made me realise that even fast
model was running several times longer on CPU (on all 16-cores!) than on GPU.
So I dropped the effort - it's as you said, running bonito models on CPU is likely a blind alley :)
Thanks @lpryszcz - will get this patched into koi.
Have the fixes been implemented in the koi package to allow it to run on a cpu?
Have the fixes been implemented in the koi package to allow it to run on a cpu?
This hasn't happened yet. However as noted running Bonito on CPU is usually too slow for any practical purpose anyway. Is there a reason for not running on GPU?
Any news regarding Bonito on CPU?
I Have no access to GPU computer at the moment and need to test Bonito on a small data set for future use. I get the assertion error as well and gues its due to the luck of Cuda. Any suggestions?
@assafgrw please use dorado for this use-case https://github.com/nanoporetech/dorado