Repository navigation
Conversation
Change-Id: I902b6ac47788dfb5083463e3ab02a23985e1ba52
|
This PR currently captures the working draft for the coming cl_khr_cooperative_matrix extension. The OpenCL working group is still making minor changes to the specification. We decided to continue doing this in public so we could engage with a wider set of stakeholders. Feedback welcome! |
| {clGetDeviceCooperativeMatrixInfoKHR} device query, otherwise | ||
| the behavior of the program is undefined. | ||
|
|
||
| For *OpTypeCooperativeMatrixMulAddKHR*, the operands must match a supported |
There was a problem hiding this comment.
| For *OpTypeCooperativeMatrixMulAddKHR*, the operands must match a supported | |
| For *OpCooperativeMatrixMulAddKHR*, the operands must match a supported |
| * {CL_DEVICE_COOPERATIVE_MATRIX_COMPONENT_TYPE_SINT8_KHR_anchor} corresponds to SPIR-V `OpTypeInt 8 0`. | ||
| * {CL_DEVICE_COOPERATIVE_MATRIX_COMPONENT_TYPE_SINT16_KHR_anchor} corresponds to SPIR-V `OpTypeInt 16 0`. | ||
| * {CL_DEVICE_COOPERATIVE_MATRIX_COMPONENT_TYPE_SINT32_KHR_anchor} corresponds to SPIR-V `OpTypeInt 32 0`. | ||
| * {CL_DEVICE_COOPERATIVE_MATRIX_COMPONENT_TYPE_SINT64_KHR_anchor} corresponds to SPIR-V `OpTypeInt 64 0`. |
There was a problem hiding this comment.
Should these be OpTypeInt xx 1 to indicate signedness?
There was a problem hiding this comment.
Probably not, as the OpenCL SPIR-V Environment Specification Section 4 "Validation Rules" says:
For all OpTypeInt integer type-declaration instructions:
- Signedness must be 0, indicating no signedness semantics.
| <type name="cl_device_cooperative_matrix_variant_khr"/> | ||
| <type name="cl_device_cooperative_matrix_component_type_khr"/> | ||
| <type name="cl_device_cooperative_matrix_info_khr"/> |
There was a problem hiding this comment.
...variant_khr should go after ...component_type_khr as the former (a struct type) contains elements of the latter, and the wrong order breaks the generated header. I'd suggest putting the struct type after the cl_uint types, like so:
| <type name="cl_device_cooperative_matrix_variant_khr"/> | |
| <type name="cl_device_cooperative_matrix_component_type_khr"/> | |
| <type name="cl_device_cooperative_matrix_info_khr"/> | |
| <type name="cl_device_cooperative_matrix_component_type_khr"/> | |
| <type name="cl_device_cooperative_matrix_info_khr"/> | |
| <type name="cl_device_cooperative_matrix_variant_khr"/> |
|
Feedback on floating-point accumulation, for this draft and the OpenCL C companion (#1627). SPV_KHR_cooperative_matrix leaves two things to the client API: "The order of the operations is implementation-dependent" and "The internal precision of floating-point operations is defined by the client API". The environment section in this PR does not define the internal precision, and #1627 adds to section 7.4 that A small suggestion while
A device that sets neither flag loses nothing, and the query needs no hardware. Libraries can use it to choose an algorithm or state an error bound, and applications that need repeatable results (regression tests, safety cases) can check for it instead of finding out by testing. RISC-V's matrix extension draft (Zvvm, in architecture review) takes a similar line: each implementation must disclose its accumulation parameters. Adding a member now avoids a separate query once the struct has shipped. AI tool usage: written with the assistance of Claude Code; the quotations are from the specifications and drafts linked. |
No description provided.