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

[RELAY] Non-recursive Graph Vistor and Rewriter #4886

Merged
merged 34 commits into from Apr 3, 2020

Conversation

mbrookhart
Copy link
Contributor

@mbrookhart mbrookhart commented Feb 14, 2020

@mbrookhart mbrookhart changed the title First pass a defining a non-recursive Graph Vistor and Rewriter First pass a defining at non-recursive Graph Vistor and Rewriter Feb 14, 2020
@tqchen tqchen changed the title First pass a defining at non-recursive Graph Vistor and Rewriter [WIP][POC]First pass a defining at non-recursive Graph Vistor and Rewriter Feb 14, 2020
@mbrookhart mbrookhart force-pushed the mbrookhart/GraphVisitor branch 3 times, most recently from a13af48 to 4cf2eca Compare March 13, 2020 16:58
@jroesch
Copy link
Member

jroesch commented Mar 13, 2020

cc @MarisaKirisame

@mbrookhart mbrookhart force-pushed the mbrookhart/GraphVisitor branch 4 times, most recently from 8785019 to 8871e0b Compare March 18, 2020 21:27
src/relay/ir/expr_functor.cc Outdated Show resolved Hide resolved
src/relay/analysis/util.cc Outdated Show resolved Hide resolved
src/relay/ir/expr_functor.cc Outdated Show resolved Hide resolved
src/relay/ir/expr_functor.cc Outdated Show resolved Hide resolved
src/relay/ir/expr_functor.cc Outdated Show resolved Hide resolved
src/relay/ir/expr_functor.cc Outdated Show resolved Hide resolved
@mbrookhart mbrookhart force-pushed the mbrookhart/GraphVisitor branch 2 times, most recently from 57c6531 to 62cddf2 Compare March 23, 2020 19:41
@tqchen tqchen added status: need review status: need update need update based on feedbacks labels Mar 30, 2020
@mbrookhart mbrookhart force-pushed the mbrookhart/GraphVisitor branch 2 times, most recently from cec3bae to 9c6a04d Compare March 31, 2020 15:52
Matthew Brookhart added 6 commits March 31, 2020 13:55
autoformat

remove a currently empty test until testing is solidfied
passes tests when disabling GetExprRefCount, I think I have a bug in visit counting

fix GetExprRefCount

Fix a subtle bug with nested recursive/non-recursive scopes
@tqchen
Copy link
Member

tqchen commented Apr 3, 2020

@mbrookhart mbrookhart changed the title [WIP][POC]First pass a defining at non-recursive Graph Vistor and Rewriter [POC]First pass a defining at non-recursive Graph Vistor and Rewriter Apr 3, 2020
Copy link
Member

@tqchen tqchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some final comments, lgtm from my side once they are fixed

include/tvm/relay/expr_functor.h Outdated Show resolved Hide resolved
src/relay/ir/expr_functor.cc Show resolved Hide resolved
@tqchen tqchen changed the title [POC]First pass a defining at non-recursive Graph Vistor and Rewriter [RELAY] Non-recursive Graph Vistor and Rewriter Apr 3, 2020
Copy link
Member

@zhiics zhiics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM:)

include/tvm/relay/expr_functor.h Outdated Show resolved Hide resolved
include/tvm/relay/expr_functor.h Outdated Show resolved Hide resolved
} else if (const TupleGetItemNode* op = node.as<TupleGetItemNode>()) {
stack.top().second = true;
fpush_to_stack(op->tuple);
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we expand LetNode as it could easily lead to deep dataflow?

include/tvm/relay/expr_functor.h Show resolved Hide resolved
@tqchen
Copy link
Member

tqchen commented Apr 3, 2020

cc @icemelon9 re let node, let us not expand letnode for now, as they could be useful in Dataflow normal form and marks boundries of the dataflow regions and effect

Copy link
Member

@icemelon icemelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tqchen tqchen merged commit 7de8a53 into apache:master Apr 3, 2020
@tqchen tqchen added status: accepted and removed status: need review status: need update need update based on feedbacks labels Apr 3, 2020
@tqchen
Copy link
Member

tqchen commented Apr 3, 2020

Thanks @icemelon9 @yzhliu @anijain2305 @jroesch @MarisaKirisame, and @mbrookhart ! It would be great if we can followup to convert more passes to the non-recursive form

@mbrookhart mbrookhart deleted the mbrookhart/GraphVisitor branch April 3, 2020 21:48
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Apr 16, 2020
* First pass a defining a non-recursive Graph Vistor and Rewriter

autoformat

remove a currently empty test until testing is solidfied

* Make CalcDep from Dead Code Elimination non-recursive

* Partially working, not passing all tests yet

passes tests when disabling GetExprRefCount, I think I have a bug in visit counting

fix GetExprRefCount

Fix a subtle bug with nested recursive/non-recursive scopes

* Refactor

* improve comments

* respond to review comments on comments

* Fix a problem with default recursion for dataflow nodes

mark DataflowVisitor methods as override

* implement ScopeMutator

* convert forward_rewrite to ScopeMutator, remove DataflowMutator

* rewrite ExprRewriter and convert fast_math to use it

* switch BiasAddSimplifier to ExprRewriter

fix a clang warning

fix cpp lint

fix doc param error

* respond to review comments

* fix a typo in the iterative looping

* add a regression test for GetExprRefCount issue

* Normalize naming

* fix lint

* First pass a defining a non-recursive Graph Vistor and Rewriter

autoformat

remove a currently empty test until testing is solidfied

* Make CalcDep from Dead Code Elimination non-recursive

* Partially working, not passing all tests yet

passes tests when disabling GetExprRefCount, I think I have a bug in visit counting

fix GetExprRefCount

Fix a subtle bug with nested recursive/non-recursive scopes

* Refactor

* improve comments

* respond to review comments on comments

* Fix a problem with default recursion for dataflow nodes

mark DataflowVisitor methods as override

* implement ScopeMutator

* convert forward_rewrite to ScopeMutator, remove DataflowMutator

* rewrite ExprRewriter and convert fast_math to use it

* switch BiasAddSimplifier to ExprRewriter

fix a clang warning

fix cpp lint

fix doc param error

* respond to review comments

* fix a typo in the iterative looping

* add a regression test for GetExprRefCount issue

* Normalize naming

* fix lint

* respond to review comments
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Apr 17, 2020
* First pass a defining a non-recursive Graph Vistor and Rewriter

autoformat

remove a currently empty test until testing is solidfied

* Make CalcDep from Dead Code Elimination non-recursive

* Partially working, not passing all tests yet

passes tests when disabling GetExprRefCount, I think I have a bug in visit counting

fix GetExprRefCount

Fix a subtle bug with nested recursive/non-recursive scopes

* Refactor

* improve comments

* respond to review comments on comments

* Fix a problem with default recursion for dataflow nodes

mark DataflowVisitor methods as override

* implement ScopeMutator

* convert forward_rewrite to ScopeMutator, remove DataflowMutator

* rewrite ExprRewriter and convert fast_math to use it

* switch BiasAddSimplifier to ExprRewriter

fix a clang warning

fix cpp lint

fix doc param error

* respond to review comments

* fix a typo in the iterative looping

* add a regression test for GetExprRefCount issue

* Normalize naming

* fix lint

* First pass a defining a non-recursive Graph Vistor and Rewriter

autoformat

remove a currently empty test until testing is solidfied

* Make CalcDep from Dead Code Elimination non-recursive

* Partially working, not passing all tests yet

passes tests when disabling GetExprRefCount, I think I have a bug in visit counting

fix GetExprRefCount

Fix a subtle bug with nested recursive/non-recursive scopes

* Refactor

* improve comments

* respond to review comments on comments

* Fix a problem with default recursion for dataflow nodes

mark DataflowVisitor methods as override

* implement ScopeMutator

* convert forward_rewrite to ScopeMutator, remove DataflowMutator

* rewrite ExprRewriter and convert fast_math to use it

* switch BiasAddSimplifier to ExprRewriter

fix a clang warning

fix cpp lint

fix doc param error

* respond to review comments

* fix a typo in the iterative looping

* add a regression test for GetExprRefCount issue

* Normalize naming

* fix lint

* respond to review comments
dpankratz pushed a commit to dpankratz/incubator-tvm that referenced this pull request Apr 24, 2020
* First pass a defining a non-recursive Graph Vistor and Rewriter

autoformat

remove a currently empty test until testing is solidfied

* Make CalcDep from Dead Code Elimination non-recursive

* Partially working, not passing all tests yet

passes tests when disabling GetExprRefCount, I think I have a bug in visit counting

fix GetExprRefCount

Fix a subtle bug with nested recursive/non-recursive scopes

* Refactor

* improve comments

* respond to review comments on comments

* Fix a problem with default recursion for dataflow nodes

mark DataflowVisitor methods as override

* implement ScopeMutator

* convert forward_rewrite to ScopeMutator, remove DataflowMutator

* rewrite ExprRewriter and convert fast_math to use it

* switch BiasAddSimplifier to ExprRewriter

fix a clang warning

fix cpp lint

fix doc param error

* respond to review comments

* fix a typo in the iterative looping

* add a regression test for GetExprRefCount issue

* Normalize naming

* fix lint

* First pass a defining a non-recursive Graph Vistor and Rewriter

autoformat

remove a currently empty test until testing is solidfied

* Make CalcDep from Dead Code Elimination non-recursive

* Partially working, not passing all tests yet

passes tests when disabling GetExprRefCount, I think I have a bug in visit counting

fix GetExprRefCount

Fix a subtle bug with nested recursive/non-recursive scopes

* Refactor

* improve comments

* respond to review comments on comments

* Fix a problem with default recursion for dataflow nodes

mark DataflowVisitor methods as override

* implement ScopeMutator

* convert forward_rewrite to ScopeMutator, remove DataflowMutator

* rewrite ExprRewriter and convert fast_math to use it

* switch BiasAddSimplifier to ExprRewriter

fix a clang warning

fix cpp lint

fix doc param error

* respond to review comments

* fix a typo in the iterative looping

* add a regression test for GetExprRefCount issue

* Normalize naming

* fix lint

* respond to review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants