-
Notifications
You must be signed in to change notification settings - Fork 205
[NV] add minimaxm2.5-fp4-b200-trt #1722
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
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
139 changes: 139 additions & 0 deletions
139
benchmarks/single_node/fixed_seq_len/minimaxm2.5_fp4_b200_trt.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,139 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Source benchmark utilities early | ||
| source "$(dirname "$0")/../../benchmark_lib.sh" | ||
|
|
||
| check_env_vars \ | ||
| MODEL \ | ||
| TP \ | ||
| CONC \ | ||
| ISL \ | ||
| OSL \ | ||
| MAX_MODEL_LEN \ | ||
| RANDOM_RANGE_RATIO \ | ||
| RESULT_FILENAME \ | ||
| DP_ATTENTION \ | ||
| EP_SIZE | ||
|
|
||
| if [[ -n "$SLURM_JOB_ID" ]]; then | ||
| echo "JOB $SLURM_JOB_ID running on $SLURMD_NODENAME" | ||
| fi | ||
|
|
||
| echo "TP: $TP, CONC: $CONC, ISL: $ISL, OSL: $OSL, EP_SIZE: $EP_SIZE, DP_ATTENTION: $DP_ATTENTION" | ||
|
|
||
| MAX_NUM_TOKENS=16384 | ||
| MAX_CAPTURE_TOKENS=$(( MAX_NUM_TOKENS < CONC * ISL ? MAX_NUM_TOKENS : CONC * ISL )) | ||
| CAPTURE_TOKENS_LIST=(1 2 4 8 12 16 24 32 48 64 96 128 192 256 384 512 768) | ||
| CAPTURE_TOKENS_LIST+=( $(seq 1024 128 2047)) | ||
| CAPTURE_TOKENS_LIST+=( $(seq 2048 256 4095)) | ||
| if [[ $MAX_CAPTURE_TOKENS -ge 4096 ]]; then | ||
| CAPTURE_TOKENS_LIST+=( $(seq 4096 512 $MAX_CAPTURE_TOKENS)) | ||
| fi | ||
| CAPTURE_TOKENS_LIST=$(printf "%s, " "${CAPTURE_TOKENS_LIST[@]}") | ||
|
|
||
| CAPTURE_BATCH_LIST=(1 2 4 8 12 ) | ||
| if [[ $CONC -ge 16 ]]; then | ||
| MAX_CAPTURE_BATCH=$(( CONC < 256 ? CONC : 255 )) | ||
| CAPTURE_BATCH_LIST+=( $(seq 16 8 $MAX_CAPTURE_BATCH )) | ||
| fi | ||
| if [[ $CONC -ge 256 ]]; then | ||
| MAX_CAPTURE_BATCH=$(( CONC < 512 ? CONC : 511 )) | ||
| CAPTURE_BATCH_LIST+=( $(seq 256 16 $MAX_CAPTURE_BATCH)) | ||
| fi | ||
| if [[ $CONC -ge 512 ]]; then | ||
| MAX_CAPTURE_BATCH=$(( CONC < 768 ? CONC : 767 )) | ||
| CAPTURE_BATCH_LIST+=( $(seq 512 32 $MAX_CAPTURE_BATCH)) | ||
| fi | ||
| if [[ $CONC -ge 1024 ]]; then | ||
| CAPTURE_BATCH_LIST+=( $(seq 768 64 $CONC)) | ||
| fi | ||
| CAPTURE_BATCH_LIST=$(printf "%s, " "${CAPTURE_BATCH_LIST[@]}") | ||
| MAX_CAPTURE_TOKENS=$(( CONC < 16 ? 4096 : MAX_NUM_TOKENS )) | ||
|
|
||
| CONFIG_FILE="minimax-fp4.yaml" | ||
| cat << EOF > $CONFIG_FILE | ||
| cuda_graph_config: | ||
| enable_padding: true | ||
| batch_sizes: [${CAPTURE_BATCH_LIST%, }] | ||
| moe_config: | ||
| backend: TRTLLM | ||
| use_low_precision_moe_combine: true | ||
| enable_attention_dp: $DP_ATTENTION | ||
| torch_compile_config: | ||
| capture_num_tokens: [${CAPTURE_TOKENS_LIST%, }] | ||
| enable_piecewise_cuda_graph: true | ||
| stream_interval: 100 | ||
| print_iter_log: true | ||
| max_num_tokens: $MAX_NUM_TOKENS | ||
| kv_cache_config: | ||
| free_gpu_memory_fraction: 0.9 | ||
| enable_block_reuse: False | ||
| dtype: fp8 | ||
| scheduler_config: | ||
| capacity_scheduler_policy: MAX_UTILIZATION | ||
| context_chunking_policy: FIRST_COME_FIRST_SERVED | ||
| nvfp4_gemm_config: | ||
| allowed_backends: | ||
| - cutlass | ||
| - cublaslt | ||
| - cutedsl | ||
| - cuda_core | ||
| max_seq_len: $MAX_MODEL_LEN | ||
| num_postprocess_workers: 4 | ||
| EOF | ||
|
|
||
| if [[ $DP_ATTENTION == true ]]; then | ||
| cat << EOF >> $CONFIG_FILE | ||
| attention_dp_config: | ||
| enable_balance: true | ||
| EOF | ||
| fi | ||
|
|
||
| if [[ "$MODEL" != /* ]]; then hf download "$MODEL"; fi | ||
| SERVER_LOG=/workspace/server.log | ||
| PORT=${PORT:-8888} | ||
|
|
||
| echo "Generated config file contents:" | ||
| cat $CONFIG_FILE | ||
|
|
||
| # Start GPU monitoring (power, temperature, clocks every second) | ||
| start_gpu_monitor | ||
|
|
||
| set -x | ||
|
|
||
| # Launch TRT-LLM server | ||
| mpirun -n 1 --oversubscribe --allow-run-as-root \ | ||
| trtllm-serve $MODEL --port=$PORT \ | ||
| --trust_remote_code \ | ||
| --backend=pytorch \ | ||
| --max_batch_size $CONC \ | ||
| --tp_size=$TP --ep_size=$EP_SIZE \ | ||
| --config=$CONFIG_FILE \ | ||
| > $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" | ||
|
|
||
| run_benchmark_serving \ | ||
| --model "$MODEL" \ | ||
| --port "$PORT" \ | ||
| --backend openai \ | ||
| --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/ | ||
|
|
||
| # 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
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.
Wrong CUDA capture token cap
Medium Severity
torch_compile_config.capture_num_tokensis sized from an earlyMAX_CAPTURE_TOKENS(min(16384, CONC*ISL)), while a later assignment caps low concurrency at 4096 but is never used. ForCONCunder 16 (e.g. 8k/1k at conc 4–8), capture lists can reachCONC*ISLor 16384 instead of 4096.Reviewed by Cursor Bugbot for commit 1af0b14. Configure here.