fix: Unreachable backend check after earlier backend skip - #3368
Conversation
Greptile SummaryThis PR removes an unreachable fused-attention backend check from the JAX test configuration logic.
Confidence Score: 5/5The runtime cleanup appears safe to merge, but restoring focused regression coverage would prevent the unreachable check from being reintroduced unnoticed. The backend check was redundant behind the existing arbitrary-sequence-length backend gate, and no blocking behavioral defect remains; the sole new concern is the non-blocking loss of targeted regression coverage. Files Needing Attention: tests/jax/test_fused_attn.py Important Files Changed
|
cyanguwa
left a comment
There was a problem hiding this comment.
This is a no-brainer. Thanks.
|
script closed on accident |
1 similar comment
|
script closed on accident |
|
@andrewwhitecdw Please sign your commits. |
Root cause: FusedAttnRunner._check_configs skipped with 'Unsupported
inputs combination or device compute capability.' unless the backend was
NVTE_F16_arbitrary_seqlen. The later elif re-testing
self.backend != NVTE_F16_arbitrary_seqlen could therefore never be
reached, so its skip message ('B1SS, BHSS and 11SS bias shapes are only
supported for the F16_arbitrary_seqlen backend') was dead code.
Fix: drop the dead elif arm. The padding-mask skip in the sibling if arm
is retained. A regression test locks the remaining behavior: a
non-1HSS post-scale-bias config (BiasShape._B1SS) that passes
_check_configs selects NVTE_F16_arbitrary_seqlen, proving the removal is
behaviorally invisible and the earlier guard is the sole gate.
Testing: not run locally - the JAX test stack (jax,
transformer_engine_jax) is not installed on this machine. The suite runs
in NVIDIA TransformerEngine CI. Contribution: tests/jax tests target
real GPU/cuDNN fused-attention kernels and skip otherwise; the new test
will follow that path via CI.
Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
e44fb33 to
98432f3
Compare
Signed-off-by: Przemyslaw Tredak <ptrendx@gmail.com>
This PR removes an unreachable backend skip from the JAX fused-attention test config checks and adds a regression test.
Root cause
In
FusedAttnRunner._check_configs(tests/jax/test_fused_attn.py), the backend is selected viaFusedAttnHelperand any backend other thanNVTE_Fused_Attn_Backend.NVTE_F16_arbitrary_seqlenis skipped immediately after selection ("Unsupported inputs combination or device compute capability."). Inside the subsequent non-1HSS post-scale-bias block, theelifre-testingself.backend != NVTE_Fused_Attn_Backend.NVTE_F16_arbitrary_seqlencould therefore never be true, making its skip message dead code.Changes
tests/jax/test_fused_attn.py: removed the unreachableelifarm; the sibling padding-mask skip is retained unchanged.tests/jax/test_fused_attn.py: addedtest_post_scale_non_1hss_bias_shapes_do_not_hit_unreachable_backend_skip, which builds a non-1HSS post-scale-bias config (BiasShape._B1SS,NO_MASK, BSHD layout) whose backend isNVTE_F16_arbitrary_seqlen, calls_check_configs()without hitting a skip, and asserts the selected backend.Behavior
Behavior on real runs is unchanged: configurations that previously passed still pass, no configuration ever reached the removed arm, and the padding-mask restriction for non-1HSS post-scale bias shapes is preserved.
Testing
Not run locally — the JAX test stack (
jax,transformer_engine_jax) is not installed on this machine, so the JAX suite could not be executed here; CI runs it. The added test follows the file's existing pattern of targeting real GPU/cuDNN fused-attention kernels (such tests skip themselves when the hardware/software backend is unavailable).Branch
Recreated as a single signed-off commit on current
main(DCO) in response to the review request.