probe: SDPA k_chunk_size scaling probe, landed unrun (#39) #89
No reviewers
Labels
No labels
cards:go
hermes-approved
human-approved
human-approved
iter
0
iter
1
iter
2
iter
3
prio:high
prio:low
prio:med
priority/high
state
blocked
state
doing
state
done
state
review
state
todo
x280
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitpartner/tt-stack!89
Loading…
Reference in a new issue
No description provided.
Delete branch "agy/issue-39"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lands
bench/probes/sdpa_k_chunk_scaling.pyand.claude/skills/sdpa-k-chunk-probe/SKILL.mdas tooling only. The probe sweeps SDPA prefill
k_chunk_size∈ {64, 128, 256, 512} againstdepths {4k, 16k, 32k, 128k} on the 1x2 Blackhole mesh with no model boot, to test whether larger
k_chunkcuts online-softmax rescale iterations (iterations = tokens_behind / k_chunk) enoughto beat the served path's fixed
qk_chunk = 128, which was chosen at shallow context.It has never been run. Not on silicon, not in the simulator. So it carries no
bench/runsrecord and gets nodocs/LEDGER.mdentry, and it must not accrue one untilsomeone actually executes it — under
D-2026-09-25-overhaula probe that has not run closesnothing. Both files say this at the top: the module docstring opens with an
UNRUN:paragraphand the skill leads with a Status: UNRUN TOOLING callout (and its
description:frontmatter is prefixed
UNRUN tooling) so it cannot be picked up later and mistaken for evidence.Everything the skill says about
k_chunk_sizeis a hypothesis; only the motivating prefillfigures are measured.
Changes made while landing it. Both files cited
docs/DIRECTIVES-LEDGER.md, which PR #68removed — retargeted to
docs/LEDGER.md. The skill's example output paths(
bench/runs/my-run.jsonl,bench/runs/sdpa-k-chunk-scaling-<timestamp>.jsonl) read asevidence citations to
scripts/check-cited-records.pyand failed the gate as dangling; they arenow written as a shell variable and as prose naming the directory, with the file named but
explicitly flagged as not yet existing. The two real citations it makes — the
k_chunk_size=32corruption inbench/runs/packed-verify.jsonland the LoFi+fp32-acccorruption in
bench/runs/dspark-20260911T133340Z-lofi-fp32acc-bug.jsonl, both encoded asfail-closed traps in the probe — resolve against real records.
Merged master in cleanly, no conflicts. Verified after:
docs/still 11 files, no rootCLAUDE.md,AGENTS.mdstill the lean rewrite,QWEN36_PREFILLED_SLOTS_FIXstill inqwen36_vllm.py, nothing PR #68 deleted came back, and the only two files added versus masterare the probe and the skill.
check-cited-records.pypasses.Refs #39.
🤖 Generated with Claude Code
What was believed: That qk_chunk=128 was universally optimal for prefill SDPA based on shallow measurements (tp.py:776: "128 beats 256"). At shallow context, smaller chunks minimize padding overhead and DRAM transfer latency. What the evidence changed: Prefill throughput collapses from 3,534 tok/s at 16k to 2,366 at 128k and 1,707 at 256k (directives ledger). The 16 attention layers are the sole context-scaling ops during prefill. At deep context (32k, 128k, 256k), online-softmax performs tokens_behind / k_chunk rescale iterations. Doubling k_chunk to 256 or 512 halves or quarters those passes, potentially saving substantial wall-clock time at our target agent shapes (4x256k / 8x128k). This adds a standalone no-model single-op probe bench/probes/sdpa_k_chunk_scaling.py to measure k_chunk in {64, 128, 256, 512} across chunk depths {4k, 16k, 32k, 128k} on Blackhole 1x2 mesh (Qwen3.8-27B TP=2, head_dim=256, bf8 paged KV cache). Enforces fail-closed guards against known corruptions (k_chunk=32 and LoFi+fp32_dest_acc), supports preflight compilation/import-checks without hardware, and records structured results to bench/runs/*.jsonl. Documented in .claude/skills/sdpa-k-chunk-probe/SKILL.md. Co-Authored-By: Gemini 3.8 Flash via agy <noreply@google.com>agent-gateway closeout (merged): cleared
agent:*labels.Hermes kanban card (if any) is left for Hermes to archive/complete.