Add NCCL/RCCL pre-warming to reduce P99 TTFT cold-start latency#20477
Merged
HaiShaw merged 4 commits intosgl-project:mainfrom Mar 17, 2026
Merged
Add NCCL/RCCL pre-warming to reduce P99 TTFT cold-start latency#20477HaiShaw merged 4 commits intosgl-project:mainfrom
HaiShaw merged 4 commits intosgl-project:mainfrom
Conversation
Implements NCCL/RCCL communicator pre-warming during server startup to eliminate cold-start latency (up to 1400ms) for first requests when using multi-GPU tensor parallelism. Measured on AMD MI355X: - P99 TTFT improvement: 74.9% (1413ms → 357ms) - Latency stability: 87.8% lower std dev (327ms → 40ms) - Warmup overhead: 4.7s one-time cost (5.2% of model loading) Changes: - server_args.py: Add pre_warm_nccl field with platform-aware default (enabled for AMD/HIP, disabled for NVIDIA/CUDA until validation) - server_args.py: Add --pre-warm-nccl CLI argument - model_runner.py: Implement warmup via single all_reduce operation during ModelRunner initialization Default behavior: - AMD/HIP: Enabled (validated 74.9% improvement) - NVIDIA/CUDA: Disabled (pending validation) Inspired by InstantTensor's implementation which achieved 71% improvement on NVIDIA GPUs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
sogalin
approved these changes
Mar 13, 2026
HaiShaw
reviewed
Mar 13, 2026
Collaborator
There was a problem hiding this comment.
@hubertlu-tw
Can you make the change rocm/hip specific (nccl->rccl), or cuda&hip specific (to avoid regression to other platforms).
Collaborator
Author
@HaiShaw I have modified server_args.py so that --pre-warm-nccl is only applicable for CUDA and HIP and it is set to True by default only for AMD GPUs. |
HaiShaw
approved these changes
Mar 17, 2026
Wangzheee
pushed a commit
to Wangzheee/sglang
that referenced
this pull request
Mar 21, 2026
…project#20477) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0-693
pushed a commit
to 0-693/sglang
that referenced
this pull request
Mar 25, 2026
…project#20477) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
JustinTong0323
pushed a commit
to JustinTong0323/sglang
that referenced
this pull request
Apr 7, 2026
…project#20477) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
yhyang201
pushed a commit
to yhyang201/sglang
that referenced
this pull request
Apr 22, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
When using multi-GPU tensor parallelism (TP > 1), the first collective communication operation triggers NCCL/RCCL communicator initialization, causing severe P99 TTFT degradation (up to 1400ms) for the first 2-3 requests.
This PR implements NCCL/RCCL pre-warming during server startup to eliminate cold-start latency, inspired by InstantTensor's implementation.
Measured Impact on AMD MI355X:
Default Behavior:
Modifications
Server Arguments (server_args.py)
Added
pre_warm_ncclfield with platform-aware default:Added CLI argument:
Model Runner (model_runner.py)
Added warmup logic during initialization:
Accuracy Tests
No accuracy impact - latency optimization only, does not affect model outputs.
Validated with GSM8K (100 questions):
Benchmarking and Profiling
Test Environment
Results
Key Findings:
Reproduction Commands
Click to expand
Test without pre-warming:
Test with pre-warming (default for AMD):
NVIDIA users (pre-warm disabled by default):
# Enable explicitly with --pre-warm-nccl python3 -m sglang.launch_server \ --model-path /data/model \ --tp-size 8 \ --pre-warm-ncclChecklist
Review Process
/tag-run-ci-label,/rerun-failed-ci