Untraced launch-latency microbench for a verify-sized CUDA graph (plan 6b step 1) and its holder stub

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-11-12 16:47:03 +01:00
co-authored by Claude Sonnet 5.5
parent 97d548e2b8
commit adc8af982c
2 changed files with 166 additions and 0 deletions
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# HOLDER JOB (needs only the GPU lock, not the model). Plan 6b step 1: is "cuGraphLaunch of the verify graph -> first kernel = 1.3 ms with the GPU idle"
# (CUPTI timeline, ledger "Between graphs") the tracer's? tools/launch-latency/launch_latency.cu launches a verify-shaped graph (250/1000/1850/2050 kernel
# nodes, side streams) on an idle stream WITHOUT a tracer and reports the launch call, launch call -> first kernel and the graph span. Run twice (A/A).
# Result: /data/leleka-e2e/spd-gap/runs/decode-launch-latency-microbench-verify-sized-graph-untraced/{a,b}.txt
set -uo pipefail
OUT=/data/leleka-e2e/spd-gap/runs/decode-launch-latency-microbench-verify-sized-graph-untraced
LOCK=/data/leleka-e2e/gpu.lock
mkdir -p "$OUT"
got=0; for _ in $(seq 1 4320); do if mkdir "$LOCK" 2>/dev/null; then echo "launch-latency $(date -u +%FT%TZ) $OUT" >"$LOCK/owner"; got=1; break; fi; sleep 5; done
[ $got = 1 ] || { echo "GPU lock held by: $(cat $LOCK/owner 2>/dev/null)"; exit 3; }
trap 'rm -f "$LOCK/owner"; rmdir "$LOCK" 2>/dev/null' EXIT
[ -z "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ] || { echo "something uses the GPU"; exit 3; }
nvidia-smi --query-gpu=name,driver_version,clocks.sm,clocks.mem,power.draw --format=csv >"$OUT/gpu.txt"
for run in a b; do /data/leleka-e2e/spd-gap/tools/launch-latency/launch_latency 250 1000 1850 2050 >"$OUT/$run.txt" 2>&1; echo "run $run rc=$?"; done
cat "$OUT/a.txt"