Skip to content

Commit

Permalink
Fix the flakiness in xplane processsing.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 636215943
  • Loading branch information
lionelfeng authored and tensorflower-gardener committed May 22, 2024
1 parent c4ca189 commit 10434b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions tensorflow/core/profiler/convert/xplane_to_op_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,9 @@ OpStats ConvertXSpaceToOpStats(const XSpace& space,
*op_stats.mutable_host_op_metrics_db() =
ConvertHostThreadsXPlaneToOpMetricsDb(*host_plane);
}
if (options.generate_step_db) {
const StepEvents* device_step_events =
has_device ? &step_events : nullptr;
if (options.generate_step_db && !has_device) {
StepEvents host_step_events =
ConvertHostThreadsXPlaneToStepEvents(*host_plane, device_step_events);
ConvertHostThreadsXPlaneToStepEvents(*host_plane, nullptr);
CombineStepEvents(host_step_events, &step_events);
}
XPlaneVisitor visitor = tsl::profiler::CreateTfXPlaneVisitor(host_plane);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ TEST(ConvertXPlaneToOpStats, GpuStepDbTest) {
options, &op_stats));
const StepDatabaseResult& step_db = op_stats.step_db();

EXPECT_EQ(step_db.step_sequence_size(), 1);
EXPECT_EQ(step_db.step_sequence_size(), 0);

PrecisionStats precision_stats =
op_stats.device_op_metrics_db().precision_stats();
Expand Down

0 comments on commit 10434b5

Please sign in to comment.