Skip to content

Commit 35135d9

Browse files
whoozlegeorgepaw
authored andcommitted
Do not constrain the layout of all-reduce
Summary: We don't use it and it prevents DCE from removing such instructions/computations TF2.4 Only. Fix T43367. Reviewers: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, georgep, hakons Reviewed By: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, georgep Maniphest Tasks: T43367 Differential Revision: https://phabricator.sourcevertex.net/D49055
1 parent ee82dcd commit 35135d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tensorflow/compiler/plugin/poplar/driver/passes/replicated_resource_update_elementwise_clustering.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ ReplicatedResourceUpdateElementwiseClustering::AddClusterInput(
288288
builder->AddInstruction(HloInstruction::CreateAllReduce(
289289
scatter->shape(), std::vector<HloInstruction*>{scatter},
290290
sum_reduction, orthogonal_groups.ToXlaReplicaGroups(),
291-
/*constrain_layout=*/true,
291+
/*constrain_layout=*/false,
292292
/*channel_id=*/absl::nullopt, /*use_global_device_ids=*/false));
293293

294294
context->MapInstruction(cluster_input, all_reduce);

tensorflow/compiler/plugin/poplar/tests/poplar_replica_groups_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ struct PoplarReplicaGroupsHloTest : public HloTestBase {
204204
auto* all_reduce = builder.AddInstruction(HloInstruction::CreateAllReduce(
205205
shape, std::vector<HloInstruction*>{param}, reduction,
206206
groups.ToXlaReplicaGroups(),
207-
/*constrain_layout=*/true,
207+
/*constrain_layout=*/false,
208208
/*channel_id=*/absl::nullopt, /*use_global_device_ids=*/false));
209209
module->AddEntryComputation(builder.Build(all_reduce));
210210

0 commit comments

Comments
 (0)