Add QLinearConv for activations=u8, weights=s8#5510
Merged
Conversation
Contributor
Author
|
/azp run orttraining-linux-gpu-ci-pipeline |
|
Azure Pipelines successfully started running 1 pipeline(s). |
yufenglee
reviewed
Oct 19, 2020
| auto X_zero_point_value = *(X_zero_point->template Data<uint8_t>()); | ||
| auto Y_zero_point_value = *(Y_zero_point->template Data<uint8_t>()); | ||
|
|
||
| const auto& W_zero_point_shape = W_zero_point->Shape(); |
Member
There was a problem hiding this comment.
W_zero_point_shape [](start = 14, length = 18)
Looks like scale and zero point can be checked in PrePacking.
Contributor
Author
There was a problem hiding this comment.
Yeah, but this could be addressed later.
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.
Description: Add an implementation of QLinearConv for the case of activations=u8 and weights=s8.
Motivation and Context
This implementation reworks QLinearConv to internally do a NCHW->NHWC transpose, then a threaded im2col+GEMM+requantization, then a transpose back to NCHW. All of this ends up being faster than the u8u8 implementation that only partially threaded the convolution and went through a slower im2col path. This u8s8 version also supports per-channel weight quantization to help improve accuracy.