-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve forward incompatibility error messaging (#2569)
Now failure to `--deserialize` a portable artifact will include: 1. The op that failed. 2. The version that the portable artifact was serialized for. 3. The current version of StableHLO. This should help debugging compat issues at a glance. Added a forward incompatible hypothetical feature `vhlo.constant_v99`, serialized for `StableHLO_v2.0.0`, which emulates a current version of StableHLO trying to parse a future operation that doesn't currently exist. ``` $ stablehlo-translate --deserialize file.mlirbc unregistered operation 'vhlo.constant_v99' found in dialect ('vhlo') that does not allow unknown operations note: in bytecode version 6 produced by: StableHLO_v2.0.0 failed to deserialize portable artifact using StableHLO_v1.7.5 ```
- Loading branch information
Showing
16 changed files
with
48 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// RUN: not stablehlo-translate --deserialize %s.bc --verify-diagnostics 2>&1 | FileCheck %s | ||
// | ||
// Note: This file is not valid to parse since VHLO doesn't support unknown | ||
// operations, but is kept around to help visualize the bytecode file in test. | ||
// The bytecode file should not break, as it is a portable artifact with full | ||
// backward compatibility. | ||
|
||
// CHECK: error: unregistered operation 'vhlo.constant_v99' found in dialect ('vhlo') that does not allow unknown operations | ||
// CHECK: note: in bytecode version 6 produced by: StableHLO_v2.0.0 | ||
// CHECK: error: failed to deserialize portable artifact using StableHLO_v{{.*}} | ||
vhlo.func_v1 @main() -> (!vhlo.tensor_v1<!vhlo.f32_v1>) { | ||
%0 = "vhlo.constant_v99"() <{value = #vhlo.tensor_v1<dense<1.000000e+00> : tensor<f32>>}> : () -> !vhlo.tensor_v1<!vhlo.f32_v1> | ||
"vhlo.return_v1"(%0) : (!vhlo.tensor_v1<!vhlo.f32_v1>) -> () | ||
} {arg_attrs = #vhlo.array_v1<[]>, res_attrs = #vhlo.array_v1<[]>, sym_visibility = #vhlo.string_v1<"public">} |
Binary file not shown.
1 change: 1 addition & 0 deletions
1
stablehlo/tests/vhlo/vhlo_to_version_downgrade_invalid.0_10_0.mlir
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
1 change: 1 addition & 0 deletions
1
stablehlo/tests/vhlo/vhlo_to_version_downgrade_invalid.0_15_0.mlir
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
1 change: 1 addition & 0 deletions
1
stablehlo/tests/vhlo/vhlo_to_version_downgrade_invalid.0_17_0.mlir
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
1 change: 1 addition & 0 deletions
1
stablehlo/tests/vhlo/vhlo_to_version_downgrade_invalid.0_18_0.mlir
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
1 change: 1 addition & 0 deletions
1
stablehlo/tests/vhlo/vhlo_to_version_downgrade_invalid.1_3_0.mlir
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