Skip to content

Enable Qwen3 and Deepseekv3 mxfp8 Training#134

Merged
sudhu2k merged 19 commits into
rocm_devfrom
sudhu/enable_qwen3_deepseekv3_mxfp8
Jun 14, 2026
Merged

Enable Qwen3 and Deepseekv3 mxfp8 Training#134
sudhu2k merged 19 commits into
rocm_devfrom
sudhu/enable_qwen3_deepseekv3_mxfp8

Conversation

@sudhu2k

@sudhu2k sudhu2k commented May 25, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds training scripts for Qwen3 and modifies existing Deepseekv3 script to enable mxfp8 training.

sudhu2k added 16 commits April 28, 2026 18:52
- Introduced `train_qwen2.sh` and `train_qwen3.sh` scripts for pretraining Qwen2 and Qwen3 models, respectively, with detailed configuration options.
- Added `readme.md` files for both Qwen2 and Qwen3, outlining dataset preparation, model training processes, and environment setup.
- Included instructions for single-node and multi-node training setups, along with customizable parameters for model size and training iterations.
…node runs

- Updated `train_qwen3.sh` to include FP8 recipe options for improved precision handling during training.
- Added a new script `1P1G_AAI_proxy_mi355x_qwen3_235B_A22B.sh` for smaller Qwen3-235B-style MoE proxy configurations, allowing for single-node and single-GPU smoke runs.
- Improved environment variable handling for model size, layers, and experts in the training scripts to facilitate easier customization.
- Adjusted default values and added comments for clarity on tunable parameters.
…ation

- Modified `train_deepseekv3.sh` to disable legacy grouped GEMM when using FP8, ensuring compatibility with TE grouped GEMM requirements.
- Updated `1P1G_AAI_proxy_mi355x_qwen3_235B_A22B.sh` to set `MOE_USE_LEGACY_GROUPED_GEMM` to false for improved performance.
- Enhanced `train_qwen3.sh` to include automatic handling of `--moe-router-padding-for-fp8` for MXFP8 configurations, streamlining the training process for FP8 models.
- Added informative logging to clarify changes in grouped GEMM settings based on FP8 configurations.
- Added support for `MOE_PERMUTE_FUSION` in `train_qwen3.sh`, allowing users to disable the fused token permute/unpermute feature.
- Updated MoE options to conditionally include `--moe-permute-fusion` based on the new environment variable, improving flexibility in model training configurations.
…MoE options

- Added `PROFILE` environment variable to `proxy_mi355x_deepseekv3_671B.sh` and `proxy_mi355x_qwen3_235B_A22B.sh` for enhanced profiling capabilities.
- Updated `train_qwen3.sh` to reflect changes in MoE padding options, replacing `--moe-router-padding-for-fp8` with `--moe-router-padding-for-quantization` for better clarity and accuracy in FP8 configurations.
- Introduced `run_deepseekv3_compare_perf.sh` to facilitate performance comparisons across bf16, fp8, and mxfp8 configurations, generating TraceLens reports and comparison files.
- Added `run_qwen3_perf_compare.sh` for similar functionality with Qwen3-235B, ensuring compatibility with existing baseline CSV directories and TraceLens tools.
- Enhanced user guidance in both scripts with detailed usage instructions and optional overrides for improved flexibility in performance testing.
…g iterations and adjust profiling ranges

- Changed `TRAIN_ITERS` from 5 to 20 in both `proxy_mi355x_deepseekv3_671B.sh` and `proxy_mi355x_qwen3_235B_A22B.sh` to enhance training duration.
- Updated `PROFILE_START` and `PROFILE_END` values to 12 and 13 respectively, refining the profiling range for better performance analysis.
- Updated `mean_log_value.py` to include options for skipping the first N iterations and specific profile steps, improving flexibility in log analysis.
- Adjusted calls to `mean_log_value.py` in both `train_deepseekv3.sh` and `train_qwen3.sh` to utilize the new arguments, ensuring accurate throughput and elapsed time calculations.
@sudhu2k
sudhu2k requested a review from wenchenvincent June 1, 2026 22:15
Comment thread examples/deepseek_v3/train_deepseekv3.sh
Comment thread examples/deepseek_v3/train_deepseekv3.sh
Comment thread examples/deepseek_v3/train_deepseekv3.sh
Comment thread megatron/core/extensions/transformer_engine.py
Comment thread examples/qwen3/train_qwen3.sh
Comment thread examples/deepseek_v3/train_deepseekv3.sh
@wenchenvincent

Copy link
Copy Markdown
Collaborator

@sudhu2k Please also resolve conflicts

sudhu2k added 2 commits June 8, 2026 19:15
Changed the default value of MOE_USE_LEGACY_GROUPED_GEMM from false to true
@sudhu2k
sudhu2k requested a review from wenchenvincent June 8, 2026 19:29
@sudhu2k

sudhu2k commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

@sudhu2k Please also resolve conflicts

Resolved it.

@wenchenvincent wenchenvincent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Is the CI failure flaky?

@sudhu2k
sudhu2k merged commit 83ab8e5 into rocm_dev Jun 14, 2026
1 check passed
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