diff options
author | Justin Lebar <jlebar@google.com> | 2018-05-14 14:09:01 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-05-14 14:11:46 -0700 |
commit | d0230156b60c1e11ed4ac2fdf888409ae52051f4 (patch) | |
tree | bddc314e9c641f510a97beeb150f45937debdb68 /tensorflow/compiler/aot | |
parent | 321d69b55a61a623360b70fc96dac2c7e1f71ad3 (diff) |
[XLA] Ergonomic improvements to --xla_hlo_profile.
- Don't display ops with 0 optimal seconds and 0 actual cycles. These
are ops that were expected to be free and were actually free.
- Fix HloCostAnalysis to mark parameters, constants, and
get-tuple-element as expected-to-be-free per the definition above.
- Allow optimal-seconds < 0 to indicate "I don't know". Use this for
custom calls, and then hide such ops from the "seconds above the
optimum" table.
- Don't display "<none>" and "<unknown>" -- instead, just display the
empty string. Less visual noise.
- Instead of showing ~5 ops per category in the categories tables, show
everything. This isn't so noisy now that we're hiding "free" ops, and
it makes finding optimization opportunities much easier.
PiperOrigin-RevId: 196564177
Diffstat (limited to 'tensorflow/compiler/aot')
-rw-r--r-- | tensorflow/compiler/aot/tests/tfcompile_test.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/tensorflow/compiler/aot/tests/tfcompile_test.cc b/tensorflow/compiler/aot/tests/tfcompile_test.cc index 309a991fc1..868d752927 100644 --- a/tensorflow/compiler/aot/tests/tfcompile_test.cc +++ b/tensorflow/compiler/aot/tests/tfcompile_test.cc @@ -40,7 +40,7 @@ namespace tfcompile { namespace { using ::testing::HasSubstr; -using ::testing::UnorderedElementsAre; +using ::testing::IsSupersetOf; TEST(TFCompileTest, Add) { AddComp add; @@ -559,17 +559,10 @@ TEST(TFCompileTest, HloProfiling) { auto tuple_profile_line = HasSubstr( "%tuple.0.8 = (f32[2,2]{1,0}, f32[2,2]{1,0}) tuple(f32[2,2]{1,0} " "%dot.0.2, f32[2,2]{1,0} %add.0.5)"); - auto arg0_profile_line = HasSubstr("%arg0.0.0 = f32[2,2]{1,0} parameter(0)"); - auto arg1_profile_line = HasSubstr("%arg1.0.1 = f32[2,2]{1,0} parameter(1)"); - hlo_profile_lines.erase(hlo_profile_lines.begin() + 7, - hlo_profile_lines.end()); - - EXPECT_THAT( - hlo_profile_lines, - UnorderedElementsAre(header, total_cycles_profile_line, dot_profile_line, - add_profile_line, tuple_profile_line, - arg0_profile_line, arg1_profile_line)); + EXPECT_THAT(hlo_profile_lines, + IsSupersetOf({header, total_cycles_profile_line, dot_profile_line, + add_profile_line, tuple_profile_line})); } } // namespace |