feat(rollout): conditionally enable tower connector LoRA for VLMs#6670
feat(rollout): conditionally enable tower connector LoRA for VLMs#6670luoshijiang wants to merge 1 commit into
Conversation
Add conditional logic in vllm_async_server.py to set enable_tower_connector_lora only when the model is a VLM (detected via vision_config) and vision components are not frozen. Non-VLM models and VLMs with frozen vision towers remain unaffected.
There was a problem hiding this comment.
Code Review
This pull request updates vllm_async_server.py to enable tower connector LoRA for Vision-Language Models (VLMs) when vision components are trainable. It detects VLMs by checking for a vision_config attribute in hf_config and enables enable_tower_connector_lora if the vision model or projection is not frozen. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| is_vlm = hasattr(self.model_config.hf_config, "vision_config") | ||
| if is_vlm: | ||
| vision_frozen = self.model_config.lora.get("freeze_vision_model", True) and \ | ||
| self.model_config.lora.get("freeze_vision_projection", True) |
There was a problem hiding this comment.
This needs a vLLM version/feature gate, or the PR should bump the minimum supported vLLM version. setup.py still allows vllm>=0.8.5, and vLLM 0.8.5 does not define enable_tower_connector_lora, so any VLM run that reaches this branch will fail during CLI parsing with an unknown argument.
Summary
This PR adds conditional support for enabling vLLM's
enable_tower_connector_loraflag in the vLLM rollout server, allowing LoRA training on vision components (vision tower + vision projection) of vision-language models (VLMs) during RL training.Motivation
By default, verl only supports LoRA for the language model. When users want to train the vision part of a VLM via LoRA (by setting
freeze_vision_model=False/freeze_vision_projection=False), the vLLM rollout server also needs to be aware of this via theenable_tower_connector_loraengine arg. Previously this had to be hard-coded, which would incorrectly apply to non-VLM models as well.Changes
verl/workers/rollout/vllm_rollout/vllm_async_server.pyto conditionally addenable_tower_connector_lora=Truewhen:hasattr(hf_config, "vision_config"), consistent withtrtllm_async_server.py)freeze_vision_modelorfreeze_vision_projectionis set toFalseBackward Compatibility
vision_configattribute, so the flag is never setTruepermegatron_peft.pyenable_tower_connector_lora=Trueto vLLMUsage Example
Related
Detection pattern follows existing VLM detection in:
Checklist
Co-Authored-By: XuAn@cpic