Skip to content

Conversation

MrSidims
Copy link
Contributor

The patch adds TypeJointMatrixINTELv2 which maps to new type OpCode
6184. Under new OpCode matrix type no longer has Layout parameter. The patch also moved 'scope' to optional matrix muladd instruction.

The changes are done only in the consumer part to prepare the switch and make E2E switch backward compatible by preparing consumers ahead of time.

Unfortunately there is no way to add a test foe this unless it's binary test, but it seems to be a bit unsafe to add this, so the patch was tested localy.

Spec change:
intel/llvm#8175

The patch adds TypeJointMatrixINTELv2 which maps to new type OpCode
6184. Under new OpCode matrix type no longer has Layout parameter.
The patch also moved 'scope' to optional matrix muladd instruction.

The changes are done only in the consumer part to prepare the switch and
make E2E switch backward compatible by preparing consumers ahead of time.

Unfortunately there is no way to add a test foe this unless it's binary
test, but it seems to be a bit unsafe to add this, so the patch was
tested localy.

Spec change:
intel/llvm#8175

Signed-off-by: Sidorov, Dmitry <[email protected]>
@MrSidims
Copy link
Contributor Author

@asudarsa @maksimsab @jgstarIntel please take a look

Copy link
Contributor

@maksimsab maksimsab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see in the patch description that scope is moved to optional matrix muladd instruction.

Could you please clarify where is it done? Unfortunately, not obvious for me :(

SPIRVModule *M, SPIRVId TheId, SPIRVType *CompType,
std::vector<SPIRVValue *> Args)
: SPIRVType(M, FixedWC + Args.size(), internal::OpTypeJointMatrixINTEL,
TheId), CompType(CompType), Args(Args) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest Args(std::move(Args)) here. Although this is a copy of previous constructor, I wouldn't copy small flaws.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! We probably should also scan other places in the translator to embrace this optimization

return Args[2];
return nullptr;
}
SPIRVValue *getScope() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please separate this methods by blank lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied

Comment on lines +3333 to +3336
_SPIRV_OP(JointMatrixMad, true, 6, true)
_SPIRV_OP(JointMatrixSUMad, true, 6, true)
_SPIRV_OP(JointMatrixUSMad, true, 6, true)
_SPIRV_OP(JointMatrixUUMad, true, 6, true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maksimsab move of scope parameter happens here (see the second 'true').

Note, that 'scope' according to old spec is mandatory parameter and per new spec is removed at all. So to balance it here making both representations translatable we have to add is as optional for a while.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Signed-off-by: Sidorov, Dmitry <[email protected]>
@MrSidims MrSidims requested a review from maksimsab April 3, 2023 13:05
Signed-off-by: Sidorov, Dmitry <[email protected]>
Copy link
Contributor

@maksimsab maksimsab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you

@MrSidims MrSidims merged commit a6fcade into KhronosGroup:main Apr 4, 2023
fda0 pushed a commit to fda0/SPIRV-LLVM-Translator that referenced this pull request May 22, 2025
…onosGroup#1935)

The patch adds TypeJointMatrixINTELv2 which maps to new type OpCode
6184. Under new OpCode matrix type no longer has Layout parameter. The patch also moved 'scope' to optional matrix muladd instruction.

The changes are done only in the consumer part to prepare the switch and make E2E switch backward compatible by preparing consumers ahead of time.

Unfortunately there is no way to add a test foe this unless it's binary test, but it seems to be a bit unsafe to add this, so the patch was tested locally.

Spec change:
intel/llvm#8175

Signed-off-by: Sidorov, Dmitry <[email protected]>
(cherry picked from commit a6fcade)
bokrzesi added a commit to bokrzesi/SPIRV-LLVM-Translator that referenced this pull request Jun 10, 2025
bokrzesi added a commit to bokrzesi/SPIRV-LLVM-Translator that referenced this pull request Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants