-
Notifications
You must be signed in to change notification settings - Fork 498
fix(mmlu): expert-DP batch sharding for MoE + Nano-30B-A3B PTQ example #1967
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
13 commits
Select commit
Hold shift + click to select a range
0984ea9
example: Nemotron-3-Nano-30B-A3B-BF16 Megatron-LM PTQ launcher example
ChenhanYu 2447faa
fix(mmlu): shard batches over expert-DP group for MoE models
ChenhanYu 444fe80
example: drop hardcoded partition/time so it runs on any cluster
ChenhanYu fa0a810
example: drop the vLLM NVFP4 smoke (requires Blackwell)
ChenhanYu 534da60
examples(llama-qad): lower MMLU gate 0.40 -> 0.36 for NVFP4 Llama-3.2-1B
ChenhanYu ea9a05b
Merge branch 'main' into chenhany/repro-5434-validation
ChenhanYu 3c2759e
test(megatron): skip flaky compressed sharded_state_dict on Blackwell
ChenhanYu 2a8bc3e
example(eagle3): Qwen3-0.6B EAGLE3 online/offline launcher examples
ChenhanYu 05ae720
example(eagle3): fix Qwen3-0.6B offline parallelism + cap query samples
ChenhanYu 5895b60
example(eagle3): Qwen3-0.6B training_seq_len 4096 -> 1024
ChenhanYu 57203d2
example(eagle3): disable torch.compile for Qwen3-0.6B CI train
ChenhanYu 4bff3f5
fix(dataset): retry HF datasets-server /splits; xfail flaky preproces…
ChenhanYu 32a4b3c
Merge branch 'main' into chenhany/repro-5434-validation
ChenhanYu 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
109 changes: 109 additions & 0 deletions
109
tools/launcher/examples/Qwen/Qwen3-0.6B/hf_offline_eagle3.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,109 @@ | ||
| # EAGLE3 offline speculative decoding pipeline for Qwen3-0.6B. | ||
| # | ||
| # 4-step pipeline: | ||
| # task_0: Data synthesis — query TRT-LLM server to generate prompt samples | ||
| # task_1: Dump hidden states — run target model to capture hidden states | ||
| # task_2: Offline training — train the EAGLE3 draft head | ||
| # task_3: Benchmark — evaluate speculative decoding speedup via VLLM | ||
| # | ||
| # All tasks share /scratchspace to pass artifacts between steps. | ||
| # | ||
| # Usage: | ||
| # uv run launch.py --yaml examples/Qwen/Qwen3-0.6B/hf_offline_eagle3.yaml --yes | ||
| # uv run slurm.py --yaml modules/Model-Optimizer/tools/launcher/examples/Qwen/Qwen3-0.6B/hf_offline_eagle3.yaml --yes | ||
|
|
||
| job_name: Qwen3-0.6B_EAGLE3_offline | ||
| pipeline: | ||
| allow_to_fail: false | ||
| skip: false | ||
| note: | ||
|
|
||
| global_vars: | ||
| hf_model: /hf-local/Qwen/Qwen3-0.6B | ||
|
|
||
| # Step 1: Data synthesis via TRT-LLM server | ||
| # Args before "--" go to trtllm-serve; args after "--" go to tools/query.py. | ||
| task_0: | ||
| script: common/tensorrt_llm/query.sh | ||
| args: | ||
| - --model <<global_vars.hf_model>> | ||
| - --tp_size 1 | ||
| - --ep_size 1 | ||
| - --max_num_tokens 32000 | ||
| - --port 8000 | ||
| - --host 0.0.0.0 | ||
| - --trust_remote_code | ||
| - -- | ||
| - --data /hf-local/modelopt/Speculative-Decoding-Prompt-Samples | ||
| - --save /scratchspace/data | ||
| - --num-samples 128 | ||
| environment: | ||
| - HF_LOCAL: /hf-local | ||
| slurm_config: | ||
| _factory_: "slurm_factory" | ||
| nodes: 1 | ||
| ntasks_per_node: 1 | ||
| gpus_per_node: 1 | ||
| container: nvcr.io/nvidia/tensorrt-llm/release:1.2.0 | ||
|
|
||
| # Step 2: Dump hidden states from target model | ||
| task_1: | ||
| script: common/eagle3/dump_offline_data.sh | ||
| args: | ||
| - --input-data /scratchspace/data | ||
| - --output-dir /scratchspace/offline_hidden_states | ||
| - --max-seq-len 8192 | ||
| - --tp 1 | ||
| - --moe-ep 1 | ||
| environment: | ||
| - HF_MODEL_CKPT: <<global_vars.hf_model>> | ||
| slurm_config: | ||
| _factory_: "slurm_factory" | ||
| nodes: 1 | ||
| ntasks_per_node: 1 | ||
| gpus_per_node: 1 | ||
| container: nvcr.io/nvidia/tensorrt-llm/release:1.2.0 | ||
|
|
||
| # Step 3: Train EAGLE3 draft head (offline, single task) | ||
| task_2: | ||
| script: common/eagle3/train_eagle.sh | ||
| args: | ||
| - --config modules/Model-Optimizer/modelopt_recipes/general/speculative_decoding/eagle3.yaml | ||
| - model.model_name_or_path=<<global_vars.hf_model>> | ||
| - data.offline_data_path=/scratchspace/offline_hidden_states | ||
| - training.output_dir=/scratchspace/eagle3 | ||
| - training.training_seq_len=1024 | ||
| - training.disable_tqdm=true | ||
| - training.ar_validate_steps=500000 | ||
| # CI: disable torch.compile (recipe default mode="max-autotune") — its | ||
| # exhaustive Triton bmm autotuning floods the log with benign "out of | ||
| # resource" errors on the L40 and adds compile overhead for no CI benefit. | ||
| - eagle.eagle_use_torch_compile=false | ||
| slurm_config: | ||
| _factory_: "slurm_factory" | ||
| nodes: 1 | ||
| ntasks_per_node: 1 | ||
| gpus_per_node: 1 | ||
| container: nvcr.io/nvidia/tensorrt-llm/release:1.2.0 | ||
|
|
||
| # Step 4: Benchmark speculative decoding (VLLM backend) | ||
| task_3: | ||
| script: common/specdec_bench/quick_check.sh | ||
| args: | ||
| - --draft_model_dir /scratchspace/export | ||
| - --draft_length 3 | ||
| - --output_length 4096 | ||
| - --engine VLLM | ||
| - --tp_size 1 | ||
| - --ep_size 1 | ||
| - --speculative_algorithm EAGLE3 | ||
| - --mtbench /hf-local/HuggingFaceH4/mt_bench_prompts/raw/question.jsonl | ||
| - --concurrency 32 | ||
| environment: | ||
| - HF_MODEL_CKPT: <<global_vars.hf_model>> | ||
| slurm_config: | ||
| _factory_: "slurm_factory" | ||
| nodes: 1 | ||
| ntasks_per_node: 1 | ||
| gpus_per_node: 1 | ||
| container: vllm/vllm-openai:latest |
77 changes: 77 additions & 0 deletions
77
tools/launcher/examples/Qwen/Qwen3-0.6B/hf_online_eagle3.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,77 @@ | ||
| # EAGLE3 offline speculative decoding pipeline for Qwen3-8B. | ||
| # | ||
| # 4-step pipeline: | ||
| # task_0: Data synthesis — query TRT-LLM server to generate prompt samples | ||
| # task_1: Dump hidden states — run target model to capture hidden states | ||
| # task_2: Offline training — train the EAGLE3 draft head | ||
| # task_3: Benchmark — evaluate speculative decoding speedup via VLLM | ||
| # | ||
| # All tasks share /scratchspace to pass artifacts between steps. | ||
| # | ||
| # Usage: | ||
| # uv run launch.py --yaml examples/Qwen/Qwen3-0.6B/hf_offline_eagle3.yaml --yes | ||
| # uv run slurm.py --yaml modules/Model-Optimizer/tools/launcher/examples/Qwen/Qwen3-0.6B/hf_offline_eagle3.yaml --yes | ||
|
|
||
| job_name: Qwen3-0.6B_EAGLE3_online | ||
| pipeline: | ||
| allow_to_fail: false | ||
| skip: false | ||
| note: | ||
|
|
||
| global_vars: | ||
| hf_model: /hf-local/Qwen/Qwen3-0.6B | ||
|
|
||
| task_0: | ||
| script: common/eagle3/make_dataset.sh | ||
| args: | ||
| - -f modules/Model-Optimizer/examples/dataset/example_data_config.yaml | ||
| - --full-conversations | ||
| slurm_config: | ||
| _factory_: "slurm_factory" | ||
| nodes: 1 | ||
| ntasks_per_node: 1 | ||
| gpus_per_node: 1 | ||
| container: nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc10 | ||
|
|
||
| task_1: | ||
| script: common/eagle3/train_eagle.sh | ||
| args: | ||
| - --config modules/Model-Optimizer/modelopt_recipes/general/speculative_decoding/eagle3.yaml | ||
| - model.model_name_or_path=<<global_vars.hf_model>> | ||
| - data.data_path=/scratchspace/data/train.jsonl | ||
| - training.output_dir=/scratchspace/eagle3 | ||
| - training.training_seq_len=1024 | ||
| - training.disable_tqdm=true | ||
| - training.ar_validate_steps=500000 | ||
| - training.num_train_epochs=1 | ||
| # CI: disable torch.compile (recipe default mode="max-autotune") — its | ||
| # exhaustive Triton bmm autotuning floods the log with benign "out of | ||
| # resource" errors on the L40 and adds compile overhead for no CI benefit. | ||
| - eagle.eagle_use_torch_compile=false | ||
| slurm_config: | ||
| _factory_: "slurm_factory" | ||
| nodes: 1 | ||
| ntasks_per_node: 1 | ||
| gpus_per_node: 1 | ||
| container: nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc10 | ||
|
|
||
| task_2: | ||
| script: common/specdec_bench/quick_check.sh | ||
| args: | ||
| - --draft_model_dir /scratchspace/export | ||
| - --draft_length 3 | ||
| - --output_length 4096 | ||
| - --engine VLLM | ||
| - --tp_size 1 | ||
| - --ep_size 1 | ||
| - --speculative_algorithm EAGLE3 | ||
| - --mtbench /hf-local/HuggingFaceH4/mt_bench_prompts/raw/question.jsonl | ||
| - --concurrency 32 | ||
| environment: | ||
| - HF_MODEL_CKPT: <<global_vars.hf_model>> | ||
| slurm_config: | ||
| _factory_: "slurm_factory" | ||
| nodes: 1 | ||
| ntasks_per_node: 1 | ||
| gpus_per_node: 1 | ||
| container: vllm/vllm-openai:latest |
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.
why do we need to reduce this now?