Skip to content

Commit 753f014

Browse files
committed
Extend kwarg dataflow graph changes into substitutions
1 parent 7fcc351 commit 753f014

63 files changed

Lines changed: 846 additions & 221 deletions

File tree

Some content is hidden

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

lib/pcg/include/pcg/parallel_computation_graph/parallel_tensor_use_t.dtg.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ features = [
99
]
1010

1111
includes = [
12-
"utils/graph/dataflow_graph/dataflow_input.dtg.h",
12+
"utils/graph/kwarg_dataflow_graph/kwarg_dataflow_input.dtg.h",
13+
"op-attrs/tensor_slot_name.dtg.h"
1314
]
1415

1516
[[fields]]
1617
name = "raw_dataflow_input"
17-
type = "::FlexFlow::DataflowInput"
18+
type = "::FlexFlow::KwargDataflowInput<::FlexFlow::TensorSlotName>"

lib/substitutions/include/substitutions/apply_substitution/perform_shape_inference.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
#define _FLEXFLOW_LIB_SUBSTITUTIONS_INCLUDE_SUBSTITUTIONS_APPLY_SUBSTITUTION_PERFORM_SHAPE_INFERENCE_H
33

44
#include "op-attrs/parallel_tensor_shape.dtg.h"
5+
#include "op-attrs/tensor_slot_name.dtg.h"
56
#include "pcg/parallel_computation_graph/parallel_layer_attrs.dtg.h"
6-
#include "utils/graph/labelled_open_dataflow_graph/labelled_open_dataflow_graph_view.h"
7+
#include "utils/graph/labelled_open_kwarg_dataflow_graph/labelled_open_kwarg_dataflow_graph_view.h"
8+
#include "utils/graph/open_kwarg_dataflow_graph/kwarg_dataflow_graph_input.dtg.h"
79

810
namespace FlexFlow {
911

@@ -22,11 +24,11 @@ namespace FlexFlow {
2224
* Exists only to enable apply_substitution(SubParallelComputationGraph const &,
2325
* Substitution const &, PCGPatternMatch const &)
2426
*/
25-
LabelledOpenDataflowGraphView<ParallelLayerAttrs, ParallelTensorShape>
27+
LabelledOpenKwargDataflowGraphView<ParallelLayerAttrs, ParallelTensorShape, int, TensorSlotName>
2628
perform_shape_inference(
27-
LabelledOpenDataflowGraphView<ParallelLayerAttrs, std::monostate> const
29+
LabelledOpenKwargDataflowGraphView<ParallelLayerAttrs, std::monostate, int, TensorSlotName> const
2830
&g,
29-
std::unordered_map<DataflowGraphInput, ParallelTensorShape> const
31+
std::unordered_map<KwargDataflowGraphInput<int>, ParallelTensorShape> const
3032
&input_shapes);
3133

3234
} // namespace FlexFlow

lib/substitutions/include/substitutions/input_parallel_tensor_guid_t.dtg.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ features = [
99
]
1010

1111
includes = [
12-
"utils/graph/open_dataflow_graph/dataflow_graph_input.dtg.h",
12+
"utils/graph/open_kwarg_dataflow_graph/kwarg_dataflow_graph_input.dtg.h",
1313
]
1414

1515
[[fields]]
1616
name = "raw_dataflow_graph_input"
17-
type = "::FlexFlow::DataflowGraphInput"
17+
type = "::FlexFlow::KwargDataflowGraphInput<int>"

lib/substitutions/include/substitutions/open_parallel_tensor_guid_t.dtg.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ features = [
99
]
1010

1111
includes = [
12-
"utils/graph/open_dataflow_graph/open_dataflow_value.dtg.h"
12+
"utils/graph/open_kwarg_dataflow_graph/open_kwarg_dataflow_value.dtg.h",
13+
"op-attrs/tensor_slot_name.dtg.h",
1314
]
1415

1516
[[fields]]
1617
name = "raw_open_dataflow_value"
17-
type = "::FlexFlow::OpenDataflowValue"
18+
type = "::FlexFlow::OpenKwargDataflowValue<int, ::FlexFlow::TensorSlotName>"

lib/substitutions/include/substitutions/open_parallel_tensor_guid_t.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ template <typename F,
1717
typename Ret = std::invoke_result_t<F, parallel_tensor_guid_t>>
1818
Ret visit_open_parallel_tensor_guid(open_parallel_tensor_guid_t t, F f) {
1919
return t.raw_open_dataflow_value.visit<Ret>(overload{
20-
[&](DataflowOutput const &o) { return f(parallel_tensor_guid_t{o}); },
21-
[&](DataflowGraphInput const &i) {
20+
[&](KwargDataflowOutput<TensorSlotName> const &o) { return f(parallel_tensor_guid_t{o}); },
21+
[&](KwargDataflowGraphInput<int> const &i) {
2222
return f(input_parallel_tensor_guid_t{i});
2323
},
2424
});

lib/substitutions/include/substitutions/output_graph/output_graph_expr.dtg.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ type = "struct"
44
features = []
55

66
includes = [
7-
"utils/graph/labelled_open_dataflow_graph/labelled_open_dataflow_graph.h",
7+
"utils/graph/labelled_open_kwarg_dataflow_graph/labelled_open_kwarg_dataflow_graph.h",
88
"substitutions/output_graph/output_operator_attrs_assignment.dtg.h",
99
"<variant>",
10+
"op-attrs/tensor_slot_name.dtg.h",
1011
]
1112

1213
[[fields]]
1314
name = "raw_graph"
14-
type = "::FlexFlow::LabelledOpenDataflowGraph<::FlexFlow::OutputOperatorAttrsAssignment, std::monostate>"
15+
type = "::FlexFlow::LabelledOpenKwargDataflowGraph<::FlexFlow::OutputOperatorAttrsAssignment, std::monostate, int, ::FlexFlow::TensorSlotName>"

lib/substitutions/include/substitutions/output_graph/output_graph_expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace FlexFlow {
1010

1111
std::unordered_set<OutputGraphExprNode> get_nodes(OutputGraphExpr const &);
1212

13-
std::vector<OutputGraphExprNodeOutput>
13+
std::unordered_map<TensorSlotName, OutputGraphExprNodeOutput>
1414
get_node_outputs(OutputGraphExpr const &, OutputGraphExprNode const &);
1515

1616
std::unordered_set<OutputGraphExprInput> get_inputs(OutputGraphExpr const &);

lib/substitutions/include/substitutions/output_graph/output_graph_expr_input.dtg.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ features = [
99
]
1010

1111
includes = [
12-
"utils/graph/open_dataflow_graph/dataflow_graph_input.dtg.h",
12+
"utils/graph/open_kwarg_dataflow_graph/kwarg_dataflow_graph_input.dtg.h",
1313
]
1414

1515
[[fields]]
1616
name = "raw_dataflow_graph_input"
17-
type = "::FlexFlow::DataflowGraphInput"
17+
type = "::FlexFlow::KwargDataflowGraphInput<int>"

lib/substitutions/include/substitutions/output_graph/output_graph_expr_node_output.dtg.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ features = [
99
]
1010

1111
includes = [
12-
"utils/graph/dataflow_graph/dataflow_output.dtg.h",
12+
"utils/graph/kwarg_dataflow_graph/kwarg_dataflow_output.dtg.h",
13+
"op-attrs/tensor_slot_name.dtg.h",
1314
]
1415

1516
[[fields]]
1617
name = "raw_dataflow_output"
17-
type = "::FlexFlow::DataflowOutput"
18+
type = "::FlexFlow::KwargDataflowOutput<::FlexFlow::TensorSlotName>"

lib/substitutions/include/substitutions/output_graph/output_graph_expr_value.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
#define _FLEXFLOW_LIB_SUBSTITUTIONS_INCLUDE_SUBSTITUTIONS_OUTPUT_GRAPH_OUTPUT_GRAPH_EXPR_VALUE_H
33

44
#include "substitutions/output_graph/output_graph_expr_value.dtg.h"
5-
#include "utils/graph/open_dataflow_graph/open_dataflow_value.dtg.h"
5+
#include "utils/graph/open_kwarg_dataflow_graph/open_kwarg_dataflow_value.dtg.h"
66

77
namespace FlexFlow {
88

9-
OpenDataflowValue raw_open_dataflow_value_from_output_graph_expr_value(
9+
OpenKwargDataflowValue<int, TensorSlotName> raw_open_dataflow_value_from_output_graph_expr_value(
1010
OutputGraphExprValue const &);
1111
OutputGraphExprValue output_graph_expr_value_from_raw_open_dataflow_value(
12-
OpenDataflowValue const &);
12+
OpenKwargDataflowValue<int, TensorSlotName> const &);
1313

1414
} // namespace FlexFlow
1515

0 commit comments

Comments
 (0)