forked from llm-d/llm-d-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
244 lines (214 loc) · 9.61 KB
/
ci-nightly-benchmark-cks.yaml
File metadata and controls
244 lines (214 loc) · 9.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
name: CI - Nightly Benchmark on CKS
on:
workflow_dispatch:
inputs:
input_dir:
description: 'Input directory for benchmark results'
required: false
default: '/tmp/cicd/analysis'
output_dir:
description: 'Output directory name (S3 prefix and artifact name)'
required: false
default: ''
schedule:
- cron: '0 8 * * *' # 08:00 UTC daily (staggered from OCP/GKE)
jobs:
build-image:
name: Build Nightly Image
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Build and push nightly image
uses: ./.github/actions/docker-build-and-push
with:
tag: nightly
image-name: llm-d-benchmark
registry: ghcr.io/llm-d
github-token: ${{ secrets.GHCR_TOKEN }}
platform: linux/amd64
run-benchmark:
name: Benchmark Test (CKS)
needs: build-image
runs-on: [self-hosted, linux, waldorf]
timeout-minutes: 240
env:
LLMDBENCH_IMAGE_TAG: nightly
steps:
- name: Checkout code
uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Display OS used
run: |
cat /etc/*os-*
shell: bash
- name: Set input and output directory environment variables
run: |
DEFAULT_INPUT_DIR=/tmp/cicd/analysis
INPUT_DIR="${{ github.event.inputs.input_dir }}"
if [ -z "$INPUT_DIR" ]; then
INPUT_DIR="$DEFAULT_INPUT_DIR"
fi
echo "INPUT_DIR=$INPUT_DIR" >> $GITHUB_ENV
if [ -z "${{ github.event.inputs.output_dir }}" ]; then
timestamp=$(date -u +%Y%m%dT%H%M%SZ)
echo "OUTPUT_DIR=benchmark-results-cks-${timestamp}" >> $GITHUB_ENV
echo "Using generated output dir: benchmark-results-cks-${timestamp}"
else
echo "OUTPUT_DIR=${{ github.event.inputs.output_dir }}" >> $GITHUB_ENV
echo "Using provided output dir: ${{ github.event.inputs.output_dir }}"
fi
shell: bash
- name: Set up kubeconfig from secret
run: |
mkdir -p ~/.kube
echo "${{ secrets.KUBECONFIG_DATA_CKS }}" | base64 -d > ~/.kube/config
chmod 600 ~/.kube/config
shell: bash
- name: Run install_deps.sh
run: |
sudo apt-get update
sudo apt install bc
./setup/install_deps.sh -y
shell: bash
- name: Install config explorer dependencies
run: pip install ./config_explorer
shell: bash
- name: Install kubectl-view-allocations
run: |
cd /
curl https://raw.githubusercontent.com/davidB/kubectl-view-allocations/master/scripts/getLatest.sh | sudo bash
kubectl-view-allocations -h
shell: bash
- name: Count preemptible GPUs (negative-priority pods)
run: |
# Count GPUs held by Running pods with priority < 0 (e.g. hpc-verification at -1).
# Our benchmark pods (default priority 0) will preempt these, so they
# should count as "available" for the simulator-fallback decision.
PREEMPTABLE_GPUS=$(kubectl get pods --all-namespaces -o json | \
jq '[.items[] | select((.spec.priority // 0) < 0 and .status.phase == "Running") |
(.spec.containers[]?.resources.limits["nvidia.com/gpu"] // "0" | tonumber)] | add // 0')
echo "PREEMPTABLE_GPUS=$PREEMPTABLE_GPUS" >> $GITHUB_ENV
echo "Preemptible GPUs (held by negative-priority Running pods): $PREEMPTABLE_GPUS"
shell: bash
- name: Cleanup target cloud (modelservice)
env:
LLMDBENCH_HF_TOKEN: ${{ secrets.LLMDBENCH_HF_TOKEN }}
run: ./setup/teardown.sh -c cks_fb -t modelservice -d
shell: bash
- name: Cleanup target cloud (standalone)
env:
LLMDBENCH_HF_TOKEN: ${{ secrets.LLMDBENCH_HF_TOKEN }}
run: |
./setup/teardown.sh -c cks_fb -t standalone -d
shell: bash
- name: Standup target cloud (standalone)
env:
LLMDBENCH_HF_TOKEN: ${{ secrets.LLMDBENCH_HF_TOKEN }}
run: |
AVAIL=$(echo "$(kubectl-view-allocations -r gpu -o csv | grep resource,nvidia.com/gpu | cut -d ',' -f 11) + ${PREEMPTABLE_GPUS:-0}" | bc)
if [[ $(echo "$AVAIL - 10.00" | bc | cut -d '.' -f 1) -lt 0 ]]; then echo "LLM-D SIMULATOR (available+preemptible=$AVAIL < 10)"; sed -i 's^####^^g' scenarios/cicd/cks_fb.sh; fi
./setup/standup.sh -c cks_fb -t standalone
shell: bash
- name: Run benchmark (standalone, inference-perf)
env:
LLMDBENCH_HF_TOKEN: ${{ secrets.LLMDBENCH_HF_TOKEN }}
run: |
./setup/run.sh -c cks_fb -t standalone
shell: bash
- name: Run benchmark (standalone, guidellm)
env:
LLMDBENCH_HF_TOKEN: ${{ secrets.LLMDBENCH_HF_TOKEN }}
run: |
./setup/run.sh -c cks_fb -t standalone -l guidellm -w sanity_concurrent
shell: bash
- name: Run benchmark (standalone, vllm-benchmark)
env:
LLMDBENCH_HF_TOKEN: ${{ secrets.LLMDBENCH_HF_TOKEN }}
run: |
./setup/run.sh -c cks_fb -t standalone -l vllm-benchmark
shell: bash
- name: Cleanup target cloud (standalone)
env:
LLMDBENCH_HF_TOKEN: ${{ secrets.LLMDBENCH_HF_TOKEN }}
run: |
./setup/teardown.sh -c cks_fb -t standalone -d
shell: bash
- name: E2E target cloud (modelservice, inference-perf)
env:
LLMDBENCH_HF_TOKEN: ${{ secrets.LLMDBENCH_HF_TOKEN }}
run: |
AVAIL=$(echo "$(kubectl-view-allocations -r gpu -o csv | grep resource,nvidia.com/gpu | cut -d ',' -f 11) + ${PREEMPTABLE_GPUS:-0}" | bc)
if [[ $(echo "$AVAIL - 20.00" | bc | cut -d '.' -f 1) -lt 0 ]]; then echo "LLM-D SIMULATOR (available+preemptible=$AVAIL < 20)"; sed -i 's^####^^g' scenarios/cicd/cks_fb.sh; fi
./setup/e2e.sh -c cks_fb -t modelservice --deep
shell: bash
- name: E2E target cloud (modelservice, guidellm)
env:
LLMDBENCH_HF_TOKEN: ${{ secrets.LLMDBENCH_HF_TOKEN }}
run: |
AVAIL=$(echo "$(kubectl-view-allocations -r gpu -o csv | grep resource,nvidia.com/gpu | cut -d ',' -f 11) + ${PREEMPTABLE_GPUS:-0}" | bc)
if [[ $(echo "$AVAIL - 20.00" | bc | cut -d '.' -f 1) -lt 0 ]]; then echo "LLM-D SIMULATOR (available+preemptible=$AVAIL < 20)"; sed -i 's^####^^g' scenarios/cicd/cks_fb.sh; fi
./setup/e2e.sh -c cks_fb -t modelservice --deep -l guidellm -w sanity_concurrent.yaml
shell: bash
- name: E2E target cloud (modelservice, vllm-benchmark)
env:
LLMDBENCH_HF_TOKEN: ${{ secrets.LLMDBENCH_HF_TOKEN }}
run: |
AVAIL=$(echo "$(kubectl-view-allocations -r gpu -o csv | grep resource,nvidia.com/gpu | cut -d ',' -f 11) + ${PREEMPTABLE_GPUS:-0}" | bc)
if [[ $(echo "$AVAIL - 20.00" | bc | cut -d '.' -f 1) -lt 0 ]]; then echo "LLM-D SIMULATOR (available+preemptible=$AVAIL < 20)"; sed -i 's^####^^g' scenarios/cicd/cks_fb.sh; fi
./setup/e2e.sh -c cks_fb -t modelservice --deep -l vllm-benchmark
shell: bash
- name: Collect failure diagnostics
if: failure()
run: |
echo "=== Pod status ==="
kubectl get pods -n llmdbenchcicd -o wide || true
echo ""
echo "=== Describe failed pods ==="
for pod in $(kubectl get pods -n llmdbenchcicd --field-selector=status.phase!=Running,status.phase!=Succeeded -o name 2>/dev/null); do
echo "--- $pod ---"
kubectl describe -n llmdbenchcicd "$pod" || true
done
echo ""
echo "=== Pod logs (crashed/errored) ==="
for pod in $(kubectl get pods -n llmdbenchcicd --field-selector=status.phase!=Running,status.phase!=Succeeded -o name 2>/dev/null); do
echo "--- $pod logs ---"
kubectl logs -n llmdbenchcicd "$pod" --tail=200 --all-containers || true
echo "--- $pod previous logs ---"
kubectl logs -n llmdbenchcicd "$pod" --previous --tail=200 --all-containers 2>/dev/null || true
done
echo ""
echo "=== Harness launcher pods ==="
kubectl get pods -n llmdbenchcicd -l app=llmdbench-harness-launcher -o wide || true
for pod in $(kubectl get pods -n llmdbenchcicd -l app=llmdbench-harness-launcher -o name 2>/dev/null); do
echo "--- $pod logs ---"
kubectl logs -n llmdbenchcicd "$pod" --tail=200 --all-containers || true
done
echo ""
echo "=== Recent events ==="
kubectl get events -n llmdbenchcicd --sort-by='.lastTimestamp' | tail -30 || true
shell: bash
- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
aws --version
- name: Upload results to IBM COS
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws configure set default.s3.signature_version s3v4
aws s3 cp "$INPUT_DIR" "s3://${{ secrets.COS_BUCKET_NAME }}/$OUTPUT_DIR/" \
--recursive --endpoint-url ${{ secrets.COS_ENDPOINT_URL }} || true
- name: Archive benchmark results as GitHub artifact
if: success() || failure()
uses: actions/upload-artifact@v6
with:
name: ${{ env.OUTPUT_DIR }}
path: ${{ env.INPUT_DIR }}
retention-days: 14