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 instead of GPU #4

Closed
TechnologyClassroom opened this issue Aug 3, 2022 · 4 comments
Closed

CPU instead of GPU #4

TechnologyClassroom opened this issue Aug 3, 2022 · 4 comments

Comments

@TechnologyClassroom
Copy link

Is there a way to do such a thing with CPU instead of GPU? I know this would be slower, but it would be a cheaper solution and would not depend on NVIDIA.

@moyix
Copy link
Collaborator

moyix commented Aug 3, 2022

You won't be able to do that with this particular codebase (which is heavily dependent on FasterTransformer so that it can get decent latency), but this gist from @nforest shows how to use any model from Huggingface Transformers with Copilot, and Transformers supports doing CPU-only:

https://gist.github.com/nforest/d1432b917468f5ad24b83954c98e67b1

You should be able to pass in pretrained=Salesforce/codegen-16B-multi there and device='cpu' to run everything on the CPU instead.

I do warn you that it will be a lot slower!

@moyix moyix closed this as completed Aug 3, 2022
@TechnologyClassroom
Copy link
Author

TechnologyClassroom commented Aug 3, 2022

Thank you!

Edit: Running off CPU makes this more accessible by moving the barrier to entry from a $3000 rig to a $1000 rig.

@1muen
Copy link

1muen commented Aug 5, 2022

@TechnologyClassroom Did you tried it? How long did it take for a completion on what cpu? 😃

@TechnologyClassroom
Copy link
Author

TechnologyClassroom commented Aug 5, 2022

@1muen I didn't try it yet. I commented asking about licensing and have not heard back. (That project really deserves to be a full repo too)

moyix pushed a commit that referenced this issue Sep 20, 2022
Catch up with origin
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