Skip to content

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

Merged
tqchen merged 34 commits into
apache:masterfrom
mbrookhart:mbrookhart/GraphVisitor
Apr 3, 2020
Merged

tqchen merged 34 commits into
apache:masterfrom
mbrookhart:mbrookhart/GraphVisitor

Conversation

@mbrookhart

@mbrookhart mbrookhart commented Feb 14, 2020 •

Copy link
Copy Markdown
Contributor

@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
@mbrookhart
mbrookhart force-pushed the mbrookhart/GraphVisitor branch from ab7eb8b to 450b998 Compare February 14, 2020 19:00
@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
Comment thread include/tvm/relay/expr_functor.h Outdated
@mbrookhart
mbrookhart force-pushed the mbrookhart/GraphVisitor branch from 6933b30 to 9c952ee Compare February 28, 2020 22:39
@mbrookhart
mbrookhart force-pushed the mbrookhart/GraphVisitor branch 3 times, most recently from a13af48 to 4cf2eca Compare March 13, 2020 16:58
@jroesch

jroesch commented Mar 13, 2020

Copy link
Copy Markdown
Member

cc @MarisaKirisame

@mbrookhart
mbrookhart force-pushed the mbrookhart/GraphVisitor branch 4 times, most recently from 8785019 to 8871e0b Compare March 18, 2020 21:27
Comment thread src/relay/ir/expr_functor.cc Outdated
Comment thread src/relay/analysis/util.cc Outdated
Comment thread src/relay/ir/expr_functor.cc Outdated
Comment thread src/relay/ir/expr_functor.cc Outdated
Comment thread src/relay/ir/expr_functor.cc Outdated
Comment thread src/relay/ir/expr_functor.cc Outdated
@mbrookhart
mbrookhart force-pushed the mbrookhart/GraphVisitor branch 2 times, most recently from 57c6531 to 62cddf2 Compare March 23, 2020 19:41
@mbrookhart
mbrookhart force-pushed the mbrookhart/GraphVisitor branch from 62cddf2 to 55a4213 Compare March 30, 2020 20:11
@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
@mbrookhart
mbrookhart force-pushed the mbrookhart/GraphVisitor branch from 62ca9f5 to ae3c62e Compare April 2, 2020 23:11
@tqchen

tqchen commented Apr 3, 2020

Copy link
Copy Markdown
Member

@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

@tqchen tqchen left a comment

Copy link
Copy Markdown
Member

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

Comment thread include/tvm/relay/expr_functor.h Outdated
Comment thread src/relay/ir/expr_functor.cc
@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

@zhiics zhiics left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM:)

Comment thread include/tvm/relay/expr_functor.h Outdated
Comment thread include/tvm/relay/expr_functor.h Outdated
} else if (const TupleGetItemNode* op = node.as<TupleGetItemNode>()) {
stack.top().second = true;
fpush_to_stack(op->tuple);
} else {

Copy link
Copy Markdown
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?

Comment thread include/tvm/relay/expr_functor.h
@tqchen

tqchen commented Apr 3, 2020

Copy link
Copy Markdown
Member

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

@icemelon icemelon left a comment

Copy link
Copy Markdown
Member

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

tqchen commented Apr 3, 2020

Copy link
Copy Markdown
Member

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.

8 participants