-
Notifications
You must be signed in to change notification settings - Fork 210
[NVIDIA] feat: MiniMax M3 Day 0 MTP (EAGLE3) support B300 #1737
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
132 changes: 132 additions & 0 deletions
132
benchmarks/single_node/fixed_seq_len/minimaxm3_fp8_b300_mtp.sh
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,132 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # MiniMax-M3 MXFP8 B300 single-node vLLM MTP (EAGLE3) variant of | ||
| # minimaxm3_fp8_b300.sh (https://recipes.vllm.ai/MiniMaxAI/MiniMax-M3). | ||
| # Adds the recipe's spec_decoding feature: EAGLE3 speculative decoding with the | ||
| # Inferact/MiniMax-M3-EAGLE3 draft head (num_speculative_tokens=3, | ||
| # attention_backend=FLASH_ATTN). Follows the b300 MODEL/MODEL_PATH split | ||
| # (launch_b300-nv.sh serves from /data/models/<basename>). EAGLE acceptance | ||
| # collapses on raw random prompts, so the benchmark routes prompts through | ||
| # chat-formatted encoding via --use-chat-template (required for all *_mtp.sh). | ||
|
|
||
| source "$(dirname "$0")/../../benchmark_lib.sh" | ||
|
|
||
| check_env_vars \ | ||
| MODEL \ | ||
| TP \ | ||
| EP_SIZE \ | ||
| DP_ATTENTION \ | ||
| CONC \ | ||
| ISL \ | ||
| OSL \ | ||
| MAX_MODEL_LEN \ | ||
| RANDOM_RANGE_RATIO \ | ||
| RESULT_FILENAME | ||
|
|
||
| # `hf download` creates the target dir if missing and is itself idempotent. | ||
| # When MODEL_PATH is unset (stand-alone runs), fall back to the HF_HUB_CACHE. | ||
| # Either way, MODEL_PATH is what the server is launched with. | ||
| if [[ -n "${MODEL_PATH:-}" ]]; then | ||
| if [[ ! -d "$MODEL_PATH" || -z "$(ls -A "$MODEL_PATH" 2>/dev/null)" ]]; then | ||
| hf download "$MODEL" --local-dir "$MODEL_PATH" | ||
| fi | ||
| else | ||
| hf download "$MODEL" | ||
| export MODEL_PATH="$MODEL" | ||
| fi | ||
|
|
||
| # EAGLE3 draft head. launch_b300-nv.sh stages models under /data/models (which | ||
| # is bind-mounted), so the sibling of MODEL_PATH is visible in-container; | ||
| # fall back to the HF id for stand-alone runs. | ||
| DRAFT_MODEL="${DRAFT_MODEL_PATH:-}" | ||
| if [[ -z "$DRAFT_MODEL" ]]; then | ||
| if [[ -d "${MODEL_PATH%/*}/MiniMax-M3-EAGLE3" ]]; then | ||
| DRAFT_MODEL="${MODEL_PATH%/*}/MiniMax-M3-EAGLE3" | ||
| else | ||
| DRAFT_MODEL="Inferact/MiniMax-M3-EAGLE3" | ||
| fi | ||
| fi | ||
| if [[ "$DRAFT_MODEL" != /* ]]; then hf download "$DRAFT_MODEL"; fi | ||
| echo "EAGLE3 draft head: $DRAFT_MODEL" | ||
|
|
||
| if [[ -n "$SLURM_JOB_ID" ]]; then | ||
| echo "JOB $SLURM_JOB_ID running on $SLURMD_NODENAME" | ||
| fi | ||
|
|
||
| nvidia-smi | ||
|
|
||
| SERVER_LOG=/workspace/server.log | ||
|
|
||
| # 444 GB of MXFP8 weights + EAGLE3 draft head off shared FS; engine startup | ||
| # can exceed the default 600s readiness window. | ||
| export VLLM_ENGINE_READY_TIMEOUT_S=3600 | ||
|
|
||
| if [ "${DP_ATTENTION}" = "true" ]; then | ||
| PARALLEL_ARGS="--tensor-parallel-size=1 --data-parallel-size=$TP --enable-expert-parallel" | ||
| elif [ "$EP_SIZE" -gt 1 ]; then | ||
| PARALLEL_ARGS="--tensor-parallel-size=$TP --enable-expert-parallel" | ||
| else | ||
| PARALLEL_ARGS="--tensor-parallel-size=$TP" | ||
| fi | ||
|
|
||
| # Fixed-seq-len runs don't need graphs past the request concurrency, but spec | ||
| # decoding verifies CONC*(1+num_spec) tokens per decode step; capture up to the | ||
| # next power of two >= that, capped at vLLM's 2048 ceiling. | ||
| NUM_SPEC_TOKENS=3 | ||
| CAPTURE_SIZE=4 | ||
| TARGET=$(( CONC * (NUM_SPEC_TOKENS + 1) )) | ||
| while (( CAPTURE_SIZE < TARGET )); do CAPTURE_SIZE=$((CAPTURE_SIZE * 2)); done | ||
| (( CAPTURE_SIZE > 2048 )) && CAPTURE_SIZE=2048 | ||
|
|
||
| SPEC_CONFIG="{\"method\": \"eagle3\", \"model\": \"$DRAFT_MODEL\", \"num_speculative_tokens\": $NUM_SPEC_TOKENS, \"attention_backend\": \"FLASH_ATTN\"}" | ||
|
|
||
| if [ "${EVAL_ONLY}" = "true" ]; then | ||
| setup_eval_context | ||
| MAX_MODEL_LEN="$EVAL_MAX_MODEL_LEN" | ||
| fi | ||
| # Start GPU monitoring (power, temperature, clocks every second) | ||
| start_gpu_monitor | ||
|
|
||
| set -x | ||
| vllm serve "$MODEL_PATH" --served-model-name "$MODEL" --host 0.0.0.0 --port $PORT \ | ||
| $PARALLEL_ARGS \ | ||
| --gpu-memory-utilization 0.90 \ | ||
| --max-model-len $MAX_MODEL_LEN \ | ||
| --block-size 128 \ | ||
| --language-model-only \ | ||
| --speculative-config "$SPEC_CONFIG" \ | ||
| --max-cudagraph-capture-size $CAPTURE_SIZE \ | ||
| --max-num-batched-tokens "$((ISL * 2 ))" \ | ||
| --stream-interval 20 --no-enable-prefix-caching \ | ||
| --trust-remote-code > $SERVER_LOG 2>&1 & | ||
|
|
||
| SERVER_PID=$! | ||
|
|
||
| # Wait for server to be ready | ||
| wait_for_server_ready --port "$PORT" --server-log "$SERVER_LOG" --server-pid "$SERVER_PID" | ||
|
|
||
| # --use-chat-template: EAGLE3 acceptance is trained against chat-formatted | ||
| # inputs; benchmarking raw prompts silently regresses the acceptance rate. | ||
| run_benchmark_serving \ | ||
| --model "$MODEL" \ | ||
| --port "$PORT" \ | ||
| --backend vllm \ | ||
| --input-len "$ISL" \ | ||
| --output-len "$OSL" \ | ||
| --random-range-ratio "$RANDOM_RANGE_RATIO" \ | ||
| --num-prompts "$((CONC * 10))" \ | ||
| --max-concurrency "$CONC" \ | ||
| --result-filename "$RESULT_FILENAME" \ | ||
| --result-dir /workspace/ \ | ||
| --trust-remote-code \ | ||
| --use-chat-template | ||
|
|
||
| # After throughput, run evaluation only if RUN_EVAL is true | ||
| if [ "${RUN_EVAL}" = "true" ]; then | ||
| run_eval --framework lm-eval --port "$PORT" | ||
| append_lm_eval_summary | ||
| fi | ||
|
|
||
| # Stop GPU monitoring | ||
| stop_gpu_monitor | ||
| set +x | ||
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
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.
Empty draft dir not populated
Medium Severity
The EAGLE3 draft path is chosen when its directory exists, but unlike the main
MODEL_PATHblock there is no check that the directory actually contains weights. An emptyMiniMax-M3-EAGLE3sibling under/data/modelsskipshf download, sovllm servecan fail or load an invalid draft while the primary checkpoint was populated correctly.Reviewed by Cursor Bugbot for commit f6b6935. Configure here.