-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue when targeting a patch version for serialization (#2598)
We want to allow targeting patch version because we allow `-target=current` so it makes sense that current can resolve to a patch version. That said we write our compat passes against patch v0 since all opset changes require a minor version bump and therefore have patch v0. This PR implements "version flooring" inside the vhlo-to-version pass.
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// RUN: stablehlo-opt --stablehlo-legalize-to-vhlo --vhlo-to-version='target=1.4.1' %s | FileCheck %s | ||
|
||
// AllToAll was in the initial StableHLO opset, but changed in v1.5.0 to have | ||
// tuple arguments. Ensure that serializing for 1.4.1 is valid and targets the | ||
// v1.4.0 opset. | ||
// | ||
// This will catch issues in op `isLegal` checks: | ||
// op.minVersion() <= target <= op.maxVersion() | ||
|
||
// CHECK-LABEL: vhlo.func_v1 @all_to_all | ||
func.func public @all_to_all(%arg0: tensor<8x8x1xui16>) -> tensor<1x8x8xui16> { | ||
// CHECK: vhlo.all_to_all_v1 | ||
%0 = "stablehlo.all_to_all"(%arg0) <{concat_dimension = 2 : i64, replica_groups = dense<[[0, 1, 2, 3, 4, 5, 6, 7]]> : tensor<1x8xi64>, split_count = 8 : i64, split_dimension = 0 : i64}> : (tensor<8x8x1xui16>) -> tensor<1x8x8xui16> | ||
return %0 : tensor<1x8x8xui16> | ||
} |
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