Skip to content

Commit

Permalink
Remove unused deprecated constructor of HloCollectiveInstruction
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 722206036
  • Loading branch information
toli-y authored and Google-ML-Automation committed Feb 4, 2025
1 parent 9dafff2 commit c19c780
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
20 changes: 0 additions & 20 deletions xla/hlo/ir/hlo_instructions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -920,15 +920,6 @@ HloCollectiveInstruction::HloCollectiveInstruction(
}
}

HloCollectiveInstruction::HloCollectiveInstruction(
HloOpcode opcode, const Shape& shape,
absl::Span<HloInstruction* const> operands,
absl::Span<const ReplicaGroup> replica_groups, bool constrain_layout,
const std::optional<int64_t>& channel_id)
: HloCollectiveInstruction(opcode, shape, operands,
CollectiveDeviceList(replica_groups),
constrain_layout, channel_id) {}

HloInstructionProto HloCollectiveInstruction::ToProto() const {
HloInstructionProto proto = HloChannelInstruction::ToProto();
*proto.mutable_collective_device_list() = device_list_.ToProto();
Expand Down Expand Up @@ -1040,17 +1031,6 @@ HloAllReduceInstructionBase::HloAllReduceInstructionBase(
reduce_computation->SetCollectiveCallInstruction(this);
}

HloAllReduceInstructionBase::HloAllReduceInstructionBase(
HloOpcode opcode, const Shape& shape,
absl::Span<HloInstruction* const> operands,
HloComputation* reduce_computation,
absl::Span<const ReplicaGroup> replica_groups, bool constrain_layout,
const std::optional<int64_t>& channel_id, bool use_global_device_ids)
: HloAllReduceInstructionBase(opcode, shape, operands, reduce_computation,
CollectiveDeviceList(replica_groups),
constrain_layout, channel_id,
use_global_device_ids) {}

HloInstructionProto HloAllReduceInstructionBase::ToProto() const {
HloInstructionProto proto = HloCollectiveInstruction::ToProto();
proto.set_use_global_device_ids(use_global_device_ids_);
Expand Down
17 changes: 0 additions & 17 deletions xla/hlo/ir/hlo_instructions.h
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,6 @@ class HloRecvDoneInstruction : public HloSendRecvInstruction {

class HloCollectiveInstruction : public HloChannelInstruction {
public:
// TODO(b/316622399): Remove usages of this method and replace with
// device_list()->replica_groups().
const std::vector<ReplicaGroup>& replica_groups() const {
return device_list_.replica_groups();
}
Expand Down Expand Up @@ -677,13 +675,6 @@ class HloCollectiveInstruction : public HloChannelInstruction {
const CollectiveDeviceList& collective_device_list, bool constrain_layout,
const std::optional<int64_t>& channel_id);

ABSL_DEPRECATED("Use CollectiveDeviceList instead of list of ReplicaGroup.")
explicit HloCollectiveInstruction(
HloOpcode opcode, const Shape& shape,
absl::Span<HloInstruction* const> operands,
absl::Span<const ReplicaGroup> replica_groups, bool constrain_layout,
const std::optional<int64_t>& channel_id);

HloInstructionProto ToProto() const override;

void PrintExtraAttributesImpl(AttributePrinter& printer,
Expand Down Expand Up @@ -760,14 +751,6 @@ class HloAllReduceInstructionBase : public HloCollectiveInstruction {
const CollectiveDeviceList& device_list, bool constrain_layout,
const std::optional<int64_t>& channel_id, bool use_global_device_ids);

ABSL_DEPRECATED("Use CollectiveDeviceList instead of list of ReplicaGroup.")
explicit HloAllReduceInstructionBase(
HloOpcode opcode, const Shape& shape,
absl::Span<HloInstruction* const> operands,
HloComputation* reduce_computation,
absl::Span<const ReplicaGroup> replica_groups, bool constrain_layout,
const std::optional<int64_t>& channel_id, bool use_global_device_ids);

// Returns true if the ids in the ReplicaGroup config represent a global id of
// (replica_id * partition_count + partition_id) instead of a replica id.
// This enables more flexible grouping of devices if this all-reduce is both
Expand Down

0 comments on commit c19c780

Please sign in to comment.