Skip to content
21 changes: 21 additions & 0 deletions recipes/gpt-oss-120b/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Note:

- This recipe is for gpt-oss-120b in aggregated mode.

# Running the recipe
```bash
./run.sh --model gpt-oss-120b --framework trtllm agg
```

# Images

This recipe uses the following container images using custom commits. You might need to build the images to reproduce the benchmark.
Comment thread
biswapanda marked this conversation as resolved.
Outdated

* aiperf
Based on commit [70af59489df24a601dba57604a7341966150b366](https://github.com/ai-dynamo/aiperf/commit/70af59489df24a601dba57604a7341966150b366)

* dynamo trtllm runtime for arm64
based on commit [7fdf50fec2cae9112224f5cea26cef3dde78506f](https://github.com/ai-dynamo/dynamo/commit/7fdf50fec2cae9112224f5cea26cef3dde78506f)
```
nvcr.io/nvidia/ai-dynamo/tensorrtllm-runtime:7fdf50fec2cae9112224f5cea26cef3dde78506f-35606896-trtllm-arm64
```
13 changes: 13 additions & 0 deletions recipes/gpt-oss-120b/model-cache/model-cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: model-cache
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Gi
storageClassName: "your-storage-class-name"
42 changes: 42 additions & 0 deletions recipes/gpt-oss-120b/model-cache/model-download.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
apiVersion: batch/v1
kind: Job
metadata:
name: model-download
spec:
backoffLimit: 3
completions: 1
parallelism: 1
template:
metadata:
labels:
app: model-download
spec:
restartPolicy: Never
containers:
- name: model-download
image: python:3.10-slim
command: ["sh", "-c"]
envFrom:
- secretRef:
name: hf-token-secret
env:
- name: MODEL_NAME
value: openai/gpt-oss-120b
- name: HF_HOME
value: /model-store
- name: HF_HUB_ENABLE_HF_TRANSFER
value: "1"
args:
- |
set -eux
pip install --no-cache-dir huggingface_hub hf_transfer
hf download $MODEL_NAME --exclude "original/*" --exclude "metal/*"
volumeMounts:
- name: model-cache
mountPath: /model-store
volumes:
- name: model-cache
persistentVolumeClaim:
claimName: model-cache
116 changes: 72 additions & 44 deletions recipes/gpt-oss-120b/trtllm/agg/bench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,35 @@ spec:
template:
metadata:
labels:
app: oss-gpt120b
app: oss-gpt120b-bench
spec:
restartPolicy: Never
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: nvidia.com/dynamo-graph-deployment-name
operator: In
values:
- gpt-oss-agg
topologyKey: kubernetes.io/hostname
containers:
- name: perf
image: my-registry/vllm-runtime:my-tag
workingDir: /workspace/components/backends/vllm
env:
- name: TARGET_MODEL
value: openai/gpt-oss-120b
- name: ENDPOINT
value: gpt-oss-agg-trtllmworker:8000
- name: CONCURRENCIES
value: "13000 13500 1400"
- name: ISL
value: "16"
- name: OSL
value: "1000"
- name: DEPLOYMENT_MODE
value: "agg"
- name: DEPLOYMENT_GPU_COUNT
value: "32"
- name: JOB_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['job-name']
- name: ROOT_ARTIFACT_DIR
value: /root/.cache/huggingface/hub/perf
command:
- command:
- /bin/sh
- -c
- |
#TODO: this can be baked into the aiperf image
apt-get update && apt-get install -y curl jq
apt-get update && apt-get install -y curl jq procps git && apt-get clean
pip install git+https://github.com/ai-dynamo/aiperf.git@70af59489df24a601dba57604a7341966150b366;
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, waiting 5s..."
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!"
Expand All @@ -65,11 +53,11 @@ spec:
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 ~/.cache/huggingface/hub/models--openai--gpt-oss-120b/snapshots/b5c939de8f754692c1647ca79fbf85e8c1e70f8a \
--endpoint-type chat \
--endpoint /v1/chat/completions \
--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 \
Expand All @@ -80,13 +68,14 @@ spec:
--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 $((3*concurrency)) \
--request-count $((10*concurrency)) \
--warmup-request-count $concurrency \
--conversation-num 1 \
--conversation-num 12800 \
--random-seed 100 \
--request-rate 100000 \
--workers-max 128 \
--workers-max 252 \
-H 'Authorization: Bearer NOT USED' \
-H 'Accept: text/event-stream'\
--record-processors 32 \
Expand All @@ -97,27 +86,66 @@ spec:
#### 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 for each concurrency
for concurrency in $CONCURRENCIES; do
run_perf $concurrency $ISL $OSL
sleep 10
done

# 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-agg-frontend:8000
- name: CONCURRENCY_PER_GPU
value: "900"
- name: DEPLOYMENT_GPU_COUNT
value: "72"
- name: ISL
value: "128"
- name: OSL
value: "1000"
- name: DEPLOYMENT_MODE
value: agg
- 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: /root/.cache/huggingface
mountPath: /model-cache
workingDir: /workspace
imagePullSecrets:
- name: nvcrimagepullsecret
- name: nvcrimagepullsecret
restartPolicy: Never
volumes:
- name: model-cache
persistentVolumeClaim:
Expand Down
16 changes: 4 additions & 12 deletions recipes/gpt-oss-120b/trtllm/agg/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,12 @@ metadata:
name: llm-config
data:
config.yaml: |
tensor_parallel_size: 4
moe_expert_parallel_size: 4
enable_attention_dp: true
build_config:
max_batch_size: 640
max_num_tokens: 20000
moe_config:
backend: CUTLASS
cuda_graph_config:
max_batch_size: 640
max_batch_size: 800
enable_padding: true
kv_cache_config:
free_gpu_memory_fraction: 0.9
enable_block_reuse: false
print_iter_log: false
stream_interval: 50
use_torch_sampler: true
stream_interval: 20
moe_config:
backend: CUTLASS
Loading
Loading