Refactor OmniEngineArgs and AsyncOmniEngineArgs to improve compatibility with partial payloads by using getattr for various attributes. Update GPUGenerationModelRunner and OmniGPUModelRunner to replace the activate_lora parameter with num_active_loras for better clarity and backward compatibility. This change enhances the handling of LoRA activation during model runs.

Signed-off-by: tzhouam <tzhouam@connect.ust.hk>
This commit is contained in:
tzhouam committed 2026-02-12 03:33:50 +00:00
1 parent cd2ffbf2a0
commit 0099eebb3f
4 files changed
+77 -38

No files matched your search

+9 -2
View File
@@ -424,8 +424,9 @@ class OmniGPUModelRunner(GPUModelRunner):
is_profile: bool = False,
create_mixed_batch: bool = False,
remove_lora: bool = True,
activate_lora: bool = False,
is_graph_capturing: bool = False,
num_active_loras: int = 0,
activate_lora: bool | None = None,
) -> tuple[torch.Tensor, torch.Tensor]:
"""
Run a dummy forward pass to warm up/profile run or capture the
@@ -448,8 +449,12 @@ class OmniGPUModelRunner(GPUModelRunner):
create_mixed_batch: If True, create a mixed batch with both decode
(1 token) and prefill (multiple tokens) requests.
remove_lora: If False, dummy LoRAs are not destroyed after the run
activate_lora: If False, dummy_run is performed without LoRAs.
num_active_loras: Number of active LoRAs to capture for.
activate_lora: Backward-compatible override for LoRA activation.
"""
if activate_lora is None:
activate_lora = num_active_loras > 0
mm_config = self.vllm_config.model_config.multimodal_config
if mm_config and mm_config.mm_encoder_only:
# The current dummy run only covers LM execution, so we can skip it.
@@ -527,6 +532,8 @@ class OmniGPUModelRunner(GPUModelRunner):
# activated later in the context manager, but we need to know the
# LoRA state when determining the batch descriptor for capture
force_has_lora=activate_lora,
# Capture shape specialization for specific active LoRA counts.
force_num_active_loras=num_active_loras,
)
)