You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am training a model using the Megatron-DeepSpeed framework. Previously, I was using DeepSpeed MoE (MoE layers implemented with DeepSpeed) and the training was numerically stable — the loss curve and gradient norms behaved as expected.
Recently, I replaced the DeepSpeed MoE implementation with Transformer Engine’s Grouped Linear / Grouped GEMM (for MoE experts). After switching, I observe two major issues:
Loss does not match the baseline (DeepSpeed MoE)
When running the same model, same configuration, same data, and same initialization:
The loss curve diverges from the baseline almost immediately.
Loss values cannot be aligned with the previous implementation even in the very first few steps.
Forward pass outputs appear numerically different from the original MoE implementation.
This suggests that the grouped GEMM path may be producing different numerical results compared to the standard GEMM/DeepSpeed MoE path.
Gradient norm becomes extremely large
After enabling TE Grouped Linear, I observe:
Very large grad norms, sometimes orders of magnitude larger than under the baseline implementation.
This seems to originate from the MoE layers using grouped GEMM.
When switching back to DeepSpeed MoE or standard Linear layers, the grad norm returns to normal.
This indicates a potential stability / scaling problem inside grouped GEMM.
@wukong1992 sorry for the late response, could you provide a minimal repro plus the exact TE, Megatron-DeepSpeed, CUDA/cuBLAS, GPU, dtype/FP8, and TP/EP/DP configuration?
Closing due to inactivity and missing reproduction/environment details since the follow-up request in July 2026. If you still observe numerical divergence or gradient-norm spikes with GroupedLinear on a recent Transformer Engine release, please reopen or file a new issue with a minimal standalone reproducer plus your TE, CUDA/cuBLAS, GPU, dtype/FP8, and parallelism configuration.
Activity
sbhavani commentedon Jul 24, 2026
@wukong1992 sorry for the late response, could you provide a minimal repro plus the exact TE, Megatron-DeepSpeed, CUDA/cuBLAS, GPU, dtype/FP8, and TP/EP/DP configuration?
pggPL commentedon Dec 1, 2026
Closing due to inactivity and missing reproduction/environment details since the follow-up request in July 2026. If you still observe numerical divergence or gradient-norm spikes with
GroupedLinearon a recent Transformer Engine release, please reopen or file a new issue with a minimal standalone reproducer plus your TE, CUDA/cuBLAS, GPU, dtype/FP8, and parallelism configuration.