-
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.
Merge Cortenn and Rocnnet to Tenncor with optimizations (#28)
* Merge Cortenn and Rocnnet to Tenncor with optimizations (#27) * merge cortenn repo * add ead without derivative * fix permute and extend * implement gradient for ead * add py tests for ead * add sigmoid,tanh,square, and cube in ead * add ead serialize * add rocnnet * add optimizers * add opt tests for llo and fix * add opt test for ead and fix * fix opt and add to rocnnet * add ead to doxygen * add ead benchmarks * initial implementation of ead compiler * remove redundant tensmaps * prevent building ead compiler * add matrices to ead operator * add more tools to evaluate performance * add transformation code to ead coordmap * evaluate peak performance, and implement more optimizations * benchmark and test optimized fast sigmoid mlp * fix ead operators for benchmark and prototype optimization minilanguage * initial implementation of subgraph match * use cppkg to simplify string parsing * resolve warnings * fix and mostly complete subgraph matching * move matcher in ead * centralize pybind type as PybindT and reuse in rocnnet then set as float * add tf benchmark for gd_demo * add some more tf comparisons * fix pruning and matmul gradient * session refactor * implement interactive debugger * improve interactive debugger * clean up, fix reduce_sum_1d * update matcher with abstract rep and create experiment binary * fix experiment * implement bottom-up gradient tree building * remove derive_bu (not working) * separate chain rule and local derivative lookup * provide more options for graph representation * add representation support * implement rep tree to tensor graph conversion * add rule conversion * fix rule conversion * thoroughly tested optimizer * fix optimization api to update edge * add optimization flags in makefile * revert dqn_trainer labelling * add cortenn coverage make commands * add documentation and fix docker tests * increase coverage * update some ade docs
- Loading branch information
1 parent
7e5cdca
commit d071c4d
Showing
1,745 changed files
with
102,065 additions
and
3,244 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
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 |
---|---|---|
|
@@ -75,3 +75,4 @@ CMakeFiles | |
!.gitmodules | ||
!.astylerc | ||
!.bazelrc | ||
!rocnnet/pretrained/*.pbx |
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 |
---|---|---|
|
@@ -6,5 +6,6 @@ RUN mkdir -p $APP_DIR | |
WORKDIR $APP_DIR | ||
|
||
COPY . $APP_DIR | ||
RUN pip install -r requirements.txt | ||
|
||
CMD [ "./tests.sh" ] |
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,23 @@ | ||
Boost Software License - Version 1.0 - August 17th, 2003 | ||
|
||
Permission is hereby granted, free of charge, to any person or organization | ||
obtaining a copy of the software and accompanying documentation covered by | ||
this license (the "Software") to use, reproduce, display, distribute, | ||
execute, and transmit the Software, and to prepare derivative works of the | ||
Software, and to permit third-parties to whom the Software is furnished to | ||
do so, all subject to the following: | ||
|
||
The copyright notices in the Software and this entire statement, including | ||
the above license grant, this restriction and the following disclaimer, | ||
must be included in all copies of the Software, in whole or in part, and | ||
all derivative works of the Software, unless such copies or derivative | ||
works are solely in the form of machine-executable object code generated by | ||
a source language processor. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT | ||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE | ||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
DEALINGS IN THE SOFTWARE. |
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 |
---|---|---|
@@ -1,17 +1,31 @@ | ||
workspace(name = "com_github_mingkaic_tenncor") | ||
|
||
# local dependencies | ||
# === local dependencies === | ||
|
||
load("//:tenncor.bzl", "dependencies") | ||
load("//:third_party/all.bzl", "dependencies") | ||
dependencies() | ||
|
||
# test dependencies | ||
load("@protobuf_rules//cpp:deps.bzl", "cpp_proto_library") | ||
cpp_proto_library() | ||
|
||
# === test dependencies === | ||
|
||
load("@com_github_mingkaic_cppkg//:gtest.bzl", "gtest_repository") | ||
gtest_repository(name = "gtest") | ||
|
||
git_repository( | ||
name = "com_github_google_benchmark", | ||
remote = "https://github.com/google/benchmark", | ||
commit = "e776aa0275e293707b6a0901e0e8d8a8a3679508", | ||
) | ||
load("//third_party/repos:benchmark.bzl", "benchmark_repository") | ||
benchmark_repository() | ||
|
||
load("@com_github_mingkaic_cppkg//:cppkg.bzl", "dependencies") | ||
dependencies() | ||
|
||
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps") | ||
boost_deps() | ||
|
||
# === dev dependencies === | ||
|
||
load("@protobuf_rules//cpp:deps.bzl", "cpp_grpc_library") | ||
cpp_grpc_library() | ||
|
||
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") | ||
grpc_deps() |
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
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,65 @@ | ||
/// | ||
/// ead.hpp | ||
/// ade | ||
/// | ||
/// Purpose: | ||
/// Define non-operating edges between tensor nodes | ||
/// | ||
|
||
#include "ade/ifunctor.hpp" | ||
|
||
#ifndef ADE_EDGE_HPP | ||
#define ADE_EDGE_HPP | ||
|
||
namespace ade | ||
{ | ||
|
||
/// Edge between parent and child tensor references and labelled with edge code | ||
struct Edge final | ||
{ | ||
/// Return true if either parent or child are expired, otherwise false | ||
bool expired (void) const | ||
{ | ||
return parent_.expired() || child_.expired(); | ||
} | ||
|
||
/// Parent reference | ||
TensrefT parent_; | ||
|
||
/// Child refence | ||
TensrefT child_; | ||
|
||
/// Edge label and enumeration | ||
Opcode edge_code_; | ||
}; | ||
|
||
/// Vector of edges | ||
using EdgesT = std::vector<Edge>; | ||
|
||
/// Edge hasher | ||
struct EdgeHash final | ||
{ | ||
size_t operator() (const Edge& edge) const | ||
{ | ||
if (edge.expired()) | ||
{ | ||
return 0; | ||
} | ||
std::stringstream ss; | ||
ss << edge.parent_.lock().get() << | ||
edge.child_.lock().get() << | ||
edge.edge_code_.code_; | ||
return std::hash<std::string>()(ss.str()); | ||
} | ||
}; | ||
|
||
/// Edge equality comparator | ||
inline bool operator == (const Edge& lhs, const Edge& rhs) | ||
{ | ||
EdgeHash hasher; | ||
return hasher(lhs) == hasher(rhs); | ||
} | ||
|
||
} | ||
|
||
#endif // ADE_EDGE_HPP |
Oops, something went wrong.