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

enh(model_loaders): Add GPU support. #75

Merged
merged 1 commit into from
Jan 9, 2025
Merged

enh(model_loaders): Add GPU support. #75

merged 1 commit into from
Jan 9, 2025

Conversation

daavoo
Copy link
Contributor

@daavoo daavoo commented Dec 26, 2024

Set n_gpu_layers based on torch.cuda.is_available

This just requires to install the correct llama-cpp-python (https://llama-cpp-python.readthedocs.io/en/latest/#supported-backends). For example in a Google Colab:

!pip install https://github.com/abetlen/llama-cpp-python/releases/download/v0.3.4-cu122/llama_cpp_python-0.3.4-cp310-cp310-linux_x86_64.whl

Example running on GPU inside Google Colab:

image

Takes less than 2 min:

image

Set n_gpu_layers based on torch.cuda.is_available
@daavoo daavoo self-assigned this Dec 26, 2024
@daavoo daavoo requested review from a team and removed request for a team December 26, 2024 13:10
@daavoo daavoo marked this pull request as draft December 26, 2024 13:26
@daavoo daavoo marked this pull request as ready for review December 26, 2024 13:38
@daavoo daavoo requested a review from a team December 26, 2024 13:38
Copy link
Member

@Kostis-S-Z Kostis-S-Z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR only adds GPU support for the LLM whereas #55 adds support only for the TTS, so I don't understand why we should be closing #55.

@daavoo
Copy link
Contributor Author

daavoo commented Dec 30, 2024

This PR only adds GPU support for the LLM whereas #55 adds support only for the TTS, so I don't understand why we should be closing #55.

This PR makes both text to text and text to speech use GPU. You can test it in #77

@Kostis-S-Z
Copy link
Member

This PR only adds GPU support for the LLM whereas #55 adds support only for the TTS, so I don't understand why we should be closing #55.

This PR makes both text to text and text to speech use GPU. You can test it in #77

Right, you are loading the Oute model on the GPU, I was looking at the parler code. Shall we add support only for that one then?

@daavoo
Copy link
Contributor Author

daavoo commented Jan 9, 2025

Right, you are loading the Oute model on the GPU, I was looking at the parler code. Shall we add support only for that one then?

I think we can go with this for now as the main purpose was to get the demo working on a GPU.

@daavoo daavoo merged commit 87569b4 into main Jan 9, 2025
3 checks passed
@daavoo daavoo deleted the gpu-support branch January 9, 2025 10:09
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

Successfully merging this pull request may close these issues.

2 participants