Skip to content

[ROCm] Deselect crashing FusedAttention bwd8 + add pytest-timeout (ROCM-25626)#798

Open
srinivamd wants to merge 1 commit into
rocm-jaxlib-v0.9.2from
fix-hang-deselect-bwd8-timeout-v0.9.2
Open

[ROCm] Deselect crashing FusedAttention bwd8 + add pytest-timeout (ROCM-25626)#798
srinivamd wants to merge 1 commit into
rocm-jaxlib-v0.9.2from
fix-hang-deselect-bwd8-timeout-v0.9.2

Conversation

@srinivamd

@srinivamd srinivamd commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Fixes the 9+ hour JAX UT hang on gfx942 (MI300X/MI308X) by:

  1. Deselecting the test that triggers an XLA compiler SEGFAULT
  2. Adding a per-test timeout safety net

Root Cause

test_fused_attention_bwd8 causes a SIGSEGV in the XLA Triton compiler (KernelReuseCache::GetWithStatus via ThunkEmitter::EmitTritonCustomCall) on gfx942. pytest-xdist replaces the crashed worker, but the replacement deadlocks during GPU runtime re-initialization (corrupted GPU state from the SEGFAULT). With no --timeout flag, the stuck replacement worker blocks the entire suite for 9h44m until the job-level 600-minute timeout fires.

Why bwd8 is not caught by existing in-test skips

v0.9.2 already has skipTest guards in gpu_ops_test.py lines 208-228 for bwd{1,2,7,9}, but bwd8 is not in the skip list. This variant maps to a different parameter tuple that was not included in the upstream skip PR (jax-ml/jax#34722).

Why v0.9.1 doesn't hang

On v0.9.1, bwd8 either doesn't hit the SEGFAULT codepath (different XLA/Triton version) or has been deselected (ROCm/jax#797).

Changes

ci/run_pytest_rocm.sh

  • Add --deselect=tests/pallas/gpu_ops_test.py::FusedAttentionTest::test_fused_attention_bwd8 to the single-accelerator pytest invocation (sgpu only — FusedAttentionTest is not multiaccelerator)
  • Add --timeout=1800 (30 min) to both sgpu and mgpu pytest invocations. This is a safety net: if any future test hangs, it will be killed after 30 minutes instead of wasting the full 10-hour job budget

build/test-requirements.txt

  • Add pytest-timeout dependency (required for the --timeout flag)

Evidence

What this does NOT fix

  • The underlying XLA Triton compiler SEGFAULT — that requires an upstream fix (openxla/xla#38972 may be relevant if not already in the XLA pin)
  • GPU isolation (ROCm/jax#792 — open, separate issue)
  • PGLE test deselect (ROCm/jax#790 — open, separate issue)

Test plan

  • Verify nightly CI on gfx942 completes in ~1 hour (currently 9+ hours / timeout)
  • Verify pytest-timeout installs correctly from test-requirements.txt
  • Verify other FusedAttentionTest variants still run (bwd{0-6,9} should pass; bwd{1,2,7,9} skipped by in-test guards)
  • Verify FusedAttentionInterpretTest::test_fused_attention_bwd8 still runs and passes (Interpret mode uses Python reference, no GPU kernel)

Tracked in: ROCM-25626
Related: ROCm/jax#797 (v0.9.1 LDS deselect)

test_fused_attention_bwd8 causes a SIGSEGV in the XLA Triton compiler
(KernelReuseCache::GetWithStatus via ThunkEmitter::EmitTritonCustomCall)
on gfx942. pytest-xdist replaces the crashed worker, but the replacement
deadlocks during GPU runtime re-initialization, blocking the entire test
suite for 9+ hours until the job-level timeout fires.

Changes:
1. Deselect test_fused_attention_bwd8 in ci/run_pytest_rocm.sh (sgpu only).
   This variant is NOT covered by the existing in-test skipTest guards,
   which skip bwd{1,2,7,9} but not bwd8.
2. Add pytest-timeout to build/test-requirements.txt and pass
   --timeout=1800 (30 min) to both sgpu and mgpu pytest invocations.
   This is a safety net: if any future test hangs, it will be killed
   after 30 minutes instead of wasting the full 10-hour job budget.

Tracked in: ROCM-25626
Upstream: openxla/xla#38972, jax-ml#34722
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant