forked from NVIDIA/Megatron-LM
-
Notifications
You must be signed in to change notification settings - Fork 36
Enable Qwen3 and Deepseekv3 mxfp8 Training #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
836ec86
Add Qwen2 and Qwen3 training scripts and documentation
sudhu2k 28603d5
Enhance Qwen3 training scripts and introduce proxy script for single-…
sudhu2k adf8170
Update training scripts for FP8 MoE support and grouped GEMM configur…
sudhu2k 382d61d
Renamed file
sudhu2k b223299
Added deepseek config, fix padding issues, disable flash attn for qwen
sudhu2k 88f1c97
Merge remote-tracking branch 'origin/rocm_dev' into sudhu/enable_qwen…
sudhu2k c6db0f1
Merge bug fix
sudhu2k d026b78
Enhance MoE configuration in training script
sudhu2k 7f7862d
Update deepseek and qwen training scripts for improved profiling and …
sudhu2k d43e559
Add performance comparison scripts for DeepSeek-V3 and Qwen3
sudhu2k 2487493
Update training scripts for DeepSeek-V3 and Qwen3 to increase trainin…
sudhu2k 5a88b05
Enhance log processing in training scripts for DeepSeek-V3 and Qwen3
sudhu2k 7375c0a
Remove performance comparison scripts for DeepSeek-V3 and Qwen3
sudhu2k fe52033
Merge remote-tracking branch 'origin/rocm_dev' into sudhu/enable_qwen…
sudhu2k c75e58c
Add --use-te-activation-func option to train_qwen3.sh
sudhu2k 8f7191f
Merge remote-tracking branch 'origin/rocm_dev' into sudhu/enable_qwen…
sudhu2k cdf3005
Merge remote-tracking branch 'origin/rocm_dev' into sudhu/enable_qwen…
sudhu2k d44a9fb
Update train_qwen3.sh to enable legacy grouped GEMM for MOE
sudhu2k ea4f590
Merge remote-tracking branch 'origin/rocm_dev' into sudhu/enable_qwen…
sudhu2k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # DeepSeek-V3 671B MI355X proxy — source before train_deepseekv3.sh. | ||
| # Defines MOE_LAYER_FREQ and related Primus-style defaults (override as needed). | ||
| # | ||
| # Usage (repo root): | ||
| # source examples/deepseek_v3/proxy_mi355x_deepseekv3_671B.sh | ||
| # bash examples/deepseek_v3/train_deepseekv3.sh | ||
|
|
||
| export MODEL_SIZE=671B | ||
|
|
||
| # --- MoE layer pattern only for shallow proxy (3 layers: 1 dense + 2 MoE) --- | ||
| export NUM_LAYERS=3 | ||
| export MOE_LAYER_FREQ='([0]*1+[1]*2)' | ||
|
|
||
| # --- hyperparameters (Primus overrides) --- | ||
| export TRAIN_ITERS=20 | ||
| export MICRO_BATCH_SIZE=2 | ||
| export GLOBAL_BATCH_SIZE=16 | ||
| export SEQ_LENGTH=4096 | ||
| export MAX_POSITION_EMBEDDINGS=4096 | ||
| export LR=1.0e-5 | ||
| export MIN_LR=0.0 | ||
| export LR_WARMUP_ITERS=2 | ||
| export LR_DECAY_ITERS=null | ||
| export WEIGHT_DECAY=0.1 | ||
|
|
||
| # --- parallelism (PP4 + uneven layout / VPP from layout string) --- | ||
| export TP=1 | ||
| export PP=1 | ||
| export EP=8 | ||
|
|
||
| export MOCK_DATA=1 | ||
|
|
||
|
|
||
| export APPLY_ROPE_FUSION=true | ||
|
|
||
| # recompute: full AC + block method (Megatron has no recompute_layer_ids CLI in this tree) | ||
| export AC="${AC:-full}" | ||
|
|
||
| # --- optimizer (use_precision_aware_optimizer + bf16 states) --- | ||
| export USE_PRECISION_AWARE_OPTIMIZER=true | ||
| export MAIN_GRADS_DTYPE=bf16 | ||
| export EXP_AVG_DTYPE=bf16 | ||
| export EXP_AVG_SQ_DTYPE=bf16 | ||
|
|
||
| export MOE_ROUTER_FUSION=true | ||
| export MOE_PERMUTE_FUSION=true | ||
| export MOE_SHARED_EXPERT_OVERLAP=false | ||
|
|
||
| # --- MoE / DeepEP / grouped GEMM --- | ||
| export ENABLE_DEEP_EP=false | ||
| export MOE_USE_LEGACY_GROUPED_GEMM=false | ||
| export USE_GROUPED_GEMM=true | ||
| export FORCE_BALANCE=true | ||
|
|
||
| export CE_FUSION_ARGS="--cross-entropy-fusion-impl te --cross-entropy-loss-fusion" | ||
| export GA_FUSION=true | ||
|
|
||
| export PROFILE_START=12 | ||
| export PROFILE_END=13 | ||
| export PROFILE=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.