-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add spec for UniformDequantizeOp #530
Labels
Comments
Will be handled as part of the quantization speccing effort (#588). |
sdasgup3
added a commit
that referenced
this issue
Jun 19, 2023
fixes #531 fixes #530 ## Summary The PR proposes the specification for `uniform.quantize` and `uniform.dequantize` ops. The specification of `uniform.quantize` also captures the re-quantization conversions from quantized tensor to quantized tensors. Please let me know your feedback. ### Working notes on following the `reference_checklist.md` and `spec_checkilist.md` #### uniform_dequantize We have the following constraints from the spec ``` (I1) `operand` is a quantized tensor (C1) `shape(operand) = shape(result)`. (C2) `element_type(result) = expressed_type(operand)`. ``` These constraints will be comprehensively covered by the following tests: ``` I1: a) `operand: quantized tensors`. (Covered by ODS). C1: a) `shape(operand) != shape(result)`. (Covered by ODS) C2: a) `element_type(result) != expressed_type(operand)`. ``` If we drop the "Covered by ODS" pieces, this will leave us with the following test cases: ``` C2: a) `element_type(result) != expressed_type(operand)`. ``` We already has a type inference test to cover the above. #### uniform_quantize We have the following constraints from the spec ``` (I1) `operand: tensor of floating-point or quantized type`. (C1) `shape(operand) = shape(result)`. (C2) `expressed_type(result) = is_float(operand) ? element_type(operand) : expressed_type(operand)`. ``` These constraints will be comprehensively covered by the following tests: ``` I1: a) `operand: quantized tensors`. (Covered by ODS). C1: a) `shape(operand) != shape(result)`. (Covered by ODS) C2: a) if_float(operand): `expressed_type(result) != element_type(operand)`. b) if_quantized(operand): `expressed_type(result) != expressed_type(operand)`. ``` If we drop the "Covered by ODS" pieces, this will leave us with the following test cases: ``` C2: a) if_float(operand): `expressed_type(result) != element_type(operand)`. b) if_quantized(operand): `expressed_type(result) != expressed_type(operand)`. ``` The above will be covered as part of #1603.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Request description
To spec
stablehlo.uniform_dequantize
The text was updated successfully, but these errors were encountered: