-
Notifications
You must be signed in to change notification settings - Fork 769
[SPIR-V][DOC] Add 'Use' parameter to TypeJointMatrixINTEL #5944
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
Conversation
'Use' is an optional parameter that shows where in a math operation the matrix is used. It must be the result of a constant instruction with scalar 'integer type'. Signed-off-by: Dmitry Sidorov <[email protected]>
'Use' is an optional parameter that shows where in a math operation the matrix is used. It must be the result of a constant instruction with scalar 'integer type'. Spec: intel/llvm#5944 Signed-off-by: Dmitry Sidorov <[email protected]>
'Use' is an optional parameter that shows where in a math operation the matrix is used. It must be the result of a constant instruction with scalar 'integer type'. Spec: intel#5944 Signed-off-by: Dmitry Sidorov <[email protected]> Original commit: KhronosGroup/SPIRV-LLVM-Translator@348da24
'Use' is an optional parameter that shows where in a math operation the matrix is used. It must be the result of a constant instruction with scalar 'integer type'. Spec: intel/llvm#5944 Signed-off-by: Dmitry Sidorov <[email protected]> (cherry picked from commit 348da24)
'Use' is an optional parameter that shows where in a math operation the matrix is used. It must be the result of a constant instruction with scalar 'integer type'. Spec: intel/llvm#5944 Signed-off-by: Dmitry Sidorov <[email protected]> (cherry picked from commit 348da24)
'Use' is an optional parameter that shows where in a math operation the matrix is used. It must be the result of a constant instruction with scalar 'integer type'. Spec: intel/llvm#5944 Signed-off-by: Dmitry Sidorov <[email protected]>
|
||
|
||
1+|Capability: + | ||
*{capability_name}* | ||
1+| 7 | {OpTypeJointMatrixINTEL_token} | ||
1+| 8 | {OpTypeJointMatrixINTEL_token} |
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.
Use
is an optional argument, which means that operands count is not always 8
, it should probably say 7+
instead
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.
Done, thanks!
@@ -192,11 +200,15 @@ It must be the result of a constant instruction. + | |||
+ | |||
'Scope' is memory scope for operations on the matrix. It must be the | |||
result of a constant instruction with scalar 'integer type'. + | |||
+ | |||
'Use' is an optional parameter that shows where in a math operation the matrix | |||
is used. It must be the result of a constant instruction with scalar |
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.
Integer type
is already defined as scalar in the core spec, so you can simplify this definition and probably spell integer
starting with uppercase letter to highlight that you are referring to an existing term.
Also: do we need to explicitly specify that the value is expected to be from Use
table above and not just any arbitrary integer (like 42, for example)?
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.
well, it makes sense, but "'integer type' scalar" is a commonly used wording across https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.pdf . Regarding the values - added this info, though there is some misalignments in the spec, guess, which should be corrected.
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 think it would be best to document this similar to the way Scope <id>s are documented:
Must be an <id> of a 32-bit integer scalar. Its value is expected to be one of the values in the table below. If validation rules or the client API require a constant <id>, it is invalid for it to not be one of these values. If non-constant <id> are allowed, behavior is undefined if <id> is not one of these values.
Since the Use is an optional parameter what is the behavior if the optional parameter is omitted?
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 great suggestion, Ben! I've also aligned Layout parameter with this definition. And I'll adopt it for Scope as well.
Since the Use is an optional parameter what is the behavior if the optional parameter is omitted?
Per new revision it's now a mandatory parameter, before that it was up to the devices' backends to decide.
Signed-off-by: dmitry.sidorov <[email protected]>
85a18d1
to
699248a
Compare
Signed-off-by: Sidorov, Dmitry <[email protected]>
Signed-off-by: Sidorov, Dmitry <[email protected]>
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.
Hi, I have a few questions and found a few spelling errors.
sycl/doc/design/spirv-extensions/SPV_INTEL_joint_matrix.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/design/spirv-extensions/SPV_INTEL_joint_matrix.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/design/spirv-extensions/SPV_INTEL_joint_matrix.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/design/spirv-extensions/SPV_INTEL_joint_matrix.asciidoc
Outdated
Show resolved
Hide resolved
sycl/doc/design/spirv-extensions/SPV_INTEL_joint_matrix.asciidoc
Outdated
Show resolved
Hide resolved
'Layout' indicates how the values loaded from memory are arranged. | ||
It must be the result of a constant instruction. + | ||
+ | ||
'Scope' is syncronization scope for operation on the matrix. It must be the | ||
result of a constant instruction with scalar 'integer type'. + | ||
Must be an '<id>' of a 32-bit integer scalar. Its value is expected to be one of | ||
the values in the table 3.XX, Matrix Layout. If validation rules or the client API | ||
require a constant '<id>', it is invalid for it to not be one of these values. | ||
If non-constant '<id>' are allowed, behavior is undefined if '<id>' is not one of | ||
these values. + |
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.
Should this be changed to say that "Layout" indicates how the values in memory are arranged? Presumably the way the values loaded from memory are arranged are indicated by the "Layout" of the OpTypeJointMatrix type Result Type instead.
Also, just to confirm: there are no requirements that the two layouts match, and the full set of combinations must be supported?
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.
Applied
Also, just to confirm: there are no requirements that the two layouts match, and the full set of combinations must be supported?
AFAIU yes
@@ -270,11 +306,19 @@ where elements of the matrix must be stored and arranged according to 'Layout'. | |||
'Stride' is the number of elements in memory between beginnings of successive | |||
rows, columns (or words) of the 'Object'. It must be a scalar integer type. + | |||
+ | |||
'Layout' indicates how the values stored to memory are arranged. It must be the | |||
result of a constant instruction. + | |||
'Layout' indicates how the values stored to memory are arranged. |
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.
Similar to the load instruction, I would find this sentence to be clearer if it were changed to say that it indicates how the values that are stored are arranged in memory (assuming this is the intent).
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.
Applied
either _Workgroup_ or _Subgroup_ from the table 3.27. Scope <id>. If validation | ||
rules or the client API require a constant '<id>', it is invalid for it to not | ||
be one of these values. If non-constant '<id>' are allowed, behavior is | ||
undefined if '<id>' is not one of these values. + |
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'm guessing there are some other requirements for the "Use" of the A, B, and C matrix operands that should be documented here? As an example it is probably an error (or, if it cannot be statically checked, behavior is undefined) if the "Use" for the A matrix is MatrixB or Accumulator?
Same goes for all other variants of OpJointMatrixXXMadINTEL.
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.
Applied
| 0 | *MatrixA* | *{capability_name}* | ||
| 1 | *MatrixB* | *{capability_name}* | ||
| 2 | *Accumulator* | *{capability_name}* | ||
| 3 | *Unnecessary* | *{capability_name}* |
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.
The Unnecessary use is never documented anywhere in this extension. Should it be?
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.
That's actually a spec bug, there shouldn't be any Unnecessary
value for Use parameter, instead there should be Unused
Layout value. I'll update the spec
Signed-off-by: Sidorov, Dmitry <[email protected]>
Signed-off-by: Sidorov, Dmitry <[email protected]>
| 3 | *PackedB* + | ||
Suitable for VNNI instructions | *{capability_name}* | ||
| 4 | *Unused* + | ||
| 3 | *Unused* + | ||
Only valid for _TypeJointMatrixINTEL_ | *{capability_name}* |
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.
change use names to: A, B, Accumulator
or
MatrixA, matrixB, MatrixAccumulator
sycl/doc/design/spirv-extensions/SPV_INTEL_joint_matrix.asciidoc
Outdated
Show resolved
Hide resolved
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.
LGTM
Closing as no longer needed |
'Use' is an optional parameter that shows where in a math operation the matrix
is used. It must be the result of a constant instruction with scalar
'integer type'.
Signed-off-by: Dmitry Sidorov [email protected]