Repository navigation
Conversation
|
Native TE follow-up: NVIDIA/TransformerEngine#3488 That PR extends the existing MXFP8 distributed cast helper and partial-amax/partial-cast CUDA kernels to handle absent columnwise storage. It preserves the single packed-amax MAX reduction and skips columnwise work, instead of reconstructing high-precision tiles across ranks as this PR's compatibility fallback does. It complements the row-only initialization change in NVIDIA/TransformerEngine#3468. Once the native TE change is available, the row-only writeback fallback here can be replaced with the normal TE cast path; the separate BF16 gather copy-back layout fix remains relevant. The new TE PR has now passed GPU validation on |
Signed-off-by: xiuhu17 <zhihao.wang@perplexity.ai>
Signed-off-by: xiuhu17 <zhihao.wang@perplexity.ai>
What does this PR do?
Preserve row-only MXFP8 primary storage during BF16 parameter-gather copy-back, and validate distributed writeback through TE's native cast helper.
Related TE changes:
Implementation
cast_master_weights_to_fp8path for row-only and bidirectional parameters. TE performs packed-amax reduction and writes each local shard; parameter synchronization then gathers quantized data._quantize_rowwise_mxfp8_param_shardcompatibility fallback, its high-precision tile reconstruction/all-reduces, and its special dispatch/FSDP rejection.There is no fallback for TE builds lacking #3488. That change is not yet associated with a released TE version, so this PR does not invent a minimum version or infer capability from the presence of an older public helper symbol. Use a TE build containing #3488 for row-only writeback.
Based directly on NVIDIA/Megatron-LM
dev. No TMS allocation hook,quantized_param_init_memory_context, new backward-override config, initialization API change, or NVFP4 support is included.Validation
All testing for this update ran on
training_gb200_dev, NVIDIA GB200, with the source-built TE native extension from #3488 and the synced Megatron worktree. Import paths were checked.quantize_param_shard-> native TE cast -> simulated quantized-byte parameter synchronization -> Megatron post-all-gather processing.Commands used
pytest --noconftestandtorchrun --standalone --nproc_per_node=4 -m pytest --noconftestontests/unit_tests/test_mxfp8_rowwise_writeback.py. The tests own their NCCL fixture; unrelated suite-wide dataset-download fixtures were deliberately not run. Environment warnings include optional FlashAttention/CUTLASS, TorchScript/Python 3.14, and optional dependencies.This is targeted helper/copy-back integration coverage, not a full distributed-optimizer training loop, end-to-end FSDP, checkpoint/resharding, or performance validation. Those remain unverified.
Contribution process