Skip to content

Complete clamped SwiGLU across expert paths - #5940

Merged
yaox12 merged 3 commits into
NVIDIA:mainfrom
FDecaYed:codex/clamped-swiglu
Aug 13, 2026
Merged

Complete clamped SwiGLU across expert paths#5940
yaox12 merged 3 commits into
NVIDIA:mainfrom
FDecaYed:codex/clamped-swiglu

Conversation

@FDecaYed

@FDecaYed FDecaYed commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Complete clamped SwiGLU across expert paths

Summary

Add clamped SwiGLU as one usable feature across the primitive, routed and
shared experts, token-weighted fallbacks, and the Transformer Engine grouped
MLP path.

Scope and non-goals

  • Support bias-free, biased, and token-weighted forward/backward.
  • Preserve the legacy unclamped path when the option is disabled.
  • Add validation and Transformer Engine operator/constructor-signature gating,
    so optional GroupedLinear kwargs are passed only when the installed
    interface accepts them.
  • Do not include unrelated activation rewrites, routing features, DSv4
    attention, or recipe changes.

Provenance

This local recut is reconstructed from the frozen main baseline
bb5647a9bdd0, not a replay. It references master #5795 and combines #5940
and #5941 into one functional unit, including the completion fixes derived
from #4481 and #5130. Original clamped-SwiGLU and DSv4 integration credit:
@hxbai in #4481, #5130, and #5795.

Dependencies

None beyond the frozen baseline used for this local recut. This is a reusable
prerequisite outside the nine-PR DSv4-specific series.

Tests

  • Primitive forward/backward for biased, bias-free, and token-weighted modes.
  • Routed, shared, and fallback expert paths.
  • Transformer Engine grouped-MLP behavior, optional constructor kwargs, and
    unsupported-interface validation.
  • Legacy behavior when clamping is disabled.

Publication

Publish in the first prerequisite round on then-current main. This is not a
stacked-review PR.

@copy-pr-bot

copy-pr-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@FDecaYed

Copy link
Copy Markdown
Contributor Author

/ok to test 33bd241

@FDecaYed
FDecaYed force-pushed the codex/clamped-swiglu branch from 33bd241 to 388eeb4 Compare July 23, 2026 15:53
@FDecaYed FDecaYed changed the title feat(transformer): add clamped SwiGLU fusion Complete clamped SwiGLU across expert paths Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 388eeb4

@FDecaYed

Copy link
Copy Markdown
Contributor Author

/ok to test ec202a4

Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
@svcnvidia-nemo-ci svcnvidia-nemo-ci added Approved All necessary approvals have been made and removed Final Review PR is in the "final review" stage labels Aug 10, 2026
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
@FDecaYed

Copy link
Copy Markdown
Contributor Author

/ok to test 4ba9d91

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31685310896

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31685597753

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

Labels

Approved All necessary approvals have been made complexity: medium deepseekv4 DeepSeek V4 PRs Run functional tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants