Skip to content

Commit

Permalink
Compute non-fusion computations just once.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 630962946
  • Loading branch information
jreiffers authored and tensorflower-gardener committed May 6, 2024
1 parent abb67ae commit a81aac2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions third_party/xla/xla/service/gpu/priority_fusion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,9 @@ absl::StatusOr<bool> GpuPriorityFusion::Run(
// With this modification it will be easier to match instructions before and
// after fusion passes, because they will have the same unique prefix. Names
// are not used in the pipeline, but it makes debugging much easier.
for (auto* computation :
GetNonFusionComputations(module, execution_threads)) {
auto non_fusion_computations =
GetNonFusionComputations(module, execution_threads);
for (auto* computation : non_fusion_computations) {
for (auto* instruction : computation->instructions()) {
module->SetAndUniquifyInstrName(instruction,
absl::StrCat(instruction->name(), ".0"));
Expand Down Expand Up @@ -735,8 +736,7 @@ absl::StatusOr<bool> GpuPriorityFusion::Run(
}

int changed = false;
for (auto* computation :
GetNonFusionComputations(module, execution_threads)) {
for (auto* computation : non_fusion_computations) {
if (computations_not_to_fuse.contains(computation)) continue;
CHECK(!computation->IsFusionComputation());

Expand Down

0 comments on commit a81aac2

Please sign in to comment.