Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup: Remove duplicate quantization checks (openxla#2566)
The recent upstream [change](llvm/llvm-project#100667) have introduced quantization checks that are already present in the StableHLO core library. This commit removes these duplicate checks to avoid redundancy and potential inconsistencies. |Checks proposed to be removed| StableHLO Code | Upstream MLIR | |-|-|-| | `channel-axis >= 0`| [cs](https://github.com/openxla/stablehlo/blob/1c0547f391dff5ac71d36dc20a916260afa78c61/stablehlo/dialect/Base.cpp#L795) | [cs](https://github.com/llvm/llvm-project/blob/96f37ae45310885e09195be09d9c05e1c1dff86b/mlir/lib/Dialect/Quant/IR/QuantTypes.cpp#L399) | | scale within smallest and largest finite numbers determined by `expressed_type`| [cs](https://github.com/openxla/stablehlo/blob/1c0547f391dff5ac71d36dc20a916260afa78c61/stablehlo/dialect/Base.cpp#L765) | [cs1](https://github.com/llvm/llvm-project/blob/96f37ae45310885e09195be09d9c05e1c1dff86b/mlir/lib/Dialect/Quant/IR/QuantTypes.cpp#L327) [cs2](https://github.com/llvm/llvm-project/blob/96f37ae45310885e09195be09d9c05e1c1dff86b/mlir/lib/Dialect/Quant/IR/QuantTypes.cpp#L393C9-L393C45) | Note that StableHLO has checks like `quantization_dimension < rank(self)` and `dim(self, quantization_dimension) = size(scales)` implemented at [cs](https://github.com/openxla/stablehlo/blob/1c0547f391dff5ac71d36dc20a916260afa78c61/stablehlo/dialect/Base.cpp#L795). In upstream MLIR similar checks [cs](https://github.com/llvm/llvm-project/blob/96f37ae45310885e09195be09d9c05e1c1dff86b/mlir/lib/Dialect/Quant/IR/QuantOps.cpp#L51) are encoded as part of [dcast](https://github.com/llvm/llvm-project/blob/96f37ae45310885e09195be09d9c05e1c1dff86b/mlir/lib/Dialect/Quant/IR/QuantOps.cpp#L110) and [qcast](https://github.com/llvm/llvm-project/blob/96f37ae45310885e09195be09d9c05e1c1dff86b/mlir/lib/Dialect/Quant/IR/QuantOps.cpp#L139) ops and hence cannot be claimed as duplicate. related upstream clean-up llvm/llvm-project#110604
- Loading branch information