[AutoScheduler] Support layout rewrite for whole networks#6987
Merged
merrymercy merged 12 commits intoapache:mainfrom Dec 3, 2020
Merged
[AutoScheduler] Support layout rewrite for whole networks#6987merrymercy merged 12 commits intoapache:mainfrom
merrymercy merged 12 commits intoapache:mainfrom
Conversation
cbf6dd9 to
dad8cc7
Compare
ebabcb4 to
54b9e51
Compare
Member
Author
8129203 to
b4e4278
Compare
b4e4278 to
082dcc9
Compare
51d057a to
3d492b3
Compare
f23ea6a to
ebbfbd4
Compare
Member
Author
|
@jcf94 @comaniac @FrozenGene @junrushao1994 Let us merge this as soon as possible, so we can get good performance on CPU and publish the CPU tutorial. |
ebbfbd4 to
8691c8a
Compare
FrozenGene
approved these changes
Dec 2, 2020
| dilation_h, dilation_w = dilation | ||
|
|
||
| if auto_scheduler_rewritten_layout: | ||
| # Infer shape for the rewritten layout |
Member
There was a problem hiding this comment.
As discussed, we need extract it. If conveniently, we could mark this one todo.
|
|
||
| with tempfile.NamedTemporaryFile() as fp: | ||
| log_file = fp.name | ||
| # log_file = "test_layout_rewrite.json" |
Member
There was a problem hiding this comment.
remove it. If we want to merge it soon, could leave it in the clean up pr.
8691c8a to
ebbda97
Compare
ebbda97 to
d3c69ca
Compare
merrymercy
commented
Dec 2, 2020
merrymercy
commented
Dec 2, 2020
merrymercy
commented
Dec 2, 2020
merrymercy
commented
Dec 2, 2020
comaniac
reviewed
Dec 2, 2020
merrymercy
commented
Dec 2, 2020
merrymercy
commented
Dec 2, 2020
merrymercy
commented
Dec 2, 2020
comaniac
approved these changes
Dec 2, 2020
merrymercy
commented
Dec 2, 2020
merrymercy
commented
Dec 2, 2020
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Dec 3, 2020
* [AutoScheduler] Add layout rewrite pass in relay * fix * fix lint * fix attrs * trigger CI * Apply suggestions from code review * trigger CI * Update python/tvm/auto_scheduler/relay_integration.py * Update python/tvm/auto_scheduler/relay_integration.py * Update python/tvm/auto_scheduler/compute_dag.py * Trigger CI * Apply suggestions from code review
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Dec 4, 2020
* [AutoScheduler] Add layout rewrite pass in relay * fix * fix lint * fix attrs * trigger CI * Apply suggestions from code review * trigger CI * Update python/tvm/auto_scheduler/relay_integration.py * Update python/tvm/auto_scheduler/relay_integration.py * Update python/tvm/auto_scheduler/compute_dag.py * Trigger CI * Apply suggestions from code review
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Dec 4, 2020
* [AutoScheduler] Add layout rewrite pass in relay * fix * fix lint * fix attrs * trigger CI * Apply suggestions from code review * trigger CI * Update python/tvm/auto_scheduler/relay_integration.py * Update python/tvm/auto_scheduler/relay_integration.py * Update python/tvm/auto_scheduler/compute_dag.py * Trigger CI * Apply suggestions from code review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto-scheduler can infer a good layout for constant tensors (e.g., the weight tensors in conv2d, dense) according to the loop structure created by the schedule. This PR adds a relay pass to support this kind of layout rewrite at graph level. This pass inserts necessary layout transforms in relay program and pre-computes them by
FoldConstantpass.Changes overview
auto_scheduler_layout_transformand its topi compute definition. This op can handle more general layout transform than the existingrelay.op.transform.layout_transformAutoSchedulerLayoutRewriteto do the layout rewrite.auto_scheduler_rewritten_layouttoConv2dAttrsto indicate the new layout after rewriting.python/tvm/topi/nn/conv2d.pyfor examples of how to enable the layout rewrite for a TOPI compute.co-authored by @minminsun