"docs/components/vscode:/vscode.git/clone" did not exist on "1995ef9aeec006313fad42cf12c3860081864cb6"
Unverified Commit 8f80d481 authored by jthomson04's avatar jthomson04 Committed by GitHub
Browse files

feat: GB200 GPT-oss disagg recipe (#4954)


Signed-off-by: default avatarjthomson04 <jothomson@nvidia.com>
Signed-off-by: default avatarjthomson04 <jwillthomson19@gmail.com>
Co-authored-by: default avatardagil-nvidia <dagil@nvidia.com>
parent e7936c25
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 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.
enable_attention_dp: true
disable_overlap_scheduler: false
moe_config:
backend: CUTLASS
cuda_graph_config:
enable_padding: true
cache_transceiver_config:
backend: UCX
max_tokens_in_buffer: 65536
print_iter_log: false
stream_interval: 10
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
apiVersion: v1
kind: ConfigMap
metadata:
name: llm-config
data:
prefill.yaml: |
cache_transceiver_config:
backend: UCX
max_tokens_in_buffer: 9216
cuda_graph_config:
enable_padding: true
max_batch_size: 30
disable_overlap_scheduler: true
enable_attention_dp: false
kv_cache_config:
dtype: fp8
enable_block_reuse: false
free_gpu_memory_fraction: 0.8
max_batch_size: 64
max_num_tokens: 20000
max_seq_len: 9000
moe_config:
backend: TRTLLM
moe_expert_parallel_size: 1
num_postprocess_workers: 4
pipeline_parallel_size: 1
print_iter_log: true
stream_interval: 20
tensor_parallel_size: 1
trust_remote_code: true
decode.yaml: |
allreduce_strategy: AUTO
attention_dp_config:
enable_balance: true
cache_transceiver_config:
backend: UCX
max_tokens_in_buffer: 9216
cuda_graph_config:
enable_padding: true
max_batch_size: 1280
disable_overlap_scheduler: false
enable_attention_dp: false
kv_cache_config:
dtype: fp8
enable_block_reuse: false
free_gpu_memory_fraction: 0.85
max_batch_size: 1280
max_num_tokens: 20000
max_seq_len: 11000
moe_config:
backend: TRTLLM
moe_expert_parallel_size: 1
num_postprocess_workers: 4
pipeline_parallel_size: 1
print_iter_log: true
stream_interval: 20
tensor_parallel_size: 4
trust_remote_code: true
---
apiVersion: nvidia.com/v1alpha1
kind: DynamoGraphDeployment
metadata:
name: gpt-oss-disagg
spec:
backendFramework: trtllm
pvcs:
- name: model-cache
create: false
services:
Frontend:
componentType: frontend
dynamoNamespace: gpt-oss-disagg
extraPodSpec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: nvidia.com/dynamo-graph-deployment-name
operator: In
values:
- gpt-oss-disagg-frontend
topologyKey: kubernetes.io/hostname
mainContainer:
args:
- python3 -m dynamo.frontend --router-mode round-robin --http-port 8000
command:
- /bin/sh
- -c
image: nvcr.io/nvidia/ai-dynamo/tensorrtllm-runtime:0.7.0
replicas: 1
TrtllmPrefillWorker:
componentType: main
dynamoNamespace: gpt-oss-disagg
envFromSecret: hf-token-secret
volumeMounts:
- name: model-cache
mountPoint: /opt/models
sharedMemory:
size: 80Gi
extraPodSpec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: nvidia.com/gpu.present
operator: In
values:
- "true"
mainContainer:
args:
- |
python3 -m dynamo.trtllm \
--model-path "${MODEL_PATH}" \
--served-model-name "openai/gpt-oss-120b" \
--extra-engine-args "${ENGINE_ARGS}" \
--disaggregation-mode prefill
command:
- /bin/sh
- -c
image: nvcr.io/nvidia/ai-dynamo/tensorrtllm-runtime:0.7.0
env:
- name: TRTLLM_ENABLE_PDL
value: "1"
- name: TRT_LLM_DISABLE_LOAD_WEIGHTS_IN_PARALLEL
value: "True"
- name: OVERRIDE_QUANT_ALGO
value: "W4A8_MXFP4_MXFP8"
- name: NCCL_GRAPH_REGISTER
value: "0"
- name: OMPI_MCA_coll_ucc_enable
value: "0"
- name: SERVED_MODEL_NAME
value: "openai/gpt-oss-120b"
- name: ENGINE_ARGS
value: "/opt/dynamo/configs/prefill.yaml"
- name: MODEL_PATH
value: "/opt/models/hub/models--openai--gpt-oss-120b/snapshots/b5c939de8f754692c1647ca79fbf85e8c1e70f8a"
- name: HF_HOME
value: /opt/models
volumeMounts:
- mountPath: /opt/dynamo/configs
name: llm-config
readOnly: true
workingDir: /workspace/examples/backends/trtllm
volumes:
- configMap:
name: llm-config
name: llm-config
replicas: 1
resources:
limits:
gpu: "1"
requests:
gpu: "1"
TrtllmDecodeWorker:
componentType: main
dynamoNamespace: gpt-oss-disagg
envFromSecret: hf-token-secret
volumeMounts:
- name: model-cache
mountPoint: /opt/models
sharedMemory:
size: 80Gi
extraPodSpec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: nvidia.com/gpu.present
operator: In
values:
- "true"
mainContainer:
args:
- |
python3 -m dynamo.trtllm \
--model-path "${MODEL_PATH}" \
--served-model-name "openai/gpt-oss-120b" \
--extra-engine-args "${ENGINE_ARGS}" \
--disaggregation-mode decode
command:
- /bin/sh
- -c
image: nvcr.io/nvidia/ai-dynamo/tensorrtllm-runtime:0.7.0
env:
- name: TRTLLM_ENABLE_PDL
value: "1"
- name: TRT_LLM_DISABLE_LOAD_WEIGHTS_IN_PARALLEL
value: "True"
- name: OVERRIDE_QUANT_ALGO
value: "W4A8_MXFP4_MXFP8"
- name: NCCL_GRAPH_REGISTER
value: "0"
- name: OMPI_MCA_coll_ucc_enable
value: "0"
- name: SERVED_MODEL_NAME
value: "openai/gpt-oss-120b"
- name: ENGINE_ARGS
value: "/opt/dynamo/configs/decode.yaml"
- name: MODEL_PATH
value: "/opt/models/hub/models--openai--gpt-oss-120b/snapshots/b5c939de8f754692c1647ca79fbf85e8c1e70f8a"
- name: HF_HOME
value: /opt/models
volumeMounts:
- mountPath: /opt/dynamo/configs
name: llm-config
readOnly: true
workingDir: /workspace/examples/backends/trtllm
volumes:
- configMap:
name: llm-config
name: llm-config
replicas: 1
resources:
limits:
gpu: "4"
requests:
gpu: "4"
\ No newline at end of file
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
apiVersion: batch/v1
kind: Job
metadata:
name: gpt-oss-120b-disagg-bench
spec:
backoffLimit: 1
completions: 1
parallelism: 1
template:
metadata:
labels:
app: gpt-oss-120b-disagg-bench
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: nvidia.com/dynamo-graph-deployment-name
operator: In
values:
- gpt-oss-disagg
topologyKey: kubernetes.io/hostname
containers:
- command:
- /bin/sh
- -c
- |
apt-get update && apt-get install -y curl jq procps git && apt-get clean
pip install git+https://github.com/ai-dynamo/aiperf.git@4d3fa29403c8f75da22a14f1f7b3aeb27db9288f;
echo "aiperf installation completed";
sysctl -w net.ipv4.ip_local_port_range="1024 65000"
cat /proc/sys/net/ipv4/ip_local_port_range
export COLUMNS=200
EPOCH=$(date +%s)
## utility functions -- can be moved to a bash script / configmap
wait_for_model_ready() {
echo "Waiting for model '$TARGET_MODEL' at $ENDPOINT/v1/models (checking every 5s)..."
while ! curl -s "http://$ENDPOINT/v1/models" | jq -e --arg model "$TARGET_MODEL" '.data[]? | select(.id == $model)' >/dev/null 2>&1; do
echo "[$(date '+%H:%M:%S')] Model not ready yet, sleeping 5s before checking again http://$ENDPOINT/v1/models"
sleep 5
done
echo "✅ Model '$TARGET_MODEL' is now available!"
echo "Model '$TARGET_MODEL' is now available!"
curl -s "http://$ENDPOINT/v1/models" | jq .
}
run_perf() {
local concurrency=$1
local isl=$2
local osl=$3
key=concurrency_${concurrency}
export ARTIFACT_DIR="${ROOT_ARTIFACT_DIR}/${EPOCH}_${JOB_NAME}/${key}"
mkdir -p "$ARTIFACT_DIR"
echo "ARTIFACT_DIR: $ARTIFACT_DIR"
aiperf profile --artifact-dir $ARTIFACT_DIR \
--model $TARGET_MODEL \
--tokenizer /model-cache/hub/models--openai--gpt-oss-120b/snapshots/b5c939de8f754692c1647ca79fbf85e8c1e70f8a \
--endpoint-type chat \
--endpoint /v1/chat/completions \
--streaming \
--url http://$ENDPOINT \
--synthetic-input-tokens-mean $isl \
--synthetic-input-tokens-stddev 0 \
--output-tokens-mean $osl \
--output-tokens-stddev 0 \
--extra-inputs "max_tokens:$osl" \
--extra-inputs "min_tokens:$osl" \
--extra-inputs "ignore_eos:true" \
--extra-inputs "{\"nvext\":{\"ignore_eos\":true}}" \
--extra-inputs "repetition_penalty:1.0" \
--extra-inputs "temperature: 0.0" \
--concurrency $concurrency \
--request-count $((10*concurrency)) \
--warmup-request-count $concurrency \
--num-dataset-entries 12800 \
--random-seed 100 \
--workers-max 252 \
-H 'Authorization: Bearer NOT USED' \
-H 'Accept: text/event-stream'\
--record-processors 32 \
--ui simple
echo "ARTIFACT_DIR: $ARTIFACT_DIR"
ls -la $ARTIFACT_DIR
}
#### Actual execution ####
wait_for_model_ready
mkdir -p "${ROOT_ARTIFACT_DIR}/${EPOCH}_${JOB_NAME}"
# Calculate total concurrency based on per-GPU concurrency and GPU count
TOTAL_CONCURRENCY=$((CONCURRENCY_PER_GPU * DEPLOYMENT_GPU_COUNT))
echo "Calculated total concurrency: $TOTAL_CONCURRENCY (${CONCURRENCY_PER_GPU} per GPU × ${DEPLOYMENT_GPU_COUNT} GPUs)"
# Write input_config.json
cat > "${ROOT_ARTIFACT_DIR}/${EPOCH}_${JOB_NAME}/input_config.json" <<EOF
{
"gpu_count": $DEPLOYMENT_GPU_COUNT,
"concurrency_per_gpu": $CONCURRENCY_PER_GPU,
"total_concurrency": $TOTAL_CONCURRENCY,
"mode": "$DEPLOYMENT_MODE",
"isl": $ISL,
"osl": $OSL,
"endpoint": "$ENDPOINT",
"model endpoint": "$TARGET_MODEL"
}
EOF
# Run perf with calculated total concurrency
run_perf $TOTAL_CONCURRENCY $ISL $OSL
echo "done with concurrency $TOTAL_CONCURRENCY"
env:
- name: TARGET_MODEL
value: openai/gpt-oss-120b
- name: ENDPOINT
value: gpt-oss-disagg-frontend:8000
- name: CONCURRENCY_PER_GPU
value: "256"
- name: DEPLOYMENT_GPU_COUNT
value: "6"
- name: ISL
value: "8192"
- name: OSL
value: "1024"
- name: DEPLOYMENT_MODE
value: disagg
- name: AIPERF_HTTP_CONNECTION_LIMIT
value: "252"
- name: JOB_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.labels['job-name']
- name: ROOT_ARTIFACT_DIR
value: /model-cache/perf
- name: HF_HOME
value: /model-cache
- name: PYTHONUNBUFFERED
value: "1"
image: python:3.12-slim
imagePullPolicy: IfNotPresent
name: perf
securityContext:
privileged: true
volumeMounts:
- name: model-cache
mountPath: /model-cache
workingDir: /workspace
imagePullSecrets:
- name: nvcrimagepullsecret
restartPolicy: Never
volumes:
- name: model-cache
persistentVolumeClaim:
claimName: model-cache
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 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.
enable_attention_dp: false
disable_overlap_scheduler: true
moe_config:
backend: CUTLASS
enable_chunked_prefill: true
cuda_graph_config:
max_batch_size: 32
enable_padding: true
cache_transceiver_config:
backend: UCX
max_tokens_in_buffer: 65536
print_iter_log: false
stream_interval: 10
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment