-
-
Notifications
You must be signed in to change notification settings - Fork 56.4k
Replace interactive batched Matrix Multiply. #24812
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
|
|
||
| std::vector<Mat> output; | ||
| Mat reshapedInput1 = input1; | ||
| Mat reshapedInput2 = input2; |
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.
Could you elaborate why reshape is needed here? fastGemmBatch can already handle multiplification of n-dimensional matrices.
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.
This is required as some tensors might come in with dummy deletion BxNxMx1. Reshape just removes that dummy dimension.
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.
Could you give a real Einsum example of dummy deletion BxNxMx1?
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.
This dummy dimension on BxNxMx1 appears during pre-processing for some tensors. The reshape is not needed because we want to multiply 2 tenors with dummy dimension.
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.
@fengyuentau is there anything to change more? Could you please approve if not ?
asmorkalov
left a comment
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.
👍
|
@dkurt any comments? |
This PR replaces iterative batch matrix multiplication which
FastGemmBatchin Einsum layer.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.