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] Add DefuseOps pass #6946

Merged
merged 1 commit into from
Nov 23, 2020
Merged

Conversation

merrymercy
Copy link
Member

@merrymercy merrymercy commented Nov 22, 2020

Add a DefuseOps pass. DefuseOps is an inverse operation of FuseOps pass. It transforms a fused program returned by relay::transform::FuseOps into the program before FuseOps (i.e., x == DefuseOps(FuseOps(x))).

This pass is necessary for a layout rewrite pass in Ansor auto-scheduler. Because FoldConstant cannot work across the boundary of the fused Primitive function. When we want to use FoldConstant after fusion, we have to defuse it, apply FoldConstant and fuse it again.

co-authored by @minminsun

@merrymercy
Copy link
Member Author

python/tvm/relay/transform/transform.py Outdated Show resolved Hide resolved
src/relay/transforms/defuse_ops.cc Outdated Show resolved Hide resolved
src/relay/transforms/defuse_ops.cc Outdated Show resolved Hide resolved
src/relay/transforms/defuse_ops.cc Show resolved Hide resolved
@tqchen
Copy link
Member

tqchen commented Nov 22, 2020

cc @zhiics @mbrookhart it would be great if you can also take a look at it

@merrymercy merrymercy force-pushed the pr-defuse-ops branch 3 times, most recently from 97dde7e to 7c34768 Compare November 22, 2020 19:21
Co-authored-by: minminsun <minmin.smm@alibaba-inc.com>
@merrymercy
Copy link
Member Author

@FrozenGene comments are addressed

@merrymercy merrymercy merged commit dc72204 into apache:main Nov 23, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 2, 2020
Co-authored-by: minminsun <minmin.smm@alibaba-inc.com>

Co-authored-by: minminsun <minmin.smm@alibaba-inc.com>
@merrymercy merrymercy deleted the pr-defuse-ops branch December 3, 2020 17:17
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 4, 2020
Co-authored-by: minminsun <minmin.smm@alibaba-inc.com>

Co-authored-by: minminsun <minmin.smm@alibaba-inc.com>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Dec 4, 2020
Co-authored-by: minminsun <minmin.smm@alibaba-inc.com>

Co-authored-by: minminsun <minmin.smm@alibaba-inc.com>
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.

5 participants