Skip to content

[Diffusion] [BUG] Fix missing initialization of GLM-Image text encoder config#18704

Merged
hnyls2002 merged 1 commit intosgl-project:mainfrom
haojin2:fix_glm_text_encoder_loading
Feb 13, 2026
Merged

[Diffusion] [BUG] Fix missing initialization of GLM-Image text encoder config#18704
hnyls2002 merged 1 commit intosgl-project:mainfrom
haojin2:fix_glm_text_encoder_loading

Conversation

@haojin2
Copy link
Contributor

@haojin2 haojin2 commented Feb 12, 2026

Motivation

cc @zhaochenyang20

Error in GLM-Image initialization
cmd: sglang serve --model-path zai-org/GLM-Image --backend sglang --num-gpus 1

[02-12 07:44:04] Loading pipeline modules from config: {'_class_name': 'GlmImagePipeline', '_diffusers_version': '0.37.0.dev0', '_name_or_path': 'zai-org/GLM-Image-Decoder', 'text_encoder': ['transformers', 'T5EncoderModel'], 'vision_language_encoder': ['transformers', 'GlmImageForConditionalGeneration'], 'scheduler': ['diffusers', 'FlowMatchEulerDiscreteScheduler'], 'tokenizer': ['transformers', 'ByT5Tokenizer'], 'processor': ['transformers', 'GlmImageProcessor'], 'transformer': ['diffusers', 'GlmImageTransformer2DModel'], 'vae': ['diffusers', 'AutoencoderKL']}
[02-12 07:44:04] Loading required components: ['text_encoder', 'tokenizer', 'vae', 'vision_language_encoder', 'processor', 'transformer', 'scheduler']
Loading required modules:   0%|                                                                                                                                                                                                                                                                                                                                                                                                                                                           | 0/7 [00:00<?, ?it/s][02-12 07:44:04] Loading text_encoder from /workspace/.hf_home/hub/models--zai-org--GLM-Image/snapshots/2c433cc0cbc293bde2ac8ca9624f279b5d23fcf4/text_encoder. avail mem: 87.75 GB
Traceback (most recent call last):
  File "/workspace/sglang/python/sglang/multimodal_gen/runtime/loader/component_loaders/component_loader.py", line 93, in load
    component = self.load_customized(
                ^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/sglang/python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py", line 205, in load_customized
    return self.load_model(
           ^^^^^^^^^^^^^^^^
  File "/workspace/sglang/python/sglang/multimodal_gen/runtime/loader/component_loaders/text_encoder_loader.py", line 242, in load_model
    model = model_cls(model_config)
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/sglang/python/sglang/multimodal_gen/runtime/models/encoders/t5.py", line 574, in __init__
    tp_group = _get_folding_tp_group(config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/sglang/python/sglang/multimodal_gen/runtime/distributed/__init__.py", line 64, in _get_folding_tp_group
    if config.parallel_folding:
       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/sglang/python/sglang/multimodal_gen/configs/models/base.py", line 56, in __getattr__
    raise AttributeError(
AttributeError: 'EncoderConfig' object has no attribute 'parallel_folding'

Modifications

Initialize text_encoder_config to T5Config instead of base Encoder config

Checklist

Review Process

  1. Ping Merge Oncalls to start the PR flow. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • /tag-run-ci-label, /rerun-failed-ci, /tag-and-rerun-ci
  4. After green CI and required approvals, ask Merge Oncalls to merge.

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions bot added the diffusion SGLang Diffusion label Feb 12, 2026
@haojin2 haojin2 changed the title Fix missing initialization of GLM-Image text encoder config [Diffusion] [BUG] Fix missing initialization of GLM-Image text encoder config Feb 12, 2026
@mickqian
Copy link
Collaborator

/tag-and-rerun-ci

@hnyls2002
Copy link
Collaborator

/tag-and-rerun-ci

@hnyls2002 hnyls2002 merged commit b48fe1d into sgl-project:main Feb 13, 2026
98 of 108 checks passed
alisonshao added a commit that referenced this pull request Feb 13, 2026
…st CI

Fix `from python.sglang...` imports to `from sglang...` — the `python.` prefix
is a filesystem path, not a valid Python module path.

Introduced in #18704.
Johnsonms pushed a commit to Johnsonms/sglang that referenced this pull request Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diffusion SGLang Diffusion run-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants