Skip to content

[Intel][Vulkan][Clang] Elementwise bitcasts are producing a cast to a zero-initialized type on Intel #599

@farzonl

Description

@farzonl

Issue

These don't crash like llvm/llvm-project#170534 does but they are also returning outputs of all zero.
There seems to be something wrong with the spv bitcast.

@s-perron mentioned this pr: llvm/llvm-project#169696 will handle many element-wise matrix operations. maybe that will also include elementwise bitcast. For now the plan is to xfail the tests in the offload test suite.

Trunc cast SPIRV failure Example 1

******************** TEST 'OffloadTest-clang-vk :: Basic/Matrix/matrix_trunc_cast.test' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 59
e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\split-file.exe E:\actions-runner\_work\offload-test-suite\offload-test-suite\OffloadTest\test\Basic\Matrix\matrix_trunc_cast.test E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_trunc_cast.test.tmp
# executed command: 'e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\split-file.exe' 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\OffloadTest\test\Basic\Matrix\matrix_trunc_cast.test' 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_trunc_cast.test.tmp'
# RUN: at line 60
e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\clang-dxc.exe -spirv -fspv-target-env=vulkan1.3 -fspv-extension=DXC --dxv-path=E:/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin -T cs_6_0 -Fo E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_trunc_cast.test.tmp.o E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_trunc_cast.test.tmp/source.hlsl
# executed command: 'e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\clang-dxc.exe' -spirv -fspv-target-env=vulkan1.3 -fspv-extension=DXC --dxv-path=E:/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin -T cs_6_0 -Fo 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_trunc_cast.test.tmp.o' 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_trunc_cast.test.tmp/source.hlsl'
# RUN: at line 61
e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\offloader.exe -debug-layer E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_trunc_cast.test.tmp/pipeline.yaml E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_trunc_cast.test.tmp.o
# executed command: 'e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\offloader.exe' -debug-layer 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_trunc_cast.test.tmp/pipeline.yaml' 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_trunc_cast.test.tmp.o'
# .---command stdout------------
# | Using Vulkan API
# | Physical device created.
# | Shader module created.
# | Copy command buffer created.
# | Memory buffers created.
# | Executed copy command buffer.
# | Execute command buffer created.
# | Descriptors: { type = 5, count = 2 }
# | Descriptor pool created.
# | Binding 2 descriptors.
# | Num Descriptor sets: 1
# | Updating Descriptor [0] { 0, 0 }
# | Updating Descriptor [1] { 0, 1 }
# | WriteDescriptors: 2
# | Descriptor sets created.
# | Compute pipeline created.
# | Dispatched compute shader: { 1, 1, 1 }
# | Commands created.
# | Executed compute command buffer.
# | Compute pipeline created.
# | Cleanup complete.
# `-----------------------------
# .---command stderr------------
# | Test failed: Out
# | Comparison Rule: BufferExact
# | Expected:
# | ---
# | Name:            ExpectedOut
# | Format:          Int32
# | Data:            [ 1, 2, 5, 6 ]
# | OutputProps:
# |   Height:          0
# |   Width:           0
# |   Depth:           0
# | ...
# | Got:
# | ---
# | Name:            Out
# | Format:          Int32
# | Data:            [ 0, 0, 0, 0 ]
# | OutputProps:
# |   Height:          0
# |   Width:           0
# |   Depth:           0
# | ...
# | Full Hex 64bit representation of Expected Buffer Values:
# | [ 0x1, 0x2, 0x5, 0x6 ]
# | Full Hex 64bit representation of Actual Buffer Values:
# | [ 0x0, 0x0, 0x0, 0x0 ]
# | 
# `-----------------------------
# error: command failed with exit status: 1

--

vector elementwise cast SPIRV failure Example 2

********************
FAIL: OffloadTest-clang-vk :: Basic/Matrix/matrix_elementwise_vector_cast.test (25 of 297)
******************** TEST 'OffloadTest-clang-vk :: Basic/Matrix/matrix_elementwise_vector_cast.test' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 76
e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\split-file.exe E:\actions-runner\_work\offload-test-suite\offload-test-suite\OffloadTest\test\Basic\Matrix\matrix_elementwise_vector_cast.test E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_vector_cast.test.tmp
# executed command: 'e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\split-file.exe' 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\OffloadTest\test\Basic\Matrix\matrix_elementwise_vector_cast.test' 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_vector_cast.test.tmp'
# RUN: at line 77
e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\clang-dxc.exe -spirv -fspv-target-env=vulkan1.3 -fspv-extension=DXC --dxv-path=E:/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin -T cs_6_0 -Fo E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_vector_cast.test.tmp.o E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_vector_cast.test.tmp/source.hlsl
# executed command: 'e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\clang-dxc.exe' -spirv -fspv-target-env=vulkan1.3 -fspv-extension=DXC --dxv-path=E:/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin -T cs_6_0 -Fo 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_vector_cast.test.tmp.o' 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_vector_cast.test.tmp/source.hlsl'
# RUN: at line 78
e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\offloader.exe -debug-layer E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_vector_cast.test.tmp/pipeline.yaml E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_vector_cast.test.tmp.o
# executed command: 'e:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\bin\offloader.exe' -debug-layer 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_vector_cast.test.tmp/pipeline.yaml' 'E:\actions-runner\_work\offload-test-suite\offload-test-suite\llvm-project\build\tools\OffloadTest\test\clang-vk\Basic\Matrix\Output\matrix_elementwise_vector_cast.test.tmp.o'
# .---command stdout------------
# | Using Vulkan API
# | Physical device created.
# | Shader module created.
# | Copy command buffer created.
# | Memory buffers created.
# | Executed copy command buffer.
# | Execute command buffer created.
# | Descriptors: { type = 5, count = 3 }
# | Descriptor pool created.
# | Binding 3 descriptors.
# | Num Descriptor sets: 1
# | Updating Descriptor [0] { 0, 0 }
# | Updating Descriptor [1] { 0, 1 }
# | Updating Descriptor [2] { 0, 2 }
# | WriteDescriptors: 3
# | Descriptor sets created.
# | Compute pipeline created.
# | Dispatched compute shader: { 1, 1, 1 }
# | Commands created.
# | Executed compute command buffer.
# | Compute pipeline created.
# | Cleanup complete.
# `-----------------------------
# .---command stderr------------
# | Test failed: FloatMatOut
# | Comparison Rule: BufferExact
# | Expected:
# | ---
# | Name:            ExpectedFloatOut
# | Format:          Float32
# | Data:            [ 1.1, 2.2, 3.3, 4.4 ]
# | OutputProps:
# |   Height:          0
# |   Width:           0
# |   Depth:           0
# | ...
# | Got:
# | ---
# | Name:            FloatMatOut
# | Format:          Float32
# | Data:            [ 0, 0, 0, 0 ]
# | OutputProps:
# |   Height:          0
# |   Width:           0
# |   Depth:           0
# | ...
# | Full Hex 64bit representation of Expected Buffer Values:
# | [ 0x1.1, 0x2.2, 0x3.3, 0x4.4 ]
# | Full Hex 64bit representation of Actual Buffer Values:
# | [ 0x0, 0x0, 0x0, 0x0 ]
# | 
# | Test failed: IntMatOut
# | Comparison Rule: BufferExact
# | Expected:
# | ---
# | Name:            ExpectedIntOut
# | Format:          Int32
# | Data:            [ 1, 2, 3, 4 ]
# | OutputProps:
# |   Height:          0
# |   Width:           0
# |   Depth:           0
# | ...
# | Got:
# | ---
# | Name:            IntMatOut
# | Format:          Int32
# | Data:            [ 0, 0, 0, 0 ]
# | OutputProps:
# |   Height:          0
# |   Width:           0
# |   Depth:           0
# | ...
# | Full Hex 64bit representation of Expected Buffer Values:
# | [ 0x1, 0x2, 0x3, 0x4 ]
# | Full Hex 64bit representation of Actual Buffer Values:
# | [ 0x0, 0x0, 0x0, 0x0 ]
# | 
# `-----------------------------
# error: command failed with exit status: 1

--

Metadata

Metadata

Assignees

No one assigned

    Labels

    driver-bugBugs that are likely or confirmed GPU driver bugs

    Type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions