Skip to content

feat(sdpa): additive bias on the SM90 dedicated D128 forward (engine 20541) - #2882

Open
Abhayrkhot wants to merge 6 commits into
NVIDIA:developfrom
Abhayrkhot:sm90-d128-bias
Open

Abhayrkhot wants to merge 6 commits into
NVIDIA:developfrom
Abhayrkhot:sm90-d128-bias

Conversation

@Abhayrkhot

@Abhayrkhot Abhayrkhot commented Nov 23, 2026 •

Copy link
Copy Markdown

Stacked on #2872. This branch is built on #2872's head (f8c9c25), so until #2872 merges the diff also shows its three commits. The changes in this PR are 7bd9e4b8, 82257870 and 738acd70. I'll rebase onto develop once #2872 lands.

Before submitting

  • I agree to license this contribution under the terms of LICENSE.txt.
  • I ran pre-commit run and committed any formatting changes.
  • New numerical APIs and kernel changes follow the determinism skill: add/run L0 forward/backward checks and update API support, with unsupported or unverified paths stated. Golden changes include a numerical reason and independent reference results (see coverage).
  • I reviewed the Hard Rules in the AGENTS.md for each directory this PR touches (see root AGENTS.md § Reviewing a PR) and my changes comply, or I explain the exception below.
  • I added GitHub labels: one cat-*, one or more area:* / op:*, and one orig-* (see label list).

I don't have triage rights here, so I couldn't add labels. Suggested: cat-feature, area:frost, area:global_attention, orig-external, mod-cutedsl, mod-frost.

Affected area

FE OSS kernels or CuTeDSL

Summary

Adds an additive bias to the dedicated SM90 D128 forward template (engine 20541, sdpa/fwd/kernels/sm90/d128_f16_multi_q). This is the follow-up to #2872, which added bias to the three-WG body (engine 20540). Builds on #2872 (stacked on its head, f8c9c25).

  • Scope: exact (128, 128), FP16/BF16 Q/K/V; dense, nonpaged, unsplit and unpacked; forward only. The bias is [1|B, 1|H_q, S_q, S_kv] in the Q/K/V dtype, with contiguous keys and 16-byte aligned outer pitches (the contract feat(sdpa): additive bias on the SM90 three-WG forward (engine 20540) #2872 introduced). Noncausal and causal, every D128 record (v1, overlap, persistent stride and paired walk), Stats in either log base, any scale sign.
  • FP32 bias stays on engine 20540. The template already uses 196,704 B of the 232,448 B a CTA can have, and a 128 x 128 FP32 tile is 65,536 B. The D128 row sets bias_io_dtype_only, and config_sm90.D128_NOT_SERVED names bias_fp32 (it replaces feat(sdpa): additive bias on the SM90 three-WG forward (engine 20540) #2872's bias entry), so the picker and the template refusal agree.
  • Kernel: WG0 loads each compute warpgroup's 64 x 128 bias tile per KV tile by TMA into that warpgroup's own SW128 slot (32 KiB for both slots), between the tile's K and V loads. Each compute thread loads its 32 bias words at the start of the tile's softmax and releases the slot through tile_dsl.consume.consume_then_arrive (Rule 11: the arrive's address depends on every loaded word), so WG0's refill overlaps the rest of that softmax and the next QK. The logit is scale * QK + bias in natural units, formed before masking, and the row max is subtracted before the base-2 conversion (Rule S17), as in feat(sdpa): additive bias on the SM90 three-WG forward (engine 20540) #2872. Each slot completes one phase per KV tile, so its parity is the K ring's stage index, carried across a persistent CTA's items.
  • Host: the D128 template compiles prepared_host.host_bias and appends bias to __call__, so it uses the same pointer ABI and the same Python dense frame as the three-WG body. A bias plan keeps the static persistent schedules: the claim counter binds through the native binder, which has no bias slots. check_support keeps it off and validate_params refuses the combination.
  • Capabilities: the D128 row admits a bias in the Q/K/V dtype; the D64 row still declines every bias.
  • Bias-free paths are unchanged: the normalized PTX of 12 bias-free D128 specializations (v1, overlap, persistent stride, paired walk, claim counter; causal in both alignments, LPT, LPT_L2, negative and zero scale, base-2 Stats) is identical to feat(sdpa): additive bias on the SM90 three-WG forward (engine 20540) #2872's head.
  • Docs: frost/support/sm90.md, the template README, the determinism status page and the coverage report are updated.

Why

With #2872 a biased (128, 128) graph runs on engine 20540's 64 x 64 plans, which trail the backend's bias engine at every measured shape (0.64-0.83x). The dedicated D128 template without a bias runs at about 2x the backend's bias path, so it is the body to put the bias on. harshithkantamneni confirmed on #378 that this was open.

Related issues

Related to #378, follows #2872. #2687 (device lengths in the same D128 kernel, on merge hold) touches the same file; whichever lands second will need a rebase, with no overlap in behavior.

API and compatibility impact

  • New: none at the API level. SdpaFwdDslSm90(sample_bias=...) now takes the D128 template for an exact (128, 128) bias in the Q/K/V dtype (as it does for a bias-free graph); pinning tile_m=tile_n=64 keeps engine 20540. An FP32 bias keeps engine 20540.
  • Plan order: unchanged. Biased graphs have no measured placement entries and the SM90 hand rule keeps D128 FROST plans behind the backend. Within FROST, automatic planning now proposes engine 20541's 128 x 128 plan first from D128_LEAD_MIN_SQ query rows, as for a bias-free graph. Moving 20541 ahead of the backend for biased graphs would be a placement change, which I left out of this PR.
  • Performance: measured on H200 SXM (132 SMs) with the same method as feat(sdpa): additive bias on the SM90 three-WG forward (engine 20540) #2872: kernel time from torch.profiler, a 256 MiB L2 scrub before each iteration, median of 30. The backend column is its heuristic choice with the FROST slots deselected. Every column comes from one job (d128_bias_bench.py; shapes fixed before the first run). Bias overhead is 20541 with a bias over 20541 without one. The bias column gives its broadcast form: shared (1,1), batch (B,1), head (1,H), full (B,H). The bias is in the Q/K/V dtype.
Shape Bias dtype 20541 ms Backend ms Backend / 20541 20540 / 20541 Bias overhead
B4 H16 S1k shared BF16 0.0663 0.1164 1.76 2.26 1.16
B4 H16 S1k shared FP16 0.0657 0.1172 1.78 2.29 1.13
B4 H16 S1k batch BF16 0.0666 0.1173 1.76 2.28 1.16
B4 H16 S1k batch FP16 0.0662 0.1185 1.79 2.31 1.14
B2 H16 S2k full BF16 0.1436 0.2449 1.71 2.48 1.33
B2 H16 S2k full FP16 0.1450 0.2450 1.69 2.46 1.31
B2 H32/KV8 S4k causal shared BF16 0.4769 0.8965 1.88 2.58 1.19
B2 H32/KV8 S4k causal shared FP16 0.4817 0.8826 1.83 2.54 1.17
B1 H16 S8k causal shared BF16 0.4834 0.9208 1.91 2.74 1.23
B1 H16 S8k causal shared FP16 0.4810 0.9221 1.92 2.74 1.19
B1 H16 S8k head BF16 1.0059 1.7449 1.74 2.69 1.34
B1 H16 S8k head FP16 1.0323 1.7539 1.70 2.63 1.34
B8 H16 Q512 KV4k batch BF16 0.2461 0.4190 1.70 2.67 1.20
B8 H16 Q512 KV4k batch FP16 0.2453 0.4202 1.71 2.66 1.17
B4 H16 S2k causal full BF16 0.1636 0.2803 1.71 2.34 1.32
B4 H16 S2k causal full FP16 0.1640 0.2813 1.72 2.33 1.30

20541 is 1.69 to 1.92 times as fast as the backend's bias engine at every measured shape, and 2.26 to 2.74 times as fast as 20540's 64 x 64 plans, which these graphs ran on before. Against the backend's output, the maximum relative error was 2.0e-3 to 3.5e-3 in BF16 and 2.2e-4 to 6.0e-4 in FP16, the same level as #2872. With an FP32 bias the same graphs keep running on 20540 at 0.61 to 0.86 times the backend's speed (same job), which is what a later FP32 path on this template would address.

Testing

Run on an NVIDIA H200 (cc 9.0, 132 SMs): driver 570.86.15 with the CUDA 13 forward compatibility libraries, PyTorch 2.15.0+cu132, cuDNN 9.28.1 (92801), CuTe DSL 4.8.1 (compiles with CUDA 13.4). Commands run from test/python:

python -m pytest -q sdpa/frost/test_sdpa_bias_sm90.py                                                      # 110 passed, 1 skipped
CUDNN_DETERMINISM_RECORD=<new dir> python -m pytest -m L0 -q sdpa/frost/test_sdpa_bias_sm90_determinism.py   # 16 passed
CUDNN_DETERMINISM_GOLDENS=<new dir> python -m pytest -m L0 -q sdpa/frost/test_sdpa_bias_sm90_determinism.py  # 16 passed, 0 skipped
python -m pytest -m L0 -q sdpa/frost/test_sdpa_bias_sm90_stress.py                                          # 5 passed
python -m pytest -q -m "L0 or L1" <the 13 SM90 forward files listed in the coverage report>                  # 1235 passed, 14 skipped, 0 failed
  • test_sdpa_bias_sm90.py (engine 20541 cases added beside 20540's): an FP64 reference with partial Q and KV tiles and a bias pitch wider than S_kv, covering:
    • FP16 and BF16, every broadcast form, unmasked and top-left causal;
    • every D128 record (v1, overlap one-tile, persistent stride, paired walk) on 256 items, so each persistent CTA crosses item boundaries;
    • scales -0.25, 0, 1e-38, 1e12 and 3e38; large finite logits; large negative finite masks (-1e9, dtype min); all -inf rows;
    • Stats off, natural-log and base-2;
    • rebind and CUDA Graph capture; the standalone API picking 20541, and pinning 64 x 64 to keep 20540;
    • the capability gates (IO-dtype served, FP32 and bad strides declined), the template refusals, and default discovery proposing 20541 first from D128_LEAD_MIN_SQ. The one skip is the paired walk on a dense graph (causal only).
  • Determinism: 4 new L0 cells (FP16/BF16, dense and causal) on the persistent record, each covering replay into fresh outputs, isolated, reordered and duplicated batches with changed neighbors, CUDA Graph replay, an FP64 reference and goldens (runtime key a6e0199439a0a182). The 12 cells of 20540 now pin its 64 x 64 tile (the adapter takes 20541 for these graphs otherwise); their committed goldens matched the new record byte for byte.
  • Warm stress on the bias slot refill (Rule 11): 0 wrong results in 3000 warm and 3000 poisoned launches for each of the persistent record (FP16, BF16; one CTA per SM, 19 refills per launch) and the one-tile record (BF16; 4.36 blocks per SM, 4 refills per launch). The control's unsafe twin failed 200 of 200.
  • Rendering: the D128 SASS probes now include four bias records: no spills, under the 240-register budget, and every bias-slot EMPTY arrive is computed from its thread's 32 loaded words through the kernel's last parameter (warm_stress.assert_release_dependence). A compile-only census also rendered 11 bias records with no local memory.
  • Bias-free identity: the normalized PTX of 12 bias-free D128 specializations is identical between feat(sdpa): additive bias on the SM90 three-WG forward (engine 20540) #2872's head (7e71bee) and this branch.

Not covered:

  • FP32 bias on engine 20541 (declined, see above).
  • Bottom-right causal with a bias is refused by the graph validator.
  • Only H200 was run (no H100 or GH200).
  • fern check was not run.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@YangXu1990uiuc

Copy link
Copy Markdown
Collaborator

Posted by Claude Code, an AI agent acting for @YangXu1990uiuc.

Thanks for the D128 bias path. Two notes from running this branch (head 4aba9257e) on H200, in case they help.

1. Automatic (A-mode) candidates for short-Q GQA over a long KV. Graph: b 4, H_q 16 / H_kv 4, S_q 32, S_kv 1024, unmasked, a BF16 bias of shape (1, 16, 32, 1024). For it, heuristics.recommend("A", facts, offered) returns no plan.

2. Placement. The PR leaves moving the bias plans ahead of the backend out of scope, so we measured that separately.

  • Setup: H200 against cuDNN 9.24.0.43. 640 train cells plus a 164-cell holdout at head pairs no train cell uses. Covers d128 and d256 with the bias in the Q/K/V dtype, every broadcast form, unmasked and top-left causal on squares, S_q 32-8192, BF16 and FP16, Stats on and off.
  • Timing: FROST's first plan was 20541 from S_q 65 at d128, and 20540 below that and at d256. It ran at 0.35-0.97 of the backend's time on every train cell. Holdout geomean per class was 0.58-0.69, worst 0.90.
  • Numerics: FROST's O stayed within 0.8% of the backend's (max |diff| / max |O|) on every cell.
  • FP32 bias at d128 (20540): geomean 0.95-1.21 against the backend, so it keeps the backend first.

Once this PR and #2872 merge, we plan a small follow-up that puts FROST first for that measured domain. Nothing is needed here.

@YangXu1990uiuc YangXu1990uiuc added area:frost area:global_attention cat-feature Requests for new functionality, APIs, examples, or behavior improvements. mod-cutedsl CuTeDSL kernels, generated kernels, examples, or related integration work. mod-frost orig-external Reported or requested by an external user, customer, or community contributor. labels Nov 23, 2026
@YangXu1990uiuc YangXu1990uiuc added this to the Frontend 1.34.0 milestone Nov 23, 2026
@YangXu1990uiuc

Copy link
Copy Markdown
Collaborator

Thanks for extending the SM90 D128 path with additive bias and for documenting the validation and unsupported cases. I have added this PR to our contribution tracking, including its dependency on #2872, and supplied the labels and milestone.

When you are ready for feedback, please click GitHub's Ready for review button to leave Draft. Our maintainer review bot skips Draft PRs and can pick this up once it is non-draft. A comment saying ready alone does not change Draft status. Review readiness does not require the PR to be ready to merge, and it is not an unconditional merge request; the dependency, review findings and final validation still need to be handled before landing.

If you are still working on it, keeping it in Draft is fine. Once you want merge assistance, please say ready, and we can help with the remaining integration and validation.

@Abhayrkhot

Copy link
Copy Markdown
Author

Thanks for running it. Fixed the A-mode gap in d43df75: on SM90, a bias graph's knob sets now drop the split and packed sets that the bias check refuses and always keep one unsplit, unpacked 20540 set. Your graph (b4, H_q 16 / H_kv 4, S_q 32, S_kv 1024) now gets that plan from A with an IO or FP32 bias. So do two neighbours that had the same gap, S_q 16 over S_kv 8192 and the D256 version of your shape. Bias-free lists are unchanged. test_sdpa_bias_sm90.py now covers your shape in both discovery tests.

Good to see the placement numbers. Thanks for taking that follow-up.

@Abhayrkhot
Abhayrkhot marked this pull request as ready for review November 24, 2026 00:09
@Anerudhan

Copy link
Copy Markdown
Collaborator

Source and host checks found no confirmed blocking issue so far. I’m requesting SDPA FROST CI for the current head, including the Hopper bias numerical, replay and refill tests. Local host checks passed; native Hopper execution remains unverified here.

Codex bot review — model gpt-6-astra.

@Anerudhan

Copy link
Copy Markdown
Collaborator

@cudnn-ci-bot run python/sdpa/frost

@cudnn-ci-bot

cudnn-ci-bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🏁 Pipeline finished

SHA: d43df75
Targets: python/sdpa/frost
Branch: cudnn-gh/pr-2882-d43df75
Pipeline: 84885992
Last updated: 2026-11-24 02:51 UTC

21 passed, 5 failed, 13 manual

manual

  • manual:python_samples - Manual
  • manual:python/sdpa/frost - ✅ Passed
  • manual:python/sdpa/misc - Manual
  • manual:python/linear_attention - Manual
  • manual:python/gemm/frost - Manual
  • manual:python/gemm/cutedsl - Manual
  • manual:python/gemm/misc - Manual
  • manual:python/conv - Manual
  • manual:python/norm - Manual
  • manual:python/misc - Manual
  • manual:pycudnn - Manual
  • manual:multi_gpu - Manual
  • manual:moe_ep - Manual
  • manual:backend - Manual

analysis

  • analysis:cudnn_clang_disable_exception - ✅ Passed
  • analysis:cudnn_v9_no_half_conversion - ✅ Passed
  • analysis:cudnn_clang - ✅ Passed
  • analysis:check-relative-includes - ✅ Passed
  • analysis:check-CUDNN_FRONTEND_SKIP_JSON_LIB - ✅ Passed
  • analysis:guardwords_scan - ✅ Passed
  • analysis:jax-import-guard - ✅ Passed
  • analysis:pytest-gpu - ✅ Passed
  • san:build - ✅ Passed

build

  • analysis:api_index - ✅ Passed
  • build:dev:linux:amd64 - ✅ Passed
  • build:rel:linux:amd64 - ✅ Passed
  • build:dev:linux:arm64 - ✅ Passed
  • build:rel:linux:arm64 - ✅ Passed
  • build:rel:win:amd64 - ✅ Passed

python/sdpa/frost

  • python/sdpa/frost:be-9.29i-cutedsl-4.8.0:sm80 - ✅ Passed
  • python/sdpa/frost:be-9.29i-cutedsl-4.8.0:sm90 - ❌ New Failure! (nightly passed)
  • python/sdpa/frost:be-9.29i-cutedsl-4.8.0:sm100 - ❌ Old Failure (nightly failed)
  • python/sdpa/frost:be-9.29i-cutedsl-4.8.0:sm103 - ❌ New Failure! (nightly passed)
  • python/sdpa/frost:be-9.29i-cutedsl-4.8.0:sm107 - ❌ Old Failure (nightly failed)
  • python/sdpa/frost:be-9.29i-cutedsl-4.8.0:sm120 - ❌ New Failure! (nightly passed)

sanitizer_tests

  • san:cpp_test:sm80 - ✅ Passed
  • san:cpp_test:sm90 - ✅ Passed
  • san:cpp_test:sm100 - ✅ Passed

triage

  • triage:ai - ✅ Passed

@Anerudhan Anerudhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex bot review · model: gpt-6-astra

Reviewed d43df7560afd against base 2b98a25ddd06.

Thank you for your contribution! No blocking issue found in the full current contribution, including the stacked #2872 changes. The short-query A-mode gap is resolved by retaining an unsplit, unpacked candidate. Local host checks and four offline SM90 code-generation checks passed. Native Hopper numerics, determinism and refill stress remain pending in the requested SDPA FROST CI; the H200 results in the description are author-reported. Keep the existing dependency and CI requirements before merging.

Validation: Reviewed bias admission and dtype/storage limits, standalone and graph binding, both kernel implementations, partial-tile copies, scale/mask/Stats handling, persistent bias-slot phases and release ordering. D64 and unsupported FP32/split/paged/THD/claim combinations remain gated. 1317 host checks passed across the new bias admission suite, D128 routing, forward heuristics and heuristic geometry. 61 GPU-dependent checks skipped on the local SM100 GPU; 3 cases were deselected. 630 graph-analyzer checks passed on the exact PR Python source. Four independent compile-only SM90a checks passed for serial, overlap, persistent-dense and paired-causal D128 BF16 bias variants. Every generated dependent bias release consumed all 32 loaded words through the final kernel parameter; disassembly showed no local-memory loads/stores and retained register redistribution. No Hopper kernels were executed locally. Reviewed FP64 numerical references, poisoned outputs, changed-input capture/rebinding, batch reorder/duplication checks and runtime-scoped goldens. Precheck A03a was rejected after confirming initialization uses one elected lane in warp 0.

Limitations: No independent native Hopper numerical, warm-stress, sanitizer or performance run was available locally. Requested CI is pending, not a passing result. No independent bias-free PTX identity comparison or verification of the author's speedups. Compile checks cover the stated BF16 D128 variants only.

Approved: no P0 or high-risk P1 found. Remaining findings stay with the owner; merge timing stays with the owner.

Comment thread python/cudnn/sdpa/fwd/api_dsl.py Resolved
@Anerudhan

Copy link
Copy Markdown
Collaborator

Current-head CI has finished. Native Hopper validation remains open: SM90 failed during dependency setup before tests. SM100/SM103 were denied container access before tests, and SM120 timed out with no established cause. SM80 passed. SM107 reported 17,382 passed and five failures in unchanged MXFP8 graph plan/fallback assertions outside the Hopper change.

This run does not validate the new Hopper bias path on hardware. The host and offline compilation checks in the review retain their stated scope. No failed job was retried.

Codex bot review — model gpt-6-astra.

@Anerudhan Anerudhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex bot review · model: gpt-6-astra

Reviewed 738acd70db3e against base 73ce9b1298cf.

Thank you for your contribution! No new finding in this follow-up. Since the earlier review, only regression tests changed: they now cover short-query and decode bias graphs whose mode-A candidates must remain unsplit and unpacked. The runtime and kernel code are unchanged. The branch merges cleanly with current develop; keep the existing dependency and native validation requirements before merging.

Validation: 19 exact-head discovery checks passed, including all nine new FP32/IO-bias shape cases. The clean current-develop merge passed 1,190 host checks; 61 Hopper-only cases skipped and three higher-level cases were deselected. Reused the prior source audit and four offline SM90 code-generation checks because the runtime/kernel source is unchanged. Rechecked the precheck barrier candidate: initialization is guarded by warp 0 and one elected lane, so it is not a finding. Approved the current head's unchanged lint, security and docs-validation workflows under the standing check-workflow rule, and verified GitHub queued each run.

Limitations: Native Hopper numerical, determinism, refill-stress and performance validation remains incomplete. Earlier pipeline 84885992 failed during dependency setup on SM90 and container access on SM100/SM103, before tests. No failed-job retry or duplicate GPU pipeline was requested for this test-only update. The retained H200 measurements are author evidence. Local host and offline compilation checks do not establish native Hopper correctness or speed.

Comment only: this PR already has an active approval; preserving existing approvals.

Serve [1|B, 1|H_q, S_q, S_kv] additive bias (FP32 or the Q/K/V dtype) on the
SM90 D512 body for dense, nonpaged, unsplit, unpacked graphs at D128/D256/D512
envelopes; FP32 bias is declined at D512, where its tile does not fit.

- Each WG1 warp stages its 16 bias rows in shared memory with cp.async before
  QK (swizzled 16-byte chunks, zero-filled past S_q and S_kv). The softmax forms
  scale * Q.K + bias before masking and subtracts the row anchor before the
  base-2 conversion (SDPA Rule S17).
- Bias plans bind through prepared_host.host_bias and the python dense frame.
- The D64 and dedicated D128 rows decline bias; the D128 template lists it in
  D128_NOT_SERVED, so a biased (128, 128) graph runs on engine 20540.
- The private SM90 policy row admits bias, so default discovery proposes 20540.
- The SM90 adapter now refuses kv_mask and score side outputs instead of
  dropping them.

Bias-free renderings are PTX-identical to develop.
…atus

Record the 12 H200 goldens for the engine 20540 bias determinism suite
(runtime key a6e0199439a0a182), add a warm stress test for the per-KV-tile
bias refill, and document the coverage and the new SM90 status row.
The SM90 bias leg runs unsplit and unpacked, and mismatch's SM90 bias
block refuses the split-KV and packed-GQA sets. A short-Q GQA graph over a
long KV (B1, H_q 32 / H_kv 4, S_q 1, S_kv 512, or B4, H_q 16 / H_kv 4,
S_q 32, S_kv 1024) got only split or packed sets from _knob_sets, so
heuristic mode A returned no plan for it with an IO or FP32 bias while
FALLBACK and explicit plans still offered one.

On SM90 with a bias, _knob_sets now drops the split and packed sets and
keeps one unsplit, unpacked set, so A offers the same 20540 plan as
FALLBACK for these graphs. Bias-free lists are unchanged. The discovery
test covers the short-Q shape, and a new mode-A test covers decode and
short-Q GQA at D128, D256 and D512 over KV lengths up to 32768, with FP32
and IO-dtype biases.
…20541)

The dedicated D128 template takes an additive [1|B, 1|H_q, S_q, S_kv] bias in
the Q/K/V dtype on dense, nonpaged, unsplit, unpacked graphs, so a biased exact
(128, 128) graph no longer has to run on engine 20540's 64 x 64 plans.

WG0 loads each compute warpgroup's 64 x 128 bias tile per KV tile by TMA into
that warpgroup's own SW128 slot, between the tile's K and V loads. Each compute
thread loads its 32 bias words at the start of the tile's softmax and releases
the slot through tile_dsl.consume (Rule 11). The logit is scale * QK + bias in
natural units, formed before masking, and the row max is subtracted before the
base-2 conversion (Rule S17). A slot's phase is the K ring's stage index.

An FP32 bias tile does not fit beside the template's storage: the D128 row sets
bias_io_dtype_only and D128_NOT_SERVED names bias_fp32, so an FP32 bias keeps
engine 20540. A bias plan keeps the static persistent schedules (the claim
counter binds through the native binder only). Bias-free specializations
compile to identical PTX.
Adds 4 L0 determinism cells for the D128 template's bias leg (FP16/BF16,
unmasked and top-left causal) with goldens under a6e0199439a0a182, and pins the
D512-body cells to their 64 x 64 tile so their committed goldens keep applying.
Adds warm stress on the per-KV-tile TMA refill of the bias slots for the
persistent and one-tile records, and records the coverage and support status.
The A-mode fix for SM90 bias graphs lives in the parent PR. With the D128
template serving IO-dtype biases, the short-Q GQA shape from the review
(B4, H_q 16 / H_kv 4, S_q 32, S_kv 1024) sits below D128_LEAD_MIN_SQ, so
default discovery keeps engine 20540's unsplit, unpacked plan alone.

@Anerudhan Anerudhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex bot review · model: gpt-6-astra

Reviewed 58d7acb3c3c8 against base bb786fe42a97.

Thank you for your contribution! No new finding in this rebase. The six contribution commits retain the previously reviewed runtime and test changes; only documentation insertion context changed. Rechecked compatibility with the newer base. The prior approval remains in place, with native Hopper validation still incomplete.

Validation: Current-head host admission, D128 routing, forward heuristic and geometry checks: 1,341 passed, 61 Hopper-only cases skipped and three cases deselected. Four offline SM90 code-generation checks passed against the current shared helper: serial, overlap, persistent and paired-causal D128 BF16 bias variants. Each dependent bias release still consumes all 32 loaded words through the final kernel parameter; disassembly shows no local-memory loads or stores. Confirmed the SM90 kernels, adapter, configuration and bias regression tests are byte-identical to the previously reviewed revision. Rechecked the precheck A03a candidate: barrier initialization remains under warp 0 and one elected lane. Approved the exact head's unchanged lint, security and docs-validation workflows under the standing rule and verified that GitHub queued or started each run.

Limitations: No native Hopper numerical, determinism, stress, sanitizer or performance validation was run here. Host and offline checks do not establish native GPU results. No new GPU pipeline was requested: the broad SDPA FROST target includes retained held tests, and the earlier runner/setup failures remain preserved. The rebase does not resolve those validation limits.

Comment only: this PR already has an active approval; preserving existing approvals.

This branch has not been deployed

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

Labels

area:frost area:global_attention cat-feature Requests for new functionality, APIs, examples, or behavior improvements. mod-cutedsl CuTeDSL kernels, generated kernels, examples, or related integration work. mod-frost orig-external Reported or requested by an external user, customer, or community contributor.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants