-
Notifications
You must be signed in to change notification settings - Fork 696
[TOSA] Replace Linear lowering of using Matmul with Conv2d #1336
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
Jerry-Ge
commented
Dec 1, 2023
- The existing Vela compiler doesn't support Matmul and TOSA.Fully_Connected will be deprecated
- Also add support for linear layers with rank>2 + tests
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/1336
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 78d0594 with merge base d96c49e ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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 at a high level, let's close the comments?
| [bias_reshape_res.name, mm_res.name], | ||
| [add_res.name], | ||
| None, | ||
| TosaOp.Op().CONV2D, |
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.
what's the rationale to use conv2d instead? Is it to support U55 better through older TOSA?
Any perf impact?
Also document that the input is in NHWC and weights are in OHWI.
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.
U55 doesn't support matmul from two activation channels (it has operations which are activation, weights as input). This should also be faster generally as weight inputs are typically optimised.
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.
Ok. IIUC, should we lower something like torch.[b]mm to this as well?
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.
Ok. IIUC, should we lower something like torch.[b]mm to this as well?
i think so.
- Rationale: Vela compiler doesn't support Matmul and TOSA.Fully_Connected will be deprecated - Also added support for linear layers with rank>2 and tests - Temporarily removed the DuplicateDequantNodePass since the transform API now forces verifier but haven't supported quantized ops yet Signed-off-by: Jerry Ge <jerry.ge@arm.com>
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, let me know if you are ready I can merge it. Thanks @Jerry-Ge
|
@digantdesai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
thanks Digant! it's ready and let's merge it. |
|
@digantdesai merged this pull request in 99f912a. |