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

Implement support for CUDA #944

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Implement support for CUDA #944

wants to merge 25 commits into from

Conversation

gaby
Copy link
Member

@gaby gaby commented Dec 4, 2023

Done:

  • Adds support for using CUDA GPU's
  • Adds -cuda docker images

TODO:

  • Fix startup scripts
  • Add nvidia-runtime image to Dockerfile.gpu
  • Investigate if CUDA images have Python, and which version.
  • Update README.md

Fixes #43
Fixes #128

Summary by CodeRabbit

  • New Features
    • Introduced a GitHub Actions workflow for building and publishing a Docker image with CUDA support.
    • Added a multi-stage build process for a containerized application with enhanced GPU support.
  • Enhancements
    • Updated .dockerignore to optimize Docker builds.
    • Modified GitHub Actions workflow to improve Docker image building and publishing.
    • Expanded deployment and development scripts to dynamically support NVIDIA and AMD GPUs.
  • Configuration
    • Added GPU support flags in the configuration to toggle NVIDIA and AMD GPU support.

@lgblkb
Copy link

lgblkb commented Feb 7, 2024

Hi guys! First of all, thanks for this amazing project! Any news regarding release of CUDA support feature?

@JuniperChris929
Copy link

Please add this pull request - it would really make a difference if we can finally use CUDA :)

Smartappli and others added 7 commits February 12, 2024 22:54
* Update dev.sh

* Update deploy.sh

* Update serge.env

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
* Update serge.env

* Update deploy.sh

Update path

* Update dev.sh

update path

* Update serge.env

* Update serge.env

Bump version of Llama cpp python to v0.2.44
@gaby
Copy link
Member Author

gaby commented Feb 26, 2024

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Feb 26, 2024

Note

Reviews Paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Walkthrough

The project has been enhanced to support GPU acceleration, specifically targeting NVIDIA and AMD GPUs, for Dockerized large language models. This includes configuring the build process to create Docker images with CUDA support, adjusting deployment scripts to dynamically select package sources based on GPU architecture, and setting up environment variables for GPU support. These changes aim to improve performance by leveraging GPU capabilities for computational tasks.

Changes

File(s) Change Summary
.dockerignore Exclude Dockerfile; Include docker/ directory
.github/workflows/.../docker-gpu.yml New workflow for building/publishing Docker images with CUDA support
.github/workflows/.../docker.yml Updated paths for Dockerfiles and Docker context
docker/Dockerfile.gpu Multi-stage build for an environment with GPU support
scripts/deploy.sh, scripts/dev.sh Expanded logic for GPU support, including dynamic package URLs
scripts/serge.env Added GPU support flags for NVIDIA and AMD

Assessment against linked issues

Objective Addressed Explanation
Add the Ability to Use NVIDIA for Docker (#43)
Make the webui and container work with a GPU version of llama (#128)

Poem

In a burrow, not so deep,
A rabbit dreamt as it did sleep.
Of Docker images, sleek and fast,
With NVIDIA and AMD, at last.
🚀 Through the code, changes weave,
🐇 For a future, we believe.
GPU support, now unfurled,
A swifter world, now heralded.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 26bf8a3 and 38d2245.
Files ignored due to path filters (1)
  • docker-compose.dev.yml is excluded by: !**/*.yml
Files selected for processing (7)
  • .dockerignore (1 hunks)
  • .github/workflows/docker-gpu.yml (1 hunks)
  • .github/workflows/docker.yml (2 hunks)
  • docker/Dockerfile.gpu (1 hunks)
  • scripts/deploy.sh (1 hunks)
  • scripts/dev.sh (1 hunks)
  • scripts/serge.env (1 hunks)
Additional comments: 5
scripts/serge.env (1)
  • 1-2: The addition of SERGE_GPU_NVIDIA_SUPPORT and SERGE_GPU_AMD_SUPPORT configuration flags with default values set to false is a clear and effective way to introduce optional GPU support. This approach allows for easy configuration and ensures backward compatibility by making GPU support opt-in.
.dockerignore (1)
  • 12-12: Updating the .dockerignore file to ignore the docker/ directory is a good practice for optimizing Docker builds by excluding unnecessary files. This change supports a cleaner project structure by centralizing Docker-related files.
.github/workflows/docker.yml (1)
  • 63-63: The update to the Dockerfile path in the .github/workflows/docker.yml workflow file correctly reflects the project's restructuring to support GPU-enabled Docker images. This change ensures that the CI/CD pipeline builds and publishes the correct Docker images.
scripts/deploy.sh (1)
  • 28-35: The updated logic in deploy.sh for dynamically setting the pip_command based on NVIDIA or AMD GPU support is well-implemented, aligning with the PR's objectives to introduce flexible GPU support. Ensure that the serge.env file is correctly sourced in deployment environments to properly set the SERGE_GPU_NVIDIA_SUPPORT and SERGE_GPU_AMD_SUPPORT variables.
scripts/dev.sh (1)
  • 29-36: The updates to dev.sh for dynamically setting the pip_command based on GPU support are consistent with similar changes in deploy.sh, promoting flexibility and alignment with the PR's objectives. Ensure that the serge.env file is correctly sourced in development environments to properly set the GPU support variables.

docker/Dockerfile.gpu Show resolved Hide resolved
.github/workflows/docker-gpu.yml Show resolved Hide resolved
@gaby gaby mentioned this pull request Feb 27, 2024
@gaby
Copy link
Member Author

gaby commented Mar 30, 2024

@coderabbitai pause

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

Successfully merging this pull request may close these issues.

[Enhancement] Add the Ability to Use NVIDIA for Docker GPU support
4 participants