[DRAFT][SM6.10][BugFix] Update calculation of loaded bias vector size in MultiplyAdd#8389
Draft
hekota wants to merge 1 commit intomicrosoft:users/hekota/pr8388-fix-size-checkfrom
Draft
Conversation
If the bias vector is packed, the number of components of the loaded vector should be the number of packed components divided by the number of elements per scalar, rounded to the nearest integer. The loaded vector and its interpretation are passed into `__builtin_LinAlg_MatrixVectorMultiplyAdd` built-in function which is lowered to `dx.op.linAlgMatVecMulAdd` op. The expectation is that the op will convert the bias vector to the output vector type based on the bias interpretation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For bias vector with a packed type, when the vector is loaded from memory, the number of components of the loaded vector should be equal to the number of packed components divided by the number of elements per scalar, rounded to the nearest integer. For example
VectorRef<ComponentType::F8_E4M3FN, 7>is loaded intovector<uint,2>.In the LinAlg
MultiplyAddfunction the loaded bias vector and its interpretation are passed into__builtin_LinAlg_MatrixVectorMultiplyAddbuilt-in function which is lowered to thedx.op.linAlgMatVecMulAddop. The expectation is that thedx.op.linAlgMatVecMulAddop will convert the bias vector to the output vector type based on the bias interpretation.Since the sizes of the output, input and bias vectors can all differ, the HLSL intrinsic support had to be extended to support vectors of 3 different sizes in one built-in function.