[PyT] Check FA3 backward compatibility during backend selection #3490
All Vouch review confidence checks passed
Residual risk 0.35 = Change Risk (0.59) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #3490"
general
weight: 0.35
yuweih205
Description
Related to #3481.
Check FA3 backward compatibility when selecting the attention backend for training:
Unequal-dimension backward support was added in flash-attention#1604. Builds before and after that change can both report package version
3.0.0b1and expose the same Python signature. The original unconditional unequal-dimension restriction was too broad for newer builds, while checking only V > 256 re-enabled the original backward crash on older builds.Type of change
Changes
torch.compile, and CUDA Graph capture.Validation
Validated on 2026-10-09 using 8 H200 GPUs (SM90), distributing cases among independent GPU workers. Both real FA3 installations report package version
3.0.0b1.| FA3 implementation / variant | Passed | Expected backward failures |
| --- | ---: | ---: |
|
v2.8.3/hopper, compatibility check enabled | 91 | 0 ||
75f90d60f348af768625b6ab6ce13e800c5bc48a(parent of #1604), compatibility check enabled | 91 | 0 || Same legacy build, remove only the compatibility check | 12 | 12 |
All 206 cases ran with no skips, collection errors, or unexpected outcomes. Each fixed variant includes:
torch.compile(..., backend="eager", fullgraph=True), and cold-cache CUDA Graph capture. These also check unchanged RNG state and cache reuse.bshd/sbhd, training/inference, dimensions 192/128, 64/128, 64/256, 64/264, 64/512, and 128/128. Outputs and Q/K/V gradients are compared with an independent FP32 attention reference using unchanged tolerances, then the selected backend is asserted. FA3 and UnfusedAttention are enabled for this comparison.Expected support is established independently through the public FA3 autograd interface with nonempty tensors. It is not inferred from the new empty-sequence probe. The legacy control reproduces native
out must have shapeerrors in all 12 unequal-dimension training cases; the corresponding 12 inference cases pass.A separate probe profile on the modern build recorded zero CUDA kernels, unchanged allocated CUDA storage, and unchanged RNG state. The compatibility check targets the native backward shape contract; this validation does not cover every custom FA3 build configuration.
Environment and source identity:
62750a2b75c802660e4894434dc55e839f322277with the same CUDA/PyTorch runtime. Native and interface sources were unchanged; the offline setup adjustment only avoids re-downloading the pinned submodule. The legacy build retained the tested SM90 forward/backward paths while disabling optional SM80, FP8, paged-KV, append-KV, local, and softcap paths.The focused tests can be run on an SM90 device with either FA3 implementation and the repository's attention-test dependencies:
Changed-file pre-commit,
L0_license, and the Python portion ofL0_pytorch_lintpassed. The full TE test suites were not run. These results cover numerical correctness, backend selection, and capability-query execution behavior; distributed communication and performance were not evaluated.Checklist