Skip to content

perf(hip-kernel-provider): gfx942 4-warp GQA softmax exp2_fast + bf16 swizzle-hoist - #8

Open
AviralGoelAMD wants to merge 1 commit into
developfrom
users/avirgoel/rocke/gfx942-4wgqa-exp2fast-swz
Open

AviralGoelAMD wants to merge 1 commit into
developfrom
users/avirgoel/rocke/gfx942-4wgqa-exp2fast-swz

Conversation

@AviralGoelAMD

Copy link
Copy Markdown
Owner

Summary

The gfx942 4-warp GQA attention kernel (the paged-prefill path used for D128
sliding-window and D256) did avoidable work in its inner loop: the online-softmax
exp2 went through a full overflow/underflow guard on every element even though the
exponent is always non-positive, and the LDS bank-swizzle addressing was precomputed
once-per-lane only for fp16 (recomputed on every access for bf16). This change removes
both. The kernel is measurably faster and produces identical results. Confidence is
high: verified correct on real gfx942 against an fp32 reference for both bf16 and fp16
across two sequence lengths, with a new test guarding the change.

What was wrong

  • The online softmax emitted the guarded exp2 (math.exp2, an extra
    range-reduction clamp per call) at both exp2 sites, though the exponent is always <= 0.
  • The LDS swizzle-hoist (precompute the bank-swizzle columns once per lane instead of
    recomputing div/mod/xor/mul/add per K/V access) was gated to fp16; bf16 recomputed it.

What changed

  • library/kernels/gfx942/attention_tiled_2d.py (build_gfx942_4warp_gqa):
    • the two online-softmax exp2 sites use exp2_fast;
    • the swizzle-hoist is enabled for bf16 as well as fp16.
  • New CPU-only emit test asserting the softmax lowers to exp2_fast for bf16 and fp16.

Why it works

  • exp2_fast is v_exp_f32 without the overflow/underflow guard. Both arguments —
    m_old - m_new and S*scale - m_new — are <= 0 by the running-max invariant, so the
    guard can never fire and the raw op flushes the tail correctly. Safe by construction,
    independent of dtype/shape.
  • The swizzle columns depend only on (key, col) once buf_off is 0 mod 16 (it is), so
    they are loop-invariant and hoistable. bf16 was excluded over a 256-VGPR spill that only
    arises at larger tiles; this cohort is the small-tile BN=32 path (HD128_PIPE => BS<=32),
    which has register headroom (measured; no spill).

How it was validated

  • Correctness on real gfx942 (kreb) vs an fp32 windowed-SDPA reference: bf16 and fp16,
    D128 GQA 32/8, sliding window, Sq 8192 and 16384
    — all within tolerance.
  • The new emit test fails against the pre-change kernel (guarded exp2) and passes after.
  • pre-commit clean; deliverable source only (kernel + test), no scratch/bench.

Notes

  • Measured faster on gfx942; per repo policy the numbers live in the private results page,
    not in this body or the commits.
  • exp2_fast also applies to the D256 4-warp path (same shared softmax); its correctness
    rides the same arg <= 0 proof, and its IR is covered by the representative golden.
  • Golden re-bless required (follow-up): the IR changed, so the
    attention_d256/gfx942/4warp_gqa entry in rocke_representative_ir_sha256.json must be
    re-blessed under the CI LLVM flavor. It cannot be blessed from the dev environment used
    here (LLVM-flavor mismatch + the C++ engine archive is not built).
  • Fork staging PR to exercise CI before the upstream PR; the tracking ticket will be filed
    with the upstream PR.

… swizzle-hoist

The gfx942 4-warp GQA attention kernel (build_gfx942_4warp_gqa) ran the
online-softmax through the guarded math.exp2 (overflow/underflow range
reduction) and hoisted the LDS bank-swizzle columns for fp16 only.

- Softmax now emits exp2_fast: both exp2 arguments (m_old-m_new and
  S*scale-m_new) are <= 0 by the running-max invariant, so the guard is
  unnecessary and v_exp_f32 flushes the tail correctly.
- Enable the swizzle-hoist for bf16 as well as fp16: this cohort is the
  small-tile BN=32 wide-flash path (HD128_PIPE => BS<=32), whose register
  pressure leaves headroom for the precomputed columns (the earlier bf16
  spill concern was for larger tiles this path never uses).

Verified correct on real gfx942 vs an fp32 windowed-SDPA reference for bf16
and fp16 (D128, GQA 32/8, Sq 8192 and 16384). Adds a CPU-only emit test that
guards the exp2_fast lowering for both dtypes.
@github-actions

Copy link
Copy Markdown

🤖 rocKE PR Review

PR #8 · 2 files · +96/-7

Branch: users/avirgoel/rocke/gfx942-4wgqa-exp2fast-swz
Title: perf(hip-kernel-provider): gfx942 4-warp GQA softmax exp2_fast + bf16 swizzle-hoist
Base: develop · Verdict: FAIL


A. Byte-identity & two-engine parity — graded 9/9

§ Item Verdict Severity Evidence
A1 Kernel-body emitters need no C++ twin only where the family is Python-only; where a C++ kernel twin exists, keep it in sync. PASS build_gfx942_4warp_gqa is Python-only — no hits for 4warp_gqa in platform/cpp/bindings/rocke_engine_attention.cpp. The C++ builder rocke_build_unified_attention_2d_tiled_scalar_new covers build_unified_attention_2d_tiled (line 1298), a distinct builder untouched by this PR.
A2 Core lowering-op / op-handler changes mirrored in both engines — even when the PR's kernels are Python-only. PASS exp2_fast is pre-existing in both engines: Python platform/python/rocke/core/ir.py:538; C++ platform/cpp/core/lower_llvm/arith.cpp:612–615 (registered at line 746). No new core-op introduced; no mirroring gap.
A3 Selectors, spec builder, lowering, dispatch, knobs mirrored in C++ — unconditional. N/A Dispatch layers for 4-warp family are Python-only routing; C++ engine invokes a different builder directly. No C++ dispatch layer to mirror.
A4 Where a C++ twin exists, emit ORDER matches Python exactly. N/A No C++ twin for build_gfx942_4warp_gqa (confirmed A1). Inapplicable.
A5 Representative-IR golden UNCHANGED for byte-identical changes; re-blessed only for intentional IR change. FAIL HIGH Intentional IR change (exp2exp2_fast at attention_tiled_2d.py:6069, 6075). platform/tests/golden/rocke_representative_ir_sha256.json attention_d256/gfx942/4warp_gqa SHA unchanged (SHA 6e81882f…). PR body acknowledges re-bless is deferred — but this leaves CI golden gate as a live tripwire. Must be re-blessed before or at merge.
A6 "Golden untouched/added" is NOT parity proof — ask WHICH gate. FAIL MEDIUM The new test test_gfx942_4wgqa_softmax_exp2fast.py is a Python-only emit check, not a cross-engine check_byte_identity.py run. This is appropriate (builder is Python-only), but the PR body does not explicitly label the test as Python-only emit verification, leaving room for misinterpretation.
A7 New logic guarded so covered shapes emit identical IR; no unconditional op on a hot path. FAIL MEDIUM exp2_fast at lines 6069, 6075 is unconditional for all shapes through build_gfx942_4warp_gqa — intentional and math-safe, but ALL shapes through this builder now emit changed IR. The golden (A5) must be re-blessed to reflect this. _SWZH bf16 extension is correctly guarded by HD128_PIPE and spec.dtype in ("fp16", "bf16") (line 5920).
A8 Don't trust green CI for C++ — review C++ by hand / run check_byte_identity.py. FAIL LOW No documented check_byte_identity.py run or explicit waiver. For a Python-only builder, cross-engine identity is inapplicable (A1), but the PR body doesn't state this explicitly. A one-line waiver noting "4-warp builder is Python-only, check_byte_identity.py not applicable" would satisfy the item.
A9 Shared op-handler fix proven cheaply via a <op>_emit.{py,c} mini-pair in library/tests/parity/. N/A exp2_fast op handler unchanged by this PR; mini-pair only needed for shared-op-handler modifications.

B. Coverage & silent-fallback — graded 5/5

§ Item Verdict Severity Evidence
B1 Every new rejection/gate classified: real hardware limit vs implementation shortcut. PASS No new rejection introduced. _SWZH opens a previously-closed path; existing NotImplementedError at line ~5712 unchanged.
B2 Preflight gate rejects EXACTLY what the spec constructor rejects, per arch. PASS Dispatch gate _d128_gfx942_swa_fast (attention_unified.py:916–946) requires dtype in ("bf16", "fp16") — matches builder's dtype guard. No mismatch.
B3 No real model-zoo shape silently demoted to slow fallback. PASS _SWZH change is internal register optimization; routing unchanged. No shape leaves the fast path.
B4 Gate scope = verified scope — configs newly opened by a gate are tested or scoped down. FAIL HIGH _SWZH=True for bf16 is newly opened (line 5920; was fp16-only). The new test is CPU-only emit verification — it does not confirm on-device correctness for the bf16+swizzle-hoist configuration on real gfx942 hardware.
B5 is_valid_spec/supports_* is FUNCTIONAL-only. PASS supports_tiled_2d (attention_tiled_2d.py:1043) is unchanged; its rejections are functional hardware/algorithm invariants.

C. DRY / single-source / blast-radius — graded 8/8

§ Item Verdict Severity Evidence
C1 Repeated predicate/logic → one named helper. FAIL LOW exp2_fast called at two sites (lines 6069, 6075) without a local alias (contrast: gfx950/attention_dense.py:544 uses _exp2 = b.exp2_fast). _SWZH is inlined 5× (lines 5920, 5953, 5960, 5987, 6031, 6115).
C2 One build_<family>(spec) per family — no bespoke shape-class kernel. PASS No new builder introduced; changes stay inside build_gfx942_4warp_gqa (line 5703).
C3 Name by operation+algorithm, not workload. PASS kernel_name() encodes codegen knobs (dtype, head_size, block_size, sw); no workload sizes.
C4 Arch-independent logic lives in common/. PASS _SWZH and exp2_fast are gfx942-HD128_PIPE-specific. No arch-independent logic forked.
C5 Blast radius judged: inherent fan-out vs inflated diff. PASS 2 files: kernel emitter + matching CPU emit test. No inflation.
C6 Make the change easy, then make the easy change — refactor-first. FAIL LOW Direct two-site patch without a prior no-op alias commit. The _exp2 = b.exp2_fast pattern already exists in gfx950/attention_dense.py:544; applying it first would be self-documenting.
C7 Big cleanups welcomed as proven no-ops. N/A No large cleanup in this PR.
C8 ★ A found bug is a CLASS — grep every sibling site. FAIL MEDIUM build_unified_attention_2d_tiled (same file) has four guarded b.exp2() softmax sites (lines 4495, 4701, 4795, 4815) computing exp2(s - m_new) and exp2(m_old - m_new). The running-max invariant applies there too (≤ 0 by construction). None audited or converted. The PR description acknowledges different register characteristics but does not provide a per-site verdict. Also: gfx1250/wmma_attention_fwd.py and common/_fmha_warp_body.py have structurally identical softmax exp2 patterns — each needs a stated verdict (safe-to-fast or kept-guarded with reason).

D. Dispatcher & spec integration — graded 10/10

§ Item Verdict Severity Evidence
D1 ★ Knobs/features on KernelSpec, NOT os.environ. N/A Pure emitter change; no new knobs, no KernelSpec fields, no os.environ.
D2 Derived cache-key faithful to what's built. N/A Cache-key unchanged; _SWZH and exp2_fast deterministically derived from already-keyed fields.
D3 Cohort routing keeps spec-builder + launch-meta + cache-key in agreement. PASS _gfx942_4warp_route (common/attention_unified.py:947) unmodified.
D4 Hand-pinned overrides live ABOVE heuristics. N/A No overrides added.
D5 Cohort = single source of truth shared by supports() and spec override predicate. N/A No cohort definition changed.
D6 New kernel/arch registered as KernelCandidate AND exercised THROUGH dispatcher. N/A No new kernel/arch; modification of existing emitter path.
D7 CPU routing test: selects cohort candidate, outranks generic. N/A No routing change; existing routing tests unchanged.
D8 Don't over-claim registration. PASS No dispatcher registration changed; no over-claim.
D9 Selection-layer fix mirrored in C++. N/A Not a selection-layer change; no C++ mirror required.
D10 Fix the chooser, not the artifact. N/A Change is correctly an emitter fix, not a chooser workaround.

E. Structure & hygiene — graded 10/10

§ Item Verdict Severity Evidence
E1 platform ← library one-way dependency; platform tests don't import library. PASS New test is a library test importing from rocke.core.ir_print (platform→library direction allowed). Existing pattern in test_attention_builds.py etc.
E2 Library doesn't import torch for device queries. PASS Neither changed file imports torch.
E3 No Jira/tracking IDs, reviewer usernames, or PR numbers in code. PASS No such identifiers in either file.
E4 Scope discipline — unrelated fixes in their own PR. PASS 2 files, tightly scoped to stated feature.
E5 Only deliverable source committed. PASS No .md, bench scripts, or scratch files committed.
E6 Both arches covered, or explicitly scoped out. N/A gfx950 already had exp2_fast prior to this PR. Change correctly gfx942-only; PR body states scope.
E7 Dead code removed = symbol AND stale references in same commit. PASS Old fp16-only swizzle comment (fp16-only: trims ~12 VGPR…; bf16 regresses…) removed alongside the guard change (line 5916 diff).
E8 No dead parameters. PASS _SWZH is consumed at 5+ sites (lines 5953, 5960, 5987, 6031, 6115).
E9 Severity honesty. PASS Golden re-bless deferral is called out explicitly in PR body ("Golden re-bless required (follow-up)").
E10 ★ No software-achieved perf numbers in code, commit messages, or PR description. FAIL MEDIUM PR body contains: "Measured faster on gfx942" — a relative perf verdict. E10 prohibits absolute OR relative perf statements in the PR description. Actual numbers are correctly kept in the private results page, but the relative verdict ("faster") itself must not appear.

F. Merge-readiness / PR-bot policy — graded 10/10

§ Item Verdict Severity Evidence
F1 Branch name matches recognized prefix. PASS users/avirgoel/rocke/gfx942-4wgqa-exp2fast-swz — valid users/<user>/<segment>/<desc>.
F2 ★ rocKE PR branch uses rocke segment, NOT ck. PASS Branch contains /rocke/ segment; no CK CI triggered.
F3 Title Conventional Commits type(scope): desc, 10–80 chars, scope [a-z0-9-]+. FAIL LOW Title is 87 characters (limit 80). Type perf and scope hip-kernel-provider are valid. Only the length fails.
F4 Description ≥30 chars + an issue reference. FAIL MEDIUM Body is ~3000 chars (passes threshold). No issue reference (Closes #, Fixes #, or Jira/GitHub link). Body acknowledges: "tracking ticket will be filed with the upstream PR" — but an issue reference is required at PR open time.
F5 A unit-test file in the diff for any changed code file. PASS test_gfx942_4wgqa_softmax_exp2fast.py (basename test_*) tests both bf16 and fp16; would fail against pre-change kernel.
F6 No forbidden files. PASS 2 Python source files only.
F7 pre-commit green locally before push. PASS Both files follow surrounding code style; no black-formatting violations in diff.
F8 Stacked PR self-check. N/A Not a stacked PR; this is a fork-staging PR on its own branch.
F9 Don't split/trim for PR-size cap. N/A No evidence of artificial splitting.
F10 Don't add throwaway tests just to green the bot. PASS Test is a real regression guard: asserts the structural change, would fail pre-change, exercises both dtypes.

G. Verification honesty — graded 23/23

§ Item Verdict Severity Evidence
G1 Byte-identity proves parity, never correctness. PASS PR body does not conflate byte-identity with correctness; on-silicon verification cited separately.
G2 ★ On-silicon (fp32 ref, bf16 tol) is the only "done" for kernel work. FAIL HIGH PR body claims silicon correctness ("Verified correct on real gfx942 against an fp32 reference for both bf16 and fp16 across two sequence lengths") but no committed parity test or harness invocation. Claim lives in PR prose only; silicon correctness evidence is not persistent.
G3 ★ Local gate sweep green — or provably unchanged vs develop. FAIL BLOCKER platform/tests/golden/rocke_representative_ir_sha256.json attention_d256/gfx942/4warp_gqa SHA not re-blessed. PR explicitly defers. CI golden tripwire WILL FAIL on merge. Re-bless required before or at merge.
G4 New behavior has a test that would FAIL before the change. PASS test_gfx942_4wgqa_softmax_exp2fast.pyn_slow == 0 assertion fails on pre-change kernel (emitted guarded exp2). Docstring confirms this.
G5 ★ Every load-bearing PROSE claim maps to a check that would FAIL if false. PASS ≤0 precondition stated in code comments (attention_tiled_2d.py:6066–6069, 6074–6075); emit test verifies the fast path is taken. Mathematical invariant by construction.
G6 fp32 parity reference reviewed as a first-class gate. PASS PR body cites fp32 reference verification. Not a design doc; conditional on G2 evidence existing offline.
G7 No silent dtype fallback in harnesses. PASS Test iterates for dt in ("bf16", "fp16") explicitly; no fallback.
G8 Load-bearing numbers tool-sourced (comgr verbose), not hand-derived. FAIL MEDIUM PR body says "register headroom (measured; no spill)" with no tool source cited (no ISA dump, no occupancy probe output). Old comment "~12 VGPR + ~6% wall-clock" was removed; no replacement measurement committed.
G9 Perf provenance locked. PASS No perf numbers in committed files. PR body defers to private results page.
G10 ★ Optimized kernel is REACHABLE for the shape on the surface that runs it. PASS attention_unified.py:966_gfx942_4warp_route imports and returns build_gfx942_4warp_gqa; gate _gfx942_4warp_eligible (lines 862–910) routes the cohort.
G11 Two-engine/cross-layer gap graded by who-calls-it-now. PASS build_gfx942_4warp_gqa is Python-only (A1 confirmed); attention_tiled_2d_kv_body_qk_softmax.cpp is the C++ twin of build_unified_attention_2d_tiled (confirmed: gfx942_attn2d_build_ctx, rocke_build_unified_attention_2d_tiled_scalar in attention_tiled_2d.cpp:802). The C++ exp2 sites in that file belong to a different builder; no two-engine gap for this PR's builder.
G12 Intrinsic overload class verified in .td. N/A No new intrinsic; exp2_fast pre-existed.
G13 Bottleneck classified with DYNAMIC hw counters. N/A Targeted arithmetic/register optimization; no new memory bottleneck claim.
G14 Wrong-branch risk. N/A Branch name correct; no routing logic changed.
G15 Plan assumptions verified against codebase. N/A No written plan with assumptions.
G16 Shipped scripts run once end-to-end. N/A No one-shot scripts in this PR.
G17 A skip is not a pass. PASS _PinArch("gfx942") (lines 29–37) pins arch for CPU-only resolution. Docstring explicitly states "CPU-only emit test." No hidden @unittest.skip.
G18 ★ Perf/routing claims are config-labeled. PASS PR body cites "gfx942 GQA 32/8, sliding window, Sq 8192 and 16384." Shapes identified.
G19 A golden re-bless is NOT a correctness claim. PASS PR body explicitly acknowledges golden re-bless is a follow-up, not a correctness claim.
G20 Benchmark on worktree off PR's TARGET base. N/A No benchmarks committed; perf measurements are external.
G21 ★ A/B toggles EXACTLY the knob the PR ships. FAIL MEDIUM PR bundles two changes: exp2→exp2_fast and _SWZH bf16 extension. No isolation measurement for each knob's individual contribution. The emit test exercises both simultaneously for bf16.
G22 Separate develop→PR delta from counterfactual. N/A No counterfactual analysis claimed.
G23 Guarded→fast primitive swap only where precondition provably holds. PASS attention_tiled_2d.py:6066–6069: "argument (m_old - m_new) is <= 0 by the running-max invariant." Standard online-softmax structural guarantee; both sites satisfy this by construction.

H. Kernel input validation & memory safety — graded 5/5

This PR modifies only: (1) the _SWZH dtype condition (compile-time register precomputation) and (2) b.exp2(...)b.exp2_fast(...) (arithmetic, no memory access). No device-side masks, bounds, paged KV indexing, block_tables, kv_lens, or indirection logic is touched.

H trace (required): No device-side mask or bound is added or modified. Trace is vacuous — all H items are N/A.

§ Item Verdict Evidence
H1 ★ Hardware/resource bound from SPEC fields matched by launch tensors. N/A _SWZH depends on compile-time HD128_PIPE and spec.dtype; no new launch tensor or SPEC-derived bound.
H2 ★ Guard indirection VALUES, not just indices. N/A No indirection (paged KV, block_tables) touched. Both changes are arithmetic/register-level.
H3 Hot-loop div/mod by compile-time constant lowers to shift/mask. N/A No new div/mod in hot loop. Swizzle hoist precomputes column offsets outside the KV loop.
H4 ★ Device-side MASK/BOUND from runtime input covers FULL compile-time-visited range. N/A No device-side mask or bound modified. Softmax scale sc unchanged; _SWZH is compile-time.
H5 Every launch input feeding device-side bound/mask has host-validation AND negative test. N/A No new launch input added or modified.

I. Reusable design principles — graded 5/5

§ Item Verdict Severity Evidence
I1 Measure the space, not just the selection — best-achievable − shipped gap. FAIL LOW No sweep over remaining headroom for the affected shapes. The gap between this PR and theoretical peak is undocumented.
I2 Repair > loud-reject > silent-slow > cryptic-fail. PASS bf16 previously fell through to slower unhoisted swz(row, hd) inline computation; PR repairs the silent-slow path.
I3 Coverage = union(curated, generated). FAIL LOW Test adds one curated emit test for one shape. No generated sweep over the full HD128_PIPE cohort (varying block_size, seqlen, dtype edge cases).
I4 Keep both "shipped" and "achievable" columns. FAIL LOW No before/after TFLOP/s table committed or linked. Perf results are external; no shipped-vs-achievable delta documented in committed artifact.
I5 A baked search result is a snapshot that drifts. N/A No baked routing table added. Routing is not changed.

Rollup

Total graded: 82/82 (all items graded)

Findings — BLOCKER → HIGH → MEDIUM → LOW

Severity Finding Location Fix
BLOCKER G3: Golden IR SHA not re-blessed; CI golden gate WILL FAIL on merge platform/tests/golden/rocke_representative_ir_sha256.jsonattention_d256/gfx942/4warp_gqa Re-bless the golden for this entry under CI LLVM flavor before or at merge. Cannot be deferred past merge.
HIGH A5: Intentional IR change without golden re-bless — live CI tripwire attention_tiled_2d.py:6069,6075 × rocke_representative_ir_sha256.json Same fix as G3; blocking.
HIGH B4: bf16 swizzle-hoist newly opened gate with CPU-only verification only attention_tiled_2d.py:5920 Add on-device correctness run for bf16+swizzle-hoist path, or add a note scoping the verification claim to what was actually run.
HIGH G2: On-silicon correctness is PR-prose-only; no committed parity test PR body Commit or link a parity-harness invocation output, or add a parity_ test that runs against a real device.
MEDIUM A6: Python-only emit test not labeled as such; risks being conflated with cross-engine parity test_gfx942_4wgqa_softmax_exp2fast.py:1–13 Add one sentence in the test docstring: "This is a Python-engine emit test; build_gfx942_4warp_gqa is Python-only — cross-engine check_byte_identity.py is not applicable."
MEDIUM A7: All shapes through the builder now emit changed IR; golden must reflect this attention_tiled_2d.py:6069,6075 Part of golden re-bless (G3/A5).
MEDIUM C8: Sibling b.exp2() softmax sites in build_unified_attention_2d_tiled not audited (4 sites, same invariant may apply) attention_tiled_2d.py:4495,4701,4795,4815; also gfx1250/wmma_attention_fwd.py, common/_fmha_warp_body.py Document each site with a per-site verdict: "same invariant applies → safe to swap" or "different kernel family / register pressure → kept guarded because [reason]."
MEDIUM E10: PR body contains relative perf verdict ("Measured faster on gfx942") PR description Remove the relative verdict or replace with "see results page." Actual numbers are correctly absent.
MEDIUM F4: No issue reference in PR body PR description Add a Closes #N or Jira issue link.
MEDIUM G8: "Register headroom (measured; no spill)" — no tool source cited PR body Commit or reference the ISA dump (llvm-readelf --notes .vgpr_count / .private_segment_fixed_size) for the shipping build, confirming scratch=0 for bf16.
MEDIUM G21: Two knobs bundled without per-knob isolation PR body + test Document individual contribution in PR body, or accept the bundle with a note that isolation is deferred.
LOW A8: No documented check_byte_identity.py waiver for Python-only family PR body Add one line: "build_gfx942_4warp_gqa is Python-only; check_byte_identity.py not applicable for this builder."
LOW C1: exp2_fast not aliased as _exp2 = b.exp2_fast; _SWZH inlined without extraction attention_tiled_2d.py:6069,6075 Alias _exp2 = b.exp2_fast before use; consider extracting _swzh_enabled = HD128_PIPE and spec.dtype in ("fp16", "bf16").
LOW C6: Refactor-first not followed; direct two-site patch without a prior no-op alias attention_tiled_2d.py:6069,6075 Acceptable for a patch-level change; noted for style.
LOW F3: Title is 87 chars (limit 80) PR title Shorten by ~7 chars, e.g., drop "+ bf16" from title.
LOW I1 / I3 / I4: No space measurement, generated cohort sweep, or shipped-vs-achievable table Acceptable deferral for an optimization PR; document intent as follow-up.

Final Verdict: FAIL

Blocking items (must fix before merge):

  1. G3 / A5 (BLOCKER): Re-bless attention_d256/gfx942/4warp_gqa in rocke_representative_ir_sha256.json — the CI golden gate will fail without this. Cannot merge with a stale tripwire.

High-priority items (strongly recommended before merge):
2. B4 / G2 (HIGH): The bf16 swizzle-hoist path lacks committed on-device correctness evidence. Either add a parity test or narrow the stated verification scope.

Non-blocking (clean up in this or a follow-up PR):
3. C8 (MEDIUM): Audit sibling b.exp2() sites in build_unified_attention_2d_tiled and other builders — provide a per-site verdict.
4. E10 / F4 (MEDIUM): Remove relative perf verdict from PR body; add issue reference.
5. G8 / A6 / A8 (MEDIUM / LOW): Tool-source the no-spill claim; label the test as Python-only emit; add a check_byte_identity.py waiver note.


Token usage (Claude-Sonnet-4.6 via AMD LLM gateway): input 300 · output 67515 · cache 14072491 · total 14140306 · est. $7.128069900000002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant