Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running inference on CPU #149

Open
AD-lite24 opened this issue Aug 22, 2024 · 3 comments
Open

Running inference on CPU #149

AD-lite24 opened this issue Aug 22, 2024 · 3 comments

Comments

@AD-lite24
Copy link

Hi I was wondering if there was any support for CPU inferences. The sample script from hubconf.py doesn't run even if after all the code instructing tensors and models to move to cuda were removed perhaps because of some internal line which still expects CUDA

torch.autocast(device_type='cuda', dtype=torch.bfloat16, enabled=False)

in mono/model/decode_heads/RAFTDepthNormalDPTDecoder5.py

Not sure how many more such instances there are so I wanted to get it clarified. I am sure it will be difficult to run on CPU but still

@elvistheyo
Copy link

@AD-lite24 were you able to run it on CPU?

@AD-lite24
Copy link
Author

@elvistheyo Nope as I said it would take a lot of effort which might end up wasted anyway. Let me know if you choose to try it out though I could try to assist you with it if possible

@JUGGHM
Copy link
Collaborator

JUGGHM commented Sep 3, 2024

I think it will be difficult and not beneficial to infer on cpu. Approximately it will take 1.5~4 minutes to perform one inference for the ViT-L model. Additionally, one important acceleration library xformers does not support cpu as well.
The type torch.bfloat16 is only supported on GPU. The data type for all tensors should be torch.float32 for cpu devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants