Add flag parsing to more tests in xla/service specifically those which build
HLO graphs. This enables, for example, dumping of the graphs with --xla_generate_hlo_graph. Also remove some superfluous tensorflow test_main dependencies. PiperOrigin-RevId: 168406746
This commit is contained in:
parent
d4efa695cd
commit
9c4ce24527
@ -121,7 +121,6 @@ cc_test(
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/compiler/xla/tests:literal_test_util",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
@ -769,7 +768,6 @@ cc_test(
|
||||
"//tensorflow/compiler/xla:util",
|
||||
"//tensorflow/compiler/xla:xla_data_proto",
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
@ -891,7 +889,6 @@ cc_test(
|
||||
"//tensorflow/compiler/xla:status_macros",
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
@ -1106,7 +1103,6 @@ cc_test(
|
||||
"//tensorflow/compiler/xla:xla_data_proto",
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/compiler/xla/tests:literal_test_util",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
@ -1260,7 +1256,6 @@ cc_test(
|
||||
"//tensorflow/compiler/xla/client:padding",
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
@ -1291,7 +1286,6 @@ cc_test(
|
||||
"//tensorflow/compiler/xla:test",
|
||||
"//tensorflow/compiler/xla:test_helpers",
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
@ -1384,6 +1378,7 @@ cc_test(
|
||||
deps = [
|
||||
":hlo",
|
||||
":hlo_dataflow_analysis",
|
||||
":hlo_graph_dumper",
|
||||
":hlo_matchers",
|
||||
":instruction_fusion",
|
||||
"//tensorflow/compiler/xla:literal_util",
|
||||
@ -1395,7 +1390,6 @@ cc_test(
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:test",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
@ -1441,6 +1435,7 @@ cc_test(
|
||||
":flatten_call_graph",
|
||||
":hlo",
|
||||
":hlo_alias_analysis",
|
||||
":hlo_graph_dumper",
|
||||
":hlo_matchers",
|
||||
":instruction_fusion",
|
||||
"//tensorflow/compiler/xla:literal_util",
|
||||
@ -1451,7 +1446,6 @@ cc_test(
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:test",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
@ -1504,7 +1498,6 @@ cc_test(
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:test",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
@ -1650,7 +1643,6 @@ cc_test(
|
||||
"//tensorflow/compiler/xla:types",
|
||||
"//tensorflow/compiler/xla:xla_data_proto",
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
@ -1967,8 +1959,8 @@ cc_test(
|
||||
"//tensorflow/compiler/xla:xla_data_proto",
|
||||
"//tensorflow/compiler/xla/client:computation_builder",
|
||||
"//tensorflow/compiler/xla/service/gpu:ir_emission_utils",
|
||||
"//tensorflow/compiler/xla/tests:hlo_test_base",
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:test_main",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -117,3 +117,7 @@ TEST_F(CallInlinerTest, CallsWithinWhileBodiesAreInlined) {
|
||||
|
||||
} // namespace
|
||||
} // namespace xla
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return xla::ParseDebugOptionsFlagsAndRunTests(argc, argv);
|
||||
}
|
||||
|
@ -847,3 +847,7 @@ TEST_F(LazyBestFitHeapTest, Alignment) {
|
||||
|
||||
} // namespace
|
||||
} // namespace xla
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return xla::ParseDebugOptionsFlagsAndRunTests(argc, argv);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ limitations under the License.
|
||||
|
||||
#include "tensorflow/compiler/xla/literal_util.h"
|
||||
#include "tensorflow/compiler/xla/service/flatten_call_graph.h"
|
||||
#include "tensorflow/compiler/xla/service/hlo_graph_dumper.h"
|
||||
#include "tensorflow/compiler/xla/service/hlo_matchers.h"
|
||||
#include "tensorflow/compiler/xla/service/hlo_opcode.h"
|
||||
#include "tensorflow/compiler/xla/service/instruction_fusion.h"
|
||||
@ -44,6 +45,7 @@ class HloAliasAnalysisTest : public HloTestBase {
|
||||
// Run alias analysis on the member module. For convenience returns a
|
||||
// reference to the generated analysis stored in analysis_.
|
||||
HloAliasAnalysis& RunAnalysis() {
|
||||
hlo_graph_dumper::MaybeDumpHloModule(*module_, "Before alias analysis");
|
||||
analysis_ = HloAliasAnalysis::Run(module_.get()).ConsumeValueOrDie();
|
||||
return *analysis_;
|
||||
}
|
||||
@ -818,3 +820,7 @@ TEST_F(HloAliasAnalysisTest, Bitcast) {
|
||||
|
||||
} // namespace
|
||||
} // namespace xla
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return xla::ParseDebugOptionsFlagsAndRunTests(argc, argv);
|
||||
}
|
||||
|
@ -442,3 +442,7 @@ TEST_F(HloCostAnalysisTest, TupleCost) {
|
||||
|
||||
} // namespace
|
||||
} // namespace xla
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return xla::ParseDebugOptionsFlagsAndRunTests(argc, argv);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||
|
||||
#include "tensorflow/compiler/xla/literal_util.h"
|
||||
#include "tensorflow/compiler/xla/service/hlo_computation.h"
|
||||
#include "tensorflow/compiler/xla/service/hlo_graph_dumper.h"
|
||||
#include "tensorflow/compiler/xla/service/hlo_matchers.h"
|
||||
#include "tensorflow/compiler/xla/service/hlo_opcode.h"
|
||||
#include "tensorflow/compiler/xla/service/instruction_fusion.h"
|
||||
@ -45,6 +46,7 @@ class HloDataflowAnalysisTest : public HloTestBase,
|
||||
// reference to the generated analysis stored in analysis_.
|
||||
const HloDataflowAnalysis& RunAnalysis(bool ssa_form,
|
||||
bool bitcast_defines_value = false) {
|
||||
hlo_graph_dumper::MaybeDumpHloModule(*module_, "Before dataflow analysis");
|
||||
analysis_ =
|
||||
HloDataflowAnalysis::Run(module_.get(), ssa_form, bitcast_defines_value)
|
||||
.ConsumeValueOrDie();
|
||||
@ -1488,3 +1490,7 @@ INSTANTIATE_TEST_CASE_P(HloDataflowAnalysisInstantiation,
|
||||
|
||||
} // namespace
|
||||
} // namespace xla
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return xla::ParseDebugOptionsFlagsAndRunTests(argc, argv);
|
||||
}
|
||||
|
@ -1598,3 +1598,7 @@ TEST_F(HloEvaluatorTest, Reverse) {
|
||||
|
||||
} // namespace
|
||||
} // namespace xla
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return xla::ParseDebugOptionsFlagsAndRunTests(argc, argv);
|
||||
}
|
||||
|
@ -30,12 +30,14 @@ limitations under the License.
|
||||
#include "tensorflow/compiler/xla/shape_util.h"
|
||||
#include "tensorflow/compiler/xla/test.h"
|
||||
#include "tensorflow/compiler/xla/test_helpers.h"
|
||||
#include "tensorflow/compiler/xla/tests/hlo_test_base.h"
|
||||
#include "tensorflow/compiler/xla/xla_data.pb.h"
|
||||
#include "tensorflow/core/platform/logging.h"
|
||||
|
||||
namespace xla {
|
||||
namespace {
|
||||
|
||||
class TransposeFoldingTest : public ::testing::Test {
|
||||
class TransposeFoldingTest : public HloTestBase {
|
||||
protected:
|
||||
void FoldTranspose(HloModule* module) {
|
||||
TransposeFolding transpose_folding(
|
||||
@ -365,4 +367,9 @@ TEST_F(TransposeFoldingTest, FoldConvTransposeLhs) {
|
||||
<< "entry_computation should contain exactly 4 instructions.";
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace xla
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
return xla::ParseDebugOptionsFlagsAndRunTests(argc, argv);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user