pytorch - ✅(Solved) Fix [Inductor CPU] Compilation fails when converting bool to float8_e4m3fn dtype [2 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#178095Fetched 2026-04-08 01:16:41
View on GitHub
Comments
1
Participants
2
Timeline
18
Reactions
1
Author
Participants
Timeline (top)
referenced ×4assigned ×3labeled ×3cross-referenced ×2

Error Message

/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:143:32: error: ‘blendv’ is not a member of ‘at::vec::CPU_CAPABILITY::Vectorizedc10::Float8_e4m3fn’ 143 | Vectorized<T>::blendv(a.values[i], b.values[i], mask.values[i]);

Fix Action

Fix / Workaround

CPU: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 46 bits physical, 57 bits virtual Byte Order: Little Endian CPU(s): 192 On-line CPU(s) list: 0-191 Vendor ID: GenuineIntel Model name: Intel(R) Xeon(R) Platinum 8474C CPU family: 6 Model: 143 Thread(s) per core: 2 Core(s) per socket: 48 Socket(s): 2 Stepping: 8 CPU(s) scaling MHz: 100% CPU max MHz: 3800.0000 CPU min MHz: 800.0000 BogoMIPS: 4200.00 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hfi vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities ibpb_exit_to_user Virtualization: VT-x L1d cache: 4.5 MiB (96 instances) L1i cache: 3 MiB (96 instances) L2 cache: 192 MiB (96 instances) L3 cache: 195 MiB (2 instances) NUMA node(s): 2 NUMA node0 CPU(s): 0-47,96-143 NUMA node1 CPU(s): 48-95,144-191 Vulnerability Gather data sampling: 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: Not affected 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; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Mitigation; IBPB before exit to userspace

PR fix notes

PR #178221: [Inductor CPU] Fix compilation failure when converting bool to float8 dtype

Description (problem / solution / changelog)

  • Review newly added PR comments and identify actionable ones for @copilot
  • Check latest workflow run statuses for this PR branch
  • Address request to post @pytorchbot merge
<!-- START COPILOT CODING AGENT TIPS -->

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Changed files

  • aten/src/ATen/cpu/vec/vec512/vec512_float8.h (modified, +9/-0)
  • test/inductor/test_cpu_repro.py (modified, +21/-0)

PR #178728: [CPU] Add blendv to Vectorizedf8 for bool-to-float8 conversion

Description (problem / solution / changelog)

Reopen of https://github.com/pytorch/pytorch/pull/178221 since I don't know how to merge that PR created by copilot. Fixes #178095 Summary The Vectorizedf8 base class (used by Vectorized<Float8_e4m3fn> and Vectorized<Float8_e5m2>) was missing a blendv static method. This caused a C++ compilation failure when Inductor's VecMaskTo::apply tried to use blendv during bool-to-float8 dtype conversion. Fix adds blendv to Vectorizedf8 with the same byte-level semantics as the existing uint8_t/int8_t blendv implementations in vec512_int.h.

Test plan Adds regression tests for both float8_e4m3fn and float8_e5m2 in test_cpu_repro.py.

Assisted by Copilot/Claude

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

Changed files

  • aten/src/ATen/cpu/vec/vec512/vec512_float8.h (modified, +9/-0)
  • test/inductor/test_cpu_repro.py (modified, +25/-0)

Code Example

/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:143:32: error: ‘blendv’ is not a member of ‘at::vec::CPU_CAPABILITY::Vectorized<c10::Float8_e4m3fn>  143 |           Vectorized<T>::blendv(a.values[i], b.values[i], mask.values[i]);

---

import torch


def test(x):
    return x.to(dtype=torch.float8_e4m3fn)


compiled = torch.compile(test, backend="inductor")
x = torch.ones(64, dtype=torch.bool)
output = compiled(x)  # crashed here

print(output)

---

Traceback (most recent call last):
  File "/tmp/bug/bug.py", line 10, in <module>
    output = compiled(x)  # crashed here
             ^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_dynamo/eval_frame.py", line 967, in compile_wrapper
    raise e.remove_dynamo_frames() from None  # see TORCHDYNAMO_VERBOSE=1
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1019, in _compile_fx_inner
    raise InductorError(e, currentframe()).with_traceback(
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1003, in _compile_fx_inner
    mb_compiled_graph = fx_codegen_and_compile(
                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1766, in fx_codegen_and_compile
    return scheme.codegen_and_compile(gm, example_inputs, inputs_to_check, graph_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1537, in codegen_and_compile
    compiled_module = graph.compile_to_module()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/graph.py", line 2416, in compile_to_module
    return self._compile_to_module()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/graph.py", line 2426, in _compile_to_module
    mod = self._compile_to_module_lines(wrapper_code)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/graph.py", line 2501, in _compile_to_module_lines
    mod = PyCodeCache.load_by_key_path(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/codecache.py", line 3674, in load_by_key_path
    mod = _reload_python_module(key, path, set_sys_modules=in_toplevel)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/runtime/compile_tasks.py", line 35, in _reload_python_module
    exec(code, mod.__dict__, mod.__dict__)
  File "/tmp/torchinductor_yohei/2l/c2lyvmi2trceu5m5n4cpcubcjlus5dp56ntqti6bf3vpj36ggjx5.py", line 55, in <module>
    async_compile.wait(globals())
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/async_compile.py", line 649, in wait
    self._wait_futures(scope)
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/async_compile.py", line 669, in _wait_futures
    kernel = result.result()
             ^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/codecache.py", line 4417, in result
    return self.result_fn()
           ^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/codecache.py", line 3147, in future
    result = get_result()
             ^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/codecache.py", line 2936, in load_fn
    future.result()
  File "/usr/lib64/python3.12/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/lib64/python3.12/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/codecache.py", line 2966, in _worker_compile_cpp
    builder.build()
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 2144, in build
    run_compile_cmd(build_cmd, cwd=_build_tmp_dir)
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 636, in run_compile_cmd
    _run_compile_cmd(cmd_line, cwd)
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 631, in _run_compile_cmd
    raise exc.CppCompileError(cmd, output) from e
torch._inductor.exc.InductorError: CppCompileError: C++ compile error

Command:
g++ /tmp/torchinductor_yohei/wd/cwdoube3lwvq3hpor733lspyxzbfv2o5an4wx6i6tvzgahjxa2hj.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_yohei/precompiled_headers/ckaz777desxwxx6qojurhqse5du6klleyhj5bw7ardugmkymv5z5.h -I/usr/include/python3.12 -I/tmp/.venv/lib64/python3.12/site-packages/torch/include -I/tmp/.venv/lib64/python3.12/site-packages/torch/include/torch/csrc/api/include -mavx512f -mavx512dq -mavx512vl -mavx512bw -mfma -mavx512vnni -mavx512vl -mamx-tile -mamx-bf16 -mamx-int8 -mavx512bf16 -o /tmp/torchinductor_yohei/wd/cwdoube3lwvq3hpor733lspyxzbfv2o5an4wx6i6tvzgahjxa2hj.main.so -ltorch -ltorch_cpu -ltorch_python -lgomp -L/usr/lib64 -L/tmp/.venv/lib64/python3.12/site-packages/torch/lib

Output:

---

In file included from /tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_convert.h:5,
                 from /tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_base.h:1531,
                 from /tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec512/vec512.h:10:
/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h: In instantiation ofstatic 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 = c10::Float8_e4m3fn; int N = 1]:
/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_mask.h:67:45:   required fromstatic at::vec::CPU_CAPABILITY::VecMask<dst_t, dst_n> at::vec::CPU_CAPABILITY::VecMaskTo<dst_t, dst_n, src_t, src_n, Enabled>::apply(const at::vec::CPU_CAPABILITY::VecMask<mask_t, mask_n>&) [with dst_t = c10::Float8_e4m3fn; int dst_n = 1; src_t = float; int src_n = 1; Enabled = void]   67 |     return VectorizedN<dst_t, dst_n>::blendv(
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   68 |         zeros, ones, vec_mask.template cast<dst_t, dst_n>());
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_mask.h:216:40:   required from ‘at::vec::CPU_CAPABILITY::Vectorized<U> at::vec::CPU_CAPABILITY::VecMask<T, N>::to() const [with U = c10::Float8_e4m3fn; int L = 1; typename std::enable_if<(L == 1), int>::type <anonymous> = 0; T = float; int N = 1]  216 |     return VecMaskTo<U, L, T, N>::apply(*this);
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/tmp/torchinductor_yohei/wd/cwdoube3lwvq3hpor733lspyxzbfv2o5an4wx6i6tvzgahjxa2hj.main.cpp:13:61:   required from here
   13 |                     auto tmp1 = tmp0.to<at::Float8_e4m3fn,1>();
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:143:32: error: ‘blendv’ is not a member of ‘at::vec::CPU_CAPABILITY::Vectorized<c10::Float8_e4m3fn>  143 |           Vectorized<T>::blendv(a.values[i], b.values[i], mask.values[i]);
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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"

---

PyTorch version: 2.10.0+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Red Hat Enterprise Linux 9.7 (Plow) (x86_64)
GCC version: (GCC) 14.2.1 20250110 (Red Hat 14.2.1-12)
Clang version: Could not collect
CMake version: version 4.2.1
Libc version: glibc-2.34

Python version: 3.12.12 (main, Feb 27 2026, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-11)] (64-bit runtime)
Python platform: Linux-5.14.0-427.102.1.el9_4.x86_64-x86_64-with-glibc2.34
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
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:                        46 bits physical, 57 bits virtual
Byte Order:                           Little Endian
CPU(s):                               192
On-line CPU(s) list:                  0-191
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) Platinum 8474C
CPU family:                           6
Model:                                143
Thread(s) per core:                   2
Core(s) per socket:                   48
Socket(s):                            2
Stepping:                             8
CPU(s) scaling MHz:                   100%
CPU max MHz:                          3800.0000
CPU min MHz:                          800.0000
BogoMIPS:                             4200.00
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hfi vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities ibpb_exit_to_user
Virtualization:                       VT-x
L1d cache:                            4.5 MiB (96 instances)
L1i cache:                            3 MiB (96 instances)
L2 cache:                             192 MiB (96 instances)
L3 cache:                             195 MiB (2 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0-47,96-143
NUMA node1 CPU(s):                    48-95,144-191
Vulnerability Gather data sampling:   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:   Not affected
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; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected
Vulnerability Vmscape:                Mitigation; IBPB before exit to userspace

Versions of relevant libraries:
[pip3] Could not collect
[conda] Could not collect
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

When using torch.compile with the Inductor backend to convert a bool tensor to float8_e4m3fn dtype, compilation fails with a C++ error indicating that blendv is not a member of Vectorized<c10::Float8_e4m3fn>.

/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:143:32: error: ‘blendv’ is not a member of ‘at::vec::CPU_CAPABILITY::Vectorized<c10::Float8_e4m3fn>’
  143 |           Vectorized<T>::blendv(a.values[i], b.values[i], mask.values[i]);

Reproduction:

import torch


def test(x):
    return x.to(dtype=torch.float8_e4m3fn)


compiled = torch.compile(test, backend="inductor")
x = torch.ones(64, dtype=torch.bool)
output = compiled(x)  # crashed here

print(output)

Error:

Traceback (most recent call last):
  File "/tmp/bug/bug.py", line 10, in <module>
    output = compiled(x)  # crashed here
             ^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_dynamo/eval_frame.py", line 967, in compile_wrapper
    raise e.remove_dynamo_frames() from None  # see TORCHDYNAMO_VERBOSE=1
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1019, in _compile_fx_inner
    raise InductorError(e, currentframe()).with_traceback(
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1003, in _compile_fx_inner
    mb_compiled_graph = fx_codegen_and_compile(
                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1766, in fx_codegen_and_compile
    return scheme.codegen_and_compile(gm, example_inputs, inputs_to_check, graph_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/compile_fx.py", line 1537, in codegen_and_compile
    compiled_module = graph.compile_to_module()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/graph.py", line 2416, in compile_to_module
    return self._compile_to_module()
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/graph.py", line 2426, in _compile_to_module
    mod = self._compile_to_module_lines(wrapper_code)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/graph.py", line 2501, in _compile_to_module_lines
    mod = PyCodeCache.load_by_key_path(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/codecache.py", line 3674, in load_by_key_path
    mod = _reload_python_module(key, path, set_sys_modules=in_toplevel)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/runtime/compile_tasks.py", line 35, in _reload_python_module
    exec(code, mod.__dict__, mod.__dict__)
  File "/tmp/torchinductor_yohei/2l/c2lyvmi2trceu5m5n4cpcubcjlus5dp56ntqti6bf3vpj36ggjx5.py", line 55, in <module>
    async_compile.wait(globals())
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/async_compile.py", line 649, in wait
    self._wait_futures(scope)
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/async_compile.py", line 669, in _wait_futures
    kernel = result.result()
             ^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/codecache.py", line 4417, in result
    return self.result_fn()
           ^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/codecache.py", line 3147, in future
    result = get_result()
             ^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/codecache.py", line 2936, in load_fn
    future.result()
  File "/usr/lib64/python3.12/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/lib64/python3.12/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/codecache.py", line 2966, in _worker_compile_cpp
    builder.build()
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 2144, in build
    run_compile_cmd(build_cmd, cwd=_build_tmp_dir)
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 636, in run_compile_cmd
    _run_compile_cmd(cmd_line, cwd)
  File "/tmp/.venv/lib64/python3.12/site-packages/torch/_inductor/cpp_builder.py", line 631, in _run_compile_cmd
    raise exc.CppCompileError(cmd, output) from e
torch._inductor.exc.InductorError: CppCompileError: C++ compile error

Command:
g++ /tmp/torchinductor_yohei/wd/cwdoube3lwvq3hpor733lspyxzbfv2o5an4wx6i6tvzgahjxa2hj.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_yohei/precompiled_headers/ckaz777desxwxx6qojurhqse5du6klleyhj5bw7ardugmkymv5z5.h -I/usr/include/python3.12 -I/tmp/.venv/lib64/python3.12/site-packages/torch/include -I/tmp/.venv/lib64/python3.12/site-packages/torch/include/torch/csrc/api/include -mavx512f -mavx512dq -mavx512vl -mavx512bw -mfma -mavx512vnni -mavx512vl -mamx-tile -mamx-bf16 -mamx-int8 -mavx512bf16 -o /tmp/torchinductor_yohei/wd/cwdoube3lwvq3hpor733lspyxzbfv2o5an4wx6i6tvzgahjxa2hj.main.so -ltorch -ltorch_cpu -ltorch_python -lgomp -L/usr/lib64 -L/tmp/.venv/lib64/python3.12/site-packages/torch/lib

Output:

(snip)

In file included from /tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_convert.h:5,
                 from /tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_base.h:1531,
                 from /tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec512/vec512.h:10:
/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h: In instantiation 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 = c10::Float8_e4m3fn; int N = 1]’:
/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_mask.h:67:45:   required from ‘static at::vec::CPU_CAPABILITY::VecMask<dst_t, dst_n> at::vec::CPU_CAPABILITY::VecMaskTo<dst_t, dst_n, src_t, src_n, Enabled>::apply(const at::vec::CPU_CAPABILITY::VecMask<mask_t, mask_n>&) [with dst_t = c10::Float8_e4m3fn; int dst_n = 1; src_t = float; int src_n = 1; Enabled = void]’
   67 |     return VectorizedN<dst_t, dst_n>::blendv(
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   68 |         zeros, ones, vec_mask.template cast<dst_t, dst_n>());
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_mask.h:216:40:   required from ‘at::vec::CPU_CAPABILITY::Vectorized<U> at::vec::CPU_CAPABILITY::VecMask<T, N>::to() const [with U = c10::Float8_e4m3fn; int L = 1; typename std::enable_if<(L == 1), int>::type <anonymous> = 0; T = float; int N = 1]’
  216 |     return VecMaskTo<U, L, T, N>::apply(*this);
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/tmp/torchinductor_yohei/wd/cwdoube3lwvq3hpor733lspyxzbfv2o5an4wx6i6tvzgahjxa2hj.main.cpp:13:61:   required from here
   13 |                     auto tmp1 = tmp0.to<at::Float8_e4m3fn,1>();
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/tmp/.venv/lib64/python3.12/site-packages/torch/include/ATen/cpu/vec/vec_n.h:143:32: error: ‘blendv’ is not a member of ‘at::vec::CPU_CAPABILITY::Vectorized<c10::Float8_e4m3fn>’
  143 |           Vectorized<T>::blendv(a.values[i], b.values[i], mask.values[i]);
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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"

full-log.txt

Versions

PyTorch version: 2.10.0+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Red Hat Enterprise Linux 9.7 (Plow) (x86_64)
GCC version: (GCC) 14.2.1 20250110 (Red Hat 14.2.1-12)
Clang version: Could not collect
CMake version: version 4.2.1
Libc version: glibc-2.34

Python version: 3.12.12 (main, Feb 27 2026, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-11)] (64-bit runtime)
Python platform: Linux-5.14.0-427.102.1.el9_4.x86_64-x86_64-with-glibc2.34
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
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:                        46 bits physical, 57 bits virtual
Byte Order:                           Little Endian
CPU(s):                               192
On-line CPU(s) list:                  0-191
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) Platinum 8474C
CPU family:                           6
Model:                                143
Thread(s) per core:                   2
Core(s) per socket:                   48
Socket(s):                            2
Stepping:                             8
CPU(s) scaling MHz:                   100%
CPU max MHz:                          3800.0000
CPU min MHz:                          800.0000
BogoMIPS:                             4200.00
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hfi vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities ibpb_exit_to_user
Virtualization:                       VT-x
L1d cache:                            4.5 MiB (96 instances)
L1i cache:                            3 MiB (96 instances)
L2 cache:                             192 MiB (96 instances)
L3 cache:                             195 MiB (2 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0-47,96-143
NUMA node1 CPU(s):                    48-95,144-191
Vulnerability Gather data sampling:   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:   Not affected
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; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected
Vulnerability Vmscape:                Mitigation; IBPB before exit to userspace

Versions of relevant libraries:
[pip3] Could not collect
[conda] Could not collect

extent analysis

Fix Plan

The issue arises from the missing implementation of the blendv function for Vectorized<c10::Float8_e4m3fn>. To fix this, we need to add the implementation for this specific type.

Here are the steps to fix the issue:

  • Modify the vec_n.h file to include the implementation for blendv with c10::Float8_e4m3fn type.
  • Add a specialization for Vectorized<c10::Float8_e4m3fn> to include the blendv function.

Example code snippet:

# Add this to the vec_n.h file
template <>
struct Vectorized<c10::Float8_e4m3fn> {
    // ... existing code ...

    static Vectorized<c10::Float8_e4m3fn> blendv(
        const Vectorized<c10::Float8_e4m3fn>& a,
        const Vectorized<c10::Float8_e4m3fn>& b,
        const Vectorized<c10::Float8_e4m3fn>& mask) {
        // implementation for blendv with c10::Float8_e4m3fn type
        // ...
    }
};

Note: The actual implementation of the blendv function will depend on the specific requirements of the c10::Float8_e4m3fn type.

Verification

To verify that the fix worked, recompile the code and run the test case again. The error should be resolved, and the code should execute without any issues.

Extra Tips

  • Make sure to test the implementation thoroughly to ensure it works correctly for all possible input scenarios.
  • Consider submitting a pull request to the PyTorch repository to include the fix for the blendv function with c10::Float8_e4m3fn type.

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