forked from openxla/stablehlo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verifier and Type inference changes for reduction operations (openxla…
…#1869) Implements the specification changes at openxla#1796. The PR adds/updates the verifier and type inference routines for the following ops: `reduce, reduce_window, select_and_scatter, all_reduce, reduce_scatter, scatter`. Please refer to openxla#1796 for the updated constraints which the PR implements. Note the openxla#1796 is going to be merged soon. Here are the changes for each operation: - reduce - openxla#1796 added a new constraint C8 - Updated labels - Add positive tests and negative tests verifying reduce_c6 at verify_reduce.mlir and type inference tests at infrer_stablehlo.mlir, for reduce_c8. - reduce_window: - openxla#1796 updated the C16 - Add positive tests ; negative tests verifying reduce_window_c13 at verify_reduce_window.mlir and type inference tests at infrer_stablehlo.mlir, for reduce_window_c16. - select_and_scatter - openxla#1796 added a new constraint C12 - Updated labels - Add positive tests ; negative tests verifying selelct_and_scatter_c10 at verify_select_and_scatter.mlir and type inference tests at infrer_stablehlo.mlir, for select_and_scatter_c12. - scatter - openxla#1796 added a new constraint C17 - Updated labels - Add positive tests ; negative tests verifying scatter_c15 at verify_scatter.mlir and type inference tests at infrer_stablehlo.mlir, for scatter_C17. - reduce_scatter - openxla#1796 added a new constraint C9 - This op does not have the type inference supported. We had a trait `SameOperandsAndResultElementType` implementing the outdated constraint. For the new constraint C9, we added a check at `verifyReduceScatterOp`. - Add positive tests; negative tests verifying reduce_scatter_C7 at ops_stablehlo.mlir and type inference tests at ops_stablehlo.mlir, for reduce_scatter_C9. - all_reduce - openxla#1796 added a new constraint C7 - This op implemented an outdated constraint related to type inference using `inferReturnTypeComponentsFromOperands`. For the new constraint C9, we added a trait `InferTensorType` in the tablegen definition of the op. - Updated labels - Add positive tests; negative tests verifying all_reduce_C5 at ops_stablehlo.mlir and type inference tests at ops_stablehlo.mlir, for all_reduce_C7.
- Loading branch information
Showing
20 changed files
with
3,699 additions
and
75 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
Oops, something went wrong.