-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-readme
- Loading branch information
Showing
19 changed files
with
1,551 additions
and
19 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
18 changes: 18 additions & 0 deletions
18
lib/compiler/include/compiler/cost_estimator/op_cost_metrics.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,18 @@ | ||
namespace = "FlexFlow" | ||
name = "OpCostMetrics" | ||
features = [ | ||
"eq", | ||
"fmt", | ||
"hash", | ||
] | ||
|
||
includes = [ | ||
] | ||
|
||
[[fields]] | ||
name = "runtime" | ||
type = "float" | ||
|
||
[[fields]] | ||
name = "memory" | ||
type = "size_t" |
48 changes: 48 additions & 0 deletions
48
...de/compiler/machine_mapping/memory_optimization/get_optimal_machine_mapping_with_memory.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,48 @@ | ||
#ifndef _FLEXFLOW_COMPILER_MACHINE_MAPPING_MEMORY_OPTIMIZATION_GET_OPTIMAL_MACHINE_MAPPING_WITH_MEMORY_H | ||
#define _FLEXFLOW_COMPILER_MACHINE_MAPPING_MEMORY_OPTIMIZATION_GET_OPTIMAL_MACHINE_MAPPING_WITH_MEMORY_H | ||
|
||
#include "compiler/machine_mapping/machine_mapping_cache.dtg.h" | ||
#include "compiler/machine_mapping/machine_mapping_constraints.dtg.h" | ||
#include "compiler/machine_mapping/machine_mapping_context.dtg.h" | ||
#include "compiler/machine_mapping/machine_mapping_problem_tree/machine_mapping_problem_tree.dtg.h" | ||
#include "compiler/machine_mapping/machine_mapping_problem_tree/mm_problem_tree_parallel_split.dtg.h" | ||
#include "compiler/machine_mapping/machine_mapping_problem_tree/mm_problem_tree_series_split.dtg.h" | ||
#include "compiler/machine_mapping/memory_optimization/machine_mapping_with_memory_cache.dtg.h" | ||
#include "compiler/machine_mapping/parallel_split_transformation.dtg.h" | ||
#include "pcg/machine_specification.dtg.h" | ||
|
||
namespace FlexFlow { | ||
|
||
MachineMappingWithMemoryResult get_optimal_machine_mapping_with_memory( | ||
MachineMappingWithMemoryCache &result_cache, | ||
MachineMappingContext const &context, | ||
MachineMappingProblemTree const &problem_tree, | ||
MachineSpecification const &resources, | ||
MachineMappingConstraints const &constraints); | ||
|
||
MachineMappingWithMemoryResult get_optimal_machine_mapping_with_memory( | ||
MachineMappingWithMemoryCache &result_cache, | ||
MachineMappingContext const &context, | ||
MMProblemTreeSeriesSplit const &series_split, | ||
MachineSpecification const &resources, | ||
MachineMappingConstraints const &constraints, | ||
std::optional<ParallelSplitTransformation> const | ||
¶llel_split_transformation); | ||
|
||
MachineMappingWithMemoryResult get_optimal_machine_mapping_with_memory( | ||
MachineMappingWithMemoryCache &result_cache, | ||
MachineMappingContext const &context, | ||
MMProblemTreeParallelSplit const ¶llel_split, | ||
MachineSpecification const &resources, | ||
MachineMappingConstraints const &constraints); | ||
|
||
MachineMappingWithMemoryResult get_optimal_machine_mapping_with_memory( | ||
MachineMappingWithMemoryCache &result_cache, | ||
MachineMappingContext const &, | ||
UnmappedOpCostEstimateKey const &leaf, | ||
MachineSpecification const &resources, | ||
MachineMappingConstraints const &constraints); | ||
|
||
} // namespace FlexFlow | ||
|
||
#endif |
20 changes: 20 additions & 0 deletions
20
...compiler/machine_mapping/memory_optimization/machine_mapping_for_single_layer.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,20 @@ | ||
namespace = "FlexFlow" | ||
name = "MachineMappingForSingleLayer" | ||
features = [ | ||
"eq", | ||
"hash", | ||
"fmt", | ||
] | ||
|
||
includes = [ | ||
"compiler/machine_mapping/parallel_layer_guid_oblivious_machine_mapping.dtg.h", | ||
"compiler/cost_estimator/op_cost_metrics.dtg.h", | ||
] | ||
|
||
[[fields]] | ||
name = "cost" | ||
type = "::FlexFlow::OpCostMetrics" | ||
|
||
[[fields]] | ||
name = "machine_mapping" | ||
type = "::FlexFlow::ParallelLayerGuidObliviousMachineMapping" |
19 changes: 19 additions & 0 deletions
19
.../include/compiler/machine_mapping/memory_optimization/machine_mapping_with_memory_cache.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,19 @@ | ||
#ifndef _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_MEMORY_OPTIMIZATION_MACHINE_MAPPING_CACHE_WITH_MEMORY_H | ||
#define _FLEXFLOW_LIB_COMPILER_INCLUDE_COMPILER_MACHINE_MAPPING_MEMORY_OPTIMIZATION_MACHINE_MAPPING_CACHE_WITH_MEMORY_H | ||
|
||
#include "compiler/machine_mapping/memory_optimization/machine_mapping_with_memory_cache.dtg.h" | ||
|
||
namespace FlexFlow { | ||
|
||
MachineMappingWithMemoryCache empty_machine_mapping_with_memory_cache(); | ||
std::optional<MachineMappingWithMemoryResult> | ||
machine_mapping_with_memory_cache_load( | ||
MachineMappingWithMemoryCache const &, MachineMappingState const &); | ||
void machine_mapping_with_memory_cache_save( | ||
MachineMappingWithMemoryCache &, | ||
MachineMappingState const &, | ||
MachineMappingWithMemoryResult const &); | ||
|
||
} // namespace FlexFlow | ||
|
||
#endif |
22 changes: 22 additions & 0 deletions
22
...ompiler/machine_mapping/memory_optimization/machine_mapping_with_memory_cache.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,22 @@ | ||
namespace = "FlexFlow" | ||
name = "MachineMappingWithMemoryCache" | ||
features = [ | ||
"eq", | ||
"hash", | ||
"fmt", | ||
] | ||
|
||
includes = [ | ||
"<unordered_map>", | ||
"compiler/machine_mapping/machine_mapping_state.dtg.h", | ||
"compiler/machine_mapping/memory_optimization/machine_mapping_with_memory_result.dtg.h", | ||
] | ||
|
||
src_includes = [ | ||
"utils/fmt/unordered_map.h", | ||
"utils/hash/unordered_map.h", | ||
] | ||
|
||
[[fields]] | ||
name = "raw_map" | ||
type = "std::unordered_map<::FlexFlow::MachineMappingState, ::FlexFlow::MachineMappingWithMemoryResult>" |
41 changes: 41 additions & 0 deletions
41
...include/compiler/machine_mapping/memory_optimization/machine_mapping_with_memory_result.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,41 @@ | ||
#ifndef _FLEXFLOW_COMPILER_MACHINE_MAPPING_MEMORY_OPTIMIZATION_MACHINE_MAPPING_RESULT_WITH_MEMORY_H | ||
#define _FLEXFLOW_COMPILER_MACHINE_MAPPING_MEMORY_OPTIMIZATION_MACHINE_MAPPING_RESULT_WITH_MEMORY_H | ||
|
||
#include "compiler/machine_mapping/memory_optimization/machine_mapping_with_memory_result.dtg.h" | ||
#include "compiler/machine_mapping/parallel_split_transformation.dtg.h" | ||
#include <optional> | ||
|
||
namespace FlexFlow { | ||
|
||
[[nodiscard]] MachineMappingWithMemoryResult | ||
empty_machine_mapping_with_memory_result(); | ||
[[nodiscard]] bool is_empty(MachineMappingWithMemoryResult const &); | ||
|
||
[[nodiscard]] MachineMappingWithMemoryResult get_mapping_with_minimal_runtime( | ||
std::unordered_set<MachineMappingWithMemoryResult> const &); | ||
|
||
[[nodiscard]] MachineMappingWithMemoryResult | ||
remove_non_pareto_optimal_machine_mapping_result( | ||
MachineMappingWithMemoryResult const &); | ||
|
||
[[nodiscard]] MachineMappingWithMemoryResult | ||
series_combine(float comm_cost, | ||
MachineMappingWithMemoryResult const &pre_result, | ||
MachineMappingWithMemoryResult const &post_result, | ||
std::optional<ParallelSplitTransformation> const | ||
¶llel_split_transformation); | ||
[[nodiscard]] MachineMappingWithMemoryResult | ||
parallel_combine(MachineMappingWithMemoryResult const &lhs_result, | ||
MachineMappingWithMemoryResult const &rhs_result); | ||
|
||
[[nodiscard]] MachineMappingWithMemoryResult | ||
minimize_runtime(MachineMappingWithMemoryResult const &m1, | ||
MachineMappingWithMemoryResult const &m2); | ||
|
||
[[nodiscard]] MachineMappingWithMemoryResult | ||
make_singleton_machine_mapping_with_memory_result( | ||
OpCostMetrics cost, MachineView const &machine_view); | ||
|
||
} // namespace FlexFlow | ||
|
||
#endif |
20 changes: 20 additions & 0 deletions
20
...mpiler/machine_mapping/memory_optimization/machine_mapping_with_memory_result.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,20 @@ | ||
namespace = "FlexFlow" | ||
name = "MachineMappingWithMemoryResult" | ||
features = [ | ||
"eq", | ||
"hash", | ||
"fmt", | ||
] | ||
|
||
includes = [ | ||
"compiler/machine_mapping/memory_optimization/machine_mapping_for_single_layer.dtg.h", | ||
] | ||
|
||
src_includes = [ | ||
"utils/hash/unordered_set.h", | ||
"utils/fmt/unordered_set.h", | ||
] | ||
|
||
[[fields]] | ||
name = "machine_mappings" | ||
type = "std::unordered_set<::FlexFlow::MachineMappingForSingleLayer>" |
13 changes: 13 additions & 0 deletions
13
...clude/compiler/machine_mapping/memory_optimization/machine_memory_constraints.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,13 @@ | ||
namespace = "FlexFlow" | ||
name = "MachineMemoryConstraints" | ||
features = [ | ||
"eq", | ||
"hash", | ||
"fmt", | ||
] | ||
|
||
includes = [] | ||
|
||
[[fields]] | ||
name = "memory_limit" | ||
type = "size_t" |
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
Oops, something went wrong.