pytorch - ✅(Solved) Fix CPU AOT Inductor Regression from PT2.10 to PT2.11 [1 pull requests, 1 comments, 2 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#178417Fetched 2026-04-08 01:30:31
View on GitHub
Comments
1
Participants
2
Timeline
44
Reactions
0
Author
Participants
Assignees
Timeline (top)
mentioned ×17subscribed ×17labeled ×6assigned ×1

Error Message

---------------------------- Captured stderr setup ----------------------------- /usr/lib/python3.12/copyreg.py:99: FutureWarning: isinstance(treespec, LeafSpec) is deprecated, use isinstance(treespec, TreeSpec) and treespec.is_leaf() instead. return cls.new(cls, *args) W0325 19:20:00.685000 2065 torch/_inductor/ir.py:8256] aten._linalg_det.default is missing a c-shim implementation, using proxy executor as fallback Traceback (most recent call last): File "/opt/venv/bin/nequip-compile", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/venv/lib/python3.12/site-packages/nequip/scripts/compile.py", line 318, in main _ = aot_export_model( ^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/nequip/utils/aot.py", line 81, in aot_export_model out_path = torch._inductor.aoti_compile_and_package( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/init.py", line 151, in aoti_compile_and_package return aot_inductor_minifier_wrapper( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/debug.py", line 1334, in aot_inductor_minifier_wrapper raise e File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/debug.py", line 1304, in aot_inductor_minifier_wrapper return func( ^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/init.py", line 194, in _aoti_compile_and_package_inner aoti_files = aot_compile(gm, args, kwargs, options=inductor_configs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/init.py", line 310, in aot_compile return compile_fx_aot( ^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2048, in compile_fx_aot compiled_artifacts = compile_fx( ^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2527, in compile_fx return compile_fx( ^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2566, in compile_fx return _maybe_wrap_and_compile_fx_main( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2655, in _maybe_wrap_and_compile_fx_main return _compile_fx_main( ^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2838, in compile_fx_main return inference_compiler(unlifted_gm, example_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_functorch/_aot_autograd/schemas.py", line 1394, in call output_code = self.compiler_fn(gm, example_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2719, in fw_compiler_base return compile_fx_forward( ^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2390, in compile_fx_forward return inner_compile( ^^^^^^^^^^^^^^ File "/usr/lib/python3.12/contextlib.py", line 81, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 826, in compile_fx_inner return wrap_compiler_debug(_compile_fx_inner, compiler_name="inductor")( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_dynamo/repro/after_aot.py", line 273, in debug_wrapper inner_compiled_fn = compiler_fn(gm, example_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1026, in _compile_fx_inner raise InductorError(e, currentframe()).with_traceback( File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1022, in _compile_fx_inner mb_compiled_graph = fx_codegen_and_compile( ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1798, in fx_codegen_and_compile return scheme.codegen_and_compile(gm, example_inputs, inputs_to_check, graph_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1552, in codegen_and_compile compiled_fn = AotCodeCompiler.compile( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/codecache.py", line 2390, in compile kernel_builder.build() File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 2146, in build run_compile_cmd(build_cmd, cwd=_build_tmp_dir) File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 638, in run_compile_cmd _run_compile_cmd(cmd_line, cwd) File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 633, in _run_compile_cmd raise exc.CppCompileError(cmd, output) from e torch._inductor.exc.InductorError: CppCompileError: C++ compile error

Command: g++ /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp -D TORCH_INDUCTOR_CPP_WRAPPER -D STANDALONE_TORCH_HEADER -D C10_USING_CUSTOM_GENERATED_MACROS -D CPU_CAPABILITY_AVX2 -O3 -DNDEBUG -fno-trapping-math -funsafe-math-optimizations -ffinite-math-only -fno-signed-zeros -fno-math-errno -fno-finite-math-only -fno-unsafe-math-optimizations -ffp-contract=off -fexcess-precision=fast -fno-tree-loop-vectorize -march=native -fPIC -Wall -std=c++17 -Wno-unused-variable -Wno-unknown-pragmas -pedantic -fopenmp -include /tmp/torchinductor_root/precompiled_headers/c3kzjqu7cfsfcdtnyh5in7emcyr2qx2wpaxaqdsjtsjewokmfiqq.h -I/usr/include/python3.12 -I/opt/venv/lib/python3.12/site-packages/torch/include -I/opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/api/include -mavx2 -mfma -mf16c -c -o /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.o

Output: In file included from /opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/cpp_prefix.h:34, from /tmp/torchinductor_root/precompiled_headers/c3kzjqu7cfsfcdtnyh5in7emcyr2qx2wpaxaqdsjtsjewokmfiqq.h:1: /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp: In lambda function: /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:2245:103: warning: ���~��� on an expression of type ���bool��� [-Wbool-operation] 2245 | AOTI_TORCH_CHECK(((0 <= tmp42) & (tmp42 < ks0)) | ~((tmp35).all_masked()), "index out of bounds: 0 <= tmp42 < ks0"); | ~~~~~~~~~~~~~~~~~~~^~~ /opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/aoti_torch/c/shim.h:643:9: note: in definition of macro ���AOTI_TORCH_CHECK��� 643 | if (!(cond)) {
| ^~~~ /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:2245:103: note: did you mean to use logical not (���!���)? 2245 | AOTI_TORCH_CHECK(((0 <= tmp42) & (tmp42 < ks0)) | ~((tmp35).all_masked()), "index out of bounds: 0 <= tmp42 < ks0"); | ~~~~~~~~~~~~~~~~~~~^~~ /opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/aoti_torch/c/shim.h:643:9: note: in definition of macro ���AOTI_TORCH_CHECK��� 643 | if (!(cond)) {
| ^~~~ /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp: In function ���void cpp_fused_add_clone_copy_full_full_like_mul_permute_slice_sub_view_23(const double*, const double*, const double*, const double*, const double*, const double*, const double*, double*, double*, double*, int64_t)���: /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3772:66: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&��� 3772 | auto tmp94 = decltype(tmp93)::blendv(tmp60, tmp93, tmp76.template cast<double,2>()); | ^~~~~ | | | double In file included from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_convert.h:5, from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_base.h:1531, from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec256/vec256.h:9, from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec.h:8, from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/functional_base.h:7, from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/functional.h:4, from /opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/cpp_prefix.h:45: /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note: initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]��� 137 | const VectorizedN<T, N>& a, | ~~~~~~~~~~~~~~~~~~~~~~~~~^ /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3798:68: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&��� 3798 | auto tmp103 = decltype(tmp102)::blendv(tmp60, tmp102, tmp97.template cast<double,2>()); | ^~~~~ | | | double /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note: initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]��� 137 | const VectorizedN<T, N>& a, | ~~~~~~~~~~~~~~~~~~~~~~~~~^ /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3911:74: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&��� 3911 | auto tmp38 = decltype(tmp37)::blendv(tmp13, tmp37, tmp20.template cast<double,2>()); | ^~~~~ | | | double /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note: initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]��� 137 | const VectorizedN<T, N>& a, | ~~~~~~~~~~~~~~~~~~~~~~~~~^ /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3939:74: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&��� 3939 | auto tmp50 = decltype(tmp49)::blendv(tmp13, tmp49, tmp44.template cast<double,2>()); | ^~~~~ | | | double /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note: initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]��� 137 | const VectorizedN<T, N>& a, | ~~~~~~~~~~~~~~~~~~~~~~~~~^ /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp: In function ���void cpp_fused_add_clone_copy_full_full_like_permute_slice_view_24(const double*, const double*, const double*, const double*, double*, int64_t)���: /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:4065:70: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&��� 4065 | auto tmp38 = decltype(tmp37)::blendv(tmp13, tmp37, tmp20.template cast<double,2>()); | ^~~~~ | | | double

PR fix notes

PR #178451: [Inductor][CPP] Fix masked vectorization for Inductor CPP backend

Description (problem / solution / changelog)

Fixes #173626

Fixes is_vec flag for masked vectorization.

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

Changed files

  • test/inductor/test_cpu_repro.py (modified, +46/-0)
  • torch/_inductor/codegen/cpp.py (modified, +2/-1)

Code Example

---------------------------- Captured stderr setup -----------------------------
/usr/lib/python3.12/copyreg.py:99: FutureWarning: `isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
  return cls.__new__(cls, *args)
W0325 19:20:00.685000 2065 torch/_inductor/ir.py:8256] aten._linalg_det.default is missing a c-shim implementation, using proxy executor as fallback
Traceback (most recent call last):
  File "/opt/venv/bin/nequip-compile", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/nequip/scripts/compile.py", line 318, in main
    _ = aot_export_model(
        ^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/nequip/utils/aot.py", line 81, in aot_export_model
    out_path = torch._inductor.aoti_compile_and_package(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/__init__.py", line 151, in aoti_compile_and_package
    return aot_inductor_minifier_wrapper(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/debug.py", line 1334, in aot_inductor_minifier_wrapper
    raise e
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/debug.py", line 1304, in aot_inductor_minifier_wrapper
    return func(
           ^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/__init__.py", line 194, in _aoti_compile_and_package_inner
    aoti_files = aot_compile(gm, args, kwargs, options=inductor_configs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/__init__.py", line 310, in aot_compile
    return compile_fx_aot(
           ^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2048, in compile_fx_aot
    compiled_artifacts = compile_fx(
                         ^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2527, in compile_fx
    return compile_fx(
           ^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2566, in compile_fx
    return _maybe_wrap_and_compile_fx_main(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2655, in _maybe_wrap_and_compile_fx_main
    return _compile_fx_main(
           ^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2838, in _compile_fx_main
    return inference_compiler(unlifted_gm, example_inputs_)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_functorch/_aot_autograd/schemas.py", line 1394, in __call__
    output_code = self.compiler_fn(gm, example_inputs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2719, in fw_compiler_base
    return compile_fx_forward(
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2390, in compile_fx_forward
    return inner_compile(
           ^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 826, in compile_fx_inner
    return wrap_compiler_debug(_compile_fx_inner, compiler_name="inductor")(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_dynamo/repro/after_aot.py", line 273, in debug_wrapper
    inner_compiled_fn = compiler_fn(gm, example_inputs)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1026, in _compile_fx_inner
    raise InductorError(e, currentframe()).with_traceback(
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1022, in _compile_fx_inner
    mb_compiled_graph = fx_codegen_and_compile(
                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1798, in fx_codegen_and_compile
    return scheme.codegen_and_compile(gm, example_inputs, inputs_to_check, graph_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1552, in codegen_and_compile
    compiled_fn = AotCodeCompiler.compile(
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/codecache.py", line 2390, in compile
    kernel_builder.build()
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 2146, in build
    run_compile_cmd(build_cmd, cwd=_build_tmp_dir)
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 638, in run_compile_cmd
    _run_compile_cmd(cmd_line, cwd)
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 633, in _run_compile_cmd
    raise exc.CppCompileError(cmd, output) from e
torch._inductor.exc.InductorError: CppCompileError: C++ compile error

Command:
g++ /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp -D TORCH_INDUCTOR_CPP_WRAPPER -D STANDALONE_TORCH_HEADER -D C10_USING_CUSTOM_GENERATED_MACROS -D CPU_CAPABILITY_AVX2 -O3 -DNDEBUG -fno-trapping-math -funsafe-math-optimizations -ffinite-math-only -fno-signed-zeros -fno-math-errno -fno-finite-math-only -fno-unsafe-math-optimizations -ffp-contract=off -fexcess-precision=fast -fno-tree-loop-vectorize -march=native -fPIC -Wall -std=c++17 -Wno-unused-variable -Wno-unknown-pragmas -pedantic -fopenmp -include /tmp/torchinductor_root/precompiled_headers/c3kzjqu7cfsfcdtnyh5in7emcyr2qx2wpaxaqdsjtsjewokmfiqq.h -I/usr/include/python3.12 -I/opt/venv/lib/python3.12/site-packages/torch/include -I/opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/api/include -mavx2 -mfma -mf16c -c -o /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.o

Output:
In file included from /opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/cpp_prefix.h:34,
                 from /tmp/torchinductor_root/precompiled_headers/c3kzjqu7cfsfcdtnyh5in7emcyr2qx2wpaxaqdsjtsjewokmfiqq.h:1:
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp: In lambda function:
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:2245:103: warning: ���~��� on an expression of type ���bool��� [-Wbool-operation]
 2245 |                                 AOTI_TORCH_CHECK(((0 <= tmp42) & (tmp42 < ks0)) | ~((tmp35).all_masked()), "index out of bounds: 0 <= tmp42 < ks0");
      |                                                                                    ~~~~~~~~~~~~~~~~~~~^~~
/opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/aoti_torch/c/shim.h:643:9: note: in definition of macro ���AOTI_TORCH_CHECK���
  643 |   if (!(cond)) {                                   \
      |         ^~~~
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:2245:103: note: did you mean to use logical not (���!���)?
 2245 |                                 AOTI_TORCH_CHECK(((0 <= tmp42) & (tmp42 < ks0)) | ~((tmp35).all_masked()), "index out of bounds: 0 <= tmp42 < ks0");
      |                                                                                    ~~~~~~~~~~~~~~~~~~~^~~
/opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/aoti_torch/c/shim.h:643:9: note: in definition of macro ���AOTI_TORCH_CHECK���
  643 |   if (!(cond)) {                                   \
      |         ^~~~
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp: In function ���void cpp_fused_add_clone_copy_full_full_like_mul_permute_slice_sub_view_23(const double*, const double*, const double*, const double*, const double*, const double*, const double*, double*, double*, double*, int64_t)���:
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3772:66: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&���
 3772 |                             auto tmp94 = decltype(tmp93)::blendv(tmp60, tmp93, tmp76.template cast<double,2>());
      |                                                                  ^~~~~
      |                                                                  |
      |                                                                  double
In file included from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_convert.h:5,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_base.h:1531,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec256/vec256.h:9,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec.h:8,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/functional_base.h:7,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/functional.h:4,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/cpp_prefix.h:45:
/opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note:   initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]���
  137 |       const VectorizedN<T, N>& a,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~^
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3798:68: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&���
 3798 |                             auto tmp103 = decltype(tmp102)::blendv(tmp60, tmp102, tmp97.template cast<double,2>());
      |                                                                    ^~~~~
      |                                                                    |
      |                                                                    double
/opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note:   initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]���
  137 |       const VectorizedN<T, N>& a,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~^
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3911:74: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&���
 3911 |                                     auto tmp38 = decltype(tmp37)::blendv(tmp13, tmp37, tmp20.template cast<double,2>());
      |                                                                          ^~~~~
      |                                                                          |
      |                                                                          double
/opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note:   initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]���
  137 |       const VectorizedN<T, N>& a,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~^
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3939:74: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&���
 3939 |                                     auto tmp50 = decltype(tmp49)::blendv(tmp13, tmp49, tmp44.template cast<double,2>());
      |                                                                          ^~~~~
      |                                                                          |
      |                                                                          double
/opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note:   initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]���
  137 |       const VectorizedN<T, N>& a,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~^
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp: In function ���void cpp_fused_add_clone_copy_full_full_like_permute_slice_view_24(const double*, const double*, const double*, const double*, double*, int64_t)���:
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:4065:70: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&���
 4065 |                                 auto tmp38 = decltype(tmp37)::blendv(tmp13, tmp37, tmp20.template cast<double,2>());
      |                                                                      ^~~~~
      |                                                                      |
      |                                                                      double
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

Unfortunately, it's hard for me to get a minimal reproducible example. But there our CI started failing going from PyTorch 2.10.0 to PyTorch 2.11.0, indicating a regression when doing AOT Inductor compilation on CPU with our models. Here is the CI run with full error trace: https://github.com/mir-group/nequip/actions/runs/23558161630/job/68590608405

At least it seems like a compilation error, which may make it easier to find a solution without trying to reproduce it with our models.

Error logs

The full error can be found in the CI link. Here's the initial part of the error:

---------------------------- Captured stderr setup -----------------------------
/usr/lib/python3.12/copyreg.py:99: FutureWarning: `isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
  return cls.__new__(cls, *args)
W0325 19:20:00.685000 2065 torch/_inductor/ir.py:8256] aten._linalg_det.default is missing a c-shim implementation, using proxy executor as fallback
Traceback (most recent call last):
  File "/opt/venv/bin/nequip-compile", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/nequip/scripts/compile.py", line 318, in main
    _ = aot_export_model(
        ^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/nequip/utils/aot.py", line 81, in aot_export_model
    out_path = torch._inductor.aoti_compile_and_package(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/__init__.py", line 151, in aoti_compile_and_package
    return aot_inductor_minifier_wrapper(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/debug.py", line 1334, in aot_inductor_minifier_wrapper
    raise e
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/debug.py", line 1304, in aot_inductor_minifier_wrapper
    return func(
           ^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/__init__.py", line 194, in _aoti_compile_and_package_inner
    aoti_files = aot_compile(gm, args, kwargs, options=inductor_configs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/__init__.py", line 310, in aot_compile
    return compile_fx_aot(
           ^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2048, in compile_fx_aot
    compiled_artifacts = compile_fx(
                         ^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2527, in compile_fx
    return compile_fx(
           ^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2566, in compile_fx
    return _maybe_wrap_and_compile_fx_main(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2655, in _maybe_wrap_and_compile_fx_main
    return _compile_fx_main(
           ^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2838, in _compile_fx_main
    return inference_compiler(unlifted_gm, example_inputs_)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_functorch/_aot_autograd/schemas.py", line 1394, in __call__
    output_code = self.compiler_fn(gm, example_inputs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2719, in fw_compiler_base
    return compile_fx_forward(
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 2390, in compile_fx_forward
    return inner_compile(
           ^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 826, in compile_fx_inner
    return wrap_compiler_debug(_compile_fx_inner, compiler_name="inductor")(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_dynamo/repro/after_aot.py", line 273, in debug_wrapper
    inner_compiled_fn = compiler_fn(gm, example_inputs)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1026, in _compile_fx_inner
    raise InductorError(e, currentframe()).with_traceback(
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1022, in _compile_fx_inner
    mb_compiled_graph = fx_codegen_and_compile(
                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1798, in fx_codegen_and_compile
    return scheme.codegen_and_compile(gm, example_inputs, inputs_to_check, graph_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1552, in codegen_and_compile
    compiled_fn = AotCodeCompiler.compile(
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/codecache.py", line 2390, in compile
    kernel_builder.build()
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 2146, in build
    run_compile_cmd(build_cmd, cwd=_build_tmp_dir)
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 638, in run_compile_cmd
    _run_compile_cmd(cmd_line, cwd)
  File "/opt/venv/lib/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 633, in _run_compile_cmd
    raise exc.CppCompileError(cmd, output) from e
torch._inductor.exc.InductorError: CppCompileError: C++ compile error

Command:
g++ /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp -D TORCH_INDUCTOR_CPP_WRAPPER -D STANDALONE_TORCH_HEADER -D C10_USING_CUSTOM_GENERATED_MACROS -D CPU_CAPABILITY_AVX2 -O3 -DNDEBUG -fno-trapping-math -funsafe-math-optimizations -ffinite-math-only -fno-signed-zeros -fno-math-errno -fno-finite-math-only -fno-unsafe-math-optimizations -ffp-contract=off -fexcess-precision=fast -fno-tree-loop-vectorize -march=native -fPIC -Wall -std=c++17 -Wno-unused-variable -Wno-unknown-pragmas -pedantic -fopenmp -include /tmp/torchinductor_root/precompiled_headers/c3kzjqu7cfsfcdtnyh5in7emcyr2qx2wpaxaqdsjtsjewokmfiqq.h -I/usr/include/python3.12 -I/opt/venv/lib/python3.12/site-packages/torch/include -I/opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/api/include -mavx2 -mfma -mf16c -c -o /tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.o

Output:
In file included from /opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/cpp_prefix.h:34,
                 from /tmp/torchinductor_root/precompiled_headers/c3kzjqu7cfsfcdtnyh5in7emcyr2qx2wpaxaqdsjtsjewokmfiqq.h:1:
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp: In lambda function:
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:2245:103: warning: ���~��� on an expression of type ���bool��� [-Wbool-operation]
 2245 |                                 AOTI_TORCH_CHECK(((0 <= tmp42) & (tmp42 < ks0)) | ~((tmp35).all_masked()), "index out of bounds: 0 <= tmp42 < ks0");
      |                                                                                    ~~~~~~~~~~~~~~~~~~~^~~
/opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/aoti_torch/c/shim.h:643:9: note: in definition of macro ���AOTI_TORCH_CHECK���
  643 |   if (!(cond)) {                                   \
      |         ^~~~
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:2245:103: note: did you mean to use logical not (���!���)?
 2245 |                                 AOTI_TORCH_CHECK(((0 <= tmp42) & (tmp42 < ks0)) | ~((tmp35).all_masked()), "index out of bounds: 0 <= tmp42 < ks0");
      |                                                                                    ~~~~~~~~~~~~~~~~~~~^~~
/opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/aoti_torch/c/shim.h:643:9: note: in definition of macro ���AOTI_TORCH_CHECK���
  643 |   if (!(cond)) {                                   \
      |         ^~~~
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp: In function ���void cpp_fused_add_clone_copy_full_full_like_mul_permute_slice_sub_view_23(const double*, const double*, const double*, const double*, const double*, const double*, const double*, double*, double*, double*, int64_t)���:
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3772:66: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&���
 3772 |                             auto tmp94 = decltype(tmp93)::blendv(tmp60, tmp93, tmp76.template cast<double,2>());
      |                                                                  ^~~~~
      |                                                                  |
      |                                                                  double
In file included from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_convert.h:5,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_base.h:1531,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec256/vec256.h:9,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec.h:8,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/functional_base.h:7,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/functional.h:4,
                 from /opt/venv/lib/python3.12/site-packages/torch/include/torch/csrc/inductor/cpp_prefix.h:45:
/opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note:   initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]���
  137 |       const VectorizedN<T, N>& a,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~^
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3798:68: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&���
 3798 |                             auto tmp103 = decltype(tmp102)::blendv(tmp60, tmp102, tmp97.template cast<double,2>());
      |                                                                    ^~~~~
      |                                                                    |
      |                                                                    double
/opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note:   initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]���
  137 |       const VectorizedN<T, N>& a,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~^
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3911:74: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&���
 3911 |                                     auto tmp38 = decltype(tmp37)::blendv(tmp13, tmp37, tmp20.template cast<double,2>());
      |                                                                          ^~~~~
      |                                                                          |
      |                                                                          double
/opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note:   initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]���
  137 |       const VectorizedN<T, N>& a,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~^
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:3939:74: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&���
 3939 |                                     auto tmp50 = decltype(tmp49)::blendv(tmp13, tmp49, tmp44.template cast<double,2>());
      |                                                                          ^~~~~
      |                                                                          |
      |                                                                          double
/opt/venv/lib/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:137:32: note:   initializing argument 1 of ���static at::vec::CPU_CAPABILITY::VectorizedN<T, N> at::vec::CPU_CAPABILITY::VectorizedN<T, N>::blendv(const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&, const at::vec::CPU_CAPABILITY::VectorizedN<T, N>&) [with T = double; int N = 2]���
  137 |       const VectorizedN<T, N>& a,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~^
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp: In function ���void cpp_fused_add_clone_copy_full_full_like_permute_slice_view_24(const double*, const double*, const double*, const double*, double*, int64_t)���:
/tmp/torchinductor_23558161630_1/chobr2kjknsikvsndfjz7qd4gl2p7xh3ynjtbr6bhby4kg7ijayu/cw2gjly67j6bmkx6nhnj4ypb4vexge6v32rbhd7zyv2d6kqpy7lr.kernel.cpp:4065:70: error: cannot convert ���double��� to ���const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>&���
 4065 |                                 auto tmp38 = decltype(tmp37)::blendv(tmp13, tmp37, tmp20.template cast<double,2>());
      |                                                                      ^~~~~
      |                                                                      |
      |                                                                      double

Versions

Just the usual Github CI runner with PyTorch 2.11.0.

cc @chauhang @penguinwu @avikchaudhuri @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4 @desertfire @yushangdi @benjaminglass1 @jataylo @iupaikov-amd

extent analysis

Fix Plan

The error message indicates a C++ compilation error when using PyTorch 2.11.0. The issue seems to be related to the blendv function, which is expecting a const at::vec::CPU_CAPABILITY::VectorizedN<double, 2>& but is receiving a double instead.

To fix this issue, we need to update the code to match the expected input type. Here are the steps:

  • Check the PyTorch version and update the code accordingly.
  • Update the blendv function calls to match the expected input type.

Example code changes:

# Before
auto tmp94 = decltype(tmp93)::blendv(tmp60, tmp93, tmp76.template cast<double,2>());

# After
auto tmp94 = decltype(tmp93)::blendv(at::vec::VectorizedN<double, 2>(tmp60), tmp93, tmp76.template cast<double,2>());

Note: The above code change is just an example and may need to be adjusted based on the actual code.

Verification

To verify that the fix worked, run the CI job again with the updated code. If the error is resolved, the CI job should pass.

Extra Tips

  • Make sure to test the code thoroughly after making any changes to ensure that the fix did not introduce any new issues.
  • If the issue persists, try updating PyTorch to the latest version or seeking help from the PyTorch community.
  • Consider adding additional error checking and handling to prevent similar issues in the future.

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 CPU AOT Inductor Regression from PT2.10 to PT2.11 [1 pull requests, 1 comments, 2 participants]