pytorch - ✅(Solved) Fix AArch64 Unit Test Failure - TestOperatorsCPU.test_jvp_triangular_solve_cpu_float32 [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#177251Fetched 2026-04-08 00:42:46
View on GitHub
Comments
0
Participants
1
Timeline
81
Reactions
0
Participants
Timeline (top)
mentioned ×30subscribed ×30referenced ×15labeled ×5

Error Message

Traceback (most recent call last): File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_device_type.py", line 1165, in test_wrapper return test(*args, **kwargs) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_cuda.py", line 335, in wrapped return f(*args, **kwargs) File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/functorch/test_ops.py", line 685, in test_jvp self.jvp_opinfo_test( File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/functorch/test_ops.py", line 760, in jvp_opinfo_test self.assertEqual(noncontig_tangent_outs, expected_tangent_outs) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 4365, in assertEqual raise error_metas.pop()[0].to_error( # type: ignore[index] AssertionError: Tensor-likes are not close!

Mismatched elements: 1 / 60 (1.7%) Greatest absolute difference: 3.814697265625e-05 at index (1, 0, 2, 2) (up to 1e-05 allowed) Greatest relative difference: 1.8489261037757387e-06 at index (1, 0, 2, 2) (up to 1.3e-06 allowed)

Fix Action

Fixed

PR fix notes

PR #177584: Add AArch64 xfails for inductor, nn, jit, and linalg tests

Description (problem / solution / changelog)

Stack from ghstack (oldest at bottom):

  • -> #177584

This PR marks all known unit test failures for AArch64 as xfail or skip with a small code comment referencing the github issues. The test files affected are also added to the linux-aarch64 unit test suite.

Once this PR has been merged we should be able to run ALL unit tests on all AArch64 cpus without any reported failures ( this will be a follow up PR ).

Related PRs #177243, #177244, #177245, #177247, #177249, #177250, #177251, #177254, #177255, #177258, #177264, #170787, #146483, #177327

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo @fadara01 @aditew01 @nikhil-arm @milpuz01

Changed files

  • .ci/pytorch/test.sh (modified, +3/-0)
  • test/inductor/test_aot_inductor.py (modified, +7/-0)
  • test/inductor/test_cpu_repro.py (modified, +8/-0)
  • test/inductor/test_cpu_select_algorithm.py (modified, +8/-0)
  • test/inductor/test_fused_attention.py (modified, +14/-3)
  • test/inductor/test_torchinductor.py (modified, +5/-1)
  • test/inductor/test_torchinductor_opinfo.py (modified, +6/-2)
  • test/jit/test_freezing.py (modified, +4/-0)
  • test/nn/test_convolution.py (modified, +6/-0)
  • test/test_jit.py (modified, +4/-2)
  • test/test_jit_autocast.py (modified, +13/-1)
  • test/test_nn.py (modified, +4/-1)
  • torch/testing/_internal/common_methods_invocations.py (modified, +11/-0)
  • torch/testing/_internal/opinfo/definitions/linalg.py (modified, +21/-0)

Code Example

Traceback (most recent call last):
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_device_type.py", line 1165, in test_wrapper
    return test(*args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_cuda.py", line 335, in wrapped
    return f(*args, **kwargs)
  File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/functorch/test_ops.py", line 685, in test_jvp
    self.jvp_opinfo_test(
  File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/functorch/test_ops.py", line 760, in jvp_opinfo_test
    self.assertEqual(noncontig_tangent_outs, expected_tangent_outs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 4365, in assertEqual
    raise error_metas.pop()[0].to_error(  # type: ignore[index]
AssertionError: Tensor-likes are not close!

Mismatched elements: 1 / 60 (1.7%)
Greatest absolute difference: 3.814697265625e-05 at index (1, 0, 2, 2) (up to 1e-05 allowed)
Greatest relative difference: 1.8489261037757387e-06 at index (1, 0, 2, 2) (up to 1.3e-06 allowed)
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

Test

est/functorch/test_ops.py TestOperatorsCPU.test_jvp_triangular_solve_cpu_float32

Stacktrace

Traceback (most recent call last):
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_device_type.py", line 1165, in test_wrapper
    return test(*args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_cuda.py", line 335, in wrapped
    return f(*args, **kwargs)
  File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/functorch/test_ops.py", line 685, in test_jvp
    self.jvp_opinfo_test(
  File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/functorch/test_ops.py", line 760, in jvp_opinfo_test
    self.assertEqual(noncontig_tangent_outs, expected_tangent_outs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 4365, in assertEqual
    raise error_metas.pop()[0].to_error(  # type: ignore[index]
AssertionError: Tensor-likes are not close!

Mismatched elements: 1 / 60 (1.7%)
Greatest absolute difference: 3.814697265625e-05 at index (1, 0, 2, 2) (up to 1e-05 allowed)
Greatest relative difference: 1.8489261037757387e-06 at index (1, 0, 2, 2) (up to 1.3e-06 allowed)

Affects Neoverse-V2 and V1

Versions

Commit - https://github.com/pytorch/pytorch/commit/08b6f48d871affbc7abe9277020aed882fdf110a

cc @ezyang @albanD @gqchen @nikitaved @soulitzer @Varal7 @bobrenjc93 @jianyuh @mruberry @walterddr @xwang233 @Lezcano @snadampal @milpuz01 @aditew01 @nikhil-arm @fadara01 @nWEIdia

extent analysis

Fix Plan

The fix involves updating the test_jvp_triangular_solve_cpu_float32 test case in test_ops.py to account for the numerical instability of floating-point operations.

  • Update the assertEqual statement to use assertAllClose instead, which allows for a small tolerance in the comparison:
self.assertAllClose(noncontig_tangent_outs, expected_tangent_outs, atol=1e-5, rtol=1e-6)
  • Alternatively, increase the tolerance values in the assertEqual statement to match the observed differences:
self.assertEqual(noncontig_tangent_outs, expected_tangent_outs, atol=1e-4, rtol=1e-5)

Verification

To verify the fix, re-run the test_jvp_triangular_solve_cpu_float32 test case and check that it passes without any assertions.

Extra Tips

  • When working with floating-point numbers, it's essential to consider the numerical instability and use appropriate comparison methods.
  • The assertAllClose method is a more robust way to compare tensor-like objects, as it allows for a small tolerance in the comparison.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - ✅(Solved) Fix AArch64 Unit Test Failure - TestOperatorsCPU.test_jvp_triangular_solve_cpu_float32 [1 pull requests, 1 participants]