-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for offset load/store #2804
base: main
Are you sure you want to change the base?
Add support for offset load/store #2804
Conversation
!4 = !{} | ||
!5 = !{i16 6, i16 14} | ||
!6 = !{!"-ze-opt-level=O2"} | ||
!7 = !{!"ModuleMD", !8, !9, !111, !112, !143, !144, !148, !151, !152, !153, !189, !215, !228, !229, !230, !246, !247, !248, !249, !250, !251, !252, !253, !254, !255, !259, !260, !267, !268, !269, !270, !271, !272, !273, !274, !275, !276, !277, !278, !280, !284, !285, !286, !287, !288, !289, !290, !291, !292, !293, !294, !295, !296, !297, !298, !299, !300, !301, !302, !303, !304, !305, !307, !310, !311, !312, !314, !315, !316, !321} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please shorten the tests - we won't need all of these metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions! I have updated the test.
… accepts two separate arguments: the row index and the column index.
0bf6ab2
to
47c9ada
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 nits, other than that the patch is LGTM
@@ -3710,6 +3710,27 @@ _SPIRV_OP(CooperativeMatrixStoreChecked, false, 8, true, 8) | |||
_SPIRV_OP(CooperativeMatrixConstructChecked, true, 8) | |||
#undef _SPIRV_OP | |||
|
|||
class SPIRVJointMatrixOffsetInstructionsINTELInstBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class SPIRVJointMatrixOffsetInstructionsINTELInstBase | |
class SPIRVCooperativeMatrixOffsetInstructionsINTELInstBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I have fixed this :)
|
||
#define _SPIRV_OP(x, ...) \ | ||
typedef SPIRVInstTemplate< \ | ||
SPIRVJointMatrixOffsetInstructionsINTELInstBase, \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have also fixed this.
@@ -0,0 +1,152 @@ | |||
; This is an adapted copy of test/extensions/INTEL/SPV_INTEL_joint_matrix/joint_matrix.ll |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use KHR/SPV_KHR_cooperative_matrix test as the template...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions! I have updated the test :)
; CHECK-SPIRV: CooperativeMatrixLoadOffsetINTEL [[#MatTy1]] | ||
; CHECK-SPIRV: CooperativeMatrixLoadOffsetINTEL [[#MatTy2]] | ||
; CHECK-SPIRV: CooperativeMatrixLoadOffsetINTEL [[#MatTy3]] | ||
; CHECK-SPIRV: JointMatrixMadINTEL [[#MatTy1]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...so here we would have CooperativeMatrixMulAddKHR instruction.
Reason: JointMatrixMadINTEL will be deprecated. And real-life SYCL joint_matrix workflows with switch to cooperative matrix KHR when intel/llvm#16045 is merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I have change this.
Add a new form of load/store operations for cooperative matrices that accepts two separate arguments: the row index and the column index. Unlike the original approach requiring a pointer to the matrix base, this new form of load/store operations is expected to yield better optimized code on 2dblock read/write instructions on PVC.
ICapabilityCooperativeMatrixOffsetInstructionsINTEL = 6211
IOpCooperativeMatrixLoadOffsetINTEL = 6212
IOpCooperativeMatrixStoreOffsetINTEL = 6213