Skip to content

[BMG] sparse mul hangs > 10 min for complex128/float64 (sub-issue of #4947) #5928

Closed

Description

@ZhaoqiongZ

Sub-issue of #4947. These cases hang past the 10-minute timeout on BMG (B60) and take down the pytest-xdist worker. The hangs are dtype-specific: some float64 variants finish quickly while complex128 hangs.

Cases

# Case
1 test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseCSR_xpu_complex128
2 test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseCSR_xpu_float64
3 test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseCSC_xpu_complex128
4 test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseCSC_xpu_float64
5 test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseBSR_xpu_complex128
6 test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseBSC_xpu_complex128
7 test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseBSC_xpu_float64

Reproducer

cd pytorch/third_party/torch-xpu-ops/test/xpu
export PYTORCH_TEST_WITH_SLOW=1
ZE_AFFINITY_MASK=0 timeout 660 pytest -v <file>::<class>::<test>   # hangs > 10 min

Full logs and environment are in #4947.

Activity

  1. ZhaoqiongZ commented on Oct 29, 2026

    @ZhaoqiongZ
    ContributorAuthor
  2. torchxpubot commented on Oct 29, 2026

    @torchxpubot
    Contributor

    Automated fix session for this issue. Stages are appended below as they complete.

    Issue Triage
    Field Value
    Issue type batch-bug (skip-list)
    Reproduction missing no
    Scope unclear
    Dependencies (none)
    Handling agent-fixable

    Sub-items handled by this run (numbered as in the issue body):

    1. test_binary_operation_mul_SparseCSR_xpu_complex128 (TestSparseAnyXPU)
    2. test_binary_operation_mul_SparseCSR_xpu_float64
    3. test_binary_operation_mul_SparseCSC_xpu_complex128
    4. test_binary_operation_mul_SparseCSC_xpu_float64
    5. test_binary_operation_mul_SparseBSR_xpu_complex128
    6. test_binary_operation_mul_SparseBSC_xpu_complex128
    7. test_binary_operation_mul_SparseBSC_xpu_float64

    All seven are dtype/layout variants of the same parametrized test and all seven are
    already listed in test/xpu/skip_list_common.py, so this is handled as a
    homogeneous skip-list batch: sub-item 1 takes any fix and the remaining six are
    re-checked against it rather than fixed separately.

    Automated by issue-triage.

    Reproduce

    Checked against the latest XPU nightly wheel 2.16.0.dev20261029+xpu
    (torchvision 0.30.0.dev20261029, torchaudio 2.11.0.dev20261029) on this
    BMG runner -- Intel(R) Arc(TM) Pro B60 Graphics, 8 devices, driver
    1.17.39395+16 -- i.e. the same hardware class as the original report in
    #4947. torch-xpu-ops tree at 0eb9b32e6 (main).

    None of the seven cases hangs any more. Each finishes in about 7 s against a
    660 s cap; the original report had them killed at 660 s.

    # Test case Verdict Observed
    1 test_binary_operation_mul_SparseCSR_xpu_complex128 NOT_REPRODUCED 1 passed in 7.56s
    2 test_binary_operation_mul_SparseCSR_xpu_float64 NOT_REPRODUCED 1 passed in 7.59s
    3 test_binary_operation_mul_SparseCSC_xpu_complex128 NOT_REPRODUCED 1 passed in 7.32s
    4 test_binary_operation_mul_SparseCSC_xpu_float64 NOT_REPRODUCED 1 passed in 7.15s
    5 test_binary_operation_mul_SparseBSR_xpu_complex128 NOT_REPRODUCED 1 passed in 7.10s
    6 test_binary_operation_mul_SparseBSC_xpu_complex128 NOT_REPRODUCED 1 passed in 7.39s
    7 test_binary_operation_mul_SparseBSC_xpu_float64 NOT_REPRODUCED 1 passed in 7.25s

    A wider sweep in a single process with no ZE_AFFINITY_MASK pin also came back
    clean: all 130 test_binary_operation_mul_Sparse* variants of
    TestSparseAnyXPU passed in 32 s.

    One detour worth recording. test/xpu/test_sparse_xpu.py does not collect
    against current pytorch/pytorch main at all: its module-level
    @onlyCUDA-retarget block still references TestSparse.test_cuda_empty and
    TestSparse.test_same_gpu, which the device-agnostic refactor in
    pytorch/pytorch#198121 (2026-09-29) renamed and dropped, so the module raises
    AttributeError: type object 'TestSparse' has no attribute 'test_cuda_empty'
    before any test runs. That is a separate, pre-existing breakage in this file --
    unrelated to the hang -- and it is why the runs above used the last pytorch
    commit before that rename (32b144349df), where the test body of
    test_binary_operation is byte-identical to main's. As a cross-check that the
    result is not an artefact of that older tree, the same test body was also
    replayed standalone against the nightly wheel's own OpInfo machinery, with no
    pytorch source tree involved; all seven layout/dtype combinations passed in
    under 2 s.

    Automated by fix-reproduce.

    Batch fan-out results

    Base: torch-xpu-ops@0eb9b32e6 (main), reproduce base nightly
    2.16.0.dev20261029+xpu, BMG Intel(R) Arc(TM) Pro B60 Graphics.

    Sub-item Outcome Branch / Reason
    1. test_binary_operation_mul_SparseCSR_xpu_complex128 STALE_SKIP passes in 7.6 s; follow-up: drop skip entry
    2. test_binary_operation_mul_SparseCSR_xpu_float64 STALE_SKIP passes in 7.6 s; follow-up: drop skip entry
    3. test_binary_operation_mul_SparseCSC_xpu_complex128 STALE_SKIP passes in 7.3 s; follow-up: drop skip entry
    4. test_binary_operation_mul_SparseCSC_xpu_float64 STALE_SKIP passes in 7.2 s; follow-up: drop skip entry
    5. test_binary_operation_mul_SparseBSR_xpu_complex128 STALE_SKIP passes in 7.1 s; follow-up: drop skip entry
    6. test_binary_operation_mul_SparseBSC_xpu_complex128 STALE_SKIP passes in 7.4 s; follow-up: drop skip entry
    7. test_binary_operation_mul_SparseBSC_xpu_float64 STALE_SKIP passes in 7.3 s; follow-up: drop skip entry
    • STALE_SKIP: 7 sub-items -- every case now passes well inside the 660 s
      cap, so the skip entries added for this hang are obsolete. Nothing was
      auto-removed; removing a skip is its own change and wants its own verify
      plus PR.
    • FIXED / NEEDS_HUMAN / INVALID_ENTRY / UNVERIFIED: none.

    Follow-ups

    1. Drop the obsolete skips. In test/xpu/skip_list_common.py, the
      "test_sparse_xpu.py" tuple (lines 270-276 at 0eb9b32e6) holds exactly
      these seven test_binary_operation_mul_* entries; they can go. Leave the
      four neighbouring entries from the same comment block
      (test_index_select_*, test_to_sparse_*) alone -- those are the other
      sub-issues of [release/2.14] 20 UT cases hang (>10 min timeout) on BMG: sparse / linalg / stft / multi_head_attention #4947 and were not checked by this run.
    2. Unrelated, but blocking any run of this file:
      test/xpu/test_sparse_xpu.py no longer collects against pytorch/pytorch
      main, because its @onlyCUDA-retarget block references
      TestSparse.test_cuda_empty and TestSparse.test_same_gpu, both removed by
      pytorch/pytorch#198121. Worth its own issue if one is not open already --
      [release/2.15] test_sparse_xpu.py fail to collect on BMG #5620 covers the same symptom but on release/2.15 and
      Windows.

    Automated by issue-handler.

    Summary

    Outcome: SKIPPED(no_longer_reproduces)

    All seven cases are layout/dtype parametrizations of one test,
    TestSparseAny.test_binary_operation with op=mul, and none of them hangs any
    more: on this BMG B60 runner against nightly 2.16.0.dev20261029+xpu each one
    passes in roughly 7 s against the issue's own 660 s cap, and a wider sweep of
    all 130 test_binary_operation_mul_Sparse* variants passed in 32 s. The
    original report in #4947 was taken on torch 2.14.0.dev, so
    the hang looks to have been resolved somewhere between 2.14 and 2.16; no root
    cause was pursued and no code was changed, because there is no longer a failure
    to fix. What is left is a cleanup: the seven skip entries this hang earned in
    test/xpu/skip_list_common.py are now stale.

    • Branch: none -- nothing was implemented, so there is no fix branch.
    • Base: 0eb9b32e6d437edcda4588c16c2daee8934cd891
    • Changed files: none
    • Nothing was pushed, and there is no patch artifact for this run. The
      machine-readable outcome is in agent_space_xpu/batch_summary.json.

    Two caveats on the evidence. First, test/xpu/test_sparse_xpu.py cannot be
    collected against current pytorch main at all (see follow-up 2 above), so the
    seven node ids were run against the last pytorch commit before that rename,
    32b144349df, where the body of test_binary_operation is byte-identical to
    main's; the same test body was additionally replayed standalone against the
    nightly wheel's own OpInfo machinery with no pytorch source tree, and passed
    there too. Second, the original failure surfaced under pytest-xdist with
    eight workers, whereas these runs were single-process -- matching the
    per-case re-run that the issue itself specifies as the reproducer.

    Generated by fix job.

    Review

    Copy into a new comment, keep ONE verdict, add a note. Two verdicts in
    one comment are dropped as ambiguous.

    **strong-accepted** <!-- review: strong-accepted -->
    **weak-accepted** <!-- review: weak-accepted -->
    **weak-rejected** <!-- review: weak-rejected -->
    **strong-rejected** <!-- review: strong-rejected -->
    **issue-drop** <!-- review: issue-drop -->
    
    notes:
    

    On a batch run add item=<pytorch issue> to say which sub-item the
    verdict is about, in the bold text and in the marker -- the marker
    is invisible, so the bold line is all a reader sees. One comment per
    sub-item, since a bare verdict on a batch does not say which test it
    means and is dropped. run=<id> only when judging a run other than the
    newest, in both places too.

    A CI DISABLED sub-item, item= from the fan-out table:

    **strong-accepted item=197334** <!-- review: strong-accepted item=197334 -->
    notes: same TensorAssign overload as upstream CUDA, fp8 dispatch list matches
    

    Another sub-item of the same batch, judged on an earlier run:

    **weak-rejected run=35171979678 item=197335** <!-- review: weak-rejected run=35171979678 item=197335 -->
    notes: green only because the test is skipped, the kernel still lacks fp8
    

    An [xpu-alignment] issue that should not have been filed -- one issue
    per difference, so no item=:

    **issue-drop** <!-- review: issue-drop -->
    notes: accepted XPU/CUDA numerics difference, nothing to repair
    
  3. added
    agent:skippedAgent lifecycle: nothing to fix (not a bug, no reproducer, or no longer reproduces)
    and removed on Oct 29, 2026
  4. added
    module: sparseSparse tensor formats/ops, nested tensors
    dtype: complexcomplex64 / complex128 dtype
    functionalityFunctional defect: error/assert/hang/timeout (non-numeric)
    on Nov 9, 2026
  5. added theissue type on Nov 9, 2026
  6. daisyden commented on Nov 9, 2026

    @daisyden
    Contributor
    label-issue: #5928

    Root cause: inconclusive; hang with no traceback. Compressed mul (mul_sparse_csr -> mul_out_sparse_csr, aten/src/ATen/native/sparse/SparseCsrTensorMath.cpp:208-224,254-278) round-trips
    through COO (to_sparse, COO mul_out_sparse_xpu at src/ATen/native/sparse/xpu/SparseTensorMath.cpp:53, to_sparse_csr); the hanging step is not pinned.

    Analyzed case: issue as a whole (the 7 cases are in a markdown table, so no test_cases entry was parsed)

    axis value reason
    type Bug issue_type empty; body reports a hang past the 10-min timeout that takes down the xdist worker.
    test test: ut Existing test: ut label; reproducer runs pytest -v <file>::<class>::<test> under test/xpu.
    module module: sparse test_binary_operation_mul_Sparse{CSR,CSC,BSR,BSC}, compressed sparse mul path (SparseCsrTensorMath.cpp:254).
    priority High Hang (>10 min timeout); also 7 failing UT cases (>6).
    hw hw: BMG Existing hw: BMG label; title tag [BMG].
    dtype dtype: complex Hanging cases ..._xpu_complex128 (CSR/CSC/BSR/BSC).
    dtype dtype: float64 Hanging cases ..._xpu_float64 (CSR/CSC/BSC).
    symptom functionality Hang/timeout: a functional failure.

    Test cases (7):

    • test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseCSR_xpu_complex128
    • test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseCSR_xpu_float64
    • test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseCSC_xpu_complex128
    • test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseCSC_xpu_float64
    • test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseBSR_xpu_complex128
    • test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseBSC_xpu_complex128
    • test_sparse_xpu.py::TestSparseAnyXPU::test_binary_operation_mul_SparseBSC_xpu_float64

    Applied to this issue. Generated by a local label-issue run.

  7. xuhancn commented on Nov 11, 2026

    @xuhancn
    Contributor

    Re-verified on the latest nightly 2.16.0.dev20261110+xpu (pytorch df21fc2d) on B60 (ZE_AFFINITY_MASK=0, 660 s cap): all seven test_binary_operation_mul_*_{complex128,float64} cases pass in < 1 s each (7 passed in 2.43 s). NOT_REPRODUCED. Note: the test/xpu/test_sparse_xpu.py shim no longer collects against this nightly — upstream #193175 enabled XPU for TestSparseCSR/TestSparseAny in test/test_sparse.py, so the shim's dtypesIfXPU re-definitions now raise dtypes redefinition for xpu; the XPU variants run from upstream test_sparse.py directly.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:skippedAgent lifecycle: nothing to fix (not a bug, no reproducer, or no longer reproduces)dtype: complexcomplex64 / complex128 dtypedtype: float64fp64 / double dtypefunctionalityFunctional defect: error/assert/hang/timeout (non-numeric)hw: BMGBattlemagemodule: sparseSparse tensor formats/ops, nested tensorsskipped_bmgTemporarily skipped on BMGtest: utUnit-test failure surface

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions