docs: Block AttnRes model + ROCm-first plan, with executable contract tests - #552
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f579d0f6cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… tests Formal model of Block AttnRes (arXiv 2603.15031) with the paper's gaps filled explicitly (first-of-block partial exclusion, attention-based output aggregation, derived VJP eqs. 11-13, numeric policy per Decision #15a), the algorithm set (naive forward, attn-with-stats + softmax_merge primitive pair, exact two-phase schedule, VJP), and a lowering plan sequenced ROCm-first per fleet routing: the mathematical contract lands host-free (Phases 0-3), the first hardware proof on gfx1151 (Phase 4). tests/unit/test_block_attnres_model.py is the executable contract: VJP vs central finite differences (<=1e-7), merge-lemma exactness over random partition trees (atol 1e-12), properties P1-P4, two-phase == naive across block partitions, Full-AttnRes limit, and GAP-2 source-count semantics. These numpy references double as the F4 oracles for the later ROCm/Apple kernels. No registry or generated-doc changes in this PR (those start at plan Phase 1). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gstoner
force-pushed
the
plan/block-attnres-rocm-first
branch
from
August 12, 2026 15:45
f579d0f to
d34957d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lands the Block AttnRes (arXiv 2603.15031) work as a plan + executable mathematical contract, sequenced ROCm-first per fleet routing (Strix Halo owns the first hardware proof on gfx1151).
docs/audit/compiler/BLOCK_ATTNRES_ROCM_PLAN.md— formal model with the paper's gaps filled and marked ([GAP-1..5]): last-block convention, first-of-block partial exclusion (no zero placeholder), attention-based output aggregation, numeric policy in Decision-#15a terms, and the derived VJP (the paper ships no backward). Plus the algorithm set (naive forward,attn_with_stats/softmax_mergeprimitive pair, exact two-phase schedule, VJP, sharded prefill) and the lowering plan: Graph IR op-set (softmax_mergeas the reassociable primitive,return_statsonFlashAttnOppromoting the existing FA-4 LSE checkpoint, thindepth_attnwith its decomposition as declared oracle per Decision Apple GPU: Gumbel-max inference sampler (#18-safe, reproducible) #31), ROCm execution lane, then schedule-level transforms. Appendices: sequence-mixer facet mapping (recurrence axis as facet), public-implementation survey (no faithful Block AttnRes exists publicly).tests/unit/test_block_attnres_model.py— 14 pure-numpy tests, the executable contract and future F4 oracles: VJP vs central finite differences (≤1e-7), merge-lemma exactness over random partition trees (atol 1e-12), properties P1–P4 (convexity, zero-init uniformity, key scale-invariance, gain absorption), two-phase == naive across block partitions, the Full-AttnResS=1limit, GAP-2 source-count semantics, and input-validation errors.No registry, catalog, or generated-doc changes — those begin at plan Phase 1.
Test plan
python3 -m pytest tests/unit/test_block_attnres_model.py -q→ 14 passed (numpy-only; no torch, runs on the Strix box venv and the Mac Homebrew env)ruff checkclean on the new test filebash scripts/check_generated_docs.sh→ in sync; pre-push spec/freshness gate passes🤖 Generated with Claude Code