Skip to content

[LongVec] Add Dot Product test cases - #1445

Open
farzonl wants to merge 2 commits into
llvm:mainfrom
farzonl:tests/issue-1443
Open

[LongVec] Add Dot Product test cases#1445
farzonl wants to merge 2 commits into
llvm:mainfrom
farzonl:tests/issue-1443

Conversation

@farzonl

@farzonl farzonl commented Aug 17, 2026

Copy link
Copy Markdown
Member

resolves #1443

In Clang we have 3 unique dot product intrinsics
covering floating point, unsigned, and signed integers.

These test cover these 3 unique paths.

resolves llvm#1443

In Clang we have 3 unique dot product intrinsics
covering floating point, unsigned, and signed integers.

These test cover these 3 unique paths.
Comment thread test/Feature/HLSLLib/dot.longvec.u32.test
Comment thread test/Feature/HLSLLib/dot.longvec.s32.test
Comment thread test/Feature/HLSLLib/dot.longvec.fp32.test
the Windows CI machines don't have SM 6.9 support yet. we can however test sm 6_9 on macos agents funny enough.

Co-authored-by: Farzon Lotfi <farzonl@gmail.com>
@farzonl

farzonl commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

The intel failures are XPasses. There is one legit failure on Metal that I will need to investigate before asking for reviews:

******************** TEST 'OffloadTest-mtl :: Feature/HLSLLib/dot.longvec.fp32.test' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 103
/Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/split-file /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/OffloadTest/test/Feature/HLSLLib/dot.longvec.fp32.test /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot.longvec.fp32.test.tmp
# executed command: /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/split-file /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/OffloadTest/test/Feature/HLSLLib/dot.longvec.fp32.test /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot.longvec.fp32.test.tmp
# RUN: at line 104
"/Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin/dxc-3.7" -T cs_6_9 -Fo /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot.longvec.fp32.test.tmp.o /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot.longvec.fp32.test.tmp/source.hlsl
# executed command: /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/DXC/build/bin/dxc-3.7 -T cs_6_9 -Fo /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot.longvec.fp32.test.tmp.o /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot.longvec.fp32.test.tmp/source.hlsl
# RUN: at line 105
/Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/offloader -debug-layer /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot.longvec.fp32.test.tmp/pipeline.yaml /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot.longvec.fp32.test.tmp.o
# executed command: /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/bin/offloader -debug-layer /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot.longvec.fp32.test.tmp/pipeline.yaml /Users/admin/actions-runner/_work/offload-test-suite/offload-test-suite/llvm-project/build/tools/OffloadTest/test/mtl/Feature/HLSLLib/Output/dot.longvec.fp32.test.tmp.o
# .---command stdout------------
# | Using Metal API
# | Descriptor heap created with 3 descriptors.
# | Creating SRV: { Size = 116, Register = t0, Space = 0 }
# | Creating SRV: { Size = 116, Register = t1, Space = 0 }
# | Creating UAV: { Size = 12, Register = u2, Space = 0, HasCounter = 0 }
# | SRV: HeapIdx = 0 EltSize = 4 NumElts = 29
# | SRV: HeapIdx = 1 EltSize = 4 NumElts = 29
# | UAV: HeapIdx = 2 EltSize = 4 NumElts = 3
# | DescriptorRange[0] { Type=0, NumDescriptors=1, BaseShaderRegister=0, RegisterSpace=0, OffsetInDescriptorsFromTableStart=0 }
# | DescriptorRange[1] { Type=0, NumDescriptors=1, BaseShaderRegister=1, RegisterSpace=0, OffsetInDescriptorsFromTableStart=1 }
# | DescriptorRange[2] { Type=1, NumDescriptors=1, BaseShaderRegister=2, RegisterSpace=0, OffsetInDescriptorsFromTableStart=2 }
# | Resource[0] { Type=Table, Space=4294967295, Slot=4294967295, TopLevelOffset=0, SizeInBytes=8 }
# `-----------------------------
# .---command stderr------------
# | Validation Warning: [ mvk-warn ]
# | VK_ERROR_FEATURE_NOT_PRESENT: Metal does not support buffer robustness.
# | 
# | gpu-exec: error: Failed to compile and link DXIL to Metal IR: IRErrorCodeUnsupportedInstruction
# `-----------------------------
# error: command failed with exit status: 1

I'm not sure why we are getting a VK_ERROR_FEATURE_NOT_PRESENT but it seems unrelated.

The real issue is IRErrorCodeUnsupportedInstruction Maybe the metal IR does not support vectorized dot product. I'm thinking the vectorized signed and unsigned integer dot products are working because they were always implemented as as a vector reduce and sumation, but floats lowered to special hardware units and never went through that kind of math before.

@damyanp
damyanp requested review from bob80905 and kmpeng August 25, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LongVec] Add fp, unsigned, and signed tests for long dot product.

2 participants