-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start on pcg builder * Add tests and some implementation for pcg builder * Add pcg tests, make dtgen constructors explicit to fix bug * Add remainder of PCG tests * Fix build issues in local-execution * Format * Address Reyna comments, add topological_order function for PCG * Pre multidigraph refactor * Removing visitable from sp code * Add open dataflow graph, start to replace pcg dataflow graph * Start refactoring substitutions * Add utility functions to support pattern matching * Pre-refactor inputs * Fix proj url * Get back to substitutions, now with unordered graph inputs * Get substitutions building * substitutions-tests now builds * Fix bug in filter, pass some initial substitution tests * Add tests for fmt::to_string, fix some substitutions bugs * Pass initial unit tests for find_pattern_matches * Start on unit tests for pcg pattern * Pass initial test for find_pattern_matches * Fix small build issue in tests * Format * Sync tests in CI with tests in proj * Fix minor build errors in kernels and local-execution * Format * Remove outdated code * More outdated code removal * More cleanup, add test for sp decomposition * Pull apart containers.h * More sp testing and fixes * Break up graph algorithms.h * Pre- full SP algo commit * Add initial implementation and tests for cbc decomposition and inverse line graph * Pass test for get_inverse_line_graph * Add new multidigraph * Fix get_inverse_line_graph to return a MultiDiGraph instead of a DiGraph * Add tests for parallel and series reduction finding * Add really rough implementation of valdez sp decomposition * Fix local-execution build * Add implementations and tests for applying series/parallel reductions * Format * Clean up sp decomposition interface and tests * Format * Add comments for top-level substitutions functions, add proj doxygen support * Start sketching out substitutions code * Fix build errors * Add ability to permute node ids * Cleanup and start to test new substitutions code * Add test case for evaluate_substitution_output * Add naive isomorphism detection code * Add graph inputs to open dataflow graph isomorphism * Add input permutation to evaluate_substitution_output * Fix permute_node_ids * Add test for permute_input_ids * Migrate over to mutable implementation of apply_substitution * Add fast isomorphism checking and an initial implementation of full substitution logic * Pass initial full substitutions test * Cleanup old isomorphism checking code * Fix post-merge bugs * Fix broken pcg builder test * Format * Reorganize code and remove some outdated code pre-code-review * Format * Address review comments * Address missed comment * Remove latex dependency to avoid CI out-of-disk-space * Format * Fix build issues * Fix incorrect test case
- Loading branch information
Showing
332 changed files
with
7,939 additions
and
1,396 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
File renamed without changes.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef _FLEXFLOW_LIB_OP_ATTRS_INCLUDE_OP_ATTRS_DIM_ORDERED_ENUMERATE_H | ||
#define _FLEXFLOW_LIB_OP_ATTRS_INCLUDE_OP_ATTRS_DIM_ORDERED_ENUMERATE_H | ||
|
||
#include "op-attrs/dim_ordered.h" | ||
#include "utils/bidict/bidict.h" | ||
#include "utils/containers/count.h" | ||
|
||
namespace FlexFlow { | ||
|
||
/** | ||
* @brief Generate a map from indices to elements of \p c. | ||
* | ||
* @note We return a <tt>std::map</tt> to prevent mixups of \ref ff_dim_t and | ||
* \ref legion_dim_t. Note that <tt>std::map</tt> provides ordered iteration in | ||
* increasing order, so iterating through the result of this function should | ||
* function as expected. | ||
*/ | ||
template <typename T> | ||
std::map<ff_dim_t, T> enumerate(FFOrdered<T> const &ff_ordered) { | ||
std::map<ff_dim_t, T> result; | ||
for (int raw_ff_dim : count(ff_ordered.size())) { | ||
ff_dim_t ff_dim = ff_dim_t{raw_ff_dim}; | ||
result.insert({ff_dim, ff_ordered.at(ff_dim)}); | ||
} | ||
return result; | ||
} | ||
|
||
} // 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#ifndef _FLEXFLOW_LIB_OP_ATTRS_INCLUDE_OP_ATTRS_IS_VALID_H | ||
#define _FLEXFLOW_LIB_OP_ATTRS_INCLUDE_OP_ATTRS_IS_VALID_H | ||
|
||
#include "op-attrs/parallel_tensor_shape.h" | ||
#include "op-attrs/pcg_operator_attrs.dtg.h" | ||
|
||
namespace FlexFlow { | ||
|
||
template <typename T> | ||
bool is_valid(T const &t, std::vector<ParallelTensorShape> const &shapes) { | ||
auto num_outputs = get_num_outputs(t); | ||
if (num_outputs.has_value() && shapes.size() != num_outputs.value()) { | ||
return false; | ||
} | ||
|
||
for (ParallelTensorShape const &shape : shapes) { | ||
if (!is_valid(shape)) { | ||
return false; | ||
} | ||
} | ||
|
||
return is_valid_internal(t, shapes); | ||
} | ||
|
||
bool is_valid_internal(MultiHeadAttentionAttrs const &, | ||
std::vector<ParallelTensorShape> const &); | ||
bool is_valid_internal(BatchMatmulAttrs const &, | ||
ParallelTensorShape const &, | ||
ParallelTensorShape const &); | ||
bool is_valid_internal(CastAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(ConcatAttrs const &, | ||
std::vector<ParallelTensorShape> const &); | ||
bool is_valid_internal(Conv2DAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(DropoutAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(ElementBinaryAttrs const &, | ||
ParallelTensorShape const &, | ||
ParallelTensorShape const &); | ||
bool is_valid_internal(ElementUnaryAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(EmbeddingAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(FlatAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(GatherAttrs const &, | ||
ParallelTensorShape const &, | ||
ParallelTensorShape const &); | ||
bool is_valid_internal(LayerNormAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(LinearAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(Pool2DAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(ReduceAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(ReductionAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(RepartitionAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(ReplicateAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(ReshapeAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(SoftmaxAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(SplitAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(TopKAttrs const &, ParallelTensorShape const &); | ||
bool is_valid_internal(TransposeAttrs const &, ParallelTensorShape const &); | ||
|
||
} // namespace FlexFlow | ||
|
||
#endif |
Oops, something went wrong.