Skip to content

feat(glm_moe_dsa): add GLM5.2 context parallel support - #2695

Merged
HuiyingLi merged 22 commits into
mainfrom
huiyingl/feat/glm52-cp
Jun 23, 2026
Merged

HuiyingLi merged 22 commits into
mainfrom
huiyingl/feat/glm52-cp

Conversation

@HuiyingLi

@HuiyingLi HuiyingLi commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

Adds GLM MoE DSA context-parallel support for TileLang attention, keeping the implementation local to glm_moe_dsa.

Changelog

  • Adds a GLM-local packed THD CP batch sharder and differentiable K/V activation gather.
  • Extends GLM DSA TileLang top-k masking for CP query shards and padded THD offsets.
  • Wires GLM DSA CP capability reporting through the model-owned CP hook.
  • Adds a 32k Tulu3 CP8 TileLang recipe.

Validation

CP1/CP2 parity

image image

HuiyingLi and others added 9 commits June 21, 2026 00:44
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Add CPU-safe unit coverage for GLM DSA TileLang dispatch wrappers, validation packing, THD pipeline metas, and layer-level TileLang branches. Exclude copied vendored TileLang kernel definitions from coverage the same way existing vendored kernels are handled.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Add NVIDIA copyright headers to the vendored GLM TileLang kernel files for consistency with the existing vendored DeepSeek kernels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
The PP causal-mask cache is an optional mapping on model instances. Plain
unittest mocks fabricate missing attributes, so treat non-mapping cache values
as absent before checking membership.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Use the TileLang validation result as an explicit guard in the sparse MLA path
instead of discarding it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
@HuiyingLi
HuiyingLi requested review from a team as code owners June 21, 2026 17:34
@copy-pr-bot

copy-pr-bot Bot commented Jun 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@HuiyingLi HuiyingLi changed the title feat(glm_moe_dsa): add TileLang context parallel support feat(glm_moe_dsa): add GLM5.2 context parallel support Jun 21, 2026
hemildesai
hemildesai previously approved these changes Jun 22, 2026
HuiyingLi and others added 2 commits June 22, 2026 10:31
…ernels

Signed-off-by: HuiyingLi <willwin.lee@gmail.com>

# Conflicts:
#	nemo_automodel/components/distributed/pipelining/hf_utils.py
Add CPU unit coverage for GLM DSA context-parallel helpers, TileLang padded/query-index masking, CP gather wiring, capability gates, and the prepacked dataloader path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
@HuiyingLi

Copy link
Copy Markdown
Contributor Author

/claude review

@HuiyingLi

Copy link
Copy Markdown
Contributor Author

/ok to test 874c47d

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
@HuiyingLi

Copy link
Copy Markdown
Contributor Author

/claude review

Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
…o huiyingl/feat/glm52-cp

Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
@HuiyingLi

Copy link
Copy Markdown
Contributor Author

/ok to test 6f70549

Signed-off-by: HuiyingLi <willwin.lee@gmail.com>
…o huiyingl/feat/glm52-cp

Signed-off-by: HuiyingLi <willwin.lee@gmail.com>

# Conflicts:
#	tests/unit_tests/models/glm_moe_dsa/test_glm_moe_dsa_tilelang.py
@HuiyingLi

Copy link
Copy Markdown
Contributor Author

/ok to test 1740305

Signed-off-by: HuiyingLi <willwin.lee@gmail.com>

# Conflicts:
#	nemo_automodel/components/models/glm_moe_dsa/layers.py
#	nemo_automodel/components/models/glm_moe_dsa/model.py
#	nemo_automodel/components/models/glm_moe_dsa/optimized_kernels.py
#	tests/unit_tests/models/glm_moe_dsa/test_glm_moe_dsa_tilelang.py
@HuiyingLi

Copy link
Copy Markdown
Contributor Author

/ok to test 4609c7e

This branch was previously deployed

3 inactive deployments
public — 4609c7ec Deployed Jun 23, 2026 by copy-pr-bot[bot] via release / finalize / notify #1749
test — 4609c7ec Deployed Jun 23, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #7931
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants