[Main] Numerical fix for FC2 expert bias scales when using use_transformer_engine_op_fuser#5850
Conversation
Signed-off-by: zhongboz <zhongboz@nvidia.com>
|
This PR has been automatically converted to draft because all PRs must start as drafts. When you are ready for review, click Ready for Review to begin the review process. This will:
See the contribution guide for more details. |
|
/ok to test a1913ae |
| assert module._is_fused_impl_supported() is True | ||
|
|
||
|
|
||
| def test_is_fused_impl_supported_requires_scaled_fc2_bias(monkeypatch): |
There was a problem hiding this comment.
just a nit; looks like we dont check if fused impl is supported here but not in actual code above? is the current version of TE pinned is well above the min supported version ?
Signed-off-by: Zhongbo Zhu <zhongboz@nvidia.com>
|
/ok to test 8ac399d |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/29956320233 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/29964343805 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/29968255282 |
What does this PR do?
Triggered only for
use_transformer_engine_op_fuser+ routed expert has biasThe fused MoE MLP applies each token’s router probability before FC2:
fc2_input = router_probability * activation(fc1_output)
Previously, FC2 with bias produced:
output = router_probability * (fc2_weight @ activation) + fc2_bias
The correct result is:
output = router_probability * ((fc2_weight @ activation) + fc2_bias)
Numerical unit test
Issue tracking
For PRs from open-source community contributors:
Linked issue:
Contribution process
Pre-checks
Code review
Feel free to message or comment @NVIDIA/mcore-oncall to help accelerate your merge into main. The less complex your PR is, the faster it will be approved and merged!
All PRs start as draft. If you open a non-draft PR, it will be automatically converted to draft.
Step 1: Mark PR as "Ready for Review"
.github/CODEOWNERS.Final Review might get declined if these requirements are not fulfilled.
Step 2: Final Review
For PRs that change
megatron/core, once all expert reviewers have approved, theFinal Reviewlabel is applied automatically and final reviewers are assigned.For PRs outside
megatron/core, this step is skipped.Step 3: Approved
Once all required reviewers have approved, the
Approvedlabel is applied automatically.Merge
Any member of mcore-engineers will be able to merge your PR.