This seems a regression as I was able to build successfully before. Good revision needs to be found though as some time passed since I built with intel/llvm main branch as recently I focused on 7.0 release.
$ "./build/install/bin/llvm-spirv" "-o" "out.spv" "-spirv-max-version=1.5" "-spirv-debug-info-version=nonsemantic-shader-200" "-spirv-allow-unknown-intrinsics=llvm.genx." "-spirv-ext=-all,+SPV_EXT_shader_atomic_float_add,+SPV_EXT_shader_atomic_float_min_max,+SPV_KHR_no_integer_wrap_decoration,+SPV_KHR_float_controls,+SPV_KHR_expect_assume,+SPV_KHR_linkonce_odr,+SPV_INTEL_subgroups,+SPV_INTEL_media_block_io,+SPV_INTEL_device_side_avc_motion_estimation,+SPV_INTEL_fpga_loop_controls,+SPV_INTEL_unstructured_loop_controls,+SPV_INTEL_fpga_reg,+SPV_INTEL_blocking_pipes,+SPV_INTEL_function_pointers,+SPV_INTEL_kernel_attributes,+SPV_INTEL_io_pipes,+SPV_INTEL_inline_assembly,+SPV_INTEL_arbitrary_precision_integers,+SPV_INTEL_float_controls2,+SPV_INTEL_vector_compute,+SPV_INTEL_arbitrary_precision_fixed_point,+SPV_INTEL_arbitrary_precision_floating_point,+SPV_INTEL_variable_length_array,+SPV_INTEL_fp_fast_math_mode,+SPV_INTEL_long_composites,+SPV_INTEL_arithmetic_fence,+SPV_INTEL_global_variable_decorations,+SPV_INTEL_cache_controls,+SPV_INTEL_fpga_buffer_location,+SPV_INTEL_fpga_argument_interfaces,+SPV_INTEL_fpga_invocation_pipelining_attributes,+SPV_INTEL_fpga_latency_control,+SPV_KHR_shader_clock,+SPV_INTEL_bindless_images,+SPV_INTEL_task_sequence,+SPV_INTEL_bfloat16_conversion,+SPV_INTEL_joint_matrix,+SPV_INTEL_hw_thread_queries,+SPV_KHR_uniform_group_instructions,+SPV_INTEL_masked_gather_scatter,+SPV_INTEL_tensor_float32_conversion,+SPV_INTEL_optnone,+SPV_KHR_non_semantic_info,+SPV_KHR_cooperative_matrix,+SPV_EXT_shader_atomic_float16_add,+SPV_INTEL_fp_max_error,+SPV_INTEL_memory_access_aliasing" ./assets/torch_xpu_ops_gen_NestedTensorBinaryOpsKernels.cpp-spir64_gen_34.bc
llvm-spirv: /home/dvrogozh/git/intel-llvm/llvm-spirv/lib/SPIRV/libSPIRV/SPIRVModule.cpp:995: virtual SPIRV::SPIRVEntry* SPIRV::SPIRVModuleImpl::getEntry(SPIRV::SPIRVId) const: Assertion `false && "Id is not in map"' failed.
PLEASE submit a bug report to https://github.com/intel/llvm/issues and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: ./build/install/bin/llvm-spirv -o out.spv -spirv-max-version=1.5 -spirv-debug-info-version=nonsemantic-shader-200 -spirv-allow-unknown-intrinsics=llvm.genx. -spirv-ext=-all,+SPV_EXT_shader_atomic_float_add,+SPV_EXT_shader_atomic_float_min_max,+SPV_KHR_no_integer_wrap_decoration,+SPV_KHR_float_controls,+SPV_KHR_expect_assume,+SPV_KHR_linkonce_odr,+SPV_INTEL_subgroups,+SPV_INTEL_media_block_io,+SPV_INTEL_device_side_avc_motion_estimation,+SPV_INTEL_fpga_loop_controls,+SPV_INTEL_unstructured_loop_controls,+SPV_INTEL_fpga_reg,+SPV_INTEL_blocking_pipes,+SPV_INTEL_function_pointers,+SPV_INTEL_kernel_attributes,+SPV_INTEL_io_pipes,+SPV_INTEL_inline_assembly,+SPV_INTEL_arbitrary_precision_integers,+SPV_INTEL_float_controls2,+SPV_INTEL_vector_compute,+SPV_INTEL_arbitrary_precision_fixed_point,+SPV_INTEL_arbitrary_precision_floating_point,+SPV_INTEL_variable_length_array,+SPV_INTEL_fp_fast_math_mode,+SPV_INTEL_long_composites,+SPV_INTEL_arithmetic_fence,+SPV_INTEL_global_variable_decorations,+SPV_INTEL_cache_controls,+SPV_INTEL_fpga_buffer_location,+SPV_INTEL_fpga_argument_interfaces,+SPV_INTEL_fpga_invocation_pipelining_attributes,+SPV_INTEL_fpga_latency_control,+SPV_KHR_shader_clock,+SPV_INTEL_bindless_images,+SPV_INTEL_task_sequence,+SPV_INTEL_bfloat16_conversion,+SPV_INTEL_joint_matrix,+SPV_INTEL_hw_thread_queries,+SPV_KHR_uniform_group_instructions,+SPV_INTEL_masked_gather_scatter,+SPV_INTEL_tensor_float32_conversion,+SPV_INTEL_optnone,+SPV_KHR_non_semantic_info,+SPV_KHR_cooperative_matrix,+SPV_EXT_shader_atomic_float16_add,+SPV_INTEL_fp_max_error,+SPV_INTEL_memory_access_aliasing /home/dvrogozh/bugs/llvm-assert/torch_xpu_ops_gen_NestedTensorBinaryOpsKernels.cpp-spir64_gen_34.bc
#0 0x00006204df8fd652 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./build/install/bin/llvm-spirv+0xa3d652)
#1 0x00006204df8fa4ef llvm::sys::RunSignalHandlers() (./build/install/bin/llvm-spirv+0xa3a4ef)
#2 0x00006204df8fa63c SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x0000742fd2a45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x0000742fd2a9eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x0000742fd2a9eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x0000742fd2a9eb2c pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x0000742fd2a4527e raise ./signal/../sysdeps/posix/raise.c:27:6
#8 0x0000742fd2a288ff abort ./stdlib/abort.c:81:7
#9 0x0000742fd2a2881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x0000742fd2a3b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#11 0x00006204df2e5fad SPIRV::SPIRVModuleImpl::getEntry(unsigned int) const (./build/install/bin/llvm-spirv+0x425fad)
#12 0x00006204df2fcf75 SPIRV::operator<<(std::ostream&, SPIRV::SPIRVModule&) (./build/install/bin/llvm-spirv+0x43cf75)
#13 0x00006204df20d2a8 (anonymous namespace)::runSpirvWriterPasses(llvm::Module*, std::ostream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, SPIRV::TranslatorOpts const&) SPIRVWriter.cpp:0:0
#14 0x00006204deffcaa8 main (./build/install/bin/llvm-spirv+0x13caa8)
#15 0x0000742fd2a2a1ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#16 0x0000742fd2a2a28b call_init ./csu/../csu/libc-start.c:128:20
#17 0x0000742fd2a2a28b __libc_start_main ./csu/../csu/libc-start.c:347:5
#18 0x00006204df0f0a85 _start (./build/install/bin/llvm-spirv+0x230a85)
Aborted (core dumped)
Describe the bug
Building Pytorch per pytorch/pytorch@ffee571 with intel/llvm compiler fails with the following assert:
llvm/llvm-spirv/lib/SPIRV/libSPIRV/SPIRVModule.cpp
Line 995 in b09acde
This seems a regression as I was able to build successfully before. Good revision needs to be found though as some time passed since I built with intel/llvm main branch as recently I focused on 7.0 release.
To reproduce
Input file can be found here:
Environment
On:
Additional context
CC: @sarnex