Skip to content

Commit 94c5d3b

Browse files
author
Gautham Ganapathy
committed
Removes ExtendedProgramSequence wrapper and sets it to alias poplar::program::Sequence
Summary: REF T67791 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: T67791 Differential Revision: https://phabricator.sourcevertex.net/D73844
1 parent 26c5172 commit 94c5d3b

File tree

97 files changed

+478
-586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+478
-586
lines changed

tensorflow/compiler/plugin/poplar/driver/compiler_resources.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,7 @@ struct CompilerResources : public HloResources {
309309
}
310310

311311
void CreatePreambleSequence() {
312-
preamble_sequence =
313-
absl::make_unique<DriverProgramSequence>(*main_graph, "Preamble");
312+
preamble_sequence = absl::make_unique<DriverProgramSequence>("Preamble");
314313
}
315314

316315
Status CreateMainGraphAndPreamble(

tensorflow/compiler/plugin/poplar/driver/extended_program.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,7 @@ using ExtendedProgramSync = poplar::program::Sync;
3131
using ExtendedProgramRepeat = poplar::program::Repeat;
3232
using ExtendedProgramCall = poplar::program::Call;
3333
using ExtendedProgramWriteUndef = poplar::program::WriteUndef;
34-
35-
// Wrapper class for poplar (will be removed in T67791)
36-
class ExtendedProgramSequence : public poplar::program::Sequence {
37-
public:
38-
ExtendedProgramSequence(poplar::Graph& graph,
39-
const poplar::DebugContext& debugContext = {})
40-
: poplar::program::Sequence(debugContext) {}
41-
ExtendedProgramSequence(
42-
std::initializer_list<poplar::program::Program> programs,
43-
poplar::Graph& graph, const poplar::DebugContext& debugContext = {})
44-
: poplar::program::Sequence(programs, debugContext) {}
45-
46-
void add(const poplar::program::Program& p) {
47-
poplar::program::Sequence::add(p);
48-
}
49-
};
34+
using ExtendedProgramSequence = poplar::program::Sequence;
5035

5136
} // namespace poplarplugin
5237
} // namespace xla

tensorflow/compiler/plugin/poplar/driver/ops/cast_to_gfloat_ops.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,13 @@ StatusOr<DriverProgramSequence> CreatePoplibsGfloatParams(
3636

3737
auto& graph = GetGraph(res, inst);
3838

39-
DriverProgramSequence seq(graph, debug_name_and_id);
39+
DriverProgramSequence seq(debug_name_and_id);
4040

4141
poplar::Tensor gf_param =
4242
popfloat::experimental::GfloatCast::createCastOpParamsTensor(
4343
graph, seq, gf_calc_type, gf_packed_cfg, {debug_name_and_id});
4444

45-
TF_CHECK_OK(
46-
AddOutputTensor(tensor_map, inst, 0, DriverTensor(gf_param, graph)));
45+
TF_CHECK_OK(AddOutputTensor(tensor_map, inst, 0, DriverTensor(gf_param)));
4746
return seq;
4847
}
4948

@@ -59,7 +58,7 @@ StatusOr<DriverProgramSequence> CreatePoplibsCastNativeToGfloat(
5958

6059
auto& graph = GetGraph(res, inst);
6160

62-
DriverProgramSequence seq(graph, debug_name_and_id);
61+
DriverProgramSequence seq(debug_name_and_id);
6362

6463
auto tf_in_type = cast_inst->InputType();
6564

@@ -95,7 +94,7 @@ StatusOr<DriverProgramSequence> CreatePoplibsCastNativeToGfloat(
9594

9695
auto out = popfloat::experimental::GfloatCast::castNativeToGfloat(
9796
graph, operand, gf_params, seq, gf_cast_cfg, {debug_name_and_id});
98-
TF_CHECK_OK(AddOutputTensor(tensor_map, inst, 0, DriverTensor(out, graph)));
97+
TF_CHECK_OK(AddOutputTensor(tensor_map, inst, 0, DriverTensor(out)));
9998
}
10099

101100
return seq;
@@ -110,7 +109,7 @@ StatusOr<DriverProgramSequence> CreatePoplibsCastGfloatToNative(
110109

111110
auto& graph = GetGraph(res, inst);
112111

113-
DriverProgramSequence seq(graph, debug_name_and_id);
112+
DriverProgramSequence seq(debug_name_and_id);
114113

115114
TF_ASSIGN_OR_RETURN(
116115
poplar::Tensor operand,
@@ -122,7 +121,7 @@ StatusOr<DriverProgramSequence> CreatePoplibsCastGfloatToNative(
122121
auto out = popfloat::experimental::GfloatCast::castGfloatToNative(
123122
graph, operand, params, seq, gf_cast_cfg, {debug_name_and_id});
124123

125-
TF_CHECK_OK(AddOutputTensor(tensor_map, inst, 0, DriverTensor(out, graph)));
124+
TF_CHECK_OK(AddOutputTensor(tensor_map, inst, 0, DriverTensor(out)));
126125

127126
return seq;
128127
}

tensorflow/compiler/plugin/poplar/driver/ops/custom_ops/execution_counter.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ExecutionCounterOp : public PoplarOpDef {
3535
const xla::Shape& output_shape, TensorMap& tensor_map,
3636
const poplar::DebugContext& debug_context) override {
3737
PoplarOpDefDebugInfo debug_info(debug_context, "ExecutionCounterOp");
38-
DriverProgramSequence seq(graph, debug_info);
38+
DriverProgramSequence seq(debug_info);
3939

4040
TF_ASSIGN_OR_RETURN(poplar::Tensor counter, GetExecutionCounter(res, inst));
4141

tensorflow/compiler/plugin/poplar/driver/ops/custom_ops/host_embedding.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class HostEmbeddingLookupOp : public PoplarOpDef {
326326
const xla::Shape& output_shape, TensorMap& tensor_map,
327327
const poplar::DebugContext& debug_context) override {
328328
PoplarOpDefDebugInfo debug_info(debug_context, "HostEmbeddingLookupOp");
329-
DriverProgramSequence seq(graph, debug_info);
329+
DriverProgramSequence seq(debug_info);
330330

331331
TF_ASSIGN_OR_RETURN(TensorVector indices,
332332
FindInstructionInputTensors(tensor_map, res, inst, 0,
@@ -596,7 +596,7 @@ class HostEmbeddingUpdateOp : public PoplarOpDef {
596596
const xla::Shape& output_shape, TensorMap& tensor_map,
597597
const poplar::DebugContext& debug_context) override {
598598
PoplarOpDefDebugInfo debug_info(debug_context, "HostEmbeddingUpdateOp");
599-
DriverProgramSequence seq(graph, debug_info);
599+
DriverProgramSequence seq(debug_info);
600600

601601
TF_ASSIGN_OR_RETURN(TensorVector grads,
602602
FindInstructionInputTensors(tensor_map, res, inst, 1,
@@ -664,7 +664,7 @@ class HostEmbeddingNotifyOp : public PoplarOpDef {
664664
Cast<HloHostEmbeddingNotifyInstruction>(inst);
665665

666666
PoplarOpDefDebugInfo debug_info(debug_context, "HostEmbeddingNotifyOp");
667-
DriverProgramSequence seq(graph, debug_info);
667+
DriverProgramSequence seq(debug_info);
668668

669669
// For synthetic data or remote buffers, there's no communication with the
670670
// host.

tensorflow/compiler/plugin/poplar/driver/ops/custom_ops/poplin/cholesky.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CholeskyOp : public PoplarOpDef {
3939
PoplarOpDefDebugInfo debug_info(debug_context, "Cholesky");
4040

4141
// Create the control program.
42-
DriverProgramSequence seq(graph, debug_context);
42+
DriverProgramSequence seq(debug_context);
4343

4444
// Get the input.
4545
TF_ASSIGN_OR_RETURN(poplar::Tensor a,

tensorflow/compiler/plugin/poplar/driver/ops/custom_ops/poplin/triangular_solve.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class TriangularSolveOp : public PoplarOpDef {
5050
PoplarOpDefDebugInfo debug_info(debug_context, "TriangularSolve");
5151
poplar::DebugNameAndId debug_name_and_id(debug_info);
5252
// Create the control program.
53-
DriverProgramSequence seq(graph, debug_name_and_id);
53+
DriverProgramSequence seq(debug_name_and_id);
5454

5555
// Get the input.
5656
TF_ASSIGN_OR_RETURN(

tensorflow/compiler/plugin/poplar/driver/ops/custom_ops/poplin/weights_transpose_chans_flip_xy.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class WeightsTransposeChansFlipXYOp : public PoplarOpDef {
6666
const poplar::DebugContext& debug_context) override {
6767
PoplarOpDefDebugInfo debug_info(debug_context,
6868
"WeightsTransposeChansFlipXYOp");
69-
DriverProgramSequence seq(graph, debug_info);
69+
DriverProgramSequence seq(debug_info);
7070

7171
TF_ASSIGN_OR_RETURN(
7272
poplar::Tensor in_weights,

tensorflow/compiler/plugin/poplar/driver/ops/custom_ops/popnn/arg_min_max.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ArgMinMaxOp : public PoplarOpDef {
6565
const poplar::DebugContext& debug_context) override {
6666
PoplarOpDefDebugInfo debug_info(debug_context, "ArgMinMaxOp");
6767
// Create the control program.
68-
DriverProgramSequence seq(graph, {debug_info});
68+
DriverProgramSequence seq(debug_info);
6969

7070
// Get the input.
7171
TF_ASSIGN_OR_RETURN(

tensorflow/compiler/plugin/poplar/driver/ops/custom_ops/popnn/ctc_loss.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CTCLossOpBase : public PoplarOpDef {
5454
const poplar::DebugContext& debug_context) override {
5555
PoplarOpDefDebugInfo debug_info(debug_context, ClassName());
5656
// Create the control program.
57-
DriverProgramSequence seq(graph, debug_info);
57+
DriverProgramSequence seq(debug_info);
5858
const HloCTCLossInstructionBase* ctc_inst =
5959
Cast<HloCTCLossInstructionBase>(inst);
6060

@@ -210,7 +210,7 @@ class CTCBeamSearchOpBase : public PoplarOpDef {
210210
const xla::Shape& output_shape, TensorMap& tensor_map,
211211
const poplar::DebugContext& debug_context) override {
212212
PoplarOpDefDebugInfo debug_info(debug_context, ClassName());
213-
DriverProgramSequence seq(graph, debug_info);
213+
DriverProgramSequence seq(debug_info);
214214
const auto* ctc_inst = Cast<HloCTCInferenceInstructionBase>(inst);
215215

216216
// Retreive intputs, attributes and outputs from instruction

0 commit comments

Comments
 (0)