[Refactor][Diffusion] Remove model-specific names from LoRA and ModelOpt loader defaults (#5907)

Signed-off-by: Alicia <115451386+congw729@users.noreply.github.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
AliciaandHongsheng Liu authored and GitHub committed 2026-09-12 20:30:03 +08:00
1 parent bc0c9f4b45
commit 28291df179
6 files changed
+43 -12

No files matched your search

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""
BagelPipeline implementation for vLLM-Omni.
"""
@@ -316,6 +316,11 @@ class BagelPipeline(nn.Module, SupportsComponentDiscovery, DiffusionPipelineProf
"bagel.connector",
"bagel.vit_pos_embed",
]
# LoRA scanning target. ``_dit_modules`` holds the dotted path
# "language_model.model", which DiffusionLoRAManager cannot resolve as a
# pipeline attribute, so the top-level ``bagel`` module (LLM plus ViT,
# connector, and VAE projections) is declared explicitly here.
_lora_components: ClassVar[list[str]] = ["bagel"]
supports_step_execution: ClassVar[bool] = True
def __init__(self, *, od_config: OmniDiffusionConfig, prefix: str = ""):
@@ -612,6 +612,15 @@ class ZImageTransformer2DModel(CachedTransformer):
Note: Our "Sequence Parallelism" (SP) corresponds to "Context Parallelism" (CP) in diffusers.
"""
# Fused projections and their checkpoint shard names (mirrors
# stacked_params_mapping in load_weights). ``w13`` is the Z-Image FFN
# fusion of ``w1``/``w3``; declared here so quantized-checkpoint adapters
# can resolve shard keys without a framework-level default entry.
packed_modules_mapping = {
"to_qkv": ["to_q", "to_k", "to_v"],
"w13": ["w1", "w3"],
}
_repeated_blocks = ["ZImageTransformerBlock"]
_layerwise_offload_blocks_attrs = ["layers"]