forked from flexflow/FlexFlow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A lot of simplifying and modularizing of unity dp code
- Loading branch information
Showing
105 changed files
with
2,370 additions
and
939 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
lib/compiler/include/compiler/comm_cost_estimate_key.struct.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace = "FlexFlow" | ||
name = "CommCostEstimateKey" | ||
features = [ | ||
"eq", | ||
"ord", | ||
"hash", | ||
"fmt", | ||
] | ||
|
||
includes = [ | ||
"op-attrs/parallel_tensor_shape.dtg.h", | ||
"pcg/machine_view.dtg.h", | ||
] | ||
|
||
[[fields]] | ||
name = "parallel_tensor_shape" | ||
type = "::FlexFlow::ParallelTensorShape" | ||
|
||
[[fields]] | ||
name = "src_machine_view" | ||
type = "::FlexFlow::MachineView" | ||
|
||
[[fields]] | ||
name = "dst_machine_view" | ||
type = "::FlexFlow::MachineView" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
lib/compiler/include/compiler/machine_mapping/estimate_cost_across_split.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_ESTIMATE_COST_ACROSS_SPLIT_H | ||
#define _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_ESTIMATE_COST_ACROSS_SPLIT_H | ||
|
||
#include "compiler/cost_estimator.h" | ||
#include "compiler/machine_mapping/transitive_reduced_pcg.dtg.h" | ||
#include "pcg/machine_view.dtg.h" | ||
#include "pcg/parallel_computation_graph/parallel_layer_guid_t.dtg.h" | ||
|
||
namespace FlexFlow { | ||
|
||
float estimate_cost_across_split(TransitiveReducedPCG const &, | ||
CostEstimator const &, | ||
std::unordered_map<parallel_layer_guid_t, MachineView> const &, | ||
std::unordered_map<parallel_layer_guid_t, MachineView> const &); | ||
|
||
} // namespace FlexFlow | ||
|
||
#endif |
16 changes: 16 additions & 0 deletions
16
lib/compiler/include/compiler/machine_mapping/estimate_layer_cost.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_ESTIMATE_LAYER_COST_H | ||
#define _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_ESTIMATE_LAYER_COST_H | ||
|
||
#include "compiler/cost_estimator.h" | ||
#include "pcg/parallel_computation_graph/parallel_computation_graph.dtg.h" | ||
#include "pcg/parallel_computation_graph/parallel_layer_guid_t.dtg.h" | ||
namespace FlexFlow { | ||
|
||
float estimate_layer_cost(ParallelComputationGraph const &pcg, | ||
CostEstimator const &cost_estimator, | ||
parallel_layer_guid_t const &layer, | ||
MachineView const &machine_view); | ||
|
||
} // namespace FlexFlow | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
lib/compiler/include/compiler/machine_mapping/get_machine_resource_splits.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_GET_MACHINE_RESOURCE_SPLITS_H | ||
#define _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_GET_MACHINE_RESOURCE_SPLITS_H | ||
|
||
#include "pcg/machine_specification.dtg.h" | ||
#include <utility> | ||
#include <unordered_set> | ||
|
||
namespace FlexFlow { | ||
|
||
std::unordered_set<std::pair<MachineSpecification, MachineSpecification>> | ||
get_machine_resource_splits(MachineSpecification const &resource); | ||
|
||
} // namespace FlexFlow | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lib/compiler/include/compiler/machine_mapping/machine_mapping_context.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_MACHINE_MAPPING_CONTEXT_H | ||
#define _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_MACHINE_MAPPING_CONTEXT_H | ||
|
||
#include "compiler/machine_mapping/machine_mapping_context.dtg.h" | ||
#include "pcg/parallel_computation_graph/parallel_computation_graph_edge.dtg.h" | ||
#include "pcg/parallel_computation_graph/parallel_layer_guid_t.dtg.h" | ||
#include "pcg/parallel_computation_graph/parallel_tensor_guid_t.dtg.h" | ||
|
||
namespace FlexFlow { | ||
|
||
std::unordered_set<MachineView> get_allowed_machine_views_for_tensor(MachineMappingContext const &, | ||
parallel_tensor_guid_t const &); | ||
std::unordered_set<MachineView> get_allowed_machine_views_for_layer(MachineMappingContext const &, | ||
parallel_layer_guid_t const &); | ||
|
||
MachineMappingContext make_machine_mapping_context(ParallelComputationGraph const &pcg, | ||
CostEstimator const &cost_estimator, | ||
std::function<std::unordered_set<MachineView>( | ||
ParallelLayerAttrs const &, MachineSpecification const &)> const &allowed_machine_views); | ||
|
||
} // namespace FlexFlow | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ namespace = "FlexFlow" | |
name = "MachineMappingResult" | ||
features = [ | ||
"eq", | ||
"hash", | ||
"fmt", | ||
] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
lib/compiler/include/compiler/machine_mapping/partial_machine_mapping.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_PARTIAL_MACHINE_MAPPING_H | ||
#define _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_PARTIAL_MACHINE_MAPPING_H | ||
|
||
#include "compiler/machine_mapping/machine_mapping_context.dtg.h" | ||
#include "compiler/machine_mapping/partial_machine_mapping.dtg.h" | ||
|
||
namespace FlexFlow { | ||
|
||
PartialMachineMapping get_unconstrained_solution(); | ||
|
||
PartialMachineMapping get_sub_solution(MachineMappingContext const &ctx, | ||
PartialMachineMapping const &partial_solution, | ||
PCGBinarySPDecomposition const &sub_problem); | ||
|
||
PartialMachineMapping with_additional_tensor_machine_views(MachineMappingContext const &ctx, | ||
PartialMachineMapping const &partial_solution, | ||
std::unordered_map<parallel_tensor_guid_t, MachineView> const &additional); | ||
|
||
PartialMachineMapping with_additional_layer_machine_views(MachineMappingContext const &ctx, | ||
PartialMachineMapping const &partial_solution, | ||
std::unordered_map<parallel_layer_guid_t, MachineView> const &additional); | ||
|
||
} // namespace FlexFlow | ||
|
||
#endif |
21 changes: 21 additions & 0 deletions
21
lib/compiler/include/compiler/machine_mapping/partial_machine_mapping.struct.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace = "FlexFlow" | ||
name = "PartialMachineMapping" | ||
features = [ | ||
"eq", | ||
"hash", | ||
"fmt", | ||
] | ||
|
||
includes = [ | ||
"pcg/parallel_computation_graph/parallel_layer_guid_t.dtg.h", | ||
"pcg/machine_view.dtg.h", | ||
] | ||
|
||
src_includes = [ | ||
"utils/hash/unordered_map.h", | ||
"utils/fmt/unordered_map.h", | ||
] | ||
|
||
[[fields]] | ||
name = "machine_views" | ||
type = "std::unordered_map<::FlexFlow::parallel_layer_guid_t, ::FlexFlow::MachineView>" |
16 changes: 0 additions & 16 deletions
16
lib/compiler/include/compiler/machine_mapping/split_sp_decomposition.h
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.