Split the different functions to avoid non-deterministic execution due to multi-threading.

If a pass signals failure, we stop the pipeline from executing. Given that the thread in-which the legalize pass is executed and the timing of the failure, we may sometimes only emit one of the errors and sometimes both. This change adds 'split-input-file' to avoid this non-determinism.

PiperOrigin-RevId: 281605989
Change-Id: I9904c41c44a9f58d6d8061876e97f31049c3419f
This commit is contained in:
River Riddle 2019-11-20 14:45:16 -08:00 committed by TensorFlower Gardener
parent 57ff450287
commit 7286a69c3c

View File

@ -1,4 +1,4 @@
// RUN: tf-opt %s -xla-legalize-tf -verify-diagnostics
// RUN: tf-opt %s -xla-legalize-tf -split-input-file -verify-diagnostics
func @tf_executor_graph_op() {
// expected-error@+1 {{failed to legalize operation 'tf_executor.graph'}}
@ -13,12 +13,16 @@ func @tf_executor_graph_op() {
}
// -----
func @tf_unknown_op(%arg0: tensor<2xi32>) -> tensor<2xi32> {
// expected-error@+1 {{failed to legalize operation 'tf.OpA'}}
%0 = "tf.OpA"(%arg0, %arg0) : (tensor<2xi32>, tensor<2xi32>) -> tensor<2xi32>
return %0: tensor<2xi32>
}
// -----
func @tf_known_op(%arg0: tensor<2xi32>) -> tensor<2xi32> {
%0 = "tf.Add"(%arg0, %arg0) : (tensor<2xi32>, tensor<2xi32>) -> tensor<2xi32>
return %0: tensor<2xi32>