Skip to content

Commit 6de845d

Browse files
committed
Rename IpuInterCopy as InterIpuCopy
Summary: This commit renames all mentions of `IpuInterCopy` in camel-case, kebab- case and snake-case with their `InterIpuCopy` counterpart, which sounds better, and is easier to search. Fixes T49914. Test Plan: Use the existing tests. This is an aesthetic change only. Reviewers: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, georgep Reviewed By: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, georgep Maniphest Tasks: T49914 Differential Revision: https://phabricator.sourcevertex.net/D56748
1 parent d1c744b commit 6de845d

26 files changed

+169
-165
lines changed

tensorflow/compiler/plugin/poplar/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ poplar_cc_library(
309309
"driver/tools/custom_ops/execution_counter.cc",
310310
"driver/tools/custom_ops/hlo_extensions.cc",
311311
"driver/tools/custom_ops/host_embedding.cc",
312-
"driver/tools/custom_ops/ipu_inter_copy.cc",
312+
"driver/tools/custom_ops/inter_ipu_copy.cc",
313313
"driver/tools/custom_ops/inter_tileset_copy.cc",
314314
"driver/tools/custom_ops/candidate_sampler.cc",
315315
"driver/tools/custom_ops/lstm.cc",
@@ -513,8 +513,8 @@ poplar_cc_library(
513513
"driver/tools/custom_ops/hlo_poplar_instruction.h",
514514
"driver/tools/custom_ops/hlo_remote_buffer_info.h",
515515
"driver/tools/custom_ops/host_embedding.h",
516+
"driver/tools/custom_ops/inter_ipu_copy.h",
516517
"driver/tools/custom_ops/inter_tileset_copy.h",
517-
"driver/tools/custom_ops/ipu_inter_copy.h",
518518
"driver/tools/custom_ops/lstm.h",
519519
"driver/tools/custom_ops/multi_conv.h",
520520
"driver/tools/custom_ops/multi_slice.h",
@@ -755,8 +755,8 @@ poplar_cc_library(
755755
"driver/ops/custom_ops/poputil/codelet_expression_op.cc",
756756
"driver/ops/custom_ops/poputil/copy_into.cc",
757757
"driver/ops/custom_ops/poputil/fifo.cc",
758+
"driver/ops/custom_ops/poputil/inter_ipu_copy.cc",
758759
"driver/ops/custom_ops/poputil/inter_tileset_copy.cc",
759-
"driver/ops/custom_ops/poputil/ipu_inter_copy.cc",
760760
"driver/ops/custom_ops/poputil/print_tensor.cc",
761761
"driver/ops/custom_ops/poputil/remap.cc",
762762
"driver/ops/custom_ops/poputil/remap_deduce.cc",

tensorflow/compiler/plugin/poplar/driver/ops/custom_ops/poputil/ipu_inter_copy.cc renamed to tensorflow/compiler/plugin/poplar/driver/ops/custom_ops/poputil/inter_ipu_copy.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace xla {
3131
namespace poplarplugin {
3232
namespace {
3333

34-
class IpuInterCopyOp : public PoplarOpDef {
34+
class InterIpuCopyOp : public PoplarOpDef {
3535
StatusOr<poplar::program::Sequence> Creator(
3636
poplar::Graph& graph, CompilerResources& res, const HloInstruction* inst,
3737
const Shape& output_shape, TensorMap& tensor_map,
@@ -170,11 +170,11 @@ StatusOr<TensorCopyInfo> GetTensorCopyInfo(
170170
}
171171
} // namespace
172172

173-
StatusOr<poplar::program::Sequence> IpuInterCopyOp::Creator(
173+
StatusOr<poplar::program::Sequence> InterIpuCopyOp::Creator(
174174
poplar::Graph&, CompilerResources& res, const HloInstruction* inst,
175175
const Shape& output_shape, TensorMap& tensor_map,
176176
const poplar::DebugContext& debug_context) {
177-
PoplarOpDefDebugInfo debug_info(debug_context, "IpuInterCopyOp");
177+
PoplarOpDefDebugInfo debug_info(debug_context, "InterIpuCopyOp");
178178
poplar::program::Sequence seq({}, debug_info);
179179

180180
if (!inst->has_sharding()) {
@@ -274,7 +274,7 @@ StatusOr<poplar::program::Sequence> IpuInterCopyOp::Creator(
274274
return seq;
275275
}
276276

277-
REGISTER_POPLAR_OP(IpuInterCopy, IpuInterCopyOp);
277+
REGISTER_POPLAR_OP(InterIpuCopy, InterIpuCopyOp);
278278

279279
} // namespace
280280

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ StatusOr<bool> NeedsSpecificSeedType(const HloInstruction* inst) {
4848
PoplarOp::CopyInto,
4949
PoplarOp::Fifo,
5050
PoplarOp::InterTilesetCopy,
51-
PoplarOp::IpuInterCopy,
51+
PoplarOp::InterIpuCopy,
5252
PoplarOp::StatefulNoop,
5353
PoplarOp::GradientAccumulatorCreate,
5454
PoplarOp::GradientAccumulatorSink};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020
#include "tensorflow/compiler/plugin/poplar/driver/compiler_annotations.h"
2121
#include "tensorflow/compiler/plugin/poplar/driver/tools/conv_util.h"
2222
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/fifo.h"
23-
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/ipu_inter_copy.h"
23+
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/inter_ipu_copy.h"
2424
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/multi_conv.h"
2525
#include "tensorflow/compiler/plugin/poplar/driver/tools/matcher_predicates.h"
2626
#include "tensorflow/compiler/plugin/poplar/driver/tools/ml_type_helper.h"
@@ -127,7 +127,7 @@ HloInstruction* FindOperand(HloInstruction* inst,
127127
} else if (IsPoplarInstruction(PoplarOp::Fifo)(source)) {
128128
// We look through FIFO ops
129129
source = source->mutable_operand(0);
130-
} else if (IsPoplarInstruction(PoplarOp::IpuInterCopy)(source)) {
130+
} else if (IsPoplarInstruction(PoplarOp::InterIpuCopy)(source)) {
131131
// We look through inter-ipu copy ops.
132132
source = source->mutable_operand(0);
133133
} else if (IsPopOpsFusion(source, "zero_pad")) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515

1616
#include "tensorflow/compiler/plugin/poplar/driver/passes/inter_ipu_copy_inserter.h"
1717

18-
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/ipu_inter_copy.h"
18+
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/inter_ipu_copy.h"
1919
#include "tensorflow/compiler/plugin/poplar/driver/tools/find_all_users.h"
2020
#include "tensorflow/compiler/plugin/poplar/driver/tools/matcher_predicates.h"
2121
#include "tensorflow/compiler/plugin/poplar/driver/tools/util.h"
@@ -74,7 +74,7 @@ StatusOr<HloInstruction*> InsertInterIpuCopy(
7474
IsPoplarInstruction(PoplarOp::ExecutionCounter)(inst)) {
7575
new_inst = comp->AddInstruction(inst->Clone());
7676
} else {
77-
new_inst = comp->AddInstruction(CreateIpuInterCopy({inst}));
77+
new_inst = comp->AddInstruction(CreateInterIpuCopy({inst}));
7878
}
7979

8080
new_inst->set_sharding(output_sharding);
@@ -96,7 +96,7 @@ StatusOr<bool> InterIpuCopyInserter::Run(HloModule* module) {
9696
// These ops are expected to have their input(s) on a different device to
9797
// their output(s).
9898
return inst->opcode() == HloOpcode::kAfterAll ||
99-
IsPoplarInstruction(PoplarOp::IpuInterCopy)(inst);
99+
IsPoplarInstruction(PoplarOp::InterIpuCopy)(inst);
100100
};
101101

102102
for (auto* comp : module->MakeComputationPostOrder()) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ std::vector<HloInstruction*> SelectInterTilesetCopies(
7676
const std::vector<HloInstruction*>& insts) {
7777
std::vector<HloInstruction*> result;
7878
absl::c_copy_if(insts, std::back_inserter(result),
79-
IsPoplarInstruction(PoplarOp::IpuInterCopy));
79+
IsPoplarInstruction(PoplarOp::InterIpuCopy));
8080

8181
return result;
8282
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ StatusOr<bool> ResourceUpdateScheduleOptimizer::OptimizeResourceUpdate(
4444
absl::c_copy_if(comp->MakeInstructionPostOrder(),
4545
std::back_inserter(inter_ipu_copies),
4646
[](HloInstruction* inst) -> bool {
47-
return IsPoplarInstruction(PoplarOp::IpuInterCopy)(inst);
47+
return IsPoplarInstruction(PoplarOp::InterIpuCopy)(inst);
4848
});
4949

5050
// Find all the inputs to the computation.

tensorflow/compiler/plugin/poplar/driver/schedulers/clustering_scheduler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525
#include "absl/container/flat_hash_map.h"
2626
#include "absl/container/flat_hash_set.h"
2727
#include "tensorflow/compiler/plugin/poplar/driver/compiler_information.h"
28-
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/ipu_inter_copy.h"
28+
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/inter_ipu_copy.h"
2929
#include "tensorflow/compiler/plugin/poplar/driver/tools/flags.h"
3030
#include "tensorflow/compiler/plugin/poplar/driver/tools/instruction_colocator_helper.h"
3131
#include "tensorflow/compiler/xla/service/heap_simulator.h"

tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/ipu_inter_copy.cc renamed to tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/inter_ipu_copy.cc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,64 +13,64 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515

16-
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/ipu_inter_copy.h"
16+
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/inter_ipu_copy.h"
1717
#include "tensorflow/compiler/plugin/poplar/driver/tools/hlo_poplar_buffer_util.h"
1818
#include "tensorflow/compiler/plugin/poplar/kernels/custom_kernels_util.h"
1919
#include "tensorflow/compiler/plugin/poplar/kernels/ops.pb.h"
2020

2121
namespace xla {
2222
namespace poplarplugin {
2323

24-
HloIpuInterCopy::HloIpuInterCopy(absl::Span<HloInstruction* const> operands)
24+
HloInterIpuCopy::HloInterIpuCopy(absl::Span<HloInstruction* const> operands)
2525
: HloPoplarInstruction(GetHloPoplarInstructionShape(operands), operands,
26-
PoplarOp::IpuInterCopy) {}
26+
PoplarOp::InterIpuCopy) {}
2727

28-
absl::flat_hash_set<int64> HloIpuInterCopy::AllocatingIndices() const {
28+
absl::flat_hash_set<int64> HloInterIpuCopy::AllocatingIndices() const {
2929
return {};
3030
}
3131

32-
bool HloIpuInterCopy::AllocatingOutput() const { return false; }
32+
bool HloInterIpuCopy::AllocatingOutput() const { return false; }
3333

34-
absl::flat_hash_map<int64, int64> HloIpuInterCopy::LayoutDependencies() const {
34+
absl::flat_hash_map<int64, int64> HloInterIpuCopy::LayoutDependencies() const {
3535
return {};
3636
}
3737

38-
HloPoplarUseDescriptions HloIpuInterCopy::GetUseDescriptions() const {
38+
HloPoplarUseDescriptions HloInterIpuCopy::GetUseDescriptions() const {
3939
return UseDescriptionsNoInputOutputAlias();
4040
}
4141

42-
HloPoplarBufferDescriptions HloIpuInterCopy::GetBufferDescriptions() const {
42+
HloPoplarBufferDescriptions HloInterIpuCopy::GetBufferDescriptions() const {
4343
return BufferDescriptionsAllocatesAllOutputs(this);
4444
}
4545

46-
const FindConsumersExtensionResults HloIpuInterCopy::FindConsumers(
46+
const FindConsumersExtensionResults HloInterIpuCopy::FindConsumers(
4747
FindConsumersExtensionParams params) const {
4848
return FindConsumersExtensionResults::DoNotFindConsumers();
4949
}
5050

51-
bool HloIpuInterCopy::AllowNonInplaceLowering() const { return false; }
51+
bool HloInterIpuCopy::AllowNonInplaceLowering() const { return false; }
5252

53-
bool HloIpuInterCopy::IsPopOpsElementwise() const { return false; }
53+
bool HloInterIpuCopy::IsPopOpsElementwise() const { return false; }
5454

55-
std::unique_ptr<HloInstruction> HloIpuInterCopy::CloneWithNewOperandsImpl(
55+
std::unique_ptr<HloInstruction> HloInterIpuCopy::CloneWithNewOperandsImpl(
5656
const Shape& shape, absl::Span<HloInstruction* const> new_operands,
5757
HloCloneContext* context) const {
58-
return CreateIpuInterCopy(new_operands);
58+
return CreateInterIpuCopy(new_operands);
5959
}
6060

61-
std::vector<std::string> HloIpuInterCopy::ExtraPoplarAttributesToStringImpl(
61+
std::vector<std::string> HloInterIpuCopy::ExtraPoplarAttributesToStringImpl(
6262
const HloPrintOptions& options) const {
6363
return {};
6464
}
6565

66-
std::unique_ptr<HloInstruction> CreateIpuInterCopy(
66+
std::unique_ptr<HloInstruction> CreateInterIpuCopy(
6767
absl::Span<HloInstruction* const> operands) {
68-
return absl::make_unique<HloIpuInterCopy>(operands);
68+
return absl::make_unique<HloInterIpuCopy>(operands);
6969
}
7070

71-
static HloPoplarInstructionFactory ipu_inter_copy_factory(
72-
PoplarOp::IpuInterCopy, [](HloCustomCallInstruction* inst) {
73-
return CreateIpuInterCopy(inst->operands());
71+
static HloPoplarInstructionFactory inter_ipu_copy_factory(
72+
PoplarOp::InterIpuCopy, [](HloCustomCallInstruction* inst) {
73+
return CreateInterIpuCopy(inst->operands());
7474
});
7575
} // namespace poplarplugin
7676
} // namespace xla

tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/ipu_inter_copy.h renamed to tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/inter_ipu_copy.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,21 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515

16-
#ifndef TENSORFLOW_COMPILER_PLUGIN_POPLAR_DRIVER_TOOLS_CUSTOM_OPS_IPU_INTER_COPY_H_
17-
#define TENSORFLOW_COMPILER_PLUGIN_POPLAR_DRIVER_TOOLS_CUSTOM_OPS_IPU_INTER_COPY_H_
16+
#ifndef TENSORFLOW_COMPILER_PLUGIN_POPLAR_DRIVER_TOOLS_CUSTOM_OPS_INTER_IPU_COPY_H_
17+
#define TENSORFLOW_COMPILER_PLUGIN_POPLAR_DRIVER_TOOLS_CUSTOM_OPS_INTER_IPU_COPY_H_
18+
19+
#include <memory>
20+
#include <string>
21+
#include <vector>
1822

1923
#include "tensorflow/compiler/plugin/poplar/driver/tools/custom_ops/hlo_poplar_instruction.h"
2024

2125
namespace xla {
2226
namespace poplarplugin {
2327

24-
class HloIpuInterCopy : public HloPoplarInstruction {
28+
class HloInterIpuCopy : public HloPoplarInstruction {
2529
public:
26-
explicit HloIpuInterCopy(absl::Span<HloInstruction* const> operands);
30+
explicit HloInterIpuCopy(absl::Span<HloInstruction* const> operands);
2731

2832
absl::flat_hash_set<int64> AllocatingIndices() const override;
2933
bool AllocatingOutput() const override;
@@ -47,7 +51,7 @@ class HloIpuInterCopy : public HloPoplarInstruction {
4751
HloCloneContext*) const override;
4852
};
4953

50-
std::unique_ptr<HloInstruction> CreateIpuInterCopy(
54+
std::unique_ptr<HloInstruction> CreateInterIpuCopy(
5155
absl::Span<HloInstruction* const> operands);
5256

5357
} // namespace poplarplugin

0 commit comments

Comments
 (0)