Skip to content

[vllm] fix: LoRAModel import path change for vLLM 0.13.0#4631

Merged
vermouth1992 merged 1 commit intoverl-project:mainfrom
HollowMan6:lora_requests
Dec 21, 2025
Merged

[vllm] fix: LoRAModel import path change for vLLM 0.13.0#4631
vermouth1992 merged 1 commit intoverl-project:mainfrom
HollowMan6:lora_requests

Conversation

@HollowMan6
Copy link
Copy Markdown
Collaborator

@HollowMan6 HollowMan6 commented Dec 21, 2025

What does this PR do?

Related to vllm-project/vllm#30253 (comment)

LoRAModel import path was changed from vllm.lora.models to vllm.lora.lora_model.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 addresses an ImportError for LoRAModel due to a path change in a recent vllm version by removing the import and the corresponding type hint. While this resolves the immediate issue, I've suggested an alternative approach that preserves the benefits of static type checking. My recommendations involve using a conditional import with typing.TYPE_CHECKING to handle different vllm versions gracefully. This allows restoring the LoRAModel type hint, which improves code clarity and maintainability without causing runtime errors.

@HollowMan6 HollowMan6 changed the title [vllm] fix: Remove LoRAModel import for vLLM 0.13.0 [vllm] fix: LoRAModel import path change for vLLM 0.13.0 Dec 21, 2025
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 import path for LoRAModel to support a newer version of vLLM. The changes correctly use a try-except block for backward compatibility. However, the current implementation places the import within a TYPE_CHECKING block, making LoRAModel unavailable at runtime. This is a brittle approach that could lead to future runtime errors. I have provided suggestions to refactor this into a more robust, module-level import, which is a standard pattern for handling such compatibility issues.

Related to vllm-project/vllm#30253 (comment)

`LoRAModel` import path was changed from `vllm.lora.models`
to `vllm.lora.lora_model`.

Signed-off-by: Hollow Man <hollowman@opensuse.org>
@vermouth1992 vermouth1992 merged commit 5b0cd28 into verl-project:main Dec 21, 2025
73 of 83 checks passed
@HollowMan6 HollowMan6 deleted the lora_requests branch December 22, 2025 00:04
jsfanfanfan pushed a commit to meituan-search/verl that referenced this pull request Jan 9, 2026
vyomakesh0728 added a commit to vyomakesh0728/verl that referenced this pull request Jan 22, 2026
sophiayyya pushed a commit to sophiayyya/verl that referenced this pull request Jan 25, 2026
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