pytorch - ✅(Solved) Fix AArch64 Unit Test Failure - test/test_jit.py TestScript.test_conv_error [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#177255Fetched 2026-04-08 00:42:39
View on GitHub
Comments
0
Participants
1
Timeline
39
Reactions
0
Participants
Timeline (top)
referenced ×15mentioned ×10subscribed ×10labeled ×3

Error Message

Traceback (most recent call last): File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/test_jit.py", line 15805, in test_conv_error fn(torch.ones(2, 2), torch.ones(4, 4)) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 946, in prof_func_call return prof_callable(func_call, *args, **kwargs) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 938, in prof_callable return callable(*args, kwargs) RuntimeError: The following operation failed in the TorchScript interpreter. Traceback of TorchScript (most recent call last): File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/test_jit.py", line 15802, in fn @torch.jit.script def fn(x, y): return F.conv2d(x, y) ~~~~~~~~ <--- HERE RuntimeError: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 2] Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 2] Exception raised from batchify at /builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/aten/src/ATen/native/Convolution.cpp:821 (most recent call first): frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0xc8 (0xffff9eb36778 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libc10.so) frame #1: c10::detail::torchCheckFail(char const, char const, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0xc4 (0xffff9ead9b6c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libc10.so) frame #2: <unknown function> + 0x13c8430 (0xffff9fbc8430 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so) frame #3: at::native::conv2d_symint(at::Tensor const&, at::Tensor const&, std::optionalat::Tensor const&, c10::ArrayRefc10::SymInt, c10::ArrayRefc10::SymInt, c10::ArrayRefc10::SymInt, c10::SymInt) + 0xa4 (0xffff9fbca6a4 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so) frame #4: <unknown function> + 0x2c9ebb4 (0xffffa149ebb4 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so) frame #5: <unknown function> + 0x63b7e8c (0xffffa4bb7e8c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so) frame #6: <unknown function> + 0x5f9154c (0xffffa479154c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so) frame #7: torch::jit::InterpreterState::run(std::vector<c10::IValue, std::allocatorc10::IValue >&) + 0x48 (0xffffa47950e8 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so) frame #8: <unknown function> + 0x5f74364 (0xffffa4774364 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so) frame #9: <unknown function> + 0xdef04c (0xffffa9fbf04c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so) frame #10: <unknown function> + 0xeebc0c (0xffffaa0bbc0c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so) frame #11: <unknown function> + 0xeec284 (0xffffaa0bc284 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so) frame #12: <unknown function> + 0x5c7104 (0xffffa9797104 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so) frame #13: <unknown function> + 0x22416c (0xaaaabf1c416c in /opt/conda/envs/py_3.10/bin/python) frame #14: _PyObject_Call + 0x68 (0xaaaabf0149f0 in /opt/conda/envs/py_3.10/bin/python) frame #15: _PyObject_Call + 0x68 (0xaaaabf0149f0 in /opt/conda/envs/py_3.10/bin/python) frame #16: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python) frame #17: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #18: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python) frame #19: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #20: _PyObject_FastCallDictTstate + 0x74 (0xaaaabf014eb4 in /opt/conda/envs/py_3.10/bin/python) frame #21: _PyObject_Call_Prepend + 0x140 (0xaaaabf015240 in /opt/conda/envs/py_3.10/bin/python) frame #22: <unknown function> + 0xc78fc (0xaaaabf0678fc in /opt/conda/envs/py_3.10/bin/python) frame #23: _PyObject_MakeTpCall + 0xa0 (0xaaaabf014cc0 in /opt/conda/envs/py_3.10/bin/python) frame #24: _PyEval_EvalFrameDefault + 0x5534 (0xaaaabf0b81c0 in /opt/conda/envs/py_3.10/bin/python) frame #25: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #26: <unknown function> + 0x20aea8 (0xaaaabf1aaea8 in /opt/conda/envs/py_3.10/bin/python) frame #27: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python) frame #28: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #29: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python) frame #30: _PyEval_EvalFrameDefault + 0x54e0 (0xaaaabf0b816c in /opt/conda/envs/py_3.10/bin/python) frame #31: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #32: _PyEval_EvalFrameDefault + 0x5968 (0xaaaabf0b85f4 in /opt/conda/envs/py_3.10/bin/python) frame #33: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #34: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python) frame #35: _PyEval_EvalFrameDefault + 0x52d0 (0xaaaabf0b7f5c in /opt/conda/envs/py_3.10/bin/python) frame #36: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #37: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python) frame #38: _PyEval_EvalFrameDefault + 0x52d0 (0xaaaabf0b7f5c in /opt/conda/envs/py_3.10/bin/python) frame #39: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #40: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python) frame #41: PyVectorcall_Call + 0xe8 (0xaaaabf0148b4 in /opt/conda/envs/py_3.10/bin/python) frame #42: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python) frame #43: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #44: _PyObject_FastCallDictTstate + 0x144 (0xaaaabf014f84 in /opt/conda/envs/py_3.10/bin/python) frame #45: _PyObject_Call_Prepend + 0x140 (0xaaaabf015240 in /opt/conda/envs/py_3.10/bin/python) frame #46: <unknown function> + 0xc78fc (0xaaaabf0678fc in /opt/conda/envs/py_3.10/bin/python) frame #47: _PyObject_MakeTpCall + 0xa0 (0xaaaabf014cc0 in /opt/conda/envs/py_3.10/bin/python) frame #48: _PyEval_EvalFrameDefault + 0x6864 (0xaaaabf0b94f0 in /opt/conda/envs/py_3.10/bin/python) frame #49: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #50: _PyEval_EvalFrameDefault + 0x5968 (0xaaaabf0b85f4 in /opt/conda/envs/py_3.10/bin/python) frame #51: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #52: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python) frame #53: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #54: _PyEval_EvalFrameDefault + 0x6bdc (0xaaaabf0b9868 in /opt/conda/envs/py_3.10/bin/python) frame #55: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #56: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python) frame #57: _PyEval_EvalFrameDefault + 0x6bdc (0xaaaabf0b9868 in /opt/conda/envs/py_3.10/bin/python) frame #58: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python) frame #59: _PyObject_FastCallDictTstate + 0x144 (0xaaaabf014f84 in /opt/conda/envs/py_3.10/bin/python) frame #60: _PyObject_Call_Prepend + 0x140 (0xaaaabf015240 in /opt/conda/envs/py_3.10/bin/python) frame #61: <unknown function> + 0xc78fc (0xaaaabf0678fc in /opt/conda/envs/py_3.10/bin/python) frame #62: _PyObject_Call + 0x68 (0xaaaabf0149f0 in /opt/conda/envs/py_3.10/bin/python)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/test_jit.py", line 15807, in test_conv_error self.assertFalse('frame' in str(e)) File "/opt/conda/envs/py_3.10/lib/python3.10/unittest/case.py", line 681, in assertFalse raise self.failureException(msg) AssertionError: True is not false

To execute this test, run the following from the base repo dir: python test/test_jit.py TestScript.test_conv_error

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 "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/test_jit.py", line 15805, in test_conv_error
    fn(torch.ones(2, 2), torch.ones(4, 4))
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 946, in prof_func_call
    return prof_callable(func_call, *args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 938, in prof_callable
    return callable(*args, **kwargs)
RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
  File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/test_jit.py", line 15802, in fn
        @torch.jit.script
        def fn(x, y):
            return F.conv2d(x, y)
                   ~~~~~~~~ <--- HERE
RuntimeError: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 2]
Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 2]
Exception raised from batchify at /builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/aten/src/ATen/native/Convolution.cpp:821 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0xc8 (0xffff9eb36778 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0xc4 (0xffff9ead9b6c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libc10.so)
frame #2: <unknown function> + 0x13c8430 (0xffff9fbc8430 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #3: at::native::conv2d_symint(at::Tensor const&, at::Tensor const&, std::optional<at::Tensor> const&, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::SymInt) + 0xa4 (0xffff9fbca6a4 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #4: <unknown function> + 0x2c9ebb4 (0xffffa149ebb4 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #5: <unknown function> + 0x63b7e8c (0xffffa4bb7e8c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #6: <unknown function> + 0x5f9154c (0xffffa479154c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #7: torch::jit::InterpreterState::run(std::vector<c10::IValue, std::allocator<c10::IValue> >&) + 0x48 (0xffffa47950e8 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #8: <unknown function> + 0x5f74364 (0xffffa4774364 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #9: <unknown function> + 0xdef04c (0xffffa9fbf04c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so)
frame #10: <unknown function> + 0xeebc0c (0xffffaa0bbc0c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so)
frame #11: <unknown function> + 0xeec284 (0xffffaa0bc284 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so)
frame #12: <unknown function> + 0x5c7104 (0xffffa9797104 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so)
frame #13: <unknown function> + 0x22416c (0xaaaabf1c416c in /opt/conda/envs/py_3.10/bin/python)
frame #14: _PyObject_Call + 0x68 (0xaaaabf0149f0 in /opt/conda/envs/py_3.10/bin/python)
frame #15: _PyObject_Call + 0x68 (0xaaaabf0149f0 in /opt/conda/envs/py_3.10/bin/python)
frame #16: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python)
frame #17: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #18: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python)
frame #19: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #20: _PyObject_FastCallDictTstate + 0x74 (0xaaaabf014eb4 in /opt/conda/envs/py_3.10/bin/python)
frame #21: _PyObject_Call_Prepend + 0x140 (0xaaaabf015240 in /opt/conda/envs/py_3.10/bin/python)
frame #22: <unknown function> + 0xc78fc (0xaaaabf0678fc in /opt/conda/envs/py_3.10/bin/python)
frame #23: _PyObject_MakeTpCall + 0xa0 (0xaaaabf014cc0 in /opt/conda/envs/py_3.10/bin/python)
frame #24: _PyEval_EvalFrameDefault + 0x5534 (0xaaaabf0b81c0 in /opt/conda/envs/py_3.10/bin/python)
frame #25: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #26: <unknown function> + 0x20aea8 (0xaaaabf1aaea8 in /opt/conda/envs/py_3.10/bin/python)
frame #27: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python)
frame #28: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #29: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python)
frame #30: _PyEval_EvalFrameDefault + 0x54e0 (0xaaaabf0b816c in /opt/conda/envs/py_3.10/bin/python)
frame #31: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #32: _PyEval_EvalFrameDefault + 0x5968 (0xaaaabf0b85f4 in /opt/conda/envs/py_3.10/bin/python)
frame #33: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #34: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python)
frame #35: _PyEval_EvalFrameDefault + 0x52d0 (0xaaaabf0b7f5c in /opt/conda/envs/py_3.10/bin/python)
frame #36: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #37: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python)
frame #38: _PyEval_EvalFrameDefault + 0x52d0 (0xaaaabf0b7f5c in /opt/conda/envs/py_3.10/bin/python)
frame #39: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #40: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python)
frame #41: PyVectorcall_Call + 0xe8 (0xaaaabf0148b4 in /opt/conda/envs/py_3.10/bin/python)
frame #42: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python)
frame #43: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #44: _PyObject_FastCallDictTstate + 0x144 (0xaaaabf014f84 in /opt/conda/envs/py_3.10/bin/python)
frame #45: _PyObject_Call_Prepend + 0x140 (0xaaaabf015240 in /opt/conda/envs/py_3.10/bin/python)
frame #46: <unknown function> + 0xc78fc (0xaaaabf0678fc in /opt/conda/envs/py_3.10/bin/python)
frame #47: _PyObject_MakeTpCall + 0xa0 (0xaaaabf014cc0 in /opt/conda/envs/py_3.10/bin/python)
frame #48: _PyEval_EvalFrameDefault + 0x6864 (0xaaaabf0b94f0 in /opt/conda/envs/py_3.10/bin/python)
frame #49: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #50: _PyEval_EvalFrameDefault + 0x5968 (0xaaaabf0b85f4 in /opt/conda/envs/py_3.10/bin/python)
frame #51: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #52: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python)
frame #53: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #54: _PyEval_EvalFrameDefault + 0x6bdc (0xaaaabf0b9868 in /opt/conda/envs/py_3.10/bin/python)
frame #55: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #56: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python)
frame #57: _PyEval_EvalFrameDefault + 0x6bdc (0xaaaabf0b9868 in /opt/conda/envs/py_3.10/bin/python)
frame #58: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #59: _PyObject_FastCallDictTstate + 0x144 (0xaaaabf014f84 in /opt/conda/envs/py_3.10/bin/python)
frame #60: _PyObject_Call_Prepend + 0x140 (0xaaaabf015240 in /opt/conda/envs/py_3.10/bin/python)
frame #61: <unknown function> + 0xc78fc (0xaaaabf0678fc in /opt/conda/envs/py_3.10/bin/python)
frame #62: _PyObject_Call + 0x68 (0xaaaabf0149f0 in /opt/conda/envs/py_3.10/bin/python)



During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/test_jit.py", line 15807, in test_conv_error
    self.assertFalse('frame' in str(e))
  File "/opt/conda/envs/py_3.10/lib/python3.10/unittest/case.py", line 681, in assertFalse
    raise self.failureException(msg)
AssertionError: True is not false

To execute this test, run the following from the base repo dir:
    python test/test_jit.py TestScript.test_conv_error
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

Test test/test_jit.py TestScript.test_conv_error

Stracktrace

Traceback (most recent call last):
  File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/test_jit.py", line 15805, in test_conv_error
    fn(torch.ones(2, 2), torch.ones(4, 4))
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 946, in prof_func_call
    return prof_callable(func_call, *args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 938, in prof_callable
    return callable(*args, **kwargs)
RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
  File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/test_jit.py", line 15802, in fn
        @torch.jit.script
        def fn(x, y):
            return F.conv2d(x, y)
                   ~~~~~~~~ <--- HERE
RuntimeError: Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 2]
Expected 3D (unbatched) or 4D (batched) input to conv2d, but got input of size: [2, 2]
Exception raised from batchify at /builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/aten/src/ATen/native/Convolution.cpp:821 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0xc8 (0xffff9eb36778 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0xc4 (0xffff9ead9b6c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libc10.so)
frame #2: <unknown function> + 0x13c8430 (0xffff9fbc8430 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #3: at::native::conv2d_symint(at::Tensor const&, at::Tensor const&, std::optional<at::Tensor> const&, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::ArrayRef<c10::SymInt>, c10::SymInt) + 0xa4 (0xffff9fbca6a4 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #4: <unknown function> + 0x2c9ebb4 (0xffffa149ebb4 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #5: <unknown function> + 0x63b7e8c (0xffffa4bb7e8c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #6: <unknown function> + 0x5f9154c (0xffffa479154c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #7: torch::jit::InterpreterState::run(std::vector<c10::IValue, std::allocator<c10::IValue> >&) + 0x48 (0xffffa47950e8 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #8: <unknown function> + 0x5f74364 (0xffffa4774364 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so)
frame #9: <unknown function> + 0xdef04c (0xffffa9fbf04c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so)
frame #10: <unknown function> + 0xeebc0c (0xffffaa0bbc0c in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so)
frame #11: <unknown function> + 0xeec284 (0xffffaa0bc284 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so)
frame #12: <unknown function> + 0x5c7104 (0xffffa9797104 in /opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/lib/libtorch_python.so)
frame #13: <unknown function> + 0x22416c (0xaaaabf1c416c in /opt/conda/envs/py_3.10/bin/python)
frame #14: _PyObject_Call + 0x68 (0xaaaabf0149f0 in /opt/conda/envs/py_3.10/bin/python)
frame #15: _PyObject_Call + 0x68 (0xaaaabf0149f0 in /opt/conda/envs/py_3.10/bin/python)
frame #16: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python)
frame #17: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #18: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python)
frame #19: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #20: _PyObject_FastCallDictTstate + 0x74 (0xaaaabf014eb4 in /opt/conda/envs/py_3.10/bin/python)
frame #21: _PyObject_Call_Prepend + 0x140 (0xaaaabf015240 in /opt/conda/envs/py_3.10/bin/python)
frame #22: <unknown function> + 0xc78fc (0xaaaabf0678fc in /opt/conda/envs/py_3.10/bin/python)
frame #23: _PyObject_MakeTpCall + 0xa0 (0xaaaabf014cc0 in /opt/conda/envs/py_3.10/bin/python)
frame #24: _PyEval_EvalFrameDefault + 0x5534 (0xaaaabf0b81c0 in /opt/conda/envs/py_3.10/bin/python)
frame #25: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #26: <unknown function> + 0x20aea8 (0xaaaabf1aaea8 in /opt/conda/envs/py_3.10/bin/python)
frame #27: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python)
frame #28: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #29: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python)
frame #30: _PyEval_EvalFrameDefault + 0x54e0 (0xaaaabf0b816c in /opt/conda/envs/py_3.10/bin/python)
frame #31: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #32: _PyEval_EvalFrameDefault + 0x5968 (0xaaaabf0b85f4 in /opt/conda/envs/py_3.10/bin/python)
frame #33: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #34: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python)
frame #35: _PyEval_EvalFrameDefault + 0x52d0 (0xaaaabf0b7f5c in /opt/conda/envs/py_3.10/bin/python)
frame #36: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #37: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python)
frame #38: _PyEval_EvalFrameDefault + 0x52d0 (0xaaaabf0b7f5c in /opt/conda/envs/py_3.10/bin/python)
frame #39: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #40: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python)
frame #41: PyVectorcall_Call + 0xe8 (0xaaaabf0148b4 in /opt/conda/envs/py_3.10/bin/python)
frame #42: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python)
frame #43: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #44: _PyObject_FastCallDictTstate + 0x144 (0xaaaabf014f84 in /opt/conda/envs/py_3.10/bin/python)
frame #45: _PyObject_Call_Prepend + 0x140 (0xaaaabf015240 in /opt/conda/envs/py_3.10/bin/python)
frame #46: <unknown function> + 0xc78fc (0xaaaabf0678fc in /opt/conda/envs/py_3.10/bin/python)
frame #47: _PyObject_MakeTpCall + 0xa0 (0xaaaabf014cc0 in /opt/conda/envs/py_3.10/bin/python)
frame #48: _PyEval_EvalFrameDefault + 0x6864 (0xaaaabf0b94f0 in /opt/conda/envs/py_3.10/bin/python)
frame #49: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #50: _PyEval_EvalFrameDefault + 0x5968 (0xaaaabf0b85f4 in /opt/conda/envs/py_3.10/bin/python)
frame #51: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #52: _PyEval_EvalFrameDefault + 0x3ac8 (0xaaaabf0b6754 in /opt/conda/envs/py_3.10/bin/python)
frame #53: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #54: _PyEval_EvalFrameDefault + 0x6bdc (0xaaaabf0b9868 in /opt/conda/envs/py_3.10/bin/python)
frame #55: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #56: <unknown function> + 0x20ae28 (0xaaaabf1aae28 in /opt/conda/envs/py_3.10/bin/python)
frame #57: _PyEval_EvalFrameDefault + 0x6bdc (0xaaaabf0b9868 in /opt/conda/envs/py_3.10/bin/python)
frame #58: <unknown function> + 0x11bb40 (0xaaaabf0bbb40 in /opt/conda/envs/py_3.10/bin/python)
frame #59: _PyObject_FastCallDictTstate + 0x144 (0xaaaabf014f84 in /opt/conda/envs/py_3.10/bin/python)
frame #60: _PyObject_Call_Prepend + 0x140 (0xaaaabf015240 in /opt/conda/envs/py_3.10/bin/python)
frame #61: <unknown function> + 0xc78fc (0xaaaabf0678fc in /opt/conda/envs/py_3.10/bin/python)
frame #62: _PyObject_Call + 0x68 (0xaaaabf0149f0 in /opt/conda/envs/py_3.10/bin/python)



During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builds/software-machine-learning-infra-frameworks-workspaces-robhar02/pytorch/test/test_jit.py", line 15807, in test_conv_error
    self.assertFalse('frame' in str(e))
  File "/opt/conda/envs/py_3.10/lib/python3.10/unittest/case.py", line 681, in assertFalse
    raise self.failureException(msg)
AssertionError: True is not false

To execute this test, run the following from the base repo dir:
    python test/test_jit.py TestScript.test_conv_error

Affects Neoverse-N1 and V1

Versions

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

cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel @snadampal @milpuz01 @aditew01 @nikhil-arm @fadara01 @nWEIdia

extent analysis

Fix Plan

The fix involves modifying the input to the conv2d function to have the correct number of dimensions.

  • Check the input dimensions: The input to conv2d should be 3D (unbatched) or 4D (batched).
  • Modify the input: Use torch.unsqueeze to add a dimension to the input if necessary.

Example code:

import torch
import torch.nn.functional as F

# Define the input
x = torch.ones(2, 2)
y = torch.ones(4, 4)

# Add a dimension to the input if necessary
x = torch.unsqueeze(x, 0)  # batch dimension
y = torch.unsqueeze(y, 0)  # batch dimension

# Define the function with the correct input
@torch.jit.script
def fn(x, y):
    return F.conv2d(x, y)

# Call the function
result = fn(x, y)

Verification

To verify the fix, run the test again:

python test/test_jit.py TestScript.test_conv_error

The test should pass without any errors.

Extra Tips

  • Always check the input dimensions before calling a function like conv2d.
  • Use torch.unsqueeze to add dimensions to the input if necessary.
  • Make sure to test the function with different input sizes to ensure it works correctly in all cases.

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 - test/test_jit.py TestScript.test_conv_error [1 pull requests, 1 participants]