-
Notifications
You must be signed in to change notification settings - Fork 615
feat: sglang + gb200 #2223
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
feat: sglang + gb200 #2223
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f404ab0
docs(sglang): add GB200 deployment guide for DeepSeek-R1 with WideEP
ishandhanani 9e0badd
docs(slurm_jobs): add support for GB200 GPUs and SGLang commands
ishandhanani 1801f8d
chore(scripts): make sglang slurm scripts executable and clean up Doc…
ishandhanani e91ba89
feat(slurm_jobs): add partition argument to job script submission and…
ishandhanani acd33ab
docs(sglang): update build instructions and Dockerfile image tag for …
ishandhanani d2faf73
feat(trtllm): update BuildConfig and add GPU handling in main.py; upd…
ishandhanani f199a64
go
ishandhanani 21669c8
docs(dsr1-wideep-gb200): update build command syntax for clarity
ishandhanani a599079
fix(docs): update cuda-graph-bs parameter in dsr1-wideep-h100.md
ishandhanani 71b5bfb
Update components/backends/sglang/docs/dsr1-wideep-h100.md
ishandhanani d7f650e
go
ishandhanani 61afc94
Merge branch 'ishan/gb200-sgl' of github.com:ai-dynamo/dynamo into is…
ishandhanani 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,171 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
# Running DeepSeek-R1 Disaggregated with WideEP on GB200s | ||
|
||
Dynamo supports SGLang's GB200 implementation of wide expert parallelism and large scale P/D for DeepSeek-R1! You can read their blog post [here](https://lmsys.org/blog/2025-06-16-gb200-part-1/) for more details. Full end to end optimization is still a work in progress but you can get this up and running with the following steps. In ths example, we will run 1 prefill worker on 2 GB200 nodes (4 GPUs each) and 1 decode worker on 12 GB200 nodes (total 56 GPUs). | ||
ishandhanani marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Instructions | ||
|
||
1. Build the Dynamo container | ||
|
||
```bash | ||
cd $DYNAMO_ROOT | ||
docker build \ | ||
-f container/Dockerfile.sglang-wideep \ | ||
-t dynamo-wideep-gb200 \ | ||
--build-arg MODE=blackwell \ | ||
--build-arg SGLANG_IMAGE_TAG=v0.4.9.post6-cu128-gb200 \ | ||
--build-arg ARCH=arm64 \ | ||
--build-arg ARCH_ALT=aarch64 \ | ||
. | ||
``` | ||
|
||
2. You can run this container on each 4xGB200 node using the following command. | ||
|
||
> [!IMPORTANT] | ||
> We recommend downloading DeepSeek-R1 and then mounting it to the container. You can find the model [here](https://huggingface.co/deepseek-ai/DeepSeek-R1) | ||
ishandhanani marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```bash | ||
docker run \ | ||
--gpus all \ | ||
-it \ | ||
--rm \ | ||
--network host \ | ||
--volume /PATH_TO_DSR1_MODEL/:/model/ \ | ||
--shm-size=10G \ | ||
--ulimit memlock=-1 \ | ||
--ulimit stack=67108864 \ | ||
--ulimit nofile=65536:65536 \ | ||
--cap-add CAP_SYS_PTRACE \ | ||
--ipc host \ | ||
dynamo-wideep-gb200:latest | ||
``` | ||
|
||
3. On the head prefill node, run the helper script provided to generate commands to start the `nats-server`, `etcd`. This script will also tell you which environment variables to export on each node to make deployment easier. | ||
|
||
```bash | ||
./utils/gen_env_vars.sh | ||
``` | ||
ishandhanani marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
4. Run the ingress and prefill worker | ||
|
||
```bash | ||
# run ingress | ||
python3 -m dynamo.frontend --http-port=8000 & | ||
# optionally run the http server that allows you to flush the kv cache for all workers (see benchmarking section below) | ||
python3 utils/sgl_http_server.py --ns dynamo & | ||
# run prefill worker | ||
SGLANG_DEEPEP_NUM_MAX_DISPATCH_TOKENS_PER_RANK=2048 \ | ||
MC_TE_METRIC=true \ | ||
SGLANG_DISAGGREGATION_HEARTBEAT_MAX_FAILURE=100000 \ | ||
SGLANG_DISAGGREGATION_BOOTSTRAP_TIMEOUT=100000 \ | ||
SGLANG_DISAGGREGATION_WAITING_TIMEOUT=100000 \ | ||
SGLANG_MOONCAKE_CUSTOM_MEM_POOL=True \ | ||
MC_FORCE_MNNVL=1 \ | ||
NCCL_MNNVL_ENABLE=1 \ | ||
NCCL_CUMEM_ENABLE=1 \ | ||
SGLANG_USE_MESSAGE_QUEUE_BROADCASTER=0 \ | ||
SGL_DISABLE_TP_MEMORY_INBALANCE_CHECK=1 \ | ||
PYTHONUNBUFFERED=1 \ | ||
python3 components/worker.py \ | ||
--served-model-name deepseek-ai/DeepSeek-R1 \ | ||
--model-path /model/ \ | ||
--skip-tokenizer-init \ | ||
--trust-remote-code \ | ||
--disaggregation-mode prefill \ | ||
--dist-init-addr ${HEAD_PREFILL_NODE_IP}:29500 \ | ||
--disaggregation-bootstrap-port 30001 \ | ||
--disaggregation-transfer-backend nixl \ | ||
--nnodes 2 \ | ||
--node-rank 0 \ | ||
--tp-size 8 \ | ||
--dp-size 8 \ | ||
--enable-dp-attention \ | ||
--host 0.0.0.0 \ | ||
--decode-log-interval 1 \ | ||
--max-running-requests 6144 \ | ||
--context-length 2716 \ | ||
--disable-radix-cache \ | ||
--enable-deepep-moe \ | ||
--deepep-mode low_latency \ | ||
--moe-dense-tp-size 1 \ | ||
--enable-dp-lm-head \ | ||
--disable-shared-experts-fusion \ | ||
--ep-num-redundant-experts 32 \ | ||
--ep-dispatch-algorithm static \ | ||
--eplb-algorithm deepseek \ | ||
--attention-backend cutlass_mla \ | ||
--watchdog-timeout 1000000 \ | ||
--disable-cuda-graph \ | ||
--chunked-prefill-size 16384 \ | ||
--max-total-tokens 32768 \ | ||
--mem-fraction-static 0.8 \ | ||
--log-level debug | ||
ishandhanani marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
5. Run the decode worker on the head decode node | ||
|
||
```bash | ||
SGLANG_DEEPEP_NUM_MAX_DISPATCH_TOKENS_PER_RANK=768 \ | ||
MC_TE_METRIC=true \ | ||
SGLANG_DISAGGREGATION_HEARTBEAT_MAX_FAILURE=100000 \ | ||
SGLANG_DISAGGREGATION_BOOTSTRAP_TIMEOUT=100000 \ | ||
SGLANG_DISAGGREGATION_WAITING_TIMEOUT=100000 \ | ||
SGLANG_HACK_SEQ_BOOTSTRAP_ROOM=1 \ | ||
SGLANG_MOONCAKE_CUSTOM_MEM_POOL=True \ | ||
NCCL_MNNVL_ENABLE=1 \ | ||
MC_FORCE_MNNVL=1 \ | ||
NCCL_CUMEM_ENABLE=1 \ | ||
SGLANG_USE_MESSAGE_QUEUE_BROADCASTER=0 \ | ||
SGL_DISABLE_TP_MEMORY_INBALANCE_CHECK=1 \ | ||
PYTHONUNBUFFERED=1 \ | ||
python3 components/decode_worker.py \ | ||
--served-model-name deepseek-ai/DeepSeek-R1 \ | ||
--model-path /model/ \ | ||
--skip-tokenizer-init \ | ||
--trust-remote-code \ | ||
--disaggregation-mode decode \ | ||
--dist-init-addr ${HEAD_DECODE_NODE_IP}:29500 \ | ||
--disaggregation-bootstrap-port 30001 \ | ||
--nnodes 12 \ | ||
--node-rank 0 \ | ||
--tp-size 48 \ | ||
--dp-size 48 \ | ||
--enable-dp-attention \ | ||
--host 0.0.0.0 \ | ||
--decode-log-interval 1 \ | ||
--max-running-requests 36864 \ | ||
--context-length 2716 \ | ||
--disable-radix-cache \ | ||
--enable-deepep-moe \ | ||
--deepep-mode low_latency \ | ||
--moe-dense-tp-size 1 \ | ||
--enable-dp-lm-head \ | ||
--cuda-graph-bs 768 \ | ||
--disable-shared-experts-fusion \ | ||
--ep-num-redundant-experts 32 \ | ||
--ep-dispatch-algorithm static \ | ||
--eplb-algorithm deepseek \ | ||
--attention-backend cutlass_mla \ | ||
--watchdog-timeout 1000000 \ | ||
--chunked-prefill-size 36864 \ | ||
--mem-fraction-static 0.82 \ | ||
--log-level debug | ||
``` | ||
|
||
On the other decode nodes (this example has 12 total decode nodes), run the same command but change `--node-rank` to 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.