Align SPV_INTEL_joint_matrix implementation to the spec#3468
Align SPV_INTEL_joint_matrix implementation to the spec#3468vmaksimo wants to merge 2 commits intoKhronosGroup:mainfrom
Conversation
Spec: intel/llvm#12497 Change summary: * added Packed matrix layout to support Intel VNNI instructions. * remove `JointMatrixGetElementCoord` in favor of the same cooperative matrix instruction. * support new Cooperative Matrix Operands to specify component type interpretation for tf32 and bfloat16 types.
YuriPlyakhin
left a comment
There was a problem hiding this comment.
LGTM. Provided one nit comment above. Also, a question: should we first merge intel/llvm#12497 before merging translator changes?
Shortly - we should not. |
There is no such requirement. Most important thing - the spec is public. |
| typedef SPIRVInstTemplate<SPIRVJointMatrixINTELWorkItemInst, \ | ||
| internal::Op##x##INTEL, __VA_ARGS__> \ | ||
| SPIRV##x##INTEL; | ||
| _SPIRV_OP(JointMatrixGetElementCoord, true, 5) |
There was a problem hiding this comment.
To double check, what instruction is used in SYCL headers right now?
There was a problem hiding this comment.
There was a problem hiding this comment.
Okay, then I'd suggest to first replace the joint matrix version to cooperative matrix version in the headers and see if anything fails.
| ; RUN: llvm-as < %s -o %t.bc | ||
| ; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_KHR_cooperative_matrix,+SPV_INTEL_joint_matrix -o %t.spv | ||
| ; RUN: llvm-spirv %t.spv -to-text -o %t.spt | ||
| ; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV |
There was a problem hiding this comment.
Can we have a spirv-val check? Or is not prepared yet?
There was a problem hiding this comment.
I believe SPIR-V Tools don't support SPV_INTEL_joint_matrix at all - and not sure if this work planned by us any time soon or at all (@MrSidims I guess it also affects validation for SPIR-V BE, but it's not critical?)
| ; CHECK-SPIRV-DAG: Extension "SPV_KHR_cooperative_matrix" | ||
| ; CHECK-SPIRV-DAG: Extension "SPV_INTEL_joint_matrix" | ||
| ; CHECK-SPIRV-DAG: Capability CooperativeMatrixBFloat16ComponentTypeINTEL | ||
| ; 64 stays for MatrixAAndBBFloat16ComponentsINTEL (0x40) |
There was a problem hiding this comment.
Should we also test 0x80 and 0x100? I don't see them tested now.
There was a problem hiding this comment.
I just aligned to the tests made in SPIR-VE BE (they also test only this case). Not sure we must add more at this point
Spec: intel/llvm#12497
Change summary:
JointMatrixGetElementCoordin favor of the same cooperative matrix instruction.