-
Notifications
You must be signed in to change notification settings - Fork 277
[Bugfix] Fix lora operator compatibility with other operator #597
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
base: main
Are you sure you want to change the base?
[Bugfix] Fix lora operator compatibility with other operator #597
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @zerofishnoodles, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request primarily focuses on enhancing the compatibility and functionality of LoRA (Low-Rank Adaptation) within the vLLM production stack on Kubernetes. It introduces shared persistent storage for LoRA adapters, configures vLLM runtimes to utilize these adapters, and updates the operator's capabilities and sample configurations to support a more robust LoRA deployment workflow, addressing compatibility issues with the vLLM runtime and router.
Highlights
- Shared Persistent Storage for LoRA: Implemented a shared Persistent Volume (PV) and Persistent Volume Claim (PVC) to provide a common storage location for LoRA adapters, accessible by both the operator and vLLM runtime pods. This enables a centralized and persistent way to manage LoRA models.
- LoRA Runtime Integration and Configuration: Configured vLLM runtime deployments to enable LoRA (
enableLoRA: true
) and allow dynamic runtime updating of LoRA models via theVLLM_ALLOW_RUNTIME_LORA_UPDATING
environment variable, ensuring seamless integration with the LoRA operator. - Operator RBAC and Logic Enhancements: Updated the operator's RBAC permissions to manage
persistentvolumeclaims
,persistentvolumes
, andingresses
. The vLLM runtime controller now includes reconciliation logic to automatically provision the shared PV/PVC if they don't exist, and both vLLM router and runtime controllers propagate all labels from their custom resources to the generated Deployments for improved resource management. - Updated Sample Configurations: Revised the example YAML manifests for
LoraAdapter
,VLLMRouter
, andVLLMRuntime
to demonstrate fetching LoRA adapters from Hugging Face (including a sample secret for credentials) and using model-specific labels (model=llama-3.1-8b-instruct
) for routing, showcasing a complete LoRA deployment scenario.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request fixes compatibility issues for the LoRA operator and adds support for a shared Persistent Volume Claim (PVC) to store LoRA adapters. The changes update the operator deployment, RBAC roles, and controllers to handle the shared storage. The sample configurations are also updated to reflect these new capabilities.
My review focuses on the new PV/PVC management logic. While the intent is good, the implementation has some critical issues:
- The use of
hostPath
for aReadWriteMany
PV is not suitable for multi-node clusters. - The logic for creating the PV and PVC within the
VLLMRuntime
controller can lead to race conditions and will not work correctly in multi-namespace scenarios. - The controller code incorrectly attempts to use a namespace with cluster-scoped
PersistentVolume
resources. - There are also some minor issues like unnecessary RBAC permissions, a code style suggestion for better readability, and suggestions for improving comments and clarity in the sample configurations.
I've provided detailed comments and suggestions to address these points.
return &corev1.PersistentVolume{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: "shared-pvc-storage", | ||
Namespace: vllmRuntime.Namespace, | ||
Labels: map[string]string{"app": vllmRuntime.Name}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PersistentVolume
is a cluster-scoped resource and cannot have a namespace. Setting Namespace: vllmRuntime.Namespace
on the ObjectMeta
of a PersistentVolume
is incorrect and will cause an error when the controller tries to create it.
Please remove the Namespace
field from the PersistentVolume
's metadata.
ObjectMeta: metav1.ObjectMeta{
Name: "shared-pvc-storage",
Labels: map[string]string{"app": vllmRuntime.Name},
},
AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteMany}, | ||
StorageClassName: &[]string{""}[0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
…e logic Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
Signed-off-by: Rui Zhang <[email protected]>
a71fbc7
to
0fe59a5
Compare
Signed-off-by: Rui Zhang <[email protected]>
0fe59a5
to
a3bde66
Compare
Fix lora operator compatibility with vllm runtime and vllm router.
Add shared pvc for lora.
BEFORE SUBMITTING, PLEASE READ THE CHECKLIST BELOW AND FILL IN THE DESCRIPTION ABOVE
-s
when doinggit commit
[Bugfix]
,[Feat]
, and[CI]
.Detailed Checklist (Click to Expand)
Thank you for your contribution to production-stack! Before submitting the pull request, please ensure the PR meets the following criteria. This helps us maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Please try to classify PRs for easy understanding of the type of changes. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]
for bug fixes.[CI/Build]
for build or continuous integration improvements.[Doc]
for documentation fixes and improvements.[Feat]
for new features in the cluster (e.g., autoscaling, disaggregated prefill, etc.).[Router]
for changes to thevllm_router
(e.g., routing algorithm, router observability, etc.).[Misc]
for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
pre-commit
to format your code. SeeREADME.md
for installation.DCO and Signed-off-by
When contributing changes to this project, you must agree to the DCO. Commits must include a
Signed-off-by:
header which certifies agreement with the terms of the DCO.Using
-s
withgit commit
will automatically add this header.What to Expect for the Reviews
We aim to address all PRs in a timely manner. If no one reviews your PR within 5 days, please @-mention one of YuhanLiu11
, Shaoting-Feng or ApostaC.