-
Notifications
You must be signed in to change notification settings - Fork 47
Mingyyan/dev/hybrid #510
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
Open
Mingyuyang-1
wants to merge
39
commits into
main
Choose a base branch
from
mingyyan/dev/hybrid
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Mingyyan/dev/hybrid #510
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
3de16a0
Disable torchtitan activation checkpointing for better 8B model perfo…
alfuyao-amd 7d6d52b
Disable torchtitan activation checkpointing for better 8B model perfo…
alfuyao-amd 18cd0be
Set default for MI300 best perf.
alfuyao-amd 6075971
Update llama3.1_70B-BF16-pretrain.yaml drop log frequency to reduce l…
alfuyao-amd 464d1ae
Update llama3.1_70B-FP8-pretrain.yaml drop log frequency to reduce lo…
alfuyao-amd 05ed2ff
Update llama3.1_8B-BF16-pretrain.yaml drop log frequency to reduce lo…
alfuyao-amd aab4234
Update llama3.1_8B-FP8-pretrain.yaml drop log frequency to reduce log…
alfuyao-amd d1ec787
tw script update
clairesonglee 5fcbe85
remove cluster-specific commands
clairesonglee e16b27b
update common perf arguments - ce fusion - moe gemms
vidushi8 5ca6561
Merge branch 'main' into release/v25.10
vidushi8 ba187e4
Revert "refactor(torchtitan): rollback Titan to 99c0cb2(20250907) and…
vidushi8 be3b984
torchtitan: tune FP8 configs and share quant settings
Xiaoming-AMD 01f745d
update torchtitan yaml
vidushi8 e226b05
enable mla configs in DS models
vidushi8 9f94561
update fp8 llama3 70b tt yaml
vidushi8 299322e
update torctitan config to use real dataset
vidushi8 eabc2f8
update mi300 ds model yamls with mla
vidushi8 919f9f6
Revert "update mi300 ds model yamls with mla"
vidushi8 554be01
fix PRIMUS_TURBO_ATTN_V3_ATOMIC_FP32 typo. It will now default to 0
vidushi8 116c196
Merge branch 'main' into release/v25.10
vidushi8 653f0ec
update torch profiler gzip to false
vidushi8 343b5fe
support turbo groupgemm in titan
04aa8ac
add turbo fp8 gemm and attn via Converter
llying-001 80f247a
update deepseek_v3 config and load balance config
llying-001 d48cd84
add classic attn but with issues
llying-001 18f37be
update classic attention args for deepseek_v3
llying-001 a835bb4
update config
llying-001 48fe128
support new turo fp8 api
JohnQinAMD ad43031
support install turbo from source
JohnQinAMD f89348d
add dsv3 config for MI355
JohnQinAMD d80b8d1
Merge dev/john/titan-ptc into release/v25.10
JohnQinAMD c892660
initial commit
clairesonglee d8ae27d
set self.lr_warmup_steps < self.lr_decay_steps
clairesonglee df0b00e
unwrap model to remove loss_mask parameter
clairesonglee 58de478
add zebra-llama (hybrid mla mamba model) support
Mingyuyang-1 d36a136
add Zebra-Llama 3B configurations
Mingyuyang-1 294bf77
add Zebra-Llama 1B configs and remove unused configs
Mingyuyang-1 2e0aec8
remove unused configs
Mingyuyang-1 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
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
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
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
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,86 @@ | ||
| work_group: ${PRIMUS_TEAM:amd} | ||
| user_name: ${PRIMUS_USER:root} | ||
| exp_name: ${PRIMUS_EXP_NAME:mamba_370M-pretrain} | ||
| workspace: ${PRIMUS_WORKSPACE:./output} | ||
|
|
||
| modules: | ||
| pre_trainer: | ||
| framework: megatron | ||
| config: pre_trainer.yaml | ||
|
|
||
| # model to run | ||
| model: mamba_370M.yaml | ||
| overrides: | ||
| # log | ||
| wandb_project: "Primus_Mamba_Pretrain" | ||
| # disable_wandb: false | ||
| # disable_tensorboard: false | ||
| stderr_sink_level: DEBUG | ||
|
|
||
| eval_iters: 0 | ||
|
|
||
| log_avg_skip_iterations: 2 | ||
| log_avg_reset_interval: 50 | ||
|
|
||
| train_iters: 50 | ||
| micro_batch_size: 4 | ||
| global_batch_size: 256 | ||
|
|
||
| seq_length: 2048 | ||
| max_position_embeddings: 2048 | ||
|
|
||
| lr: 3.0e-4 | ||
| min_lr: 0.0 | ||
| lr_warmup_iters: 50000 | ||
| lr_decay_iters: 73192188 | ||
| lr_decay_style: cosine | ||
| weight_decay: 0.1 | ||
| adam_beta1: 0.9 | ||
| adam_beta2: 0.95 | ||
| eod_mask_loss: true | ||
| init_method_std: 0.02 | ||
| norm_epsilon: 1.0e-5 | ||
|
|
||
| # Mamba-specific: must provide spec | ||
| spec: ['megatron.core.models.mamba.mamba_layer_specs', 'mamba_stack_spec'] | ||
|
|
||
| # Tokenizer | ||
| tokenizer_type: HuggingFaceTokenizer | ||
| tokenizer_model: EleutherAI/gpt-neox-20b | ||
|
|
||
| # parallel | ||
| tensor_model_parallel_size: 1 | ||
| pipeline_model_parallel_size: 1 | ||
| expert_model_parallel_size: 1 | ||
| overlap_grad_reduce: true | ||
| overlap_param_gather: true | ||
| gradient_accumulation_fusion: false | ||
|
|
||
| # data | ||
| mock_data: true | ||
| train_data_path: null | ||
| valid_data_path: null | ||
| test_data_path: null | ||
|
|
||
| # ckpt | ||
| finetune: false | ||
| auto_continue_train: false | ||
| load: null | ||
| no_load_optim: null | ||
| no_load_rng: null | ||
| save: null | ||
| save_interval: 20000 | ||
| no_save_optim: null | ||
| no_save_rng: null | ||
| disable_last_saving: true | ||
| ckpt_format: torch | ||
|
|
||
| # Turbo - may need to disable for Mamba if not supported | ||
| enable_primus_turbo: false | ||
| use_turbo_attention: false | ||
| use_turbo_grouped_mlp: false | ||
|
|
||
| # Cross entropy flags | ||
| # cross_entropy_fusion_impl: "native" | ||
| # cross_entropy_loss_fusion: false | ||
|
|
70 changes: 70 additions & 0 deletions
70
examples/megatron/configs/MI300X/zebra_llama_1B-pretrain.yaml
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,70 @@ | ||
| work_group: ${PRIMUS_TEAM:amd} | ||
| user_name: ${PRIMUS_USER:root} | ||
| exp_name: ${PRIMUS_EXP_NAME:zebra_llama_1B-pretrain} | ||
| workspace: ${PRIMUS_WORKSPACE:./output} | ||
|
|
||
| modules: | ||
| pre_trainer: | ||
| framework: megatron | ||
| config: pre_trainer.yaml | ||
|
|
||
| # model to run | ||
| model: zebra_llama_1B.yaml | ||
| overrides: | ||
| # log | ||
| wandb_project: "Primus_Zebra_Llama_1B_Pretrain" | ||
| stderr_sink_level: DEBUG | ||
|
|
||
| eval_iters: 0 | ||
|
|
||
| log_avg_skip_iterations: 2 | ||
| log_avg_reset_interval: 50 | ||
|
|
||
| train_iters: 100 | ||
| micro_batch_size: 2 | ||
| global_batch_size: 128 | ||
|
|
||
| seq_length: 4096 | ||
| max_position_embeddings: 4096 | ||
|
|
||
| lr: 2.0e-4 | ||
| min_lr: 2.0e-5 | ||
| lr_warmup_iters: 200 | ||
| lr_decay_iters: 10000 | ||
| lr_decay_style: cosine | ||
| weight_decay: 0.1 | ||
| adam_beta1: 0.9 | ||
| adam_beta2: 0.95 | ||
| eod_mask_loss: true | ||
|
|
||
| # Mamba-specific: must provide spec | ||
| # Use custom hybrid Mamba+MLA spec | ||
| spec: ['primus.backends.megatron.core.models.hybrid.hybrid_mamba_mla_layer_specs', 'hybrid_stack_spec'] | ||
|
|
||
| # Tokenizer | ||
| tokenizer_type: HuggingFaceTokenizer | ||
| tokenizer_model: meta-llama/Llama-3.2-1B | ||
|
|
||
| # parallel | ||
| tensor_model_parallel_size: 1 | ||
| pipeline_model_parallel_size: 1 | ||
| expert_model_parallel_size: 1 | ||
| overlap_grad_reduce: true | ||
| overlap_param_gather: true | ||
| gradient_accumulation_fusion: true | ||
|
|
||
| # data | ||
| mock_data: true | ||
| train_data_path: null | ||
| valid_data_path: null | ||
| test_data_path: null | ||
|
|
||
| # ckpt | ||
| finetune: false | ||
| auto_continue_train: false | ||
| load: null | ||
| save: null | ||
| save_interval: 10000 | ||
| disable_last_saving: true | ||
| ckpt_format: torch | ||
|
|
70 changes: 70 additions & 0 deletions
70
examples/megatron/configs/MI300X/zebra_llama_3B-pretrain.yaml
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,70 @@ | ||
| work_group: ${PRIMUS_TEAM:amd} | ||
| user_name: ${PRIMUS_USER:root} | ||
| exp_name: ${PRIMUS_EXP_NAME:zebra_llama_3B-pretrain} | ||
| workspace: ${PRIMUS_WORKSPACE:./output} | ||
|
|
||
| modules: | ||
| pre_trainer: | ||
| framework: megatron | ||
| config: pre_trainer.yaml | ||
|
|
||
| # model to run | ||
| model: zebra_llama_3B.yaml | ||
| overrides: | ||
| # log | ||
| wandb_project: "Primus_Zebra_Llama_3B_Pretrain" | ||
| stderr_sink_level: DEBUG | ||
|
|
||
| eval_iters: 0 | ||
|
|
||
| log_avg_skip_iterations: 2 | ||
| log_avg_reset_interval: 50 | ||
|
|
||
| train_iters: 100 | ||
| micro_batch_size: 2 | ||
| global_batch_size: 128 | ||
|
|
||
| seq_length: 4096 | ||
| max_position_embeddings: 4096 | ||
|
|
||
| lr: 2.0e-4 | ||
| min_lr: 2.0e-5 | ||
| lr_warmup_iters: 200 | ||
| lr_decay_iters: 10000 | ||
| lr_decay_style: cosine | ||
| weight_decay: 0.1 | ||
| adam_beta1: 0.9 | ||
| adam_beta2: 0.95 | ||
| eod_mask_loss: true | ||
|
|
||
| # Mamba-specific: must provide spec | ||
| # Use custom hybrid Mamba+MLA spec | ||
| spec: ['primus.backends.megatron.core.models.hybrid.hybrid_mamba_mla_layer_specs', 'hybrid_stack_spec'] | ||
|
|
||
| # Tokenizer | ||
| tokenizer_type: HuggingFaceTokenizer | ||
| tokenizer_model: meta-llama/Llama-3.2-1B | ||
|
|
||
| # parallel | ||
| tensor_model_parallel_size: 1 | ||
| pipeline_model_parallel_size: 1 | ||
| expert_model_parallel_size: 1 | ||
| overlap_grad_reduce: true | ||
| overlap_param_gather: true | ||
| gradient_accumulation_fusion: true | ||
|
|
||
| # data | ||
| mock_data: true | ||
| train_data_path: null | ||
| valid_data_path: null | ||
| test_data_path: null | ||
|
|
||
| # ckpt | ||
| finetune: false | ||
| auto_continue_train: false | ||
| load: null | ||
| save: null | ||
| save_interval: 10000 | ||
| disable_last_saving: true | ||
| ckpt_format: torch | ||
|
|
70 changes: 70 additions & 0 deletions
70
examples/megatron/configs/MI300X/zebra_llama_8B-pretrain.yaml
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,70 @@ | ||
| work_group: ${PRIMUS_TEAM:amd} | ||
| user_name: ${PRIMUS_USER:root} | ||
| exp_name: ${PRIMUS_EXP_NAME:zebra_llama_8B-pretrain} | ||
| workspace: ${PRIMUS_WORKSPACE:./output} | ||
|
|
||
| modules: | ||
| pre_trainer: | ||
| framework: megatron | ||
| config: pre_trainer.yaml | ||
|
|
||
| # model to run | ||
| model: zebra_llama_8B.yaml | ||
| overrides: | ||
| # log | ||
| wandb_project: "Primus_Zebra_Llama_8B_Pretrain" | ||
| stderr_sink_level: DEBUG | ||
|
|
||
| eval_iters: 0 | ||
|
|
||
| log_avg_skip_iterations: 2 | ||
| log_avg_reset_interval: 50 | ||
|
|
||
| train_iters: 100 | ||
| micro_batch_size: 2 | ||
| global_batch_size: 128 | ||
|
|
||
| seq_length: 4096 | ||
| max_position_embeddings: 4096 | ||
|
|
||
| lr: 2.0e-4 | ||
| min_lr: 2.0e-5 | ||
| lr_warmup_iters: 200 | ||
| lr_decay_iters: 10000 | ||
| lr_decay_style: cosine | ||
| weight_decay: 0.1 | ||
| adam_beta1: 0.9 | ||
| adam_beta2: 0.95 | ||
| eod_mask_loss: true | ||
|
|
||
| # Mamba-specific: must provide spec | ||
| # Use custom hybrid Mamba+MLA spec | ||
| spec: ['primus.backends.megatron.core.models.hybrid.hybrid_mamba_mla_layer_specs', 'hybrid_stack_spec'] | ||
|
|
||
| # Tokenizer | ||
| tokenizer_type: HuggingFaceTokenizer | ||
| tokenizer_model: meta-llama/Llama-3.2-1B | ||
|
|
||
| # parallel | ||
| tensor_model_parallel_size: 1 | ||
| pipeline_model_parallel_size: 1 | ||
| expert_model_parallel_size: 1 | ||
| overlap_grad_reduce: true | ||
| overlap_param_gather: true | ||
| gradient_accumulation_fusion: true | ||
|
|
||
| # data | ||
| mock_data: true | ||
| train_data_path: null | ||
| valid_data_path: null | ||
| test_data_path: null | ||
|
|
||
| # ckpt | ||
| finetune: false | ||
| auto_continue_train: false | ||
| load: null | ||
| save: null | ||
| save_interval: 10000 | ||
| disable_last_saving: true | ||
| ckpt_format: torch | ||
|
|
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
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -63,7 +63,7 @@ modules: | |||||
| # pad 192/128 for deepseek attention | ||||||
| fused_padded_mla_attention: false | ||||||
|
|
||||||
| multi_latent_attention: false | ||||||
| #multi_latent_attention: true | ||||||
|
||||||
| #multi_latent_attention: true | |
| #multi_latent_attention: 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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Primus use public released docker image as the base image. The main branch use v25.10, please try to rebase or merge the main branch.