-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[ETHOSN] Transpose fully connected weights #12970
Conversation
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 Luke for the fix. Surprised that none of the common networks picked it up. Just a few nits and questions.
The NPU driver stack expects weights in IO (HWIO) format, however, Relay uses an OI representation. Although the shape of the weight tensor was correctly changed during codegen, the values in the weights tensor were not being transposed. This lead to an output mismatch when the output "units" was > 1. The tests didn't catch this due to using a weights tensor of all 1's. Change-Id: I51b2bcd14b677280ef3b6a6845d56b7dfacc7d6a
e14bfcf
to
66972bf
Compare
* Refactor use of weight transpose to common file between contrib codegens. * Make function areguments more explicit. * Update network hashes. Change-Id: Ib53bc7d2837b62908b92fd09062cbe9a8bb4ab30
66972bf
to
53b3383
Compare
Change-Id: Ie89e429da222ffe17bc8faf831bf59217008a68a
Thanks for the review @ashutosh-arm, this is ready for another look :) |
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 Luke for making the changes. Looks much cleaner with a separate API. I've left few nits to follow up in the future.
Change-Id: Ie5ded2db3024b9e2c5095f01adea65798fc1da55
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! Thanks Luke 👍
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, thanks @lhutton1!
* [ETHOSN] Transpose fully connected weights The NPU driver stack expects weights in IO (HWIO) format, however, Relay uses an OI representation. Although the shape of the weight tensor was correctly changed during codegen, the values in the weights tensor were not being transposed. This lead to an output mismatch when the output "units" was > 1. The tests didn't catch this due to using a weights tensor of all 1's. Change-Id: I51b2bcd14b677280ef3b6a6845d56b7dfacc7d6a * Address comments * Refactor use of weight transpose to common file between contrib codegens. * Make function areguments more explicit. * Update network hashes. Change-Id: Ib53bc7d2837b62908b92fd09062cbe9a8bb4ab30 * Fix lint Change-Id: I6a1d9ffa8e3a747b7c77c9b27aa1b1c0d4c5cbff * Fix cmsis-nn weights transpose Change-Id: Ie89e429da222ffe17bc8faf831bf59217008a68a * Address comments Change-Id: Ie5ded2db3024b9e2c5095f01adea65798fc1da55
The NPU driver stack expects weights in IO (HWIO) format, however, Relay uses an OI representation. Although the shape of the weight tensor was correctly changed during codegen, the values in the weights tensor were not being transposed. This lead to an output mismatch when the output "units" was > 1. The tests didn't catch this due to using a weights tensor of all 1's.
cc @leandron @ashutosh-arm