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

Bound #521

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Bound #521

Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d4d492b
add API for split with flag
manya-bansal Oct 29, 2021
b765721
add test for splitUpDown and bound attributes for IndexVars
manya-bansal Nov 30, 2021
cbc872c
start substituting bound rel function calls
manya-bansal Jan 9, 2022
897bb04
add index notation falg
manya-bansal Jan 22, 2022
d6c5bb7
don't add such that node for bound relation
manya-bansal Jan 22, 2022
f2e5cfb
change derive iter
manya-bansal Jan 26, 2022
aa1a114
bound rel node deleted, change workspace tests to reflect changes
manya-bansal Jan 26, 2022
fc86897
api change + new tests
manya-bansal Feb 5, 2022
e74bf06
bounds test file
manya-bansal Feb 13, 2022
9ae9908
bound and rebound test
manya-bansal Feb 13, 2022
ba95326
adding tests for bound
manya-bansal Feb 13, 2022
2cf16af
add more tests
manya-bansal Feb 14, 2022
6dc9ad4
print prov graph
manya-bansal Feb 26, 2022
9ec3e6e
print prov graph
manya-bansal Feb 27, 2022
79f2d47
added an additional test
manya-bansal Feb 27, 2022
ba621eb
merge conflicts
manya-bansal Apr 10, 2022
12af135
change taco-cli-tests.bats to refkect new bound api
manya-bansal Apr 10, 2022
27288ff
ataco-cli-test passing
manya-bansal Apr 12, 2022
a52bb4e
remove assert
manya-bansal Apr 17, 2022
57dd389
check literal split
manya-bansal Apr 17, 2022
c27ef8a
check biunds against literal values
manya-bansal Apr 17, 2022
e21812b
change ir simplify logic + add additional ir tests
manya-bansal Apr 24, 2022
e258dca
remove split up and down
manya-bansal May 30, 2022
af4ff8f
change bound abstraction from indexVar to indexStmt
manya-bansal Jun 6, 2022
b437560
merge upstream
manya-bansal Jun 6, 2022
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
Prev Previous commit
Next Next commit
bound and rebound test
  • Loading branch information
manya-bansal committed Feb 13, 2022

Verified

This commit was signed with the committer’s verified signature.
steventux Steve Laing
commit 9ae9908959151ccb130fb8e15c8f56748180d18b
78 changes: 42 additions & 36 deletions test/tests-bound.cpp
Original file line number Diff line number Diff line change
@@ -10,43 +10,9 @@

using namespace taco;

TEST(bound, test_1) {

Tensor<double> A("A", {16}, Format{Dense});
Tensor<double> B("B", {16}, Format{Dense});
Tensor<double> C("C", {16}, Format{Dense});

for (int i = 0; i < 16; i++) {
A.insert({i}, (double) i);
B.insert({i}, (double) i);
}

A.pack();
B.pack();

IndexVar i("i");
IndexVar i0("i0"), i1("i1");
IndexExpr precomputedExpr = B(i) * C(i);
A(i) = precomputedExpr;

IndexStmt stmt = A.getAssignment().concretize();
TensorVar precomputed("precomputed", Type(Float64, {Dimension(i1)}), taco::dense);
stmt = stmt.bound(i, 16, BoundType::MaxExact)
.split(i, i0, i1, 4);

A.compile(stmt);
A.assemble();
A.compute();

Tensor<double> expected("expected", {16}, Format{Dense});
expected(i) = B(i) * C(i);
expected.compile();
expected.assemble();
expected.compute();
ASSERT_TENSOR_EQ(expected, A);
}

TEST(bound, test_2) {
TEST(bound, bound_and_rebound) {

Tensor<double> A("A", {16}, Format{Dense});
Tensor<double> B("B", {16}, Format{Dense});
@@ -67,7 +33,8 @@ TEST(bound, test_2) {

IndexStmt stmt = A.getAssignment().concretize();
TensorVar precomputed("precomputed", Type(Float64, {Dimension(i1)}), taco::dense);
stmt = stmt.bound(i, 16, BoundType::MaxExact)
stmt = stmt.bound(i, 18, BoundType::MaxExact)
.bound(i, 16, BoundType::MaxExact)
.split(i, i0, i1, 5)
.precompute(precomputedExpr, i1, i1, precomputed);

@@ -83,6 +50,45 @@ TEST(bound, test_2) {
ASSERT_TENSOR_EQ(expected, A);
}


// TEST(bound, bound_and_fuse) {

// Tensor<double> A("A", {16}, Format{Dense});
// Tensor<double> B("B", {16}, Format{Dense});
// Tensor<double> C("C", {16}, Format{Dense});

// for (int i = 0; i < 16; i++) {
// A.insert({i}, (double) i);
// B.insert({i}, (double) i);
// }

// A.pack();
// B.pack();

// IndexVar i("i");
// IndexVar i0("i0"), i1("i1");
// IndexExpr precomputedExpr = B(i) * C(i);
// A(i) = precomputedExpr;

// IndexStmt stmt = A.getAssignment().concretize();
// TensorVar precomputed("precomputed", Type(Float64, {Dimension(i1)}), taco::dense);
// stmt = stmt.bound(i, 16, BoundType::MaxExact)
// .split(i, i0, i1, 5)
// .fuse()
// .precompute(precomputedExpr, i1, i1, precomputed);

// A.compile(stmt.concretize());
// A.assemble();
// A.compute();

// Tensor<double> expected("expected", {16}, Format{Dense});
// expected(i) = B(i) * C(i);
// expected.compile();
// expected.assemble();
// expected.compute();
// ASSERT_TENSOR_EQ(expected, A);
// }

TEST(bound, bound_and_split) {

Tensor<double> A("A", {17}, Format{Dense});