-
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
[ONNX] [#8838] QLinearLeakyRelu contrib op #9063
Conversation
You hit a known issue with CI's lint that was just fixed, rebase? |
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.
Minor request for documentation, otherwise looks good, thanks!
a = _qnn.op.dequantize(inputs[0], a_scale, a_zero_point) | ||
out = _op.nn.leaky_relu(a, alpha) | ||
return _qnn.op.quantize(out, y_scale, y_zero_point, out_dtype=dtype) |
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.
If we're dequantinzing, can you provide a link to ORT doing the same thing? if this is an ORT op and they're running it in int8, I'd prefer to import it in int8 here?f
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.
Added the ORT op definition from docs
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.
If alpha is a power of two e.g. 1 / 16 or 1 / 8, then we can implement this via bit shift operations assuming zero can be represented in the quantization scheme. Not making a suggestion or anything, just thought it was an interesting point.
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.
It would be an interesting point to try out. Here, we wanted to reuse the existing function.
c98c55b
to
c6c5b76
Compare
@gayatripk1 can you jostle CI via an empty commit e.g. |
Done |
@gayatripk1 think you need to jostle ci once more. Ci is a little flaky :/ |
Done |
thanks @gayatripk1 |
* [ONNX] QLinearLeakyRelu contrib op * Add comment * jostle ci * jostle ci
* [ONNX] QLinearLeakyRelu contrib op * Add comment * jostle ci * jostle ci
This PR implements com.microsoft.QLinearLeakyRelu. This is implemented as dequantize->LeakyRelu->quantize for now.