Re-enabling profiler related unit-tests / sub-tests, that were disabled on the ROCm platform

This commit is contained in:
Deven Desai 2021-03-02 18:34:27 +00:00
parent b50574c455
commit 8c94fd0426
5 changed files with 2 additions and 21 deletions

View File

@ -104,10 +104,7 @@ class TimelineTest(test.TestCase):
step_stats = run_metadata.step_stats step_stats = run_metadata.step_stats
devices = [d.device for d in step_stats.dev_stats] devices = [d.device for d in step_stats.dev_stats]
self.assertTrue('/job:localhost/replica:0/task:0/device:GPU:0' in devices) self.assertTrue('/job:localhost/replica:0/task:0/device:GPU:0' in devices)
if not test.is_built_with_rocm(): self.assertTrue('/device:GPU:0/stream:all' in devices)
# skip this check for the ROCm platform
# stream level tracing is not yet supported on the ROCm platform
self.assertTrue('/device:GPU:0/stream:all' in devices)
tl = timeline.Timeline(step_stats) tl = timeline.Timeline(step_stats)
ctf = tl.generate_chrome_trace_format() ctf = tl.generate_chrome_trace_format()
self._validateTrace(ctf) self._validateTrace(ctf)

View File

@ -47,8 +47,7 @@ class ProfilerTest(test_util.TensorFlowTestCase):
profile_pb.ParseFromString(profile_result) profile_pb.ParseFromString(profile_result)
devices = frozenset(device.name for device in profile_pb.devices.values()) devices = frozenset(device.name for device in profile_pb.devices.values())
self.assertIn('/host:CPU', devices) self.assertIn('/host:CPU', devices)
if not test_util.IsBuiltWithROCm() and config.list_physical_devices('GPU'): if config.list_physical_devices('GPU'):
# device tracing is not yet supported on the ROCm platform
self.assertIn('/device:GPU:0', devices) self.assertIn('/device:GPU:0', devices)
events = frozenset(event.name for event in profile_pb.trace_events) events = frozenset(event.name for event in profile_pb.trace_events)
self.assertIn('three_times_five', events) self.assertIn('three_times_five', events)

View File

@ -61,7 +61,6 @@ cuda_py_test(
python_version = "PY3", python_version = "PY3",
tags = [ tags = [
"no_pip", "no_pip",
"no_rocm",
], ],
deps = [ deps = [
":profiler_v2", ":profiler_v2",

View File

@ -136,10 +136,6 @@ class RunMetadataTest(test.TestCase):
ret = _extract_node(run_meta, 'MatMul') ret = _extract_node(run_meta, 'MatMul')
self.assertEqual(len(ret['gpu:0']), 1) self.assertEqual(len(ret['gpu:0']), 1)
if not test.is_built_with_rocm():
# skip this check for the ROCm platform
# stream level tracing is not yet supported on the ROCm platform
self.assertEqual(len(ret['gpu:0/stream:all']), 1, '%s' % run_meta)
@test_util.run_deprecated_v1 @test_util.run_deprecated_v1
def testAllocationHistory(self): def testAllocationHistory(self):
@ -251,9 +247,6 @@ class RunMetadataTest(test.TestCase):
for node in ret['gpu:0']: for node in ret['gpu:0']:
total_cpu_execs += node.op_end_rel_micros total_cpu_execs += node.op_end_rel_micros
if not test.is_built_with_rocm():
# skip this check for the ROCm platform
# stream level tracing is not yet supported on the ROCm platform
self.assertGreaterEqual( self.assertGreaterEqual(
len(ret['gpu:0/stream:all']), 4, '%s' % run_meta) len(ret['gpu:0/stream:all']), 4, '%s' % run_meta)

View File

@ -69,13 +69,6 @@ class ProfilerContextTest(test.TestCase):
os.path.join(test.get_temp_dir(), "profile_100")) as profiler: os.path.join(test.get_temp_dir(), "profile_100")) as profiler:
profiler.profile_operations(options=opts) profiler.profile_operations(options=opts)
with gfile.Open(outfile, "r") as f: with gfile.Open(outfile, "r") as f:
if test.is_built_with_rocm():
# The profiler output for ROCm mode, includes an extra warning
# related to the lack of stream tracing in ROCm mode.
# Need to skip this warning when doing the diff
profile_str = "\n".join(profile_str.split("\n")[7:])
self.assertEqual(profile_str, f.read()) self.assertEqual(profile_str, f.read())
@test_util.run_deprecated_v1 @test_util.run_deprecated_v1