-
Notifications
You must be signed in to change notification settings - Fork 175
Add B200 config: glm5-fp4-sglang-mtp #1087
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| source "$(dirname "$0")/../benchmark_lib.sh" | ||
|
|
||
| check_env_vars \ | ||
| MODEL \ | ||
| TP \ | ||
| CONC \ | ||
| ISL \ | ||
| OSL \ | ||
| RANDOM_RANGE_RATIO \ | ||
| RESULT_FILENAME | ||
|
|
||
| if [[ -n "$SLURM_JOB_ID" ]]; then | ||
| echo "JOB $SLURM_JOB_ID running on $SLURMD_NODENAME" | ||
| fi | ||
|
|
||
| nvidia-smi | ||
|
|
||
| hf download "$MODEL" | ||
|
|
||
| pip install --no-deps "transformers==5.2.0" "huggingface-hub==1.4.1" | ||
|
|
||
| export SGL_ENABLE_JIT_DEEPGEMM=1 | ||
| export SGLANG_ENABLE_SPEC_V2=1 | ||
|
|
||
| SERVER_LOG=/workspace/server.log | ||
| PORT=${PORT:-8888} | ||
|
|
||
|
|
||
| echo "CONC: $CONC, ISL: $ISL, OSL: $OSL" | ||
|
|
||
| EVAL_CONTEXT_ARGS="" | ||
| if [ "${EVAL_ONLY}" = "true" ]; then | ||
| setup_eval_context | ||
| EVAL_CONTEXT_ARGS="--context-length $EVAL_MAX_MODEL_LEN" | ||
| fi | ||
| # Start GPU monitoring (power, temperature, clocks every second) | ||
| start_gpu_monitor | ||
|
|
||
| set -x | ||
| PYTHONNOUSERSITE=1 python3 -m sglang.launch_server --model-path=$MODEL --host=0.0.0.0 --port=$PORT \ | ||
| --trust-remote-code \ | ||
| --tensor-parallel-size=$TP \ | ||
| --data-parallel-size 1 --expert-parallel-size 1 \ | ||
| --tool-call-parser glm47 \ | ||
| --reasoning-parser glm45 \ | ||
| --kv-cache-dtype fp8_e4m3 --quantization fp8 \ | ||
| --attention-backend nsa \ | ||
| --nsa-decode-backend trtllm --nsa-prefill-backend trtllm \ | ||
| --moe-runner-backend flashinfer_trtllm \ | ||
| --cuda-graph-max-bs $CONC --max-running-requests $CONC \ | ||
| --mem-fraction-static 0.85 \ | ||
| --chunked-prefill-size 32768 --max-prefill-tokens 32768 \ | ||
| --enable-flashinfer-allreduce-fusion --disable-radix-cache \ | ||
| --stream-interval 30 \ | ||
| --speculative-algorithm EAGLE \ | ||
| --speculative-num-steps 3 \ | ||
| --speculative-eagle-topk 1 \ | ||
| --speculative-num-draft-tokens 4 \ | ||
| --model-loader-extra-config '{"enable_multithread_load": true}' $EVAL_CONTEXT_ARGS > $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" | ||
|
|
||
| pip install -q datasets pandas | ||
|
|
||
| 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/ \ | ||
| --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
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.
🔴 The new script passes
--quantization fp8and--kv-cache-dtype fp8_e4m3(copied verbatim from the FP8 sibling script), but the model isnvidia/GLM-5-NVFP4which uses pre-quantized NVFP4 weights. The correct flag for NVFP4 weights is--quantization modelopt_fp4, as used by the existingbenchmarks/single_node/glm5_fp4_b200.sh(line 42). With the wrong quantization flag, SGLang will either fail at model load or produce invalid benchmark results.Extended reasoning...
What the bug is and how it manifests
The new launch script
benchmarks/single_node/glm5_fp4_b200_mtp.sh(line 48) passes--kv-cache-dtype fp8_e4m3 --quantization fp8tosglang.launch_server. However, the model being loaded isnvidia/GLM-5-NVFP4— a model whose weights are already pre-quantized in NVIDIA's NVFP4 (modelopt_fp4) format. The fp8 quantization flags are appropriate for FP8-quantized models likezai-org/GLM-5-FP8, not for NVFP4 weights.The specific code path that triggers it
When a sweep job runs for the
glm5-fp4-b200-sglang-mtpconfig, the harness selectsglm5_fp4_b200_mtp.shas the launch script. That script calls:with
MODEL=nvidia/GLM-5-NVFP4. SGLang will attempt to apply FP8 quantization to weights that are already stored in NVFP4 format.Why existing safeguards do not catch this
This is a semantic error invisible to
bash -nsyntax checking (which the PR author confirms passed). The YAML config andmodelfield correctly referencenvidia/GLM-5-NVFP4withprecision: fp4, but the quantization directive in the launch script contradicts this at runtime. There is no static analysis that cross-validates the quantization flag against the model weights format.Impact
SGLang will either: (a) reject the conflicting quantization scheme and fail to start the server, causing the sweep job to error out; or (b) silently misinterpret the NVFP4 weights under an FP8 quantization scheme, resulting in benchmark numbers that do not represent actual NVFP4 performance. Either outcome invalidates any measurements collected under this config. The config is already labeled
sweep-enabled, meaning it could be swept as-is.How to fix it
Replace line 48 of
benchmarks/single_node/glm5_fp4_b200_mtp.sh:This matches the existing non-MTP counterpart
benchmarks/single_node/glm5_fp4_b200.shline 42. Whether to also add--kv-cache-dtype fp8_e4m3for FP8 KV cache should be verified against the FP4 B200 recipe.Step-by-step proof
glm5-fp4-b200-sglang-mtpsetsmodel: nvidia/GLM-5-NVFP4andprecision: fp4.glm5_fp4_b200_mtp.shwithMODEL=nvidia/GLM-5-NVFP4.--quantization fp8tosglang.launch_server.benchmarks/single_node/glm5_fp4_b200.shline 42, which correctly uses--quantization modelopt_fp4for the samenvidia/GLM-5-NVFP4model.