Repository navigation
499 lines (454 loc) · 21.2 KB
/
Copy pathprofile.yml
File metadata and controls
499 lines (454 loc) · 21.2 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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
name: Profile
# Independent profiling requests use priority-scheduled runner slots.
on: # zizmor: ignore[concurrency-limits]
workflow_dispatch:
inputs:
config-key:
description: "Config key from config yaml"
required: true
type: string
config-file:
description: "Config file to use"
required: false
type: string
default: 'configs/nvidia-master.yaml'
conc:
description: "Concurrency value (must exist in config's conc-range/list)"
required: false
type: string
default: '64'
moe-debug:
description: "Enable MoE debug patch and log (MOE_DEBUG_LOG)"
required: false
type: boolean
default: false
ref:
description: "Ref (branch/sha) to checkout"
required: false
type: string
permissions:
contents: read
env:
PYTHONPATH: ${{ github.workspace }}/inferencex-e2e
INFERENCEX_E2E_ROOT: ${{ github.workspace }}
PORT: '8888'
INFMAX_CONTAINER_WORKSPACE: '/workspace'
DSV41_MIN_CUDAGRAPH_CAPTURE_SIZE: '1'
MODEL_DOWNLOAD_LOCK_TIMEOUT: '21600'
ENROOT_IMPORT_TIME_LIMIT: '120'
SALLOC_TIME_LIMIT: '480'
KEEP_LOGS: '0'
EVAL_ONLY: 'false'
RUN_EVAL: 'false'
IS_AGENTIC: '0'
IS_MULTINODE: 'false'
SCENARIO_SUBDIR: fixed_seq_len/
HF_TOKEN: ${{ secrets.INFERENCEX_OFFICIAL_RO_HF_TOKEN }}
HF_HUB_CACHE: '/mnt/hf_hub_cache/'
RANDOM_RANGE_RATIO: '0.8'
PERFETTO_RELAY_URL: https://semianalysisai.github.io/InferenceX-trace-storage
PYTHONDONTWRITEBYTECODE: '1'
PYTHONPYCACHEPREFIX: /tmp/inferencex-pycache
jobs:
get-jobs:
name: get-jobs
runs-on: ubuntu-latest
outputs:
filtered-matrix: ${{ steps.filter.outputs.filtered }}
count: ${{ steps.filter.outputs.count }}
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.ref || github.sha }}
fetch-depth: 0
persist-credentials: false
- name: Checkout priority scheduler tooling
if: ${{ inputs.ref && inputs.ref != '' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.workflow_sha }}
path: .ci-priority
persist-credentials: false
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Classify priority criteria
id: priority-criteria
if: vars.PRIORITY_SCHEDULER_ENABLED == 'true' && !inputs.moe-debug
uses: $/.github/actions/classify-priority
with:
head-ref: HEAD
scope: patchwork
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} # zizmor: ignore[secrets-outside-env]
github-token: ${{ github.token }}
- id: gen
name: Generate matrix via script
run: |
if [[ -f inferencex-e2e/configs/runners.yaml ]]; then cd inferencex-e2e; fi
MEASURED_ROOT="$PWD"
PRIORITY_ROOT="${GITHUB_WORKSPACE}"
if [ -d "${GITHUB_WORKSPACE}/.ci-priority" ]; then
PRIORITY_ROOT="${GITHUB_WORKSPACE}/.ci-priority"
fi
if [[ -f "$PRIORITY_ROOT/inferencex-e2e/configs/runners.yaml" ]]; then
PRIORITY_ROOT="$PRIORITY_ROOT/inferencex-e2e"
fi
env PYTHONPATH="$PRIORITY_ROOT" python3 -P -m infx.workflows.require_launcher "$GITHUB_WORKSPACE"
source "$PRIORITY_ROOT/benchmarks/check_env.sh"
check_env_vars INPUTS_CONFIG_FILE INPUTS_CONFIG_KEY INPUTS_CONC
GENERATOR_PATH="${MEASURED_ROOT}"
if [ -f "${MEASURED_ROOT}/infx/matrix/generate.py" ]; then
GENERATOR=(-m infx.matrix.generate)
elif [ -f "${MEASURED_ROOT}/utils/matrix_logic/generate_sweep_configs.py" ]; then
GENERATOR=("${MEASURED_ROOT}/utils/matrix_logic/generate_sweep_configs.py")
GENERATOR_PATH="${MEASURED_ROOT}/utils/matrix_logic:${MEASURED_ROOT}"
else
echo "Matrix generator not found in selected checkout" >&2
exit 1
fi
CONFIG_JSON=$(env PYTHONPATH="$GENERATOR_PATH" \
uv run --no-project --exclude-newer PT12H --python 3.12 --with pydantic --with pyyaml \
python -P "${GENERATOR[@]}" \
test-config --config-files "$INPUTS_CONFIG_FILE" --config-keys "$INPUTS_CONFIG_KEY" --conc "$INPUTS_CONC")
CONFIG_JSON=$(printf '%s' "$CONFIG_JSON" | env PYTHONPATH="$PRIORITY_ROOT" uv run --no-project --exclude-newer PT12H --python 3.12 --with pyyaml \
python -P -m infx.workflows.scheduler_facts \
--event-name "${GITHUB_EVENT_NAME}" \
--queue-namespace "${GITHUB_RUN_ID}:${GITHUB_RUN_ATTEMPT}" \
--criteria-json "${PRIORITY_CRITERIA}" \
--facts-file "${RUNNER_TEMP}/scheduling-facts.json")
echo "raw=$CONFIG_JSON" >> "$GITHUB_OUTPUT"
env:
PRIORITY_CRITERIA: ${{ inputs.moe-debug && '["patchwork"]' || steps.priority-criteria.outputs.criteria || '' }}
INPUTS_CONFIG_FILE: ${{ inputs.config-file }}
INPUTS_CONFIG_KEY: ${{ inputs.config-key }}
INPUTS_CONC: ${{ inputs.conc }}
- name: Upload scheduling facts
if: vars.PRIORITY_SCHEDULER_ENABLED == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
path: ${{ runner.temp }}/scheduling-facts.json
archive: false
overwrite: true
if-no-files-found: error
- id: filter
name: Take first generated job
shell: python
env:
STEPS_GEN_OUTPUTS_RAW: ${{ steps.gen.outputs.raw }}
run: |
import json, os, sys
raw = os.environ["STEPS_GEN_OUTPUTS_RAW"]
try:
data = json.loads(raw)
except Exception as e:
print('Invalid generator output:', e, file=sys.stderr)
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write("filtered=[]\ncount=0\n")
raise
if not isinstance(data, list):
print('Generator output is not a list.', file=sys.stderr)
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write("filtered=[]\ncount=0\n")
raise SystemExit(1)
filt = data[:1]
for entry in filt:
node_count = entry.get('node-count', 1)
if isinstance(node_count, bool) or not isinstance(node_count, int) or node_count != 1:
print(
'Profile supports only validated single-node matrix entries; '
f'got node-count={node_count!r}.',
file=sys.stderr,
)
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write("filtered=[]\ncount=0\n")
raise SystemExit(1)
entry['node-count'] = node_count
out = json.dumps(filt)
print(out)
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write(f"filtered={out}\n")
f.write(f"count={len(filt)}\n")
- name: Fail if no matching entries
if: ${{ steps.filter.outputs.count == '0' }}
run: |
echo "No entries produced for config-key=${INPUTS_CONFIG_KEY}, conc=${INPUTS_CONC}." >&2
exit 1
env:
INPUTS_CONFIG_KEY: ${{ inputs.config-key }}
INPUTS_CONC: ${{ inputs.conc }}
profile:
needs: get-jobs
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.get-jobs.outputs.filtered-matrix) }}
name: >-
${{ matrix.config.model-prefix }} ${{ matrix.config.precision }} ${{ matrix.config.runner }} ${{ matrix.config.framework }}
TP${{ matrix.config.tp }}${{ matrix.config.pp != '' && matrix.config.pp != '1' && format('/PP{0}', matrix.config.pp) || '' }}${{ matrix.config.dcp-size != '' && matrix.config.dcp-size != '1' && format('/DCP{0}', matrix.config.dcp-size) || '' }}${{ matrix.config.pcp-size != '' && matrix.config.pcp-size != '1' && format('/PCP{0}', matrix.config.pcp-size) || '' }} c${{ matrix.config.conc }}
runs-on: >- # zizmor: ignore[self-hosted-runner] GPU Slurm runners by design; workflow_dispatch only
${{ fromJSON(
vars.PRIORITY_SCHEDULER_ENABLED == 'true' &&
format(
'["self-hosted",{0},{1},{2},{3}]',
toJSON(matrix.config.runner),
toJSON(format('nodes:{0}', matrix.config['node-count'])),
toJSON(format('ci-job-{0}', matrix.config['queue-token'])),
toJSON(format('ci-attempt-{0}', github.run_attempt))
) ||
format('[{0}]', toJSON(matrix.config.runner))
) }}
env:
EXP_NAME: ${{ matrix.config.exp-name }}
MODEL: ${{ matrix.config.model }}
MODEL_PREFIX: ${{ matrix.config.model-prefix }}
ISL: ${{ matrix.config.isl }}
OSL: ${{ matrix.config.osl }}
MAX_MODEL_LEN: ${{ matrix.config.max-model-len }}
IMAGE: ${{ matrix.config.image }}
FRAMEWORK: ${{ matrix.config.framework }}
PRECISION: ${{ matrix.config.precision }}
GPU_COUNT: ${{ matrix.config['gpus-per-worker'] }}
TP: ${{ matrix.config.tp }}
PP_SIZE: ${{ matrix.config.pp }}
DCP_SIZE: ${{ matrix.config.dcp-size }}
PCP_SIZE: ${{ matrix.config.pcp-size }}
EP_SIZE: ${{ matrix.config.ep }}
DP_ATTENTION: ${{ matrix.config['dp-attn'] }}
CONC: ${{ matrix.config.conc }}
SPEC_DECODING: ${{ matrix.config.spec-decoding }}
DISAGG: ${{ matrix.config.disagg }}
MOE_DEBUG: '0'
MOE_DEBUG_LOG: ${{ (inputs.moe-debug) && '/workspace/moe_debug.tp0.log' || '' }}
steps:
- name: Slurm cleanup
run: |
if command -v squeue >/dev/null 2>&1; then
for job_name in "${RUNNER_NAME}" "inferencex-${RUNNER_NAME}"; do
echo "[Slurm] Cleaning up jobs with name: ${job_name} ..."
scancel --name="${job_name}" || true
while [ -n "$(squeue --name="${job_name}" --noheader --format='%i')" ]; do
squeue --name="${job_name}"
sleep 5
done
done
fi
# A cancelled or crashed job can leave git state in this persistent
# workspace that breaks checkout; re-cloning fixes it and is idempotent.
- name: Checkout code
id: checkout
continue-on-error: true
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: &checkout-inputs
fetch-depth: 0
ref: ${{ inputs.ref || github.sha }}
clean: false
persist-credentials: false
- name: Wipe workspace after failed checkout
if: ${{ steps.checkout.outcome == 'failure' }}
run: find "$GITHUB_WORKSPACE" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
- name: Retry checkout
if: ${{ steps.checkout.outcome == 'failure' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: *checkout-inputs
# With clean: false above, nested checkouts also persist between jobs.
- name: Checkout result tooling
id: checkout-tooling
continue-on-error: true
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: &tooling-inputs
ref: ${{ github.workflow_sha }}
path: .result-tooling
persist-credentials: false
- name: Wipe result tooling after failed checkout
if: ${{ steps.checkout-tooling.outcome == 'failure' }}
run: rm -rf "$GITHUB_WORKSPACE/.result-tooling"
- name: Retry result tooling checkout
if: ${{ steps.checkout-tooling.outcome == 'failure' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: *tooling-inputs
- name: Set up uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: false
- name: Prepare result-processing Python
env: &uv-setup-env
UV_CACHE_DIR: ${{ github.workspace }}/../.infx-uv-cache
UV_PYTHON_INSTALL_DIR: ${{ github.workspace }}/../.infx-uv-python
run: |
uv python install --quiet --no-bin 3.12
result_python=$(uv python find --system 3.12)
"$result_python" --version
echo "INFERENCEX_RESULTS_PYTHON=$result_python" >> "$GITHUB_ENV"
- name: Prepare launcher Python
env: *uv-setup-env
run: |
launch_venv="$RUNNER_TEMP/infx-launch-venv"
uv venv --quiet --python 3.12 "$launch_venv"
uv pip install --quiet --exclude-newer PT12H --python "$launch_venv/bin/python" \
-r "$GITHUB_WORKSPACE/.result-tooling/inferencex-e2e/pyproject.toml"
echo "INFERENCEX_LAUNCH_PYTHON=$launch_venv/bin/python" >> "$GITHUB_ENV"
- name: Launcher cleanup
env:
PYTHONPATH: ${{ github.workspace }}/.result-tooling/inferencex-e2e
run: |
"$INFERENCEX_LAUNCH_PYTHON" -P -m infx.launch cleanup
- name: Launch + Profile (single-node sglang/vllm)
id: run
env:
RUNNER_NAME: ${{ runner.name }}
PROFILE: '1'
SGLANG_TORCH_PROFILER_DIR: /workspace/
VLLM_TORCH_PROFILER_DIR: /workspace/
VLLM_RPC_TIMEOUT: '1800000'
shell: bash
run: |
if [[ -f inferencex-e2e/configs/runners.yaml ]]; then cd inferencex-e2e; fi
export GITHUB_WORKSPACE="$PWD"
echo "INFERENCEX_E2E_ROOT=$PWD" >> "$GITHUB_ENV"
set -eo pipefail
ep_val="${EP_SIZE:-1}"
res_name="${EXP_NAME}_${PRECISION}_${FRAMEWORK}_tp${TP}-pp${PP_SIZE}-dcp${DCP_SIZE}-pcp${PCP_SIZE}_ep${ep_val}_dpa_${DP_ATTENTION}_conc${CONC}_${RUNNER_NAME}"
export RESULT_FILENAME="${res_name}"
echo "RESULT_FILENAME=${res_name}" >> "$GITHUB_ENV"
source benchmarks/runtime_settings.sh
"$INFERENCEX_LAUNCH_PYTHON" -m infx.launch run
if [ ! -f "${res_name}.json" ]; then
echo "Run failed: Benchmark result ${res_name}.json not found." >&2
exit 1
fi
trace_path="profile_${res_name}.trace.json.gz"
if [ -f "$trace_path" ]; then
echo "trace=$PWD/$trace_path" >> "$GITHUB_OUTPUT"
if [ "${FRAMEWORK}" = "sglang" ]; then
# Try to locate corresponding TP-0 traces produced by SGLang profiler
merged_latest=$(ls -t profiles/merged-*.trace.json.gz 2>/dev/null | head -n1 || true)
if [ -n "${merged_latest}" ] && [ -f "${merged_latest}" ]; then
ts_name="${merged_latest##*/}"
ts_name="${ts_name#merged-}"
ts_name="${ts_name%.trace.json.gz}"
tp0_decode="profiles/${ts_name}-TP-0-DECODE.trace.json.gz"
tp0_extend="profiles/${ts_name}-TP-0-EXTEND.trace.json.gz"
if [ -f "${tp0_decode}" ]; then
echo "tp0_decode=$PWD/${tp0_decode}" >> "$GITHUB_OUTPUT"
fi
if [ -f "${tp0_extend}" ]; then
echo "tp0_extend=$PWD/${tp0_extend}" >> "$GITHUB_OUTPUT"
fi
fi
fi
else
echo "Profile trace not found: $trace_path" >&2
fi
- name: Process result (json -> agg)
env:
RUNNER_TYPE: ${{ matrix.config.runner }}
PYTHONPATH: ${{ github.workspace }}/.result-tooling/inferencex-e2e
run: |
if [[ -f inferencex-e2e/configs/runners.yaml ]]; then cd inferencex-e2e; fi
source "$PYTHONPATH/benchmarks/check_env.sh"
check_env_vars INFERENCEX_RESULTS_PYTHON
"$INFERENCEX_RESULTS_PYTHON" -P -m infx.results.fixed_sequence
- name: Redact stored artifacts
if: ${{ always() && env.INFERENCEX_RESULTS_PYTHON != '' }}
env:
PYTHONPATH: ${{ github.workspace }}/.result-tooling/inferencex-e2e
TRACE: ${{ steps.run.outputs.trace }}
TP0_DECODE: ${{ steps.run.outputs.tp0_decode }}
TP0_EXTEND: ${{ steps.run.outputs.tp0_extend }}
run: |
source "$PYTHONPATH/benchmarks/check_env.sh"
check_env_vars INFERENCEX_RESULTS_PYTHON INFERENCEX_E2E_ROOT
paths=("$INFERENCEX_E2E_ROOT/moe_debug.tp0.log")
for trace in "$TRACE" "$TP0_DECODE" "$TP0_EXTEND"; do
if [[ -n "$trace" ]]; then paths+=("$trace"); fi
done
"$INFERENCEX_RESULTS_PYTHON" -P -m infx.results.redact "${paths[@]}"
- name: Upload profile as artifact
if: ${{ steps.run.outputs.trace != '' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: profile_${{ env.RESULT_FILENAME }}
path: ${{ steps.run.outputs.trace }}
if-no-files-found: ignore
- name: Upload TP-0-DECODE trace as artifact
if: ${{ steps.run.outputs.tp0_decode != '' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: profile_${{ env.RESULT_FILENAME }}_TP0_DECODE
path: ${{ steps.run.outputs.tp0_decode }}
if-no-files-found: ignore
- name: Upload TP-0-EXTEND trace as artifact
if: ${{ steps.run.outputs.tp0_extend != '' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: profile_${{ env.RESULT_FILENAME }}_TP0_EXTEND
path: ${{ steps.run.outputs.tp0_extend }}
if-no-files-found: ignore
- name: Upload MoE debug log as artifact
if: ${{ env.MOE_DEBUG == '1' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: moe_debug_${{ env.RESULT_FILENAME }}
path: ${{ env.INFERENCEX_E2E_ROOT }}/moe_debug.tp0.log
if-no-files-found: ignore
- name: Checkout storage repo
id: checkout-storage
if: ${{ steps.run.outputs.trace != '' }}
continue-on-error: true
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: &storage-inputs
repository: SemiAnalysisAI/InferenceX-trace-storage
path: storage
ref: master
# Storage-repository deploy key for authorized profiling dispatches.
ssh-key: ${{ secrets.PROFILER_STORAGE_DEPLOY_KEY }} # zizmor: ignore[secrets-outside-env]
fetch-depth: 0
# This separate storage checkout pushes trace commits using its scoped deploy key.
persist-credentials: true # zizmor: ignore[artipacked]
- name: Wipe storage repo after failed checkout
if: ${{ steps.checkout-storage.outcome == 'failure' }}
run: rm -rf "$GITHUB_WORKSPACE/storage"
- name: Retry storage repo checkout
if: ${{ steps.checkout-storage.outcome == 'failure' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: *storage-inputs # zizmor: ignore[artipacked]
- name: Push profile to storage repo
if: ${{ steps.run.outputs.trace != '' }}
id: push
env:
MATRIX_CONFIG_RUNNER: ${{ matrix.config.runner }}
MATRIX_CONFIG_EXP_NAME: ${{ matrix.config['exp-name'] }}
MATRIX_EP: ${{ matrix.config.ep || 1 }}
TRACE_LOCAL: ${{ steps.run.outputs.trace }}
shell: bash
run: |
set -eo pipefail
dest_dir="storage/profiles/${GITHUB_SHA}/${MATRIX_CONFIG_RUNNER}/${FRAMEWORK}/${MATRIX_CONFIG_EXP_NAME}_${PRECISION}_tp${TP}_pp${PP_SIZE}_dcp${DCP_SIZE}_pcp${PCP_SIZE}_ep${MATRIX_EP}_conc${CONC}"
mkdir -p "$dest_dir"
cp "$TRACE_LOCAL" "$dest_dir/trace.json.gz"
pushd storage >/dev/null
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add -A
git commit -m "Add profile: ${GITHUB_SHA} ${MATRIX_CONFIG_EXP_NAME} tp${TP} pp${PP_SIZE} dcp${DCP_SIZE} pcp${PCP_SIZE} ep${MATRIX_EP} conc${CONC}" || echo "Nothing to commit"
git push
STORAGE_SHA="$(git rev-parse HEAD)"
popd >/dev/null
export RAW_URL="https://raw.githubusercontent.com/SemiAnalysisAI/InferenceX-trace-storage/${STORAGE_SHA}/profiles/${GITHUB_SHA}/${MATRIX_CONFIG_RUNNER}/${FRAMEWORK}/${MATRIX_CONFIG_EXP_NAME}_${PRECISION}_tp${TP}_pp${PP_SIZE}_dcp${DCP_SIZE}_pcp${PCP_SIZE}_ep${MATRIX_EP}_conc${CONC}/trace.json.gz"
export TITLE="${MATRIX_CONFIG_EXP_NAME}_${PRECISION}_tp${TP}_pp${PP_SIZE}_dcp${DCP_SIZE}_pcp${PCP_SIZE}_ep${MATRIX_EP}_conc${CONC}"
enc_src="$(python3 -c 'import os,urllib.parse; print(urllib.parse.quote(os.environ["RAW_URL"], safe=""))')"
enc_title="$(python3 -c 'import os,urllib.parse; print(urllib.parse.quote(os.environ["TITLE"], safe=""))')"
relay="${PERFETTO_RELAY_URL%/}"
RELAY_URL="${relay}/?src=${enc_src}&title=${enc_title}"
echo "raw_url=$RAW_URL" >> "$GITHUB_OUTPUT"
echo "relay_url=$RELAY_URL" >> "$GITHUB_OUTPUT"
- name: Print Perfetto link (relay)
if: ${{ steps.push.outputs.relay_url != '' }}
env:
RELAY_URL: ${{ steps.push.outputs.relay_url }}
RAW_URL: ${{ steps.push.outputs.raw_url }}
shell: bash
run: |
set -eo pipefail
echo "RAW trace URL: $RAW_URL"
echo "Perfetto Relay URL: $RELAY_URL"
printf "\n**Perfetto (Relay):** %s\n" "$RELAY_URL" >> "$GITHUB_STEP_SUMMARY"