-
Notifications
You must be signed in to change notification settings - Fork 182
updates for vLLM compativility with lora #359
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
Conversation
Summary of ChangesHello @danielhanchen, 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 introduces key updates to enhance the compatibility of LoRA (Low-Rank Adaptation) with vLLM. The changes focus on refining the process of loading LoRA adapter tensors and embeddings, ensuring a more unified approach. Additionally, a previous constraint on the LoRA's extra vocabulary size has been relaxed, which should improve the flexibility and robustness of integrating various LoRA configurations within the vLLM framework. Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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
|
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 updates the LoRA loading mechanism for compatibility with vLLM. The key changes include merging LoRA tensors and embeddings into a single dictionary and making the lora_extra_vocab_size configuration optional for more flexibility. These changes appear to align with updates in vLLM. However, I have pointed out a potential issue with the removal of a validation check for the extra vocabulary size, which could lead to silent failures if not handled elsewhere. I've suggested reintroducing a more robust version of this check to maintain code safety.
| raise ValueError(f"LoRA added vocab size {lora.extra_vocab_size} " | ||
| f"is greater than lora_extra_vocab_size " | ||
| f"{self.lora_config.lora_extra_vocab_size}.") | ||
| return lora |
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.
The validation check for lora.extra_vocab_size has been removed. While making lora_extra_vocab_size optional in lora_config is a good improvement for flexibility, removing this validation entirely could be risky. If a LoRA adapter adds new vocabulary and lora_extra_vocab_size is not configured (defaulting to 0), it might lead to silent errors or incorrect model behavior if the underlying LoRAModel creation methods don't perform this validation.
It's safer to ensure this validation happens. If it's not handled elsewhere (e.g., within LoRAModel creation or peft_helper.validate_legal), please consider reintroducing a more robust version of this check.
lora_extra_vocab_size = getattr(self.lora_config, "lora_extra_vocab_size", 0)
if lora.extra_vocab_size > lora_extra_vocab_size:
raise ValueError(
f"LoRA added vocab size {lora.extra_vocab_size} is greater "
f"than lora_extra_vocab_size {lora_extra_vocab_size}."
)
return lora* Update gpt_oss.py * torch compile * Update attention_sink.py * Update common.py * Update common.py * Patches * Compiled mask creation * Update attention_sink.py * Update gpt_oss.py * Update gpt_oss.py * Revert * Update gpt_oss.py * Update gpt_oss.py * Fix up * Update attention_sink.py * Update attention_sink.py * Update utils.py * Update attention_sink.py * Update attention_sink.py * Retry * Update gpt_oss.py * Update gpt_oss.py * Fix Flex * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Bug fixes * Update patching_utils.py * Update patching_utils.py * Update patching_utils.py * Update rl_replacements.py * Update patching_utils.py * Update patching_utils.py * Update patching_utils.py * flash attn * Update gpt_oss.py * Update __init__.py * Update attention_sink.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * dropout_p * Update gpt_oss.py * Update gpt_oss.py * Update attention_sink.py * Update gpt_oss.py * Update gpt_oss.py * fix * Update attention_sink.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update loss_utils.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update loss_utils.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Versioning * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Fix Gemma 3 * Update misc.py * Update rl_environments.py * Update pyproject.toml * Update rl_environments.py * Update __init__.py * Update empty_model.py * Update empty_model.py * Update empty_model.py * Update empty_model.py * Device type * Update vllm_utils.py * Update compiler.py * Update empty_model.py * Update vllm_utils.py * Update empty_model.py * Fixes * Update empty_model.py * Update empty_model.py * Update __init__.py * Update vllm_utils.py * Update vllm_utils.py * Update rl_environments.py * Update cross_entropy_loss.py * Update vllm_utils.py * Update vllm_utils.py * Update rl_environments.py * Update vllm_utils.py * Qwen3 VL vLLM (#324) * qwen3 vl additional layers * qwen3 fused vision qkv * refactor for handling qwen 3 vl * [WIP] fix backward pass issues * out hidden size change * Qwen 2.5 and qwen 3 conv3d->Linear vLLM changes * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update vllm_utils.py * Update vllm_utils.py * Update pyproject.toml * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update __init__.py * Update compiler.py * Update __init__.py * Update vllm_utils.py * Update rl_replacements.py * Update rl_replacements.py * Update rl_replacements.py * Fix CE compile * Update loss_utils.py * Update cross_entropy_loss.py * Fix * Deepseekocr fix: save single model shard (#346) * DeepSeekOCR Fix: check for saftensors_list shard naming convention * turned off shard padding length check bc deepseeks padding is different * if you try to copy the index.json file and the same file alredy exists it wil throw and error. * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update patching_utils.py * Fp8 compressed (#358) * [WIP] compressed tensors support for FP8 * [WIP 2/n] improve loading fake layer * [WIP 3/n] improve loading fake layer * [WIP 4/n] improve loading fake layer * revert seq and token util calculation --------- Co-authored-by: Datta Nimmaturi <venkatadattasainimmaturi@gmail.com> * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update gradient_checkpointing.py * Update gpt_oss.py * Update gpt_oss.py * updates for vLLM compativility with lora (#359) * updates for vLLM compativility with lora * LoRA extra vocab cleanup --------- Co-authored-by: Datta Nimmaturi <venkatadattasainimmaturi@gmail.com> * Update vllm_utils.py * Versioning --------- Co-authored-by: Datta Nimmaturi <venkatadattasainimmaturi@gmail.com> Co-authored-by: DoubleMathew <mmathew23@gmail.com>
* Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Bug fixes * Update patching_utils.py * Update patching_utils.py * Update patching_utils.py * Update rl_replacements.py * Update patching_utils.py * Update patching_utils.py * Update patching_utils.py * flash attn * Update gpt_oss.py * Update __init__.py * Update attention_sink.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * dropout_p * Update gpt_oss.py * Update gpt_oss.py * Update attention_sink.py * Update gpt_oss.py * Update gpt_oss.py * fix * Update attention_sink.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update loss_utils.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update loss_utils.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Update gpt_oss.py * Versioning * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Update saving_utils.py * Fix Gemma 3 * Update misc.py * Update rl_environments.py * Update pyproject.toml * Update rl_environments.py * Update __init__.py * Update empty_model.py * Update empty_model.py * Update empty_model.py * Update empty_model.py * Device type * Update vllm_utils.py * Update compiler.py * Update empty_model.py * Update vllm_utils.py * Update empty_model.py * Fixes * Update empty_model.py * Update empty_model.py * Update __init__.py * Update vllm_utils.py * Update vllm_utils.py * Update rl_environments.py * Update cross_entropy_loss.py * Update vllm_utils.py * Update vllm_utils.py * Update rl_environments.py * Update vllm_utils.py * Qwen3 VL vLLM (#324) * qwen3 vl additional layers * qwen3 fused vision qkv * refactor for handling qwen 3 vl * [WIP] fix backward pass issues * out hidden size change * Qwen 2.5 and qwen 3 conv3d->Linear vLLM changes * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update __init__.py * Update vllm_utils.py * Update vllm_utils.py * Update pyproject.toml * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update __init__.py * Update compiler.py * Update __init__.py * Update vllm_utils.py * Update rl_replacements.py * Update rl_replacements.py * Update rl_replacements.py * Fix CE compile * Update loss_utils.py * Update cross_entropy_loss.py * Fix * Deepseekocr fix: save single model shard (#346) * DeepSeekOCR Fix: check for saftensors_list shard naming convention * turned off shard padding length check bc deepseeks padding is different * if you try to copy the index.json file and the same file alredy exists it wil throw and error. * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update patching_utils.py * Fp8 compressed (#358) * [WIP] compressed tensors support for FP8 * [WIP 2/n] improve loading fake layer * [WIP 3/n] improve loading fake layer * [WIP 4/n] improve loading fake layer * revert seq and token util calculation --------- Co-authored-by: Datta Nimmaturi <venkatadattasainimmaturi@gmail.com> * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update gradient_checkpointing.py * Update gpt_oss.py * Update gpt_oss.py * updates for vLLM compativility with lora (#359) * updates for vLLM compativility with lora * LoRA extra vocab cleanup --------- Co-authored-by: Datta Nimmaturi <venkatadattasainimmaturi@gmail.com> * Update vllm_utils.py * Versioning * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Update vllm_utils.py * Fix * Qwen3MoE * Update qwen3_moe.py * Update qwen3_moe.py * LoRA extra vocab fix (#367) * Update qwen3_moe.py * Update qwen3_moe.py * Update qwen3_moe.py * Update qwen3_moe.py * Update __init__.py --------- Co-authored-by: Datta Nimmaturi <venkatadattasainimmaturi@gmail.com> Co-authored-by: DoubleMathew <mmathew23@gmail.com>
No description provided.