Prhub

#36875 [diffusion] Preserve exact component identity during loading

原始 PR 作者 mickqian 合并时间 2026-08-31 14:17 文件变更 10 提交数 11 评论 1 代码增减 +498 / -101

执行摘要

实现拆解

  1. 核心源码路径
    - python/sglang/multimodal_gen/runtime/loader/component_loaders/component_loader.py(core-logic):源码主路径;涉及符号 structural_component_name, structural_component_type, is_native_only_component;包含 控制流调整、配置键调整、符号定义调整;+56/-16;关键符号:structural_component_name, structural_component_type, is_native_only_component
    - python/sglang/multimodal_gen/runtime/loader/component_loaders/vae_loader.py(core-logic):源码主路径;涉及符号 select_weight_files;包含 控制流调整、配置键调整、符号定义调整;+51/-21;关键符号:select_weight_files
    - python/sglang/multimodal_gen/runtime/pipelines_core/composed_pipeline_base.py(dependency-wiring):源码主路径;包含 导入关系调整、控制流调整、配置键调整;+48/-14

  2. 测试与验证
    - python/sglang/multimodal_gen/test/unit/test_component_loader_identity.py(test-coverage):测试配套;涉及符号 _AliasPipeline, initialize_pipeline, create_pipeline_stages, TestComponentLoaderIdentity;包含 测试覆盖调整、导入关系调整、控制流调整;+263/-0;关键符号:_AliasPipeline, initialize_pipeline, create_pipeline_stages, TestComponentLoaderIdentity

文件 模块 状态 重要度
python/sglang/multimodal_gen/test/unit/test_component_loader_identity.py component/loader/identity added 8.14
python/sglang/multimodal_gen/runtime/loader/component_loaders/component_loader.py sglang/multimodal_gen modified 8.07
python/sglang/multimodal_gen/runtime/loader/component_loaders/vae_loader.py sglang/multimodal_gen modified 7.43
python/sglang/multimodal_gen/runtime/pipelines_core/composed_pipeline_base.py sglang/multimodal_gen modified 7.32
python/sglang/multimodal_gen/runtime/loader/component_loaders/transformer_loader.py sglang/multimodal_gen modified 7.2

关键符号

_AliasPipeline initialize_pipeline create_pipeline_stages TestComponentLoaderIdentity test_structural_identity_selects_roles_and_preserves_exact_policy_keys test_declared_alias_loads_by_exact_key_and_structural_source test_skipped_alias_keeps_exact_override_and_structural_config test_structural_aliases_select_loader_config_and_weight_behavior structural_component_name structural_component_type

分析完成后,这里会展示 LLM 生成的相对完整源码片段和详细注释。

评论区精华

没有提炼出高价值讨论线程

当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。

风险与影响

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论