-
Notifications
You must be signed in to change notification settings - Fork 436
Add IR instructions for cooperative matrix/vector ops #10643
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
Changes from all commits
252038f
a3dcafa
b206d1c
e164c18
2fc068e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| +1 −3 | include/slang-rhi.h | |
| +18 −14 | src/core/task-pool.cpp | |
| +9 −0 | src/d3d12/d3d12-command.cpp | |
| +21 −1 | src/debug-layer/debug-command-encoder.cpp | |
| +5 −0 | src/debug-layer/debug-device.cpp | |
| +1 −1 | src/debug-layer/debug-helper-functions.cpp | |
| +5 −0 | src/debug-layer/debug-helper-functions.h | |
| +14 −0 | src/enum-strings.cpp | |
| +1 −0 | src/enum-strings.h | |
| +15 −20 | src/rhi-shared.cpp | |
| +11 −4 | src/rhi-shared.h | |
| +5 −0 | src/strings.h | |
| +5 −2 | src/vulkan/vk-command.cpp | |
| +1 −12 | src/vulkan/vk-device.cpp | |
| +15 −0 | src/vulkan/vk-utils.cpp | |
| +2 −0 | src/vulkan/vk-utils.h | |
| +4 −1 | src/wgpu/wgpu-shader-object-layout.cpp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -857,6 +857,23 @@ typedef uint32_t SlangSizeT; | |
| SLANG_STAGE_PIXEL = SLANG_STAGE_FRAGMENT, | ||
| }; | ||
|
|
||
| typedef SlangUInt32 SlangCooperativeMatrixUseIntegral; | ||
| enum SlangCooperativeMatrixUse : SlangCooperativeMatrixUseIntegral | ||
| { | ||
| SLANG_COOPERATIVE_MATRIX_USE_A, | ||
| SLANG_COOPERATIVE_MATRIX_USE_B, | ||
| SLANG_COOPERATIVE_MATRIX_USE_ACCUMULATOR, | ||
| }; | ||
|
|
||
| typedef SlangUInt32 SlangCooperativeVectorMatrixLayoutIntegral; | ||
| enum SlangCooperativeVectorMatrixLayout : SlangCooperativeVectorMatrixLayoutIntegral | ||
| { | ||
| SLANG_COOPERATIVE_VECTOR_MATRIX_LAYOUT_ROW_MAJOR, | ||
| SLANG_COOPERATIVE_VECTOR_MATRIX_LAYOUT_COLUMN_MAJOR, | ||
| SLANG_COOPERATIVE_VECTOR_MATRIX_LAYOUT_INFERENCING_OPTIMAL, | ||
|
jkwak-work marked this conversation as resolved.
|
||
| SLANG_COOPERATIVE_VECTOR_MATRIX_LAYOUT_TRAINING_OPTIMAL, | ||
| }; | ||
|
jkwak-work marked this conversation as resolved.
|
||
|
|
||
| typedef SlangUInt32 SlangDebugInfoLevelIntegral; | ||
| enum SlangDebugInfoLevel : SlangDebugInfoLevelIntegral | ||
| { | ||
|
Comment on lines
858
to
879
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Gap: New public API enums and scalar types lack inline documentation
Suggestion: Add brief Doxygen-style comments: /** Specifies which role a cooperative matrix plays in multiply-accumulate. */
typedef SlangUInt32 SlangCooperativeMatrixUseIntegral;
enum SlangCooperativeMatrixUse : SlangCooperativeMatrixUseIntegral
{
SLANG_COOPERATIVE_MATRIX_USE_A, ///< Left-hand matrix (A) in D = A*B+C
SLANG_COOPERATIVE_MATRIX_USE_B, ///< Right-hand matrix (B) in D = A*B+C
SLANG_COOPERATIVE_MATRIX_USE_ACCUMULATOR, ///< Accumulator matrix (C/D) in D = A*B+C
};And for the scalar types: SLANG_SCALAR_TYPE_BFLOAT16, ///< Brain Float 16: 1 sign + 8 exp + 7 mantissa
SLANG_SCALAR_TYPE_FLOAT_E4M3, ///< FP8 E4M3: 1 sign + 4 exp + 3 mantissa
SLANG_SCALAR_TYPE_FLOAT_E5M2, ///< FP8 E5M2: 1 sign + 5 exp + 2 mantissa |
||
|
|
@@ -1964,7 +1981,10 @@ public: \ | |
| SLANG_SCALAR_TYPE_INT16, | ||
| SLANG_SCALAR_TYPE_UINT16, | ||
| SLANG_SCALAR_TYPE_INTPTR, | ||
| SLANG_SCALAR_TYPE_UINTPTR | ||
| SLANG_SCALAR_TYPE_UINTPTR, | ||
| SLANG_SCALAR_TYPE_BFLOAT16, | ||
| SLANG_SCALAR_TYPE_FLOAT_E4M3, | ||
| SLANG_SCALAR_TYPE_FLOAT_E5M2, | ||
| }; | ||
|
|
||
| // abstract decl reflection | ||
|
|
@@ -2349,6 +2369,11 @@ struct TypeReflection | |
| UInt8 = SLANG_SCALAR_TYPE_UINT8, | ||
| Int16 = SLANG_SCALAR_TYPE_INT16, | ||
| UInt16 = SLANG_SCALAR_TYPE_UINT16, | ||
| IntPtr = SLANG_SCALAR_TYPE_INTPTR, | ||
| UIntPtr = SLANG_SCALAR_TYPE_UINTPTR, | ||
| BFloat16 = SLANG_SCALAR_TYPE_BFLOAT16, | ||
| FloatE4M3 = SLANG_SCALAR_TYPE_FLOAT_E4M3, | ||
| FloatE5M2 = SLANG_SCALAR_TYPE_FLOAT_E5M2, | ||
| }; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| Kind getKind() { return (Kind)spReflectionType_GetKind((SlangReflectionType*)this); } | ||
|
|
||
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.
🟡 Gap: New public API enums lack documentation comments
The neighboring enums in
slang.h(e.g.,SlangDebugInfoLevel,SlangOptimizationLevel,SlangStage) have documentation comments describing their purpose. These two new enums —SlangCooperativeMatrixUseandSlangCooperativeVectorMatrixLayout— are added without any doc comments. Since they're part of the public API consumed by downstream tools and language bindings, documentation would help users understand their role without needing to read the SPIR-V or HLSL specs.Suggestion: