diff --git a/.proj.toml b/.proj.toml index 46d9b37b55..1dff77d074 100644 --- a/.proj.toml +++ b/.proj.toml @@ -79,7 +79,7 @@ has-cuda-benchmarks = false [targets.task-spec] type = "lib" has-cpu-only-tests = true -has-cpu-only-benchmarks = false +has-cpu-only-benchmarks = true has-cuda-tests = false has-cuda-benchmarks = false @@ -216,6 +216,30 @@ budget = 4_700_000_000 name = "get_computation_graph_series_parallel_decomposition_on_inception_v3" budget = 7_000_000_000 +[[benchmarks.task-spec]] +name = "make_empty_dynamic_open_dataflow_graph" +budget = 90_000_000 + +[[benchmarks.task-spec]] +name = "dynamic_open_dataflow_graph_from_invocation_set" +budget = 4_200_000_000 + +[[benchmarks.task-spec]] +name = "dynamic_graph_get_id_for_invocation" +budget = 3_400_000 + +[[benchmarks.task-spec]] +name = "dynamic_graph_get_invocation_for_id" +budget = 2_000_000 + +[[benchmarks.task-spec]] +name = "dynamic_graph_get_id_for_value" +budget = 900_000 + +[[benchmarks.task-spec]] +name = "dynamic_graph_get_value_for_id" +budget = 600_000 + # default_build_targets = [ # "utils", # ] diff --git a/lib/local-execution/include/local-execution/computation_graph_instance.h b/lib/local-execution/include/local-execution/computation_graph_instance.h index db82936dd1..d7955a5d52 100644 --- a/lib/local-execution/include/local-execution/computation_graph_instance.h +++ b/lib/local-execution/include/local-execution/computation_graph_instance.h @@ -9,7 +9,7 @@ #include "pcg/computation_graph.dtg.h" #include "pcg/optimizer_attrs.dtg.h" #include "task-spec/dynamic_graph/dynamic_layer_guid_t.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" #include "task-spec/dynamic_graph/dynamic_tensor_accessor.dtg.h" #include "task-spec/dynamic_graph/dynamic_value_attrs.dtg.h" #include "task-spec/global_device_id_t.dtg.h" diff --git a/lib/local-execution/include/local-execution/per_device_op_state_initialization.h b/lib/local-execution/include/local-execution/per_device_op_state_initialization.h index aa407b7cdd..f1ba7b5003 100644 --- a/lib/local-execution/include/local-execution/per_device_op_state_initialization.h +++ b/lib/local-execution/include/local-execution/per_device_op_state_initialization.h @@ -5,7 +5,7 @@ #include "kernels/device_handle_t.dtg.h" #include "kernels/profiling_settings.dtg.h" #include "pcg/optimizer_attrs.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" #include "task-spec/global_device_id_t.dtg.h" namespace FlexFlow { diff --git a/lib/local-execution/include/local-execution/tensor_allocation.h b/lib/local-execution/include/local-execution/tensor_allocation.h index aa89909447..10e02daa6f 100644 --- a/lib/local-execution/include/local-execution/tensor_allocation.h +++ b/lib/local-execution/include/local-execution/tensor_allocation.h @@ -2,7 +2,7 @@ #define _FLEXFLOW_LIB_LOCAL_EXECUTION_INCLUDE_LOCAL_EXECUTION_TENSOR_ALLOCATION_H #include "kernels/allocation.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" namespace FlexFlow { diff --git a/lib/realm-execution/include/realm-execution/distributed_per_device_op_state_initialization.h b/lib/realm-execution/include/realm-execution/distributed_per_device_op_state_initialization.h index d02c70e2d7..45da21ac2b 100644 --- a/lib/realm-execution/include/realm-execution/distributed_per_device_op_state_initialization.h +++ b/lib/realm-execution/include/realm-execution/distributed_per_device_op_state_initialization.h @@ -6,7 +6,7 @@ #include "realm-execution/per_device_op_state_backing.dtg.h" #include "realm-execution/realm_context.h" #include "realm-execution/tensor_instance_backing.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" namespace FlexFlow { diff --git a/lib/realm-execution/include/realm-execution/instance_allocation.h b/lib/realm-execution/include/realm-execution/instance_allocation.h index c7f03d09ee..0d88a5ba93 100644 --- a/lib/realm-execution/include/realm-execution/instance_allocation.h +++ b/lib/realm-execution/include/realm-execution/instance_allocation.h @@ -3,7 +3,7 @@ #include "realm-execution/realm_context.h" #include "realm-execution/tensor_instance_backing.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" namespace FlexFlow { diff --git a/lib/realm-execution/include/realm-execution/pcg_instance.h b/lib/realm-execution/include/realm-execution/pcg_instance.h index 4953d3e5e2..ecda0c5db3 100644 --- a/lib/realm-execution/include/realm-execution/pcg_instance.h +++ b/lib/realm-execution/include/realm-execution/pcg_instance.h @@ -10,7 +10,7 @@ #include "realm-execution/per_device_op_state_backing.dtg.h" #include "realm-execution/realm_context.h" #include "realm-execution/tensor_instance_backing.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" #include "task-spec/dynamic_graph/dynamic_tensor_accessor.dtg.h" #include "task-spec/dynamic_graph/dynamic_value_attrs.dtg.h" #include "task-spec/global_device_id_t.dtg.h" diff --git a/lib/realm-execution/src/realm-execution/distributed_per_device_op_state_initialization.cc b/lib/realm-execution/src/realm-execution/distributed_per_device_op_state_initialization.cc index ff803bba59..cdda9d5c5a 100644 --- a/lib/realm-execution/src/realm-execution/distributed_per_device_op_state_initialization.cc +++ b/lib/realm-execution/src/realm-execution/distributed_per_device_op_state_initialization.cc @@ -29,7 +29,8 @@ PerDeviceOpStateBacking perform_distributed_per_device_op_state_initialization( std::map *> device_state_map; - for (DynamicNodeInvocation const &invocation : dg.invocations) { + for (DynamicNodeInvocation const &invocation : + get_dynamic_invocation_set(dg)) { // Nodes mapped to multiple devices are always parallel operators and don't // have any initialization to perform anyway std::optional device_id = diff --git a/lib/realm-execution/src/realm-execution/instance_allocation.cc b/lib/realm-execution/src/realm-execution/instance_allocation.cc index ffb85056e4..03ca3859b6 100644 --- a/lib/realm-execution/src/realm-execution/instance_allocation.cc +++ b/lib/realm-execution/src/realm-execution/instance_allocation.cc @@ -60,7 +60,8 @@ TensorInstanceBacking perform_instance_allocation( } }; - for (DynamicNodeInvocation const &invocation : g.invocations) { + for (DynamicNodeInvocation const &invocation : + get_dynamic_invocation_set(g)) { for (DynamicValueAttrs const &input : values(invocation.inputs)) { allocate(input); } diff --git a/lib/realm-execution/src/realm-execution/pcg_instance.cc b/lib/realm-execution/src/realm-execution/pcg_instance.cc index e72c2b2cbf..f9a2d08afa 100644 --- a/lib/realm-execution/src/realm-execution/pcg_instance.cc +++ b/lib/realm-execution/src/realm-execution/pcg_instance.cc @@ -124,7 +124,8 @@ PCGInstance create_pcg_instance( logit_grad_value = transform(logit_grad_value, [&](DynamicValueAttrs const &lgv) { - for (DynamicNodeInvocation const &invocation : dg.invocations) { + for (DynamicNodeInvocation const &invocation : + get_dynamic_invocation_set(dg)) { if (invocation.node_attrs.task_type != DynamicTaskType::LOSS) { continue; } diff --git a/lib/task-spec/CMakeLists.txt b/lib/task-spec/CMakeLists.txt index af8f7f32e0..c535078ddb 100644 --- a/lib/task-spec/CMakeLists.txt +++ b/lib/task-spec/CMakeLists.txt @@ -17,3 +17,4 @@ ff_add_library( ) add_subdirectory(test) +add_subdirectory(benchmark) diff --git a/lib/task-spec/benchmark/CMakeLists.txt b/lib/task-spec/benchmark/CMakeLists.txt new file mode 100644 index 0000000000..178a5df8a1 --- /dev/null +++ b/lib/task-spec/benchmark/CMakeLists.txt @@ -0,0 +1,10 @@ +ff_add_benchmark_executable( + NAME + task-spec-benchmarks + SRC_PATTERNS + src/*.cc + PRIVATE_INCLUDE + include/ + DEPS + task-spec +) diff --git a/lib/task-spec/benchmark/include/benchmark/task-spec/dynamic_graph/dynamic_open_dataflow_graph.h b/lib/task-spec/benchmark/include/benchmark/task-spec/dynamic_graph/dynamic_open_dataflow_graph.h new file mode 100644 index 0000000000..31b95c4fad --- /dev/null +++ b/lib/task-spec/benchmark/include/benchmark/task-spec/dynamic_graph/dynamic_open_dataflow_graph.h @@ -0,0 +1,20 @@ +#ifndef _FLEXFLOW_LIB_TASK_SPEC_BENCHMARK_INCLUDE_BENCHMARK_TASK_SPEC_CONTAINERS_TRANSFORM_H +#define _FLEXFLOW_LIB_TASK_SPEC_BENCHMARK_INCLUDE_BENCHMARK_TASK_SPEC_CONTAINERS_TRANSFORM_H + +namespace FlexFlow { + +void benchmark_make_empty_dynamic_open_dataflow_graph(bool dry_run); + +void benchmark_dynamic_open_dataflow_graph_from_invocation_set(bool dry_run); + +void benchmark_dynamic_graph_get_id_for_invocation(bool dry_run); + +void benchmark_dynamic_graph_get_invocation_for_id(bool dry_run); + +void benchmark_dynamic_graph_get_id_for_value(bool dry_run); + +void benchmark_dynamic_graph_get_value_for_id(bool dry_run); + +} // namespace FlexFlow + +#endif diff --git a/lib/task-spec/benchmark/src/benchmark/task-spec/dynamic_graph/dynamic_open_dataflow_graph.cc b/lib/task-spec/benchmark/src/benchmark/task-spec/dynamic_graph/dynamic_open_dataflow_graph.cc new file mode 100644 index 0000000000..b9ab18f88b --- /dev/null +++ b/lib/task-spec/benchmark/src/benchmark/task-spec/dynamic_graph/dynamic_open_dataflow_graph.cc @@ -0,0 +1,151 @@ +#include "benchmark/task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" +#include "op-attrs/ops/element_unary.h" +#include "task-spec/dynamic_graph/dynamic_node_invocation.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" +#include "task-spec/dynamic_graph/dynamic_value_attrs.dtg.h" +#include "utils/benchmark_utils/loop.h" +#include "utils/containers/at_idx.h" +#include "utils/containers/get_only.h" +#include "utils/containers/range.h" +#include "utils/containers/range_inclusive.h" +#include "utils/nonnegative_int/nonnegative_int.h" +#include + +namespace FlexFlow { + +static std::set create_benchmark_invocation_set() { + auto mk_dynamic_value = [](size_t node_id, + TensorSlotName slot_name) -> DynamicValueAttrs { + return DynamicValueAttrs{ + /*tensor_guid=*/dynamic_tensor_guid_t{parallel_tensor_guid_t{ + KwargDataflowOutput{ + Node{node_id}, + slot_name, + }, + }}, + /*parallel_tensor_shape=*/std::nullopt, + /*create_grad=*/std::nullopt, + /*shard_coord=*/std::nullopt, + /*mapping=*/std::nullopt, + /*accessor=*/std::nullopt, + /*tensor_type=*/std::nullopt, + }; + }; + + auto mk_slot = [](TensorSlotName slot_name) { + return DynamicTensorSlot{ + /*slot_name=*/slot_name, + /*slot_tensor_role=*/std::nullopt, + /*task_shard=*/std::nullopt, + }; + }; + + auto mk_node = [](size_t node_id) { + return DynamicNodeAttrs{ + /*task_type=*/std::nullopt, + /*device_coord=*/std::nullopt, + /*mapping=*/std::nullopt, + /*op_attrs=*/ + TrainingOperationAttrs{PCGOperatorAttrs{make_relu_attrs()}}, + /*layer_guid=*/ + dynamic_layer_guid_t{parallel_layer_guid_t{Node{node_id}}}, + /*per_device_op_state=*/std::nullopt, + }; + }; + + constexpr int num_invocations = 1000; + std::vector values = + transform(range_inclusive(num_invocations), [&](int idx) { + return mk_dynamic_value(idx, TensorSlotName::OUTPUT); + }); + + std::set result = + set_of(transform(range(num_invocations), [&](int idx) { + return DynamicNodeInvocation{ + /*inputs=*/std::map{ + { + mk_slot(TensorSlotName::INPUT), + values.at(idx), + }, + }, + /*node_attrs=*/mk_node(idx), + /*outputs=*/ + std::map{ + { + mk_slot(TensorSlotName::OUTPUT), + values.at(idx + 1), + }, + }, + }; + })); + return result; +} + +void benchmark_make_empty_dynamic_open_dataflow_graph(bool dry_run) { + LOOP(10000, dry_run) { + make_empty_dynamic_open_dataflow_graph(); + } +} + +void benchmark_dynamic_open_dataflow_graph_from_invocation_set(bool dry_run) { + std::set invocation_set = + create_benchmark_invocation_set(); + LOOP(10, dry_run) { + dynamic_open_dataflow_graph_from_invocation_set(invocation_set); + } +} + +void benchmark_dynamic_graph_get_id_for_invocation(bool dry_run) { + std::set invocation_set = + create_benchmark_invocation_set(); + DynamicOpenDataflowGraph dg = + dynamic_open_dataflow_graph_from_invocation_set(invocation_set); + DynamicNodeInvocation invocation = + at_idx(invocation_set, nonnegative_int{invocation_set.size() / 2}); + LOOP(1000, dry_run) { + dynamic_graph_get_id_for_invocation(dg, invocation); + } +} + +void benchmark_dynamic_graph_get_invocation_for_id(bool dry_run) { + std::set invocation_set = + create_benchmark_invocation_set(); + DynamicOpenDataflowGraph dg = + dynamic_open_dataflow_graph_from_invocation_set(invocation_set); + DynamicNodeInvocation invocation = + at_idx(invocation_set, nonnegative_int{invocation_set.size() / 2}); + dynamic_invocation_id_t id = + dynamic_graph_get_id_for_invocation(dg, invocation); + LOOP(1000, dry_run) { + dynamic_graph_get_invocation_for_id(dg, id); + } +} + +void benchmark_dynamic_graph_get_id_for_value(bool dry_run) { + std::set invocation_set = + create_benchmark_invocation_set(); + DynamicOpenDataflowGraph dg = + dynamic_open_dataflow_graph_from_invocation_set(invocation_set); + DynamicNodeInvocation invocation = + at_idx(invocation_set, nonnegative_int{invocation_set.size() / 2}); + DynamicValueAttrs value = get_only(invocation.outputs).second; + LOOP(1000, dry_run) { + dynamic_graph_get_id_for_value(dg, value); + } +} + +void benchmark_dynamic_graph_get_value_for_id(bool dry_run) { + std::set invocation_set = + create_benchmark_invocation_set(); + DynamicOpenDataflowGraph dg = + dynamic_open_dataflow_graph_from_invocation_set(invocation_set); + DynamicNodeInvocation invocation = + at_idx(invocation_set, nonnegative_int{invocation_set.size() / 2}); + DynamicValueAttrs value = get_only(invocation.outputs).second; + dynamic_value_id_t id = dynamic_graph_get_id_for_value(dg, value); + LOOP(1000, dry_run) { + dynamic_graph_get_value_for_id(dg, id); + } +} + +} // namespace FlexFlow diff --git a/lib/task-spec/benchmark/src/main.cc b/lib/task-spec/benchmark/src/main.cc new file mode 100644 index 0000000000..8820e1536d --- /dev/null +++ b/lib/task-spec/benchmark/src/main.cc @@ -0,0 +1,37 @@ +#include "benchmark/task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" +#include "utils/benchmark_utils/benchmark_main.h" +#include +#include + +using namespace ::FlexFlow; + +int main(int argc, char **argv) { + std::map> benchmarks = { + { + "make_empty_dynamic_open_dataflow_graph", + benchmark_make_empty_dynamic_open_dataflow_graph, + }, + { + "dynamic_open_dataflow_graph_from_invocation_set", + benchmark_dynamic_open_dataflow_graph_from_invocation_set, + }, + { + "dynamic_graph_get_id_for_invocation", + benchmark_dynamic_graph_get_id_for_invocation, + }, + { + "dynamic_graph_get_invocation_for_id", + benchmark_dynamic_graph_get_invocation_for_id, + }, + { + "dynamic_graph_get_id_for_value", + benchmark_dynamic_graph_get_id_for_value, + }, + { + "dynamic_graph_get_value_for_id", + benchmark_dynamic_graph_get_value_for_id, + }, + }; + + benchmark_main(argc, argv, benchmarks); +} diff --git a/lib/task-spec/include/task-spec/dynamic_graph/copy_insertion.h b/lib/task-spec/include/task-spec/dynamic_graph/copy_insertion.h index 046ac1add7..caa3ae9a82 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/copy_insertion.h +++ b/lib/task-spec/include/task-spec/dynamic_graph/copy_insertion.h @@ -3,7 +3,7 @@ #include "task-spec/dynamic_graph/dynamic_node_attrs.dtg.h" #include "task-spec/dynamic_graph/dynamic_node_invocation.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" #include "task-spec/dynamic_graph/dynamic_slot_site.dtg.h" #include "task-spec/dynamic_graph/dynamic_value_copy_info.dtg.h" #include "task-spec/dynamic_graph/internal_dynamic_slot_site.dtg.h" diff --git a/lib/task-spec/include/task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.toml b/lib/task-spec/include/task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.toml deleted file mode 100644 index 6167bffdd2..0000000000 --- a/lib/task-spec/include/task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.toml +++ /dev/null @@ -1,22 +0,0 @@ -namespace = "FlexFlow" -name = "DynamicOpenDataflowGraph" -type = "struct" -features = [ - "eq", - "ord", - "fmt", - "json_serialize", -] - -includes = [ - "task-spec/dynamic_graph/dynamic_node_invocation.dtg.h", - "", -] - -src_includes = [ - "utils/fmt/set.h", -] - -[[fields]] -name = "invocations" -type = "std::set<::FlexFlow::DynamicNodeInvocation>" diff --git a/lib/task-spec/include/task-spec/dynamic_graph/dynamic_open_dataflow_graph.h b/lib/task-spec/include/task-spec/dynamic_graph/dynamic_open_dataflow_graph.h index 29339beb3e..33524c680a 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/dynamic_open_dataflow_graph.h +++ b/lib/task-spec/include/task-spec/dynamic_graph/dynamic_open_dataflow_graph.h @@ -4,13 +4,49 @@ #include "task-spec/dynamic_graph/dynamic_graph_edge.dtg.h" #include "task-spec/dynamic_graph/dynamic_invocation_id_t.dtg.h" #include "task-spec/dynamic_graph/dynamic_node_invocation.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" #include "task-spec/dynamic_graph/dynamic_slot_site.dtg.h" +#include "task-spec/dynamic_graph/dynamic_value_attrs.dtg.h" #include "task-spec/dynamic_graph/dynamic_value_id_t.dtg.h" #include "utils/graph/labelled_open_kwarg_dataflow_graph/labelled_open_kwarg_dataflow_graph.h" +#include "utils/unordered_bidict/unordered_bidict.h" namespace FlexFlow { +struct DynamicOpenDataflowGraph { + DynamicOpenDataflowGraph() = delete; + explicit DynamicOpenDataflowGraph( + std::set const &invocation_set); + + bool operator==(DynamicOpenDataflowGraph const &) const; + bool operator!=(DynamicOpenDataflowGraph const &) const; + bool operator<(DynamicOpenDataflowGraph const &) const; + bool operator>(DynamicOpenDataflowGraph const &) const; + bool operator<=(DynamicOpenDataflowGraph const &) const; + bool operator>=(DynamicOpenDataflowGraph const &) const; + + std::set const &get_invocation_set() const; + + DynamicNodeInvocation const & + get_invocation_for_id(dynamic_invocation_id_t) const; + dynamic_invocation_id_t + get_id_for_invocation(DynamicNodeInvocation const &) const; + + DynamicValueAttrs const &get_value_for_id(dynamic_value_id_t) const; + dynamic_value_id_t get_id_for_value(DynamicValueAttrs const &) const; + + std::string debug_to_string() const; + void debug_print() const; + +private: + std::set invocations; + unordered_bidict + invocations_by_id; + unordered_bidict values_by_id; +}; + +std::string format_as(DynamicOpenDataflowGraph const &); +std::ostream &operator<<(std::ostream &, DynamicOpenDataflowGraph const &); + DynamicOpenDataflowGraph make_empty_dynamic_open_dataflow_graph(); void check_dynamic_open_dataflow_graph_is_valid( @@ -129,4 +165,11 @@ void debug_print_dynamic_open_dataflow_graph_as_dot( } // namespace FlexFlow +namespace nlohmann { +template <> +struct adl_serializer<::FlexFlow::DynamicOpenDataflowGraph> { + static void to_json(json &, ::FlexFlow::DynamicOpenDataflowGraph const &); +}; +} // namespace nlohmann + #endif diff --git a/lib/task-spec/include/task-spec/dynamic_graph/loss_insertion.h b/lib/task-spec/include/task-spec/dynamic_graph/loss_insertion.h index 8584b4bed8..24173a554c 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/loss_insertion.h +++ b/lib/task-spec/include/task-spec/dynamic_graph/loss_insertion.h @@ -2,7 +2,7 @@ #define _FLEXFLOW_LIB_TASK_SPEC_INCLUDE_TASK_SPEC_DYNAMIC_GRAPH_LOSS_INSERTION_H #include "op-attrs/ops/loss_functions/loss_attrs.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" #include "task-spec/dynamic_graph/dynamic_tensor_guid_t.dtg.h" #include "task-spec/dynamic_graph/dynamic_value_attrs.dtg.h" #include "task-spec/dynamic_graph/loss_insertion_result.dtg.h" diff --git a/lib/task-spec/include/task-spec/dynamic_graph/loss_insertion_result.dtg.toml b/lib/task-spec/include/task-spec/dynamic_graph/loss_insertion_result.dtg.toml index 1fb8892232..0b74a2217b 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/loss_insertion_result.dtg.toml +++ b/lib/task-spec/include/task-spec/dynamic_graph/loss_insertion_result.dtg.toml @@ -9,7 +9,7 @@ features = [ ] includes = [ - "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h", + "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h", "task-spec/dynamic_graph/dynamic_value_attrs.dtg.h", ] diff --git a/lib/task-spec/include/task-spec/dynamic_graph/machine_slicing.h b/lib/task-spec/include/task-spec/dynamic_graph/machine_slicing.h index 99d8a14828..c196760fe9 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/machine_slicing.h +++ b/lib/task-spec/include/task-spec/dynamic_graph/machine_slicing.h @@ -1,7 +1,7 @@ #ifndef _FLEXFLOW_LIB_TASK_SPEC_INCLUDE_TASK_SPEC_DYNAMIC_GRAPH_MACHINE_SLICING_H #define _FLEXFLOW_LIB_TASK_SPEC_INCLUDE_TASK_SPEC_DYNAMIC_GRAPH_MACHINE_SLICING_H -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" namespace FlexFlow { diff --git a/lib/task-spec/include/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_cg.h b/lib/task-spec/include/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_cg.h index 639aef8598..4337788729 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_cg.h +++ b/lib/task-spec/include/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_cg.h @@ -2,7 +2,7 @@ #define _FLEXFLOW_LIB_TASK_SPEC_INCLUDE_TASK_SPEC_DYNAMIC_GRAPH_DYNAMIC_OPEN_DATAFLOW_GRAPH_FROM_CG_H #include "pcg/computation_graph.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" namespace FlexFlow { diff --git a/lib/task-spec/include/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_mapped_pcg.h b/lib/task-spec/include/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_mapped_pcg.h index 8370bfe498..7aa5b26831 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_mapped_pcg.h +++ b/lib/task-spec/include/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_mapped_pcg.h @@ -3,7 +3,7 @@ #include "pcg/mapped_parallel_computation_graph/mapped_parallel_computation_graph.dtg.h" #include "pcg/mapped_parallel_computation_graph/mapped_parallel_layer_invocation_info.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" namespace FlexFlow { diff --git a/lib/task-spec/include/task-spec/dynamic_graph/pass_expansion.h b/lib/task-spec/include/task-spec/dynamic_graph/pass_expansion.h index 3adf66d117..0556c14b8b 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/pass_expansion.h +++ b/lib/task-spec/include/task-spec/dynamic_graph/pass_expansion.h @@ -3,7 +3,7 @@ #include "task-spec/dynamic_graph/dynamic_invocation_id_t.dtg.h" #include "task-spec/dynamic_graph/dynamic_node_invocation.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" namespace FlexFlow { diff --git a/lib/task-spec/include/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.dtg.toml b/lib/task-spec/include/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.dtg.toml index d5e92e9b3a..4523326c54 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.dtg.toml +++ b/lib/task-spec/include/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.dtg.toml @@ -9,7 +9,7 @@ features = [ ] includes = [ - "task-spec/dynamic_graph/serializable_dynamic_node_invocation.dtg.h", + "task-spec/dynamic_graph/serializable_dynamic_node_invocation.h", "", ] diff --git a/lib/task-spec/include/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.h b/lib/task-spec/include/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.h index f8716a754d..783db91855 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.h +++ b/lib/task-spec/include/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.h @@ -1,7 +1,7 @@ #ifndef _FLEXFLOW_LIB_TASK_SPEC_INCLUDE_TASK_SPEC_DYNAMIC_GRAPH_SERIALIZABLE_DYNAMIC_OPEN_DATAFLOW_GRAPH_H #define _FLEXFLOW_LIB_TASK_SPEC_INCLUDE_TASK_SPEC_DYNAMIC_GRAPH_SERIALIZABLE_DYNAMIC_OPEN_DATAFLOW_GRAPH_H -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" #include "task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.dtg.h" namespace FlexFlow { diff --git a/lib/task-spec/include/task-spec/dynamic_graph/shard_expansion.h b/lib/task-spec/include/task-spec/dynamic_graph/shard_expansion.h index 338256ae1e..ae2057ec5a 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/shard_expansion.h +++ b/lib/task-spec/include/task-spec/dynamic_graph/shard_expansion.h @@ -4,7 +4,7 @@ #include "task-spec/dynamic_graph/dynamic_node_attrs.dtg.h" #include "task-spec/dynamic_graph/dynamic_node_invocation.dtg.h" #include "task-spec/dynamic_graph/dynamic_node_invocation_sharding_info.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" #include "task-spec/dynamic_graph/dynamic_value_attrs_sharding_info.dtg.h" namespace FlexFlow { diff --git a/lib/task-spec/include/task-spec/dynamic_graph/update_insertion.h b/lib/task-spec/include/task-spec/dynamic_graph/update_insertion.h index f274449b9e..1d2f4146b5 100644 --- a/lib/task-spec/include/task-spec/dynamic_graph/update_insertion.h +++ b/lib/task-spec/include/task-spec/dynamic_graph/update_insertion.h @@ -2,7 +2,7 @@ #define _FLEXFLOW_LIB_TASK_SPEC_INCLUDE_TASK_SPEC_DYNAMIC_GRAPH_UPDATE_INSERTION_H #include "pcg/optimizer_attrs.dtg.h" -#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.dtg.h" +#include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" namespace FlexFlow { diff --git a/lib/task-spec/src/task-spec/dynamic_graph/dynamic_open_dataflow_graph.cc b/lib/task-spec/src/task-spec/dynamic_graph/dynamic_open_dataflow_graph.cc index ee8af3135b..faeb1cd740 100644 --- a/lib/task-spec/src/task-spec/dynamic_graph/dynamic_open_dataflow_graph.cc +++ b/lib/task-spec/src/task-spec/dynamic_graph/dynamic_open_dataflow_graph.cc @@ -12,6 +12,7 @@ #include "utils/containers/concat_vectors.h" #include "utils/containers/contains_duplicates.h" #include "utils/containers/contains_value.h" +#include "utils/containers/enumerate.h" #include "utils/containers/filter_values.h" #include "utils/containers/flatmap.h" #include "utils/containers/get_only.h" @@ -19,6 +20,8 @@ #include "utils/containers/multiset_union.h" #include "utils/containers/repeat.h" #include "utils/containers/require_all_of.h" +#include "utils/containers/set_of.h" +#include "utils/containers/set_union.h" #include "utils/containers/transform.h" #include "utils/containers/zip_strict.h" #include "utils/containers/zip_values_strict.h" @@ -33,9 +36,108 @@ #include "utils/graph/open_dataflow_graph/algorithms/get_inputs.h" #include "utils/graph/open_kwarg_dataflow_graph/kwarg_dataflow_graph_input.dtg.h" #include "utils/many_to_one/many_to_one.h" +#include "utils/nonnegative_int/nonnegative_int.h" +#include "utils/unordered_bidict/algorithms/unordered_bidict_from_map.h" namespace FlexFlow { +DynamicOpenDataflowGraph::DynamicOpenDataflowGraph( + std::set const &invocations) + : invocations(invocations) { + this->invocations_by_id = unordered_bidict_from_map( + map_keys(enumerate(this->invocations), [](nonnegative_int idx) { + return dynamic_invocation_id_t{idx}; + })); + + std::map internal_values = + map_keys(enumerate(dynamic_graph_get_internal_values(*this)), + [](nonnegative_int idx) { + return dynamic_value_id_t{dynamic_internal_value_id_t{idx}}; + }); + std::map external_values = + map_keys(enumerate(dynamic_graph_get_external_values(*this)), + [](nonnegative_int idx) { + return dynamic_value_id_t{dynamic_external_value_id_t{idx}}; + }); + std::map all_values = + binary_merge_disjoint_maps(internal_values, external_values); + this->values_by_id = unordered_bidict_from_map(all_values); + + check_dynamic_open_dataflow_graph_is_valid(*this); +} + +bool DynamicOpenDataflowGraph::operator==( + DynamicOpenDataflowGraph const &other) const { + return std::tie(this->invocations) == std::tie(other.invocations); +} + +bool DynamicOpenDataflowGraph::operator!=( + DynamicOpenDataflowGraph const &other) const { + return std::tie(this->invocations) != std::tie(other.invocations); +} + +bool DynamicOpenDataflowGraph::operator<( + DynamicOpenDataflowGraph const &other) const { + return std::tie(this->invocations) < std::tie(other.invocations); +} + +bool DynamicOpenDataflowGraph::operator>( + DynamicOpenDataflowGraph const &other) const { + return std::tie(this->invocations) > std::tie(other.invocations); +} + +bool DynamicOpenDataflowGraph::operator<=( + DynamicOpenDataflowGraph const &other) const { + return std::tie(this->invocations) <= std::tie(other.invocations); +} + +bool DynamicOpenDataflowGraph::operator>=( + DynamicOpenDataflowGraph const &other) const { + return std::tie(this->invocations) >= std::tie(other.invocations); +} + +std::set const & + DynamicOpenDataflowGraph::get_invocation_set() const { + return this->invocations; +} + +DynamicNodeInvocation const &DynamicOpenDataflowGraph::get_invocation_for_id( + dynamic_invocation_id_t id) const { + return this->invocations_by_id.at_l(id); +} + +dynamic_invocation_id_t DynamicOpenDataflowGraph::get_id_for_invocation( + DynamicNodeInvocation const &invocation) const { + return this->invocations_by_id.at_r(invocation); +} + +DynamicValueAttrs const & + DynamicOpenDataflowGraph::get_value_for_id(dynamic_value_id_t id) const { + return this->values_by_id.at_l(id); +} + +dynamic_value_id_t DynamicOpenDataflowGraph::get_id_for_value( + DynamicValueAttrs const &value) const { + return this->values_by_id.at_r(value); +} + +std::string DynamicOpenDataflowGraph::debug_to_string() const { + return fmt::to_string(*this); +} + +void DynamicOpenDataflowGraph::debug_print() const { + std::cout << this->debug_to_string() << std::endl; +} + +std::string format_as(DynamicOpenDataflowGraph const &x) { + ::nlohmann::json j = x; + return j.dump(); +} + +std::ostream &operator<<(std::ostream &s, DynamicOpenDataflowGraph const &x) { + return s << fmt::to_string(x); +} + DynamicOpenDataflowGraph make_empty_dynamic_open_dataflow_graph() { return DynamicOpenDataflowGraph{ std::set{}, @@ -47,7 +149,7 @@ void check_dynamic_open_dataflow_graph_is_valid( std::map> invocations_by_value_produced; - for (DynamicNodeInvocation const &i : g.invocations) { + for (DynamicNodeInvocation const &i : g.get_invocation_set()) { for (DynamicValueAttrs const &v : values(i.outputs)) { invocations_by_value_produced[v].push_back(i); } @@ -107,12 +209,12 @@ void require_full_dynamic_graph_satisfies( DynamicOpenDataflowGraph const &g, std::function const &invocation_condition) { - require_all_of(g.invocations, invocation_condition); + require_all_of(g.get_invocation_set(), invocation_condition); } std::multiset get_dynamic_nodes(DynamicOpenDataflowGraph const &g) { - return transform(multiset_of(g.invocations), + return transform(multiset_of(g.get_invocation_set()), [&](DynamicNodeInvocation const &i) -> DynamicNodeAttrs { return i.node_attrs; }); @@ -121,7 +223,7 @@ std::multiset std::multiset get_dynamic_values(DynamicOpenDataflowGraph const &g) { return flatmap( - multiset_of(g.invocations), + multiset_of(g.get_invocation_set()), [&](DynamicNodeInvocation const &i) -> std::multiset { return multiset_union(values(i.inputs), values(i.outputs)); }); @@ -130,7 +232,7 @@ std::multiset std::multiset get_dynamic_tensor_slots(DynamicOpenDataflowGraph const &g) { return flatmap( - multiset_of(g.invocations), + multiset_of(g.get_invocation_set()), [&](DynamicNodeInvocation const &i) -> std::multiset { return multiset_of(set_union(keys(i.inputs), keys(i.outputs))); }); @@ -138,7 +240,7 @@ std::multiset std::set get_dynamic_invocation_set(DynamicOpenDataflowGraph const &g) { - return g.invocations; + return g.get_invocation_set(); } std::set @@ -173,74 +275,31 @@ std::set dynamic_invocation_id_t dynamic_graph_get_id_for_invocation( DynamicOpenDataflowGraph const &g, DynamicNodeInvocation const &invocation) { - return dynamic_invocation_id_t{ - nonnegative_int{assert_unwrap(index_of(g.invocations, invocation))}, - }; + return g.get_id_for_invocation(invocation); } DynamicNodeInvocation dynamic_graph_get_invocation_for_id(DynamicOpenDataflowGraph const &g, dynamic_invocation_id_t const &id) { - return at_idx(g.invocations, id.idx); + return g.get_invocation_for_id(id); } dynamic_value_id_t dynamic_graph_get_id_for_value(DynamicOpenDataflowGraph const &g, DynamicValueAttrs const &value) { - auto idx_in_set = [](std::set const &s, - DynamicValueAttrs const &v) -> nonnegative_int { - return nonnegative_int{assert_unwrap(index_of(s, v))}; - }; - - { - std::set internal_values = - dynamic_graph_get_internal_values(g); - if (contains(internal_values, value)) { - return dynamic_value_id_t{ - dynamic_internal_value_id_t{ - idx_in_set(internal_values, value), - }, - }; - } - } - - { - std::set external_values = - dynamic_graph_get_external_values(g); - if (contains(external_values, value)) { - return dynamic_value_id_t{ - dynamic_external_value_id_t{ - idx_in_set(external_values, value), - }, - }; - } - } - - PANIC("Could not find id for value {}", value); + return g.get_id_for_value(value); } DynamicValueAttrs dynamic_graph_get_value_for_id(DynamicOpenDataflowGraph const &g, dynamic_value_id_t const &id) { - return id.visit(overload{ - [&](dynamic_internal_value_id_t const &internal_id) -> DynamicValueAttrs { - std::set internal_values = - dynamic_graph_get_internal_values(g); - - return at_idx(internal_values, internal_id.idx); - }, - [&](dynamic_external_value_id_t const &external_id) -> DynamicValueAttrs { - std::set external_values = - dynamic_graph_get_external_values(g); - - return at_idx(external_values, external_id.idx); - }}); + return g.get_value_for_id(id); } std::set get_dynamic_graph_edges(DynamicOpenDataflowGraph const &g) { return flatmap( - get_dynamic_invocation_set(g), + g.get_invocation_set(), [&](DynamicNodeInvocation const &i) -> std::set { return get_dynamic_graph_edges_incoming_to_invocation(g, i); }); @@ -315,7 +374,7 @@ DynamicValueAttrs std::set get_internal_dynamic_slot_sites(DynamicOpenDataflowGraph const &g) { return flatmap( - get_dynamic_invocation_set(g), + g.get_invocation_set(), [&](DynamicNodeInvocation const &i) -> std::set { dynamic_invocation_id_t id = dynamic_graph_get_id_for_invocation(g, i); @@ -412,7 +471,7 @@ std::optional find_output_value_attrs(DynamicOpenDataflowGraph const &dg, dynamic_tensor_guid_t tensor_guid, std::optional const &role) { - for (DynamicNodeInvocation const &invocation : dg.invocations) { + for (DynamicNodeInvocation const &invocation : dg.get_invocation_set()) { for (auto const &[slot, output] : invocation.outputs) { if (output.tensor_guid == tensor_guid && output.role == role) { return output; @@ -427,7 +486,7 @@ DynamicOpenDataflowGraph transform_dynamic_invocation_set( std::function const &f) { std::set current_invocation_set = - get_dynamic_invocation_set(g); + g.get_invocation_set(); std::set new_invocation_set = transform(current_invocation_set, f); @@ -440,7 +499,7 @@ DynamicOpenDataflowGraph flatmap_dynamic_invocation_set( DynamicNodeInvocation const &)> const &f) { std::set current_invocation_set = - get_dynamic_invocation_set(g); + g.get_invocation_set(); std::vector new_invocation_set = flatmap(vector_of(current_invocation_set), f); @@ -452,14 +511,9 @@ DynamicOpenDataflowGraph flatmap_dynamic_invocation_set( DynamicOpenDataflowGraph dynamic_open_dataflow_graph_from_invocation_set( std::set const &invocation_set) { - - DynamicOpenDataflowGraph result = DynamicOpenDataflowGraph{ + return DynamicOpenDataflowGraph{ invocation_set, }; - - check_dynamic_open_dataflow_graph_is_valid(result); - - return result; } std::pair all_values = set_of(get_dynamic_values(g)); ManyToOne value_to_producer; - for (DynamicNodeInvocation const &invocation : - get_dynamic_invocation_set(g)) { + for (DynamicNodeInvocation const &invocation : g.get_invocation_set()) { for (DynamicValueAttrs const &output : values(invocation.outputs)) { value_to_producer.insert({output, invocation}); } @@ -520,7 +573,7 @@ std::pair node_map; - std::set to_add = g.invocations; + std::set to_add = g.get_invocation_set(); auto add_invocation_to_graph = [&](DynamicNodeInvocation const &invocation) -> void { @@ -674,3 +727,13 @@ void debug_print_dynamic_open_dataflow_graph_as_dot( } } // namespace FlexFlow + +namespace nlohmann { + +void adl_serializer<::FlexFlow::DynamicOpenDataflowGraph>::to_json( + json &j, ::FlexFlow::DynamicOpenDataflowGraph const &v) { + j["__type"] = "DynamicOpenDataflowGraph"; + j["invocations"] = v.get_invocation_set(); +} + +} // namespace nlohmann diff --git a/lib/task-spec/src/task-spec/dynamic_graph/loss_insertion.cc b/lib/task-spec/src/task-spec/dynamic_graph/loss_insertion.cc index e7c4b34460..b4c9e2f34f 100644 --- a/lib/task-spec/src/task-spec/dynamic_graph/loss_insertion.cc +++ b/lib/task-spec/src/task-spec/dynamic_graph/loss_insertion.cc @@ -82,8 +82,11 @@ LossInsertionResult perform_loss_insertion( }, }; - DynamicOpenDataflowGraph result = dg; - result.invocations.insert(loss_invocation); + std::set invocation_set = + get_dynamic_invocation_set(dg); + invocation_set.insert(loss_invocation); + DynamicOpenDataflowGraph result = + dynamic_open_dataflow_graph_from_invocation_set(invocation_set); return LossInsertionResult{result, label_value, logit_grad_value}; } diff --git a/lib/task-spec/src/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_cg.cc b/lib/task-spec/src/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_cg.cc index 1118f726a8..cafa01e49a 100644 --- a/lib/task-spec/src/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_cg.cc +++ b/lib/task-spec/src/task-spec/dynamic_graph/make_dynamic_open_dataflow_graph_from_cg.cc @@ -4,6 +4,7 @@ #include "pcg/computation_graph.h" #include "pcg/tensor_attrs.dtg.h" #include "task-spec/dynamic_graph/dynamic_layer_guid_t.dtg.h" +#include "task-spec/dynamic_graph/dynamic_node_invocation.dtg.h" #include "task-spec/dynamic_graph/dynamic_open_dataflow_graph.h" #include "task-spec/dynamic_graph/dynamic_tensor_role.h" #include "task-spec/dynamic_graph/training_operation_attrs.dtg.h" @@ -17,7 +18,7 @@ namespace FlexFlow { DynamicOpenDataflowGraph make_dynamic_open_dataflow_graph_from_cg(ComputationGraph const &cg) { - DynamicOpenDataflowGraph result = make_empty_dynamic_open_dataflow_graph(); + std::set invocation_set; for (auto const &[layer, attrs] : get_layer_attrs_mapping(cg)) { DynamicNodeAttrs result_attrs{ @@ -75,10 +76,10 @@ DynamicOpenDataflowGraph }; }); - result.invocations.emplace(result_inputs, result_attrs, result_outputs); + invocation_set.emplace(result_inputs, result_attrs, result_outputs); } - return result; + return dynamic_open_dataflow_graph_from_invocation_set(invocation_set); } } // namespace FlexFlow diff --git a/lib/task-spec/src/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.cc b/lib/task-spec/src/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.cc index 2ceb8c1214..82a6101de6 100644 --- a/lib/task-spec/src/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.cc +++ b/lib/task-spec/src/task-spec/dynamic_graph/serializable_dynamic_open_dataflow_graph.cc @@ -7,7 +7,7 @@ SerializableDynamicOpenDataflowGraph dynamic_open_dataflow_graph_to_serializable( DynamicOpenDataflowGraph const &g) { return SerializableDynamicOpenDataflowGraph{ - /*invocations=*/transform(g.invocations, + /*invocations=*/transform(get_dynamic_invocation_set(g), dynamic_node_invocation_to_serializable), }; } diff --git a/lib/task-spec/test/src/task-spec/dynamic_graph/pass_expansion.cc b/lib/task-spec/test/src/task-spec/dynamic_graph/pass_expansion.cc index 9ba685f50b..0bae1511ba 100644 --- a/lib/task-spec/test/src/task-spec/dynamic_graph/pass_expansion.cc +++ b/lib/task-spec/test/src/task-spec/dynamic_graph/pass_expansion.cc @@ -880,7 +880,7 @@ TEST_SUITE(FF_TEST_SUITE) { }(); CHECK(get_dynamic_invocation_set(result).size() == - correct.invocations.size()); + get_dynamic_invocation_set(correct).size()); nlohmann::json result_json = dynamic_open_dataflow_graph_to_serializable(result); diff --git a/lib/utils/benchmark/src/main.cc b/lib/utils/benchmark/src/main.cc index 152c72ad4f..f40507dfe4 100644 --- a/lib/utils/benchmark/src/main.cc +++ b/lib/utils/benchmark/src/main.cc @@ -10,9 +10,8 @@ #include "benchmark/utils/graph/query_set.h" #include "benchmark/utils/unordered_bidict/algorithms/try_merge_nondisjoint_unordered_bidicts.h" #include "utils/benchmark_utils/benchmark_main.h" -#include +#include #include -#include using namespace ::FlexFlow;