|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | +apiVersion: batch/v1 |
| 4 | +kind: Job |
| 5 | +metadata: |
| 6 | + name: oss-gpt120b-bench |
| 7 | +spec: |
| 8 | + backoffLimit: 1 |
| 9 | + completions: 1 |
| 10 | + parallelism: 1 |
| 11 | + template: |
| 12 | + metadata: |
| 13 | + labels: |
| 14 | + app: oss-gpt120b |
| 15 | + spec: |
| 16 | + restartPolicy: Never |
| 17 | + containers: |
| 18 | + - name: perf |
| 19 | + image: nvcr.io/nvidian/nim-llm-dev/vllm-runtime:aiperf-0637181 |
| 20 | + workingDir: /workspace/components/backends/vllm |
| 21 | + env: |
| 22 | + - name: TARGET_MODEL |
| 23 | + value: openai/gpt-oss-120b |
| 24 | + - name: ENDPOINT |
| 25 | + value: gpt-oss-agg-trtllmworker:8000 |
| 26 | + - name: CONCURRENCIES |
| 27 | + value: "13000 13500 1400" |
| 28 | + - name: ISL |
| 29 | + value: "16" |
| 30 | + - name: OSL |
| 31 | + value: "1000" |
| 32 | + - name: DEPLOYMENT_MODE |
| 33 | + value: "agg" |
| 34 | + - name: DEPLOYMENT_GPU_COUNT |
| 35 | + value: "32" |
| 36 | + - name: JOB_NAME |
| 37 | + valueFrom: |
| 38 | + fieldRef: |
| 39 | + fieldPath: metadata.labels['job-name'] |
| 40 | + - name: ROOT_ARTIFACT_DIR |
| 41 | + value: /root/.cache/huggingface/hub/perf |
| 42 | + command: |
| 43 | + - /bin/sh |
| 44 | + - -c |
| 45 | + - | |
| 46 | + #TODO: this can be baked into the aiperf image |
| 47 | + apt-get update && apt-get install -y curl jq |
| 48 | + export COLUMNS=200 |
| 49 | + EPOCH=$(date +%s) |
| 50 | + ## utility functions -- can be moved to a bash script / configmap |
| 51 | + wait_for_model_ready() { |
| 52 | + echo "Waiting for model '$TARGET_MODEL' at $ENDPOINT/v1/models (checking every 5s)..." |
| 53 | + while ! curl -s "http://$ENDPOINT/v1/models" | jq -e --arg model "$TARGET_MODEL" '.data[]? | select(.id == $model)' >/dev/null 2>&1; do |
| 54 | + echo "[$(date '+%H:%M:%S')] Model not ready yet, waiting 5s..." |
| 55 | + sleep 5 |
| 56 | + done |
| 57 | + echo "✅ Model '$TARGET_MODEL' is now available!" |
| 58 | + echo "Model '$TARGET_MODEL' is now available!" |
| 59 | + curl -s "http://$ENDPOINT/v1/models" | jq . |
| 60 | + } |
| 61 | + run_perf() { |
| 62 | + local concurrency=$1 |
| 63 | + local isl=$2 |
| 64 | + local osl=$3 |
| 65 | + key=concurrency_${concurrency} |
| 66 | + export ARTIFACT_DIR="${ROOT_ARTIFACT_DIR}/${EPOCH}_${JOB_NAME}/${key}" |
| 67 | + mkdir -p "$ARTIFACT_DIR" |
| 68 | + aiperf profile --artifact-dir $ARTIFACT_DIR \ |
| 69 | + --model $TARGET_MODEL \ |
| 70 | + --tokenizer ~/.cache/huggingface/hub/models--openai--gpt-oss-120b/snapshots/b5c939de8f754692c1647ca79fbf85e8c1e70f8a \ |
| 71 | + --endpoint-type chat \ |
| 72 | + --endpoint /v1/chat/completions \ |
| 73 | + --streaming \ |
| 74 | + --url http://$ENDPOINT \ |
| 75 | + --synthetic-input-tokens-mean $isl \ |
| 76 | + --synthetic-input-tokens-stddev 0 \ |
| 77 | + --output-tokens-mean $osl \ |
| 78 | + --output-tokens-stddev 0 \ |
| 79 | + --extra-inputs "{\"max_tokens\":$osl}" \ |
| 80 | + --extra-inputs "{\"min_tokens\":$osl}" \ |
| 81 | + --extra-inputs "{\"ignore_eos\":true}" \ |
| 82 | + --extra-inputs "{\"nvext\":{\"ignore_eos\":true}}" \ |
| 83 | + --concurrency $concurrency \ |
| 84 | + --request-count $((3*concurrency)) \ |
| 85 | + --warmup-request-count $concurrency \ |
| 86 | + --conversation-num 1 \ |
| 87 | + --random-seed 100 \ |
| 88 | + --request-rate 100000 \ |
| 89 | + --workers-max 128 \ |
| 90 | + -H 'Authorization: Bearer NOT USED' \ |
| 91 | + -H 'Accept: text/event-stream'\ |
| 92 | + --record-processors 32 \ |
| 93 | + --ui simple |
| 94 | + echo "ARTIFACT_DIR: $ARTIFACT_DIR" |
| 95 | + ls -la $ARTIFACT_DIR |
| 96 | + } |
| 97 | + #### Actual execution #### |
| 98 | + wait_for_model_ready |
| 99 | + mkdir -p "${ROOT_ARTIFACT_DIR}/${EPOCH}_${JOB_NAME}" |
| 100 | + # Write input_config.json |
| 101 | + cat > "${ROOT_ARTIFACT_DIR}/${EPOCH}_${JOB_NAME}/input_config.json" <<EOF |
| 102 | + { |
| 103 | + "gpu_count": $DEPLOYMENT_GPU_COUNT, |
| 104 | + "mode": "$DEPLOYMENT_MODE", |
| 105 | + "isl": $ISL, |
| 106 | + "osl": $OSL, |
| 107 | + "endpoint": "$ENDPOINT", |
| 108 | + "model endpoint": "$TARGET_MODEL" |
| 109 | + } |
| 110 | + EOF |
| 111 | + # Run perf for each concurrency |
| 112 | + for concurrency in $CONCURRENCIES; do |
| 113 | + run_perf $concurrency $ISL $OSL |
| 114 | + sleep 10 |
| 115 | + done |
| 116 | + volumeMounts: |
| 117 | + - name: model-cache |
| 118 | + mountPath: /root/.cache/huggingface |
| 119 | + imagePullSecrets: |
| 120 | + - name: nvcrimagepullsecret |
| 121 | + volumes: |
| 122 | + - name: model-cache |
| 123 | + persistentVolumeClaim: |
| 124 | + claimName: model-cache |
0 commit comments