Skip to content

[Fix] lora: Support Qwen3.5 GDN packed projections - #48158

Closed
yuanhengfang wants to merge 1 commit into
sgl-project:mainfrom
yuanhengfang:codex/fix-qwen35-gdn-lora
Closed

yuanhengfang wants to merge 1 commit into
sgl-project:mainfrom
yuanhengfang:codex/fix-qwen35-gdn-lora

Conversation

@yuanhengfang

@yuanhengfang yuanhengfang commented Nov 3, 2026 •

Copy link
Copy Markdown

Motivation

Qwen3.5 serves its GatedDeltaNet input projections as the fused runtime modules in_proj_qkvz and in_proj_ba. PEFT adapters commonly export those weights as in_proj_qkv + in_proj_z and in_proj_b + in_proj_a instead.

On main, the raw adapter target names are not normalized to both fused runtime modules, grouped qkv+z weights are not expanded into the four runtime slices, and in_proj_ba is missing from the supported LoRA metadata. Loading such an adapter therefore fails during buffer sizing with get_hidden_dim not implemented for in_proj_qkv or in_proj_a.

The equivalent GDN normalization was merged into the sglang-miles branch in #30499 but has not reached main. This PR brings that language-model path to main. Vision tower and merger LoRA support are intentionally out of scope.

Modifications

  • Normalize split Qwen3.5 GDN target names to in_proj_qkvz and in_proj_ba.
  • Expand grouped in_proj_qkv + in_proj_z LoRA factors using the same slice semantics as vLLM: replicate the shared qkv A factor for q/k/v and concatenate B rows.
  • Stack split in_proj_b + in_proj_a factors and support already-fused in_proj_ba adapters.
  • Add in_proj_ba hidden dimensions, stacked rank, attention-TP sharding, auto-detection, and CLI target support.
  • Size CPU GDN LoRA buffers from the CPU-padded linear-attention head counts, matching Qwen3.5 module construction.
  • Add CPU regression tests for target normalization, packed factor layouts, hidden dimensions, and attention-TP buffer shapes.

Accuracy Tests

  • python test/registered/unit/lora/test_qwen3_5_gdn_lora.py: 5/5 passed.
  • python test/registered/unit/lora/test_mem_pool_layouts.py: 7/7 passed.
  • Repository pre-commit suite passed for all six changed files.
  • Two real Qwen3.5-9B rank-8 adapters were normalized independently: 496 input tensors became 304 runtime tensors per adapter, with no raw GDN keys remaining. Representative fused shapes were:
    • in_proj_qkvz: A [32, 4096], B [12288, 8]
    • in_proj_ba: A [16, 4096], B [64, 8]
  • Qwen3.5-9B was launched on one L20 with both adapters and the CSGMV LoRA backend. The server reported all seven target module types loaded, including in_proj_qkvz and in_proj_ba.
  • Multi-LoRA routing smoke test: 5/5 serial requests and 8/8 mixed concurrent requests returned HTTP 200; an unknown adapter returned HTTP 400.

Speed Tests and Profiling

Not applicable. This changes adapter target/weight normalization and buffer metadata; it does not change inference kernels or the base-model forward path.

Checklist

  • Format code with the repository pre-commit configuration.
  • Add registered CPU unit tests.
  • Documentation is not required for this internal adapter-format compatibility fix.
  • Provide accuracy and end-to-end multi-LoRA validation results above.
  • Follow the SGLang code style guidance.

@github-actions github-actions Bot added the lora label Nov 3, 2026
@yuanhengfang yuanhengfang changed the title [codex] Support Qwen3.5 GDN packed LoRA projections [Fix] lora: Support Qwen3.5 GDN packed projections Nov 3, 2026
@yuanhengfang

Copy link
Copy Markdown
Author

Superseded by #48161 to use the repository-style branch name fix/qwen3_5-gdn-lora.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant