Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sp-ization Algorithm #1423

Draft
wants to merge 90 commits into
base: repo-refactor
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 87 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
510c2d9
Start on pcg builder
lockshaw Jun 4, 2024
7b55ed1
Add tests and some implementation for pcg builder
lockshaw Jun 4, 2024
c379efd
Add pcg tests, make dtgen constructors explicit to fix bug
lockshaw Jun 10, 2024
35fa653
Add remainder of PCG tests
lockshaw Jun 10, 2024
865a28e
Merge remote-tracking branch 'origin/repo-refactor' into pcg-builder
lockshaw Jun 10, 2024
f379539
Fix build issues in local-execution
lockshaw Jun 10, 2024
2dbb3b9
Format
lockshaw Jun 10, 2024
4050c99
Address Reyna comments, add topological_order function for PCG
lockshaw Jun 17, 2024
42c1968
Pre multidigraph refactor
lockshaw Jun 19, 2024
3be816f
Removing visitable from sp code
lockshaw Jun 21, 2024
6d68324
Add open dataflow graph, start to replace pcg dataflow graph
lockshaw Jun 23, 2024
64a3403
Start refactoring substitutions
lockshaw Jun 24, 2024
7d4c7be
Add utility functions to support pattern matching
lockshaw Jun 25, 2024
3279be0
Spization Algorithm
Jun 25, 2024
b0b5a8d
Small fix
Jun 25, 2024
f0ca00a
Merge branch 'repo-refactor' into spization
lockshaw Jun 26, 2024
9ab9eb2
Pre-refactor inputs
lockshaw Jun 26, 2024
7ae7c65
Merge remote-tracking branch 'origin/repo-refactor' into dataflow-graph
lockshaw Jun 26, 2024
f9b129e
Fix proj url
lockshaw Jun 26, 2024
c8d5177
implementation + tests for get_longest_path_lengths
Jun 27, 2024
18752c8
minor fix
Jun 27, 2024
c53a9d2
Simple sp-ization refactor
Jun 27, 2024
0b27de9
Naive Sp-ization algo refactor
Jun 27, 2024
3873d65
Minor mix
Jun 27, 2024
dbfda83
Implementation and Tests for dependency-preserving spization
Jul 1, 2024
e2472e2
Formatting
Jul 1, 2024
ec61ba0
Added testcase for NASNET-A like architecture
Jul 1, 2024
2361d3c
Minor Formatting
Jul 1, 2024
cf73f08
Get back to substitutions, now with unordered graph inputs
lockshaw Jul 7, 2024
24201be
Spization and adjacent functions
Jul 10, 2024
e423609
Spization and adjacent changes
Jul 10, 2024
4ad0d57
Additional function + bug testing
Jul 10, 2024
a7770f3
Fixes after PR review
Jul 12, 2024
5fd666d
Get substitutions building
lockshaw Jul 13, 2024
5f0c88a
substitutions-tests now builds
lockshaw Jul 13, 2024
3228f2d
Fix bug in filter, pass some initial substitution tests
lockshaw Jul 14, 2024
5f4cc01
Add tests for fmt::to_string, fix some substitutions bugs
lockshaw Jul 15, 2024
ad60be0
Pass initial unit tests for find_pattern_matches
lockshaw Jul 15, 2024
a972da2
Start on unit tests for pcg pattern
lockshaw Jul 15, 2024
ffa573e
Updates
Jul 15, 2024
4034bbb
PR Fixes + additional functionality
Jul 16, 2024
fe1174a
Minor refactoring
Jul 17, 2024
88e5c0b
Metrics and Testing Tools for SP-ization
Jul 18, 2024
1e0bb80
Minor changes
Jul 18, 2024
061cb90
initial implementation for cost_aware_barrier_sync
Jul 18, 2024
bcf776e
Pass initial test for find_pattern_matches
lockshaw Jul 19, 2024
e28400e
Merge remote-tracking branch 'origin/repo-refactor' into dataflow-graph
lockshaw Jul 19, 2024
fe6d65d
Fix small build issue in tests
lockshaw Jul 19, 2024
e647af7
Format
lockshaw Jul 19, 2024
8b58760
Sync tests in CI with tests in proj
lockshaw Jul 19, 2024
1fafb9d
Fix minor build errors in kernels and local-execution
lockshaw Jul 19, 2024
0804314
Format
lockshaw Jul 19, 2024
dd5465c
Remove outdated code
lockshaw Jul 20, 2024
29ec5b8
More outdated code removal
lockshaw Jul 20, 2024
ff41743
More cleanup, add test for sp decomposition
lockshaw Jul 20, 2024
e71d200
Pull apart containers.h
lockshaw Jul 21, 2024
c06710c
More sp testing and fixes
lockshaw Jul 21, 2024
2f75566
Break up graph algorithms.h
lockshaw Jul 21, 2024
c81d3a4
Pre- full SP algo commit
lockshaw Jul 23, 2024
2a11c7e
Add initial implementation and tests for cbc decomposition and invers…
lockshaw Jul 23, 2024
71a9e0f
Pass test for get_inverse_line_graph
lockshaw Jul 24, 2024
25eb1db
Add new multidigraph
lockshaw Jul 24, 2024
64f1932
Fix get_inverse_line_graph to return a MultiDiGraph instead of a DiGraph
lockshaw Jul 24, 2024
e201d87
Fix
Jul 24, 2024
31c8d17
Add tests for parallel and series reduction finding
lockshaw Jul 24, 2024
19e7e28
Add really rough implementation of valdez sp decomposition
lockshaw Jul 24, 2024
1794199
Fixes + sp-ization benchmarking
Jul 24, 2024
3791e86
Fix local-execution build
lockshaw Jul 25, 2024
267b72d
Add implementations and tests for applying series/parallel reductions
lockshaw Jul 25, 2024
71108b3
Additional SP-BenchMarking
Jul 25, 2024
f6a371a
Formatting
Jul 25, 2024
0d8720d
Refactoring
Jul 25, 2024
bb2769a
Format
lockshaw Jul 26, 2024
39cb7b3
Clean up sp decomposition interface and tests
lockshaw Jul 27, 2024
ce0234d
Format
lockshaw Jul 27, 2024
3dc3ec6
Add comments for top-level substitutions functions, add proj doxygen …
lockshaw Jul 31, 2024
f4dfd66
Fix proj invocation in CI
lockshaw Jul 31, 2024
e83651c
merge with dataflow-graph
Jul 31, 2024
4ce79c2
Merge with repo-refactor
Jul 31, 2024
6552c47
Sp-ization reorganization
Aug 4, 2024
02e82b6
Merge remote-tracking branch 'flexflow/repo-refactor' into spization
Aug 4, 2024
8d69da4
Refactoring + bringing up-to-date with DataFlow-graph interface
Aug 6, 2024
f77cdbb
Merge branch 'repo-refactor' into spization
lockshaw Aug 6, 2024
3222976
minor fix
Aug 6, 2024
e9fea70
Merge branch 'spization' of github.com:Marsella8/FlexFlow into spization
Aug 6, 2024
06706e9
Additional is_acyclic testing
Aug 6, 2024
8782d4f
Fixes
Aug 9, 2024
c2b4870
Additional SP-ization metric + Transitive Reduction Fix + DiGraph fro…
Aug 14, 2024
41cff89
Benchmarking updates
Aug 15, 2024
8ba896a
formatting
Aug 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ option(FF_BUILD_ALL_EXAMPLES "build all examples. Overrides others" OFF)
option(FF_BUILD_UNIT_TESTS "build non-operator unit tests" OFF)
option(FF_BUILD_SUBSTITUTION_TOOL "build substitution conversion tool" OFF)
option(FF_BUILD_VISUALIZATION_TOOL "build substitution visualization tool" ON)
option(FF_BUILD_SP_IZATION_BENCHMARKING "build sp-ization benchmarking" ON)
option(FF_BUILD_ARG_PARSER "build command line argument parser" OFF)

set(FF_CUDA_ARCH "autodetect" CACHE STRING "Target CUDA Arch")
Expand Down
4 changes: 4 additions & 0 deletions bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ if(FF_BUILD_VISUALIZATION_TOOL)
add_subdirectory(substitutions-to-dot)
endif()

if(FF_BUILD_SP_IZATION_BENCHMARKING)
add_subdirectory(sp_ization_benchmarking)
endif()

if(FF_BUILD_ARG_PARSER)
add_subdirectory(arg_parser)
endif()
9 changes: 9 additions & 0 deletions bin/sp_ization_benchmarking/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ff_add_executable(
NAME
sp-ization-benchmarking
SRC_PATTERNS
*.cc
DEPS
utils
rapidcheck
)
49 changes: 49 additions & 0 deletions bin/sp_ization_benchmarking/distributions.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include "distributions.h"

namespace FlexFlow {

Constant::Constant(float val) : val(val) {}

float Constant::operator()() const {
return val;
}

Uniform::Uniform(float a, float b) : a(a), b(b) {}

float Uniform::operator()() const {
return a + ((static_cast<double>(std::rand()) / RAND_MAX) * (b - a));
}

Bernoulli::Bernoulli(float p) : p(p) {}

float Bernoulli::operator()() const {
return (Uniform(0, 1)() < p);
}

Binary::Binary(float a, float b, float p) : a(a), b(b), p(p) {}

float Binary::operator()() const {
return (Bernoulli(p)() ? a : b);
}

UniformNoise::UniformNoise(float lower, float upper)
: lower(lower), upper(upper) {}

float UniformNoise::operator()() const {
return Uniform(lower, upper)();
}

float NoNoise::operator()() const {
return 1;
}

GaussianNoise::GaussianNoise(float mean, float stddev)
: mean(mean), stddev(stddev) {}

float GaussianNoise::operator()() const {
static std::default_random_engine generator;
static std::normal_distribution<float> distribution(mean, stddev);
return distribution(generator);
}

} // namespace FlexFlow
65 changes: 65 additions & 0 deletions bin/sp_ization_benchmarking/distributions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#ifndef _FLEXFLOW_DISTRIBUTIONS_H
#define _FLEXFLOW_DISTRIBUTIONS_H

#include "utils/graph/node/node.dtg.h"
#include <random>
#include <unordered_map>
#include <unordered_set>

namespace FlexFlow {

struct Constant {
float val;
Constant(float val = 1);
float operator()() const;
};

struct Uniform {
float a, b;
Uniform(float a = 0, float b = 1);
float operator()() const;
};

struct Bernoulli {
float p;
Bernoulli(float p = 0.5);
float operator()() const;
};

struct Binary {
float a, b, p;
Binary(float a = 0, float b = 1, float p = 0.5);
float operator()() const;
};

struct UniformNoise {
float lower, upper;
UniformNoise(float lower = 0.9, float upper = 1.1);
float operator()() const;
};

struct NoNoise {
float operator()() const;
};

struct GaussianNoise {
float mean, stddev;
GaussianNoise(float mean = 1, float stddev = .1);
float operator()() const;
};

template <typename Dist, typename Noise>
std::unordered_map<Node, float>
make_cost_map(std::unordered_set<Node> const &nodes,
Dist const &distribution,
Noise const &noise) {
std::unordered_map<Node, float> cost_map;
for (Node const &node : nodes) {
cost_map[node] = distribution() * noise();
}
return cost_map;
}

} // namespace FlexFlow

#endif
Loading
Loading