-
Notifications
You must be signed in to change notification settings - Fork 39
sglang router profiling for PD disagg #60
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
10 commits
Select commit
Hold shift + click to select a range
525e771
Restore functionality for accuracy benchmarks (#66)
Fridge003 01ba5a3
tiny update acc doc (#67)
Fridge003 fa705dc
support set prefill/decode profiling step separately and agg profilin…
weireweire 306e4ee
Update recipe for fp4+Wideep+MTP on GB200 (#62)
Fridge003 de2e977
update recipies for mtp (#73)
Fridge003 a0d51ef
Update mtp recipes to 0.5.7 (#74)
Fridge003 362c476
Support multiworker profiling
wenscarl e5ee24d
Upd
wenscarl 27fcefc
Support install sglang from external source
wenscarl 8844d36
Merge remote-tracking branch 'origin/main' into native_separate_pd
wenscarl 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
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,123 @@ | ||
| name: "gb200-fp4-1p2d" | ||
|
|
||
| model: | ||
| path: "dsfp4" | ||
| container: "0.5.5.post2" | ||
| precision: "fp4" | ||
|
|
||
| resources: | ||
| gpu_type: "gb200" | ||
| prefill_nodes: 1 | ||
| decode_nodes: 2 | ||
| prefill_workers: 1 | ||
| decode_workers: 2 | ||
| gpus_per_node: 4 | ||
|
|
||
| backend: | ||
| use_sglang_router: "true" | ||
|
|
||
| prefill_environment: | ||
| SGLANG_LOG_FORWARD_ITERS: "1" | ||
| TORCH_DISTRIBUTED_DEFAULT_TIMEOUT: "1800" | ||
| PYTHONUNBUFFERED: "1" | ||
| DYN_SKIP_SGLANG_LOG_FORMATTING: "1" | ||
| SGLANG_USE_MESSAGE_QUEUE_BROADCASTER: "0" | ||
| SGLANG_DISABLE_TP_MEMORY_INBALANCE_CHECK: "1" | ||
| SGLANG_DISAGGREGATION_HEARTBEAT_MAX_FAILURE: "100000" | ||
| SGLANG_DISAGGREGATION_BOOTSTRAP_TIMEOUT: "100000" | ||
| SGLANG_DISAGGREGATION_WAITING_TIMEOUT: "100000" | ||
| SGLANG_DECODE_BOOTSTRAP_TIMEOUT: "1000" | ||
| #SGLANG_NVFP4_CKPT_FP8_GEMM_IN_ATTN: "1" | ||
| #SGLANG_PER_TOKEN_GROUP_QUANT_8BIT_V2: "1" | ||
| MC_FORCE_MNNVL: "1" | ||
| NCCL_MNNVL_ENABLE: "1" | ||
| NCCL_CUMEM_ENABLE: "1" | ||
| SGLANG_MOONCAKE_CUSTOM_MEM_POOL: "True" | ||
| SGLANG_ENABLE_JIT_DEEPGEMM: "false" | ||
| SGLANG_ENABLE_FLASHINFER_GEMM: "true" #instead of SGLANG_FLASHINFER_FP4_GEMM_BACKEND | ||
|
|
||
| decode_environment: | ||
| SGLANG_LOG_FORWARD_ITERS: "1" | ||
| TORCH_DISTRIBUTED_DEFAULT_TIMEOUT: "1800" | ||
| PYTHONUNBUFFERED: "1" | ||
| DYN_SKIP_SGLANG_LOG_FORMATTING: "1" | ||
| SGLANG_USE_MESSAGE_QUEUE_BROADCASTER: "0" | ||
| SGLANG_DISABLE_TP_MEMORY_INBALANCE_CHECK: "1" | ||
| SGLANG_DISAGGREGATION_HEARTBEAT_MAX_FAILURE: "100000" | ||
| SGLANG_DISAGGREGATION_BOOTSTRAP_TIMEOUT: "100000" | ||
| SGLANG_DISAGGREGATION_WAITING_TIMEOUT: "100000" | ||
| SGLANG_DECODE_BOOTSTRAP_TIMEOUT: "1000" | ||
| # SGLANG_NVFP4_CKPT_FP8_GEMM_IN_ATTN: "1" | ||
| # SGLANG_PER_TOKEN_GROUP_QUANT_8BIT_V2: "1" | ||
| MC_FORCE_MNNVL: "1" | ||
| NCCL_MNNVL_ENABLE: "1" | ||
| NCCL_CUMEM_ENABLE: "1" | ||
| SGLANG_MOONCAKE_CUSTOM_MEM_POOL: "True" | ||
| SGLANG_ENABLE_JIT_DEEPGEMM: "false" | ||
| SGLANG_ENABLE_FLASHINFER_GEMM: "true" #instead of SGLANG_FLASHINFER_FP4_GEMM_BACKEND | ||
|
|
||
| sglang_config: | ||
| prefill: | ||
| disaggregation-mode: "prefill" | ||
| served-model-name: "deepseek-ai/DeepSeek-R1" | ||
| model-path: "/model/" | ||
| trust-remote-code: true | ||
| disable-radix-cache: true | ||
| kv-cache-dtype: "fp8_e4m3" | ||
| attention-backend: "trtllm_mla" | ||
| quantization: "modelopt_fp4" | ||
| moe-runner-backend: "flashinfer_trtllm" | ||
| stream-interval: 10 | ||
| watchdog-timeout: 1000000 | ||
| context-length: 2200 | ||
| mem-fraction-static: 0.95 | ||
| max-total-tokens: 8192 | ||
| chunked-prefill-size: 8192 | ||
| cuda-graph-max-bs: 256 | ||
| max-running-requests: 512 | ||
| scheduler-recv-interval: 10 | ||
| enable-symm-mem: true | ||
| moe-dense-tp-size: 1 | ||
| load-balance-method: "round_robin" | ||
| disaggregation-bootstrap-port: 30001 | ||
| load-format: "dummy" | ||
| data-parallel-size: 1 | ||
| tensor-parallel-size: 4 | ||
| expert-parallel-size: 1 | ||
|
|
||
| decode: | ||
| disaggregation-mode: "decode" | ||
| served-model-name: "deepseek-ai/DeepSeek-R1" | ||
| model-path: "/model/" | ||
| prefill-round-robin-balance: true | ||
| trust-remote-code: true | ||
| disable-radix-cache: true | ||
| kv-cache-dtype: "fp8_e4m3" | ||
| attention-backend: "trtllm_mla" | ||
| quantization: "modelopt_fp4" | ||
| moe-runner-backend: "flashinfer_trtllm" | ||
| disaggregation-bootstrap-port: 30001 | ||
| stream-interval: 10 | ||
| watchdog-timeout: 1000000 | ||
| context-length: 2200 | ||
| mem-fraction-static: 0.95 | ||
| load-format: "dummy" | ||
| chunked-prefill-size: 8192 | ||
| cuda-graph-max-bs: 256 | ||
| scheduler-recv-interval: 10 | ||
| enable-symm-mem: true | ||
| moe-dense-tp-size: 1 | ||
| tensor-parallel-size: 4 | ||
| expert-parallel-size: 1 | ||
|
|
||
| profiling: | ||
| type: "nsys" | ||
| isl: 1024 | ||
| osl: 1024 | ||
| concurrency: 256 | ||
| prefill: | ||
| start_step: 60 | ||
| stop_step: 70 | ||
| decode: | ||
| start_step: 700 | ||
| stop_step: 730 |
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,64 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # GPQA evaluation script using sglang.test.run_eval with mmlu | ||
|
|
||
| head_node="localhost" | ||
| head_port=8000 | ||
| model_name="deepseek-ai/DeepSeek-R1" # Default model name | ||
|
|
||
| # Parse arguments from SLURM job | ||
| n_prefill=$1 | ||
| n_decode=$2 | ||
| prefill_gpus=$3 | ||
| decode_gpus=$4 | ||
| num_examples=${5:-200} # Default: 200 | ||
| max_tokens=${6:-8192} # Default: 8192 | ||
| repeat=${7:-8} # Default: 8 | ||
| num_threads=${8:-512} # Default: 512 | ||
|
|
||
| echo "MMLU Benchmark Config: num_examples=${num_examples}; max_tokens=${max_tokens}; repeat=${repeat}; num_threads=${num_threads}" | ||
|
|
||
| # Source utilities for wait_for_model | ||
| source /scripts/utils/benchmark_utils.sh | ||
|
|
||
| wait_for_model_timeout=1500 # 25 minutes | ||
| wait_for_model_check_interval=5 # check interval -> 5s | ||
| wait_for_model_report_interval=60 # wait_for_model report interval -> 60s | ||
|
|
||
| wait_for_model $head_node $head_port $n_prefill $n_decode $wait_for_model_check_interval $wait_for_model_timeout $wait_for_model_report_interval | ||
|
|
||
| # Create results directory | ||
| result_dir="/logs/accuracy" | ||
| mkdir -p $result_dir | ||
|
|
||
| echo "Running MMLU evaluation..." | ||
|
|
||
| # Set OPENAI_API_KEY if not set | ||
| if [ -z "$OPENAI_API_KEY" ]; then | ||
| export OPENAI_API_KEY="EMPTY" | ||
| fi | ||
|
|
||
| # Run the evaluation | ||
| python3 -m sglang.test.run_eval \ | ||
| --base-url "http://${head_node}:${head_port}" \ | ||
| --model ${model_name} \ | ||
| --eval-name mmlu \ | ||
| --num-examples ${num_examples} \ | ||
| --max-tokens ${max_tokens} \ | ||
| --repeat ${repeat} \ | ||
| --num-threads ${num_threads} | ||
|
|
||
| # Copy the result file from /tmp to our logs directory | ||
| # The result file is named mmlu_{model_name}.json | ||
| result_file=$(ls -t /tmp/mmlu_*.json 2>/dev/null | head -n1) | ||
|
|
||
| if [ -f "$result_file" ]; then | ||
| cp "$result_file" "$result_dir/" | ||
| echo "Results saved to: $result_dir/$(basename $result_file)" | ||
| else | ||
| echo "Warning: Could not find result file in /tmp" | ||
| fi | ||
|
|
||
| echo "MMLU evaluation complete" |
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.
Document the automatic 'python' subdirectory resolution.
The documentation states that the local directory is mounted to
/ext-sglang-src/, but the implementation inscripts/worker_setup/command.py(line 163) automatically appends/pythonto this path before installation. Users should be informed thatsglang_src_dirmust point to the SGLang repository root (not the python subdirectory), as the code will automatically resolve to thepython/subdirectory within it.📝 Suggested documentation update
📝 Committable suggestion
🤖 Prompt for AI Agents