-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VHLO legalization of StableHLO UniformQuantizedPerAxisType (#1986)
The PR enables 1. VHLO legalization of StableHLO UniformQuantizedPerAxisType. 2. Writing/reading from bytecode format. The mlir::quant dialect has two different Quantized types, [one](https://github.com/llvm/llvm-project/blob/e2bb91b25c8740625fecd127c1d908a2fabd0102/mlir/include/mlir/Dialect/Quant/QuantTypes.h#L255) for per-tensor and the [other](https://github.com/llvm/llvm-project/blob/e2bb91b25c8740625fecd127c1d908a2fabd0102/mlir/include/mlir/Dialect/Quant/QuantTypes.h#L315) for per-axis. Following the same analogy, we are now having two types in VHLO `UniformQuantizedV1Type` and `UniformQuantizedPerAxisV1Type` resp. Also added the legalization of StableHLO -> VHLO and VHLO -> StableHLO for the corresponding types. Regarding testing the compatibility, we only added this feature (of new per-axis type) to [stablehlo_legalize_to_vhlo.0_17_0.mlir](https://github.com/openxla/stablehlo/compare/main...sdasgup3:serialize-per-axis-quantization-type?expand=1#diff-d78cbc82314e64545ee7b9f6a66a0b910f4a8ac2e7f27e2ad55c4b33d2ea409c. @GleasonK Please let me know if the feature needs to be added to earlier version as well.
- Loading branch information
Showing
11 changed files
with
2,627 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.