Add tool for exporting and visualizing model architectures and SP decompositions#1490
Add tool for exporting and visualizing model architectures and SP decompositions#1490lockshaw merged 117 commits intoflexflow:repo-refactorfrom
Conversation
wmdi
left a comment
There was a problem hiding this comment.
Reviewed 232 of 437 files at r1, 18 of 36 files at r2, all commit messages.
Reviewable status: 250 of 441 files reviewed, 2 unresolved discussions (waiting on @lockshaw and @Marsella8)
lib/compiler/include/compiler/series_parallel/computation_graph_binary_sp_decomposition.struct.toml line 22 at r2 (raw file):
[[fields]] name = "raw_tree" type = "::FlexFlow::GenericBinarySPDecompositionTree<::FlexFlow::layer_guid_t>"
Then how do we apply SPD for PCGs? Shouldn't we implement SPD for PCGs, and apply SPD for CGs by first converting CGs to PCGs?
lib/utils/include/utils/graph/series_parallel/series_parallel_decomposition.h line 15 at r2 (raw file):
to_final_ast(std::variant<IntermediateSpDecompositionTree, Node> const &); std::unordered_multiset<Node> get_nodes(SeriesParallelDecomposition const &sp);
Why is it multiset?
wmdi
left a comment
There was a problem hiding this comment.
Reviewed 173 of 437 files at r1, 18 of 36 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @lockshaw and @Marsella8)
lockshaw
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Marsella8 and @wmdi)
lib/compiler/include/compiler/series_parallel/computation_graph_binary_sp_decomposition.struct.toml line 22 at r2 (raw file):
Previously, wmdi (Mengdi Wu) wrote…
Then how do we apply SPD for PCGs? Shouldn't we implement SPD for PCGs, and apply SPD for CGs by first converting CGs to PCGs?
This PR doesn't add SPD for PCGs (SPD for PCGs is more complex due to potential parallel ops being inserted on the weight nodes). Doing CG SPD by converting a CG to a PCG and then doing SPD would be fine, but that would require having PCG SPD implemented, which I'd rather not fold into this already large PR.
lib/utils/include/utils/graph/series_parallel/series_parallel_decomposition.h line 15 at r2 (raw file):
Previously, wmdi (Mengdi Wu) wrote…
Why is it multiset?
Because in approximate sp-decomposition (i.e., @Marsella8's stuff) node duplication can result in having the same node id in multiple places in the SP-decomposition I believe (@Marsella8 is this correct?)
wmdi
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @Marsella8)
Description of changes:
bin/for exporting and visualizing model architectures (export-model-arch)utils/clilibrary to make a nice interface for the aboveget_cbc_decompositionthat the complete bipartite components were actually completetransitive_reduction, add optimizedtransitive_closureimplementationserial-paralleltoseries-parallelto match literaturedoctestformatting out ofutils/fmtand intotest/utils/doctest/fmt, as having it inutilsrequired adding adoctestdependency toutilswhich prevented binaries from getting built due to Linking errors, when using--no-undefinedlinking flag or setting default symbol visibility to hidden doctest/doctest#609To run
export-model-arch(from the root of the repository):should print a help message.
Related Issues:
Linked Issues:
Issues closed by this PR:
This change is