Skip to content

Commit df6034b

Browse files
committed
Log cluster GEMM autotune candidates in CI repro
1 parent b5ca1b3 commit df6034b

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/hopper-build-and-test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,30 @@ jobs:
118118
mod.main([])
119119
PY
120120
python3 python/tutorials/tle/03-topk.py
121+
python3 - <<'PY'
122+
from pathlib import Path
123+
124+
path = Path("python/tutorials/tle/04-cluster-gemm.py")
125+
text = path.read_text()
126+
old = """ for cfg in candidates:
127+
run_fn(cfg)
128+
torch.cuda.synchronize()
129+
ms = triton.testing.do_bench(lambda: run_fn(cfg), warmup=warmup, rep=rep)
130+
if ms < best_ms:
131+
"""
132+
new = """ for cfg in candidates:
133+
print(f"[autotune-candidate] {name}: start cfg={cfg}", flush=True)
134+
run_fn(cfg)
135+
torch.cuda.synchronize()
136+
print(f"[autotune-candidate] {name}: initial_sync_ok cfg={cfg}", flush=True)
137+
ms = triton.testing.do_bench(lambda: run_fn(cfg), warmup=warmup, rep=rep)
138+
print(f"[autotune-candidate] {name}: bench_ok cfg={cfg} ms={ms:.3f}", flush=True)
139+
if ms < best_ms:
140+
"""
141+
if old not in text:
142+
raise SystemExit("cluster-gemm autotune patch target not found")
143+
path.write_text(text.replace(old, new))
144+
PY
121145
echo "[debug] triton cache before cluster-gemm original loop"
122146
du -sh ~/.triton/cache || true
123147
find ~/.triton/cache -type f 2>/dev/null | wc -l || true

0 commit comments

Comments
 (0)