Skip to content

Commit

Permalink
reimplement shape transformation using coordinate map transformation …
Browse files Browse the repository at this point in the history
…using matrices (#13)

* updated srcs

* implement sum function and script updates

* add test for placeholder and source

* clear docs on developer branch

* add regress test

* cli update and fixed uninit output when permuting in llo

* improve comments, fix mul grader, implement min and max

* remove util and implement log interface

* fix log and prime ade for visitor change

* update testify

* complete and run regression test and fix incorrect Abs grad

* Llo update (#11)

* refactor evaluables

* add traversal method for DataNodes

* reimplement pbm

* fix pbm

* add log test and cleanup

* verify exception messages

* clean up and correct signature

* implement group equivalent for reduce functions

* Implement coordinate transformation in place of meta arguments in ADE (#12)

* fix rocnnet

* improve log to simplify tests

* make reduce echelon private to avoid retesting inversion

* add permute test

* fix coordinate test and correct coverage parameters

* improve coverage slightly

* update ade comments

* update llo and pbm comments

* clean up and build fix after last commit
  • Loading branch information
raggledodo committed Oct 31, 2018
1 parent ca79149 commit afb3ded
Show file tree
Hide file tree
Showing 644 changed files with 7,597 additions and 42,804 deletions.
Empty file modified .dockerignore
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
7 changes: 3 additions & 4 deletions .travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
script:
- git checkout ${TRAVIS_BRANCH}
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build -t $DOCKER_USERNAME/tenncor-test:latest .
- docker build -t $DOCKER_USERNAME/tenncor-test:travis-$(git rev-parse --short HEAD) .
- docker images
- docker push $DOCKER_USERNAME/tenncor-test:latest
- docker push $DOCKER_USERNAME/tenncor-test:travis-$(git rev-parse --short HEAD)
- stage: test
script:
- docker run -e COVERALLS_TOKEN=${COVERALLS_TOKEN}
--rm $DOCKER_USERNAME/tenncor-test:latest
--rm $DOCKER_USERNAME/tenncor-test:travis-$(git rev-parse --short HEAD)

notifications:
email: false
Expand All @@ -29,5 +29,4 @@ branches:
only:
- master
- experimental
- docs
- stable
18 changes: 0 additions & 18 deletions BUILD

This file was deleted.

41 changes: 41 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
licenses(["notice"])

package(
default_visibility = ["//visibility:public"],
)

######### GENERAL SOURCE #########

filegroup(
name = "srcs",
srcs = [
"//ade:srcs",
"//dbg:srcs",
"//llo:srcs",
"//pbm:srcs",
"BUILD.bazel",
],
)

filegroup(
name = "test_srcs",
srcs = [
"//ade:test_srcs",
"//llo:test_srcs",
"//pbm:test_srcs",
"//testutil:srcs",
],
)

filegroup(
name = "credentials",
srcs = [
"certs/server.key",
"certs/server.crt",
],
)

filegroup(
name = "scripts",
srcs = glob(["scripts/*"]),
)
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ WORKDIR $APP_DIR

COPY . $APP_DIR

CMD [ "bash", "tests.sh" ]
CMD [ "./tests.sh" ]
100 changes: 50 additions & 50 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ GTEST_REPEAT := 50

COVERAGE_INFO_FILE := coverage.info

UTIL_TEST := //util:test_util
ADE_LTEST := //ade:test_log

ADE_DTEST := //ade:test_dynamic

ADE_STEST := //ade:test_static

LLO_TEST := //llo:test_llo

REGRESS_TEST := //llo:test_regress

PBM_TEST := //pbm:test_pbm


Expand All @@ -19,11 +21,13 @@ GTEST_FLAGS := --action_env="GTEST_SHUFFLE=1" --action_env="GTEST_BREAK_ON_FAILU

REP_BZL_FLAGS := --action_env="GTEST_REPEAT=$(GTEST_REPEAT)"

VAL_BZL_FLAGS := --run_under="valgrind --leak-check=full"
VALGRIND_CMD := valgrind --leak-check=full

VAL_BZL_FLAGS := --run_under="$(VALGRIND_CMD)"

ASAN_BZL_FLAGS := --linkopt -fsanitize=address

COVERAGE_IGNORE := 'external/*' '**/test/*' 'testutil/*' '**/genfiles/*'
COVERAGE_IGNORE := 'external/*' '**/test/*' 'testutil/*' '**/genfiles/*' 'dbg/*'


BUILD := bazel build
Expand All @@ -36,19 +40,19 @@ GTEST := $(TEST) $(GTEST_FLAGS)

COVER := bazel coverage --test_output=all $(GTEST_FLAGS) # we want cache result for coverage

COVERAGE_PIPE := ./listcov.sh $(COVERAGE_INFO_FILE) $(COVERAGE_IGNORE)
COVERAGE_PIPE := ./scripts/merge_cov.sh $(COVERAGE_INFO_FILE)

TMP_LOGFILE := /tmp/tenncor-test.log


# all tests

test: test_util test_ade test_llo test_pbm check_cli
test: test_ade test_llo test_pbm

test_util:
$(GTEST) $(UTIL_TEST)
test_ade: test_ade_log test_ade_dynamic test_ade_static

test_ade: test_ade_dynamic test_ade_static
test_ade_log:
$(GTEST) $(ADE_LTEST)

test_ade_dynamic:
$(GTEST) $(REP_BZL_FLAGS) $(ADE_DTEST)
Expand All @@ -64,12 +68,12 @@ test_pbm:

# valgrind unit tests

valgrind: valgrind_util valgrind_ade valgrind_llo valgrind_pbm
valgrind: valgrind_ade valgrind_llo valgrind_pbm

valgrind_util:
$(GTEST) $(VAL_BZL_FLAGS) $(UTIL_TEST)
valgrind_ade: valgrind_ade_log valgrind_ade_dynamic valgrind_ade_static

valgrind_ade: valgrind_ade_dynamic valgrind_ade_static
valgrind_ade_log:
$(GTEST) $(VAL_BZL_FLAGS) $(ADE_LTEST)

valgrind_ade_dynamic:
$(GTEST) $(VAL_BZL_FLAGS) --action_env="GTEST_REPEAT=5" $(ADE_DTEST)
Expand All @@ -85,12 +89,12 @@ valgrind_pbm:

# asan unit tests

asan: asan_util asan_ade asan_llo asan_pbm
asan: asan_ade asan_llo asan_pbm

asan_util:
$(GTEST) $(ASAN_BZL_FLAGS) $(UTIL_TEST)
asan_ade: asan_ade_log asan_ade_dynamic asan_ade_static

asan_ade: asan_ade_dynamic asan_ade_static
asan_ade_log:
$(GTEST) $(ASAN_BZL_FLAGS) $(ADE_LTEST)

asan_ade_dynamic:
$(GTEST) $(ASAN_BZL_FLAGS) $(REP_BZL_FLAGS) $(ADE_DTEST)
Expand All @@ -106,78 +110,74 @@ asan_pbm:

# coverage unit tests

coverage: cover_util cover_ade cover_llo cover_pbm
coverage: cover_ade cover_llo cover_pbm

cover_util:
$(COVER) --instrumentation_filter=/util[/:] $(UTIL_TEST)
cover_ade: cover_ade_log cover_ade_dynamic cover_ade_static

cover_ade: cover_ade_dynamic cover_ade_static
cover_ade_log:
$(COVER) --instrumentation_filter= $(ADE_LTEST)

cover_ade_dynamic:
$(COVER) $(REP_BZL_FLAGS) --instrumentation_filter=/ade[/:],/util[/:] $(ADE_DTEST)
$(COVER) $(REP_BZL_FLAGS) --instrumentation_filter= $(ADE_DTEST)

cover_ade_static:
$(COVER) --instrumentation_filter=/ade[/:],/util[/:] $(ADE_STEST)
$(COVER) --instrumentation_filter= $(ADE_STEST)

cover_llo:
$(COVER) $(REP_BZL_FLAGS) --instrumentation_filter=/llo[/:],/ade[/:],/util[/:] $(LLO_TEST)
$(COVER) $(REP_BZL_FLAGS) --instrumentation_filter= $(LLO_TEST)

cover_pbm:
$(COVER) --instrumentation_filter=/pbm[/:],/llo[/:],/ade[/:],/util[/:] $(PBM_TEST)
$(COVER) --instrumentation_filter= $(PBM_TEST)

# generate coverage.info

lcov_all: coverage
rm -f $(TMP_LOGFILE)
cat bazel-testlogs/util/test_util/test.log >> $(TMP_LOGFILE)
cat bazel-testlogs/ade/test_log/test.log >> $(TMP_LOGFILE)
cat bazel-testlogs/ade/test_dynamic/test.log >> $(TMP_LOGFILE)
cat bazel-testlogs/ade/test_static/test.log >> $(TMP_LOGFILE)
cat bazel-testlogs/llo/test_llo/test.log >> $(TMP_LOGFILE)
cat bazel-testlogs/pbm/test_pbm/test.log >> $(TMP_LOGFILE)
cat $(TMP_LOGFILE) | $(COVERAGE_PIPE)
lcov --remove $(COVERAGE_INFO_FILE) $(COVERAGE_IGNORE) -o $(COVERAGE_INFO_FILE)
rm -f $(TMP_LOGFILE)
lcov --list $(COVERAGE_INFO_FILE)

lcov_util: cover_util
cat bazel-testlogs/util/test_util/test.log | $(COVERAGE_PIPE)
lcov --list $(COVERAGE_INFO_FILE)

lcov_ade: cover_ade
rm -f $(TMP_LOGFILE)
cat bazel-testlogs/ade/test_log/test.log >> $(TMP_LOGFILE)
cat bazel-testlogs/ade/test_dynamic/test.log >> $(TMP_LOGFILE)
cat bazel-testlogs/ade/test_static/test.log >> $(TMP_LOGFILE)
cat $(TMP_LOGFILE) | $(COVERAGE_PIPE) 'util/*'
cat $(TMP_LOGFILE) | $(COVERAGE_PIPE)
lcov --remove $(COVERAGE_INFO_FILE) $(COVERAGE_IGNORE) -o $(COVERAGE_INFO_FILE)
rm -f $(TMP_LOGFILE)
lcov --list $(COVERAGE_INFO_FILE)

lcov_llo: cover_llo
cat bazel-testlogs/llo/test_llo/test.log | $(COVERAGE_PIPE) 'util/*' 'ade/*'
cat bazel-testlogs/llo/test_llo/test.log | $(COVERAGE_PIPE)
lcov --remove $(COVERAGE_INFO_FILE) $(COVERAGE_IGNORE) 'ade/*' -o $(COVERAGE_INFO_FILE)
lcov --list $(COVERAGE_INFO_FILE)

lcov_pbm: cover_pbm
cat bazel-testlogs/pbm/test_pbm/test.log | $(COVERAGE_PIPE) 'util/*' 'ade/*' 'llo/*'
cat bazel-testlogs/pbm/test_pbm/test.log | $(COVERAGE_PIPE)
lcov --remove $(COVERAGE_INFO_FILE) $(COVERAGE_IGNORE) 'ade/*' 'llo/*' -o $(COVERAGE_INFO_FILE)
lcov --list $(COVERAGE_INFO_FILE)

# check CLI

check_cli: check_ade_cli check_llo_cli

check_ade_cli: build_ade_cli
cli/ade/test/check.sh bazel-bin/cli/ade/cli

check_llo_cli: build_llo_cli
cli/llo/test/check.sh bazel-bin/cli/llo/cli

# build CLI
# test management

build_cli: build_ade_cli build_llo_cli
dora_run:
./scripts/start_dora.sh ./certs

build_ade_cli:
bazel build //cli/ade:cli
gen_test: dora_run
bazel run //test_gen:tfgen

build_llo_cli:
bazel build //cli/llo:cli
test_regress: gen_test
$(GTEST) $(REGRESS_TEST)

# deployment

clean:
bazel clean
docs:
rm -rf docs
doxygen
mv doxout/html docs
rm -rf doxout
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Synopsis

Tenncor libraries help developers build and evaluate tensor equations and its derivatives.
A tensor is an N-dimensional container that organizes its content by some shape. An M by N matrix for instance, is a 2-dimensional tensor with a shape of <N, M> (according to Tenncor's x-y-z-... coordinate notation).
A tensor is an N-dimensional container that organizes its content by some shape. An M by N matrix for instance, is a 2-dimensional tensor with a shape of [N, M] (according to Tenncor's x-y-z-... coordinate notation).

## Components

Expand All @@ -23,8 +23,12 @@ Expect this module to split when I decide to depend on external libraries (like

This module marshals llo-extended ade graph

## Tools and utility

- DBG (Debugger)

## Building

Tenncor uses bazel 0.9+.
Tenncor uses bazel 0.15+.

Download bazel: https://docs.bazel.build/versions/master/install.html
19 changes: 17 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
workspace(name = "com_github_mingkaic_tenncor")

load("//:tenncor.bzl", "dependencies", "test_dependencies")


# ade and llo libraries have no external dependencies

# get dependencies for pbm
dependencies()

load("@org_pubref_rules_protobuf//cpp:rules.bzl", "cpp_proto_repositories")

cpp_proto_repositories()


# get dependencies for tests
test_dependencies()

load("@com_github_mingkaic_testify//:testify.bzl", "dependencies")

dependencies()

load("@org_pubref_rules_protobuf//cpp:rules.bzl", "cpp_proto_repositories")
cpp_proto_repositories()
load("@com_github_raggledodo_dora//:dora.bzl", "dependencies")

dependencies()

load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_repositories")

py_proto_repositories()
Loading

0 comments on commit afb3ded

Please sign in to comment.