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

请问可以在cpu上推理吗?大概要多少内存?谢谢 #6

Open
wenli135 opened this issue Nov 27, 2023 · 6 comments
Open

请问可以在cpu上推理吗?大概要多少内存?谢谢 #6

wenli135 opened this issue Nov 27, 2023 · 6 comments

Comments

@wenli135
Copy link

如果把代码里所有对 cuda()的调用改掉,可以在cpu上推理吗?

@amith-ananthram
Copy link

@wenli135 I was able to do this!

@wenli135
Copy link
Author

@wenli135 I was able to do this!

What changes had you made to the codes?

@amith-ananthram
Copy link

You can see my minimal edits here: main...amith-ananthram:Chinese-LLaVA:main

@wenli135
Copy link
Author

You can see my minimal edits here: main...amith-ananthram:Chinese-LLaVA:main

thanks

@wenli135
Copy link
Author

You can see my minimal edits here: main...amith-ananthram:Chinese-LLaVA:main

I use your code to run it on cpu, got error: TypeError: init() got an unexpected keyword argument 'attn_implementation',
then I remove argument attn_implementation="flash_attention_2" when initialize LlavaLlamaForCausalLM, but got another error: RuntimeError: "slow_conv2d_cpu" not implemented for 'Half'.

Any suggestion? thanks.

@sjh231
Copy link

sjh231 commented Apr 15, 2024

You can see my minimal edits here: main...amith-ananthram:Chinese-LLaVA:main

I use your code to run it on cpu, got error: TypeError: init() got an unexpected keyword argument 'attn_implementation', then I remove argument attn_implementation="flash_attention_2" when initialize LlavaLlamaForCausalLM, but got another error: RuntimeError: "slow_conv2d_cpu" not implemented for 'Half'.

Any suggestion? thanks.

我绝对是Half表示半精度。然后可能cpu不支持半精度运算。因为我之前在使用BLIP2大模型的时候也是出现了这个问题,具体怎么解决我不太清楚,你可以问一下文心一言或者gpt?

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