pytorch - 💡(How to fix) Fix InductorError when using torch.compile with Swin Transformer v2 on CPU [3 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#179135Fetched 2026-04-08 02:33:07
View on GitHub
Comments
3
Participants
2
Timeline
193
Reactions
0
Timeline (top)
mentioned ×90subscribed ×90labeled ×7commented ×3

torch.compile() fails with InductorError when running Swin Transformer v2 on CPU device (CUDA works).

I checked PyTorch 2.9 and below, it works. On 2.11 it fails.

Error Message

Error logs

InductorError Traceback (most recent call last) 462 warnings.warn( 1034 raise e.with_traceback(None) from e.cause # User compiler error 1052 except Exception as e: 403 # Break a reference cycle with the exception in self._exception InductorError: CppCompileError: C++ compile error /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:868:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:936:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:972:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:1073:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:1111:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:1183:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:1223:52: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2526:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2594:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2630:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2731:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2769:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2841:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2881:52: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type

Root Cause

torch.compile() fails with InductorError when running Swin Transformer v2 on CPU device (CUDA works).

I checked PyTorch 2.9 and below, it works. On 2.11 it fails.

Fix Action

Fix / Workaround

CPU: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 48 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 32 On-line CPU(s) list: 0-31 Vendor ID: AuthenticAMD Model name: AMD Ryzen 9 7950X3D 16-Core Processor CPU family: 25 Model: 97 Thread(s) per core: 2 Core(s) per socket: 16 Socket(s): 1 Stepping: 2 Frequency boost: enabled CPU(s) scaling MHz: 78% CPU max MHz: 5759.9639 CPU min MHz: 3000.0000 BogoMIPS: 8399.51 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif x2avic v_spec_ctrl avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid overflow_recov succor smca fsrm flush_l1d ibpb_exit_to_user Virtualization: AMD-V L1d cache: 512 KiB (16 instances) L1i cache: 512 KiB (16 instances) L2 cache: 16 MiB (16 instances) L3 cache: 128 MiB (2 instances) NUMA node(s): 1 NUMA node0 CPU(s): 0-31 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Mitigation; safe RET Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; STIBP always-on; PBRSB-eIBRS Not affected; BHI Not affected Vulnerability Srbds: Not affected Vulnerability Tsa: Vulnerable: Clear CPU buffers attempted, no microcode Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Mitigation; IBPB before exit to userspace

Code Example

from torchvision.models import swin_v2_t
import torch

model = swin_v2_t()
model = torch.compile(model)
model(torch.rand(1, 3, 224, 224))
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

Description

torch.compile() fails with InductorError when running Swin Transformer v2 on CPU device (CUDA works).

I checked PyTorch 2.9 and below, it works. On 2.11 it fails.

Reproduction Steps

from torchvision.models import swin_v2_t
import torch

model = swin_v2_t()
model = torch.compile(model)
model(torch.rand(1, 3, 224, 224))

Error logs


InductorError Traceback (most recent call last) Cell In[6], line 1 ----> 1 model(torch.rand(1, 3, 224, 224))

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_dynamo/eval_frame.py:472, in OptimizedModule.call(self, *args, **kwargs) 462 warnings.warn( 463 "Using torch.compile(module) when there are global hooks on " 464 "modules (e.g., from register_module_forward_hook); this will" (...) 469 stacklevel=2, 470 ) 471 with _set_in_optimized_module(): --> 472 return super().call(*args, **kwargs)

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py:1779, in Module._wrapped_call_impl(self, *args, **kwargs) 1777 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc] 1778 else: -> 1779 return self._call_impl(*args, **kwargs)

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py:1790, in Module._call_impl(self, *args, **kwargs) 1785 # If we don't have any hooks, we want to skip the rest of the logic in 1786 # this function, and just call forward. 1787 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks 1788 or _global_backward_pre_hooks or _global_backward_hooks 1789 or _global_forward_hooks or _global_forward_pre_hooks): -> 1790 return forward_call(*args, **kwargs) 1792 result = None 1793 called_always_called_hooks = set()

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_dynamo/eval_frame.py:1038, in _TorchDynamoContext.call.<locals>.compile_wrapper(*args, **kwargs) 1034 raise e.with_traceback(None) from e.cause # User compiler error 1035 except ShortenTraceback as e: 1036 # Failures in the backend likely don't have useful 1037 # data in the TorchDynamo frames, so we strip them out. -> 1038 raise e.remove_dynamo_frames() from None # see TORCHDYNAMO_VERBOSE=1 1039 finally: 1040 # Restore the dynamic layer stack depth if necessary. 1041 set_eval_frame(None)

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/compile_fx.py:1053, in _compile_fx_inner(gm, example_inputs, **graph_kwargs) 1051 raise 1052 except Exception as e: -> 1053 raise InductorError(e, currentframe()).with_traceback( 1054 e.traceback 1055 ) from None 1056 finally: 1057 TritonBundler.end_compile()

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/compile_fx.py:1037, in _compile_fx_inner(gm, example_inputs, **graph_kwargs) 1035 TritonBundler.begin_compile() 1036 try: -> 1037 mb_compiled_graph = fx_codegen_and_compile( 1038 gm, example_inputs, inputs_to_check, **graph_kwargs 1039 ) 1040 assert mb_compiled_graph is not None 1041 mb_compiled_graph._time_taken_ns = time.time_ns() - start_time

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/compile_fx.py:1798, in fx_codegen_and_compile(gm, example_inputs, inputs_to_check, **graph_kwargs) 1795 scheme = _ProgressiveFxCompile(fast_scheme, scheme, progression_configs) 1797 # pyrefly: ignore [unbound-name] -> 1798 return scheme.codegen_and_compile(gm, example_inputs, inputs_to_check, graph_kwargs)

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/compile_fx.py:1570, in _InProcessFxCompile.codegen_and_compile(self, gm, example_inputs, inputs_to_check, graph_kwargs) 1552 compiled_fn = AotCodeCompiler.compile( 1553 graph, 1554 wrapper_code.value, (...) 1567 ], 1568 ) 1569 else: -> 1570 compiled_module = graph.compile_to_module() 1571 compiled_fn = compiled_module.call 1572 compiled_fn_runner = getattr( 1573 compiled_module, "runner", None 1574 )

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/graph.py:2499, in GraphLowering.compile_to_module(self) 2492 def compile_to_module(self) -> CompiledModule: 2493 with dynamo_timed( 2494 "GraphLowering.compile_to_module", 2495 phase_name="code_gen", 2496 log_pt2_compile_event=True, 2497 dynamo_compile_column_us="inductor_code_gen_cumulative_compile_time_us", 2498 ): -> 2499 return self._compile_to_module()

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/graph.py:2509, in GraphLowering._compile_to_module(self) 2504 wrapper_code, _ = ( 2505 self.codegen_with_cpp_wrapper() if self.cpp_wrapper else self.codegen() 2506 ) 2508 if isinstance(wrapper_code, ValueWithLineMap): -> 2509 mod = self._compile_to_module_lines(wrapper_code) 2510 elif isinstance(wrapper_code, FileBackedGraphModule): 2511 mod = wrapper_code

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/graph.py:2584, in GraphLowering._compile_to_module_lines(self, wrapper_code) 2575 trace_structured( 2576 "inductor_output_code", 2577 lambda: { (...) 2581 payload_fn=lambda: wrapper_code.value, 2582 ) 2583 with dynamo_timed("PyCodeCache.load_by_key_path", log_pt2_compile_event=True): -> 2584 mod = PyCodeCache.load_by_key_path( 2585 key, 2586 path, 2587 linemap=linemap, # type: ignore[arg-type] 2588 attrs={ 2589 **self.constants, 2590 **self.torchbind_constants, 2591 **self.opaque_value_type_classes, 2592 }, 2593 ) 2594 self.cache_key = key 2595 self.cache_path = path

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/codecache.py:3764, in PyCodeCache.load_by_key_path(cls, key, path, linemap, attrs) 3761 return cls.modules_no_attr[path] 3763 in_toplevel = in_toplevel_process() -> 3764 mod = _reload_python_module(key, path, set_sys_modules=in_toplevel) 3766 # unzip into separate lines/nodes lists 3767 if in_toplevel:

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/runtime/compile_tasks.py:35, in _reload_python_module(key, path, set_sys_modules) 33 mod.file = path 34 mod.key = key # type: ignore[attr-defined] ---> 35 exec(code, mod.dict, mod.dict) 36 if set_sys_modules: 37 sys.modules[mod.name] = mod

File /tmp/torchinductor_user/ne/cnemzl5q5cr2xb5the4whg7yosurzgrrglhirbfdpk42y5vmzbyh.py:14211 13626 cpp_fused_add_div_mean_mul_native_layer_norm_native_layer_norm_backward_permute_view_66 = async_compile.cpp_pybinding(['float*', 'float*', 'float*', 'const float*', 'const float*', 'const float*', 'const float*', 'const float*', 'const float*', 'const float*', 'float*', 'float*', 'float*', 'float*'], r''' 13627 #include <torch/csrc/inductor/cpp_prefix.h> 13628 extern "C" void kernel(float* in_out_ptr0, (...) 13865 } 13866 ''') 13869 cpp_fused__unsafe_view_clone_native_layer_norm_native_layer_norm_backward_permute_roll_slice_view_67 = async_compile.cpp_pybinding(['float*', 'float*', 'float*', 'float*', 'float*', 'float*', 'float*', 'float*', 'float*', 'float*', 'float*'], r''' 13870 #include <torch/csrc/inductor/cpp_prefix.h> 13871 extern "C" void kernel(float* in_out_ptr0, (...) 14207 } 14208 ''')

14211 async_compile.wait(globals()) 14212 del async_compile 14214 class Runner:

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/async_compile.py:699, in AsyncCompile.wait(self, scope) 691 if get_compile_threads() > 1: 692 with dynamo_timed( 693 "async_compile.wait", 694 log_pt2_compile_event=True, (...) 697 waitcounter_name_override="compile_triton", 698 ): --> 699 self._wait_futures(scope) 701 _compile_end()

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/async_compile.py:719, in AsyncCompile._wait_futures(self, scope) 717 pbar.set_postfix_str(key) 718 try: --> 719 kernel = result.result() 720 scope[key] = kernel 721 except BrokenProcessPool as e:

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/codecache.py:4361, in LambdaFuture.result(self) 4360 def result(self) -> Callable[..., Any]: -> 4361 return self.result_fn()

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/codecache.py:3237, in CppPythonBindingsCodeCache.load_pybinding_async.<locals>.future() 3235 nonlocal result 3236 if result is None: -> 3237 result = get_result() 3238 assert isinstance(result, ModuleType) 3239 return getattr(result, cls.entry_function)

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/codecache.py:3020, in CppCodeCache.load_async.<locals>.load_fn() 3018 if lib is None: 3019 if future is not None: -> 3020 future.result() 3021 result = worker_fn() 3022 assert result is None

File /usr/lib/python3.11/concurrent/futures/_base.py:449, in Future.result(self, timeout) 447 raise CancelledError() 448 elif self._state == FINISHED: --> 449 return self.__get_result() 451 self._condition.wait(timeout) 453 if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:

File /usr/lib/python3.11/concurrent/futures/_base.py:401, in Future.__get_result(self) 399 if self._exception: 400 try: --> 401 raise self._exception 402 finally: 403 # Break a reference cycle with the exception in self._exception 404 self = None

File /usr/lib/python3.11/concurrent/futures/thread.py:58, in _WorkItem.run(self) 55 return 57 try: ---> 58 result = self.fn(*self.args, **self.kwargs) 59 except BaseException as exc: 60 self.future.set_exception(exc)

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/codecache.py:3050, in _worker_compile_cpp(lock_path, cpp_builders) 3048 for builder in cpp_builders: 3049 if not os.path.exists(builder.get_target_file_path()): -> 3050 builder.build()

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/cpp_builder.py:2146, in CppBuilder.build(self) 2143 _create_if_dir_not_exist(_build_tmp_dir) 2145 build_cmd = self.get_command_line() -> 2146 run_compile_cmd(build_cmd, cwd=_build_tmp_dir) 2147 _remove_dir(_build_tmp_dir)

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/cpp_builder.py:638, in run_compile_cmd(cmd_line, cwd) 636 def run_compile_cmd(cmd_line: str, cwd: str) -> None: 637 with dynamo_timed("compile_file"): --> 638 _run_compile_cmd(cmd_line, cwd)

File ~/Programming/birder/.venv/lib/python3.11/site-packages/torch/_inductor/cpp_builder.py:633, in _run_compile_cmd(cmd_line, cwd) 623 instruction = ( 624 "\n\nOpenMP support not found. Please try one of the following solutions:\n" 625 "(1) Set the CXX environment variable to a compiler other than Apple clang++/g++ " (...) 630 " with include/omp.h under it." 631 ) 632 output += instruction --> 633 raise exc.CppCompileError(cmd, output) from e

InductorError: CppCompileError: C++ compile error

Command: g++ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp -D TORCH_INDUCTOR_CPP_WRAPPER -D STANDALONE_TORCH_HEADER -D C10_USING_CUSTOM_GENERATED_MACROS -D CPU_CAPABILITY_AVX512 -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 -shared -fPIC -Wall -std=c++17 -Wno-unused-variable -Wno-unknown-pragmas -pedantic -fopenmp -include /tmp/torchinductor_user/precompiled_headers/cmwnyv53vbpubrcynmoyhniphsksb4stlorn3fgbxygh3brnuixk.h -I/usr/include/python3.11 -I/home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include -I/home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -mavx512f -mavx512dq -mavx512vl -mavx512bw -mfma -mavx512vnni -mavx512vl -o /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.so -ltorch -ltorch_cpu -ltorch_python -lgomp -L/usr/lib/x86_64-linux-gnu -L/home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/lib

Output: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:868:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 868 | return decltype(tmp328)::blendv(tmp329, tmp328, tmp327.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:936:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 936 | return decltype(tmp354)::blendv(tmp355, tmp354, tmp353.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:972:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 972 | return decltype(tmp366)::blendv(tmp367, tmp366, tmp365.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:1073:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 1073 | return decltype(tmp407)::blendv(tmp408, tmp407, tmp406.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:1111:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 1111 | return decltype(tmp421)::blendv(tmp422, tmp421, tmp420.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:1183:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 1183 | return decltype(tmp451)::blendv(tmp452, tmp451, tmp450.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:1223:52: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 1223 | return decltype(tmp467)::blendv(tmp468, tmp467, tmp466.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2526:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 2526 | return decltype(tmp328)::blendv(tmp329, tmp328, tmp327.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2594:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 2594 | return decltype(tmp354)::blendv(tmp355, tmp354, tmp353.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2630:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 2630 | return decltype(tmp366)::blendv(tmp367, tmp366, tmp365.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2731:60: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 2731 | return decltype(tmp407)::blendv(tmp408, tmp407, tmp406.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2769:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 2769 | return decltype(tmp421)::blendv(tmp422, tmp421, tmp420.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2841:56: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 2841 | return decltype(tmp451)::blendv(tmp452, tmp451, tmp450.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp: In lambda function: /tmp/torchinductor_user/td/ctdkbp2rglqvjyxyjjdkxnw3rcthduteujzn3uv5zlyde7qqcmqk.main.cpp:2881:52: error: ‘decltype’ evaluates to ‘float’, which is not a class or enumeration type 2881 | return decltype(tmp467)::blendv(tmp468, tmp467, tmp466.template cast<float,1>()); | ^~~~~~~~~~~~~~~~ In file included from /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512.h:15, from /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec.h:5, from /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/functional_base.h:7, from /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/functional.h:4, from /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/torch/csrc/inductor/cpp_prefix.h:45, from /tmp/torchinductor_user/precompiled_headers/cmwnyv53vbpubrcynmoyhniphsksb4stlorn3fgbxygh3brnuixk.h:1: /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h: In instantiation of ‘at::vec::CPU_CAPABILITY::Vectorized<T> at::vec::CPU_CAPABILITY::shift_512_8(const Vectorized<T>&, const Vectorized<T>&) [with bool left_shift = true; T = signed char; typename std::enable_if<(is_same_v<T, signed char> || is_same_v<T, unsigned char>), int>::type <anonymous> = 0]’: /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:2074:27: required from here /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1866:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1866 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1868:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1868 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1870:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1870 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1872:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1872 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1874:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1874 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1876:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1876 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1878:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1878 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1880:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1880 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1882:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1882 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1884:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1884 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1886:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1886 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1888:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1888 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1890:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1890 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1892:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1892 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1894:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1894 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1896:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1896 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1898:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1898 | 0x80, | ^~~~ /home/user/Programming/birder/.venv/lib/python3.11/site-packages/torch/include/ATen/cpu/vec/vec512/vec512_int.h:1900:7: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘128’ to ‘'\37777777600'’ [-Woverflow] 1900 | 0x80, | ^~~~

...

Set TORCHDYNAMO_VERBOSE=1 for the internal stack trace (please do this especially if you're reporting a bug to PyTorch). For even more developer context, set TORCH_LOGS="+dynamo"

Versions

PyTorch version: 2.11.0+cu128 Is debug build: False CUDA used to build PyTorch: 12.8 ROCM used to build PyTorch: N/A

OS: Debian GNU/Linux 12 (bookworm) (x86_64) GCC version: (Debian 12.2.0-14+deb12u1) 12.2.0 Clang version: Could not collect CMake version: version 3.25.1 Libc version: glibc-2.36

Python version: 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0] (64-bit runtime) Python platform: Linux-6.1.0-44-amd64-x86_64-with-glibc2.36 Is CUDA available: True CUDA runtime version: 12.8.93 CUDA_MODULE_LOADING set to: GPU models and configuration: GPU 0: NVIDIA RTX A5000 GPU 1: NVIDIA RTX A5000

Nvidia driver version: 595.45.04 cuDNN version: Could not collect Is XPU available: False HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True Caching allocator config: N/A

CPU: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 48 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 32 On-line CPU(s) list: 0-31 Vendor ID: AuthenticAMD Model name: AMD Ryzen 9 7950X3D 16-Core Processor CPU family: 25 Model: 97 Thread(s) per core: 2 Core(s) per socket: 16 Socket(s): 1 Stepping: 2 Frequency boost: enabled CPU(s) scaling MHz: 78% CPU max MHz: 5759.9639 CPU min MHz: 3000.0000 BogoMIPS: 8399.51 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif x2avic v_spec_ctrl avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid overflow_recov succor smca fsrm flush_l1d ibpb_exit_to_user Virtualization: AMD-V L1d cache: 512 KiB (16 instances) L1i cache: 512 KiB (16 instances) L2 cache: 16 MiB (16 instances) L3 cache: 128 MiB (2 instances) NUMA node(s): 1 NUMA node0 CPU(s): 0-31 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Mitigation; safe RET Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; STIBP always-on; PBRSB-eIBRS Not affected; BHI Not affected Vulnerability Srbds: Not affected Vulnerability Tsa: Vulnerable: Clear CPU buffers attempted, no microcode Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Mitigation; IBPB before exit to userspace

Versions of relevant libraries: [pip3] flake8==7.3.0 [pip3] flake8-pep585==0.1.7 [pip3] mypy==1.20.0 [pip3] mypy_extensions==1.1.0 [pip3] numpy==2.4.4 [pip3] nvidia-cublas-cu12==12.8.4.1 [pip3] nvidia-cuda-cupti-cu12==12.8.90 [pip3] nvidia-cuda-nvrtc-cu12==12.8.93 [pip3] nvidia-cuda-runtime-cu12==12.8.90 [pip3] nvidia-cudnn-cu12==9.19.0.56 [pip3] nvidia-cufft-cu12==11.3.3.83 [pip3] nvidia-curand-cu12==10.3.9.90 [pip3] nvidia-cusolver-cu12==11.7.3.90 [pip3] nvidia-cusparse-cu12==12.5.8.93 [pip3] nvidia-cusparselt-cu12==0.7.1 [pip3] nvidia-nccl-cu12==2.28.9 [pip3] nvidia-nvjitlink-cu12==12.8.93 [pip3] nvidia-nvtx-cu12==12.8.90 [pip3] onnx==1.21.0 [pip3] onnx-ir==0.2.0 [pip3] onnxscript==0.6.2 [pip3] torch==2.11.0+cu128 [pip3] torchao==0.17.0 [pip3] torchinfo==1.8.0 [pip3] torchmetrics==1.9.0 [pip3] torchprofile==0.1.0 [pip3] torchvision==0.26.0+cu128 [pip3] triton==3.6.0 [conda] Could not collect

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168 @aditew01 @chauhang @penguinwu @voznesenskym @EikanWang @Guobing-Chen @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @aakhundov @coconutruben @jataylo

extent analysis

TL;DR

The most likely fix is to downgrade PyTorch to version

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 - 💡(How to fix) Fix InductorError when using torch.compile with Swin Transformer v2 on CPU [3 comments, 2 participants]