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

[Ansor][AutoTVM v2.0] Phase 1: Add pragma/storage_align/rfactor steps #6141

Merged
merged 6 commits into from
Jul 29, 2020

Conversation

jcf94
Copy link
Contributor

@jcf94 jcf94 commented Jul 27, 2020

For the full upstream plan, see Ansor RFC.

In this PR, we bring pragma/storage_align/rfactor steps for Ansor auto_scheduler.

The Pragma step and StorageAlign step are two simple steps that add attributes to schedule.
The Rfactor step adds extra stage like CacheRead/CacheWrite do.

cc @merrymercy @comaniac @junrushao1994 @FrozenGene @jroesch

@jcf94 jcf94 force-pushed the pragma_rfactor_storage_align branch from e4408da to 082df7f Compare July 27, 2020 06:41
Comment on lines +1170 to +1184
// add FuseStepNode required by rfactor
if (i >= 2 && transform_steps[i - 2]->IsInstance<FuseStepNode>()) {
const Step& fuse_step = transform_steps[i - 2];
if (fuse_step->stage_id == step->stage_id) {
ret_steps.push_back(fuse_step);
}
}
// add SplitStepNode required by rfactor
CHECK_GE(i, 1);
CHECK(transform_steps[i - 1]->IsInstance<SplitStepNode>());
const Step& split_step = transform_steps[i - 1];
CHECK_EQ(split_step->stage_id, step->stage_id);
ret_steps.push_back(split_step);
// add RfactorStepNode
ret_steps.push_back(step);
Copy link
Contributor Author

@jcf94 jcf94 Jul 27, 2020

Choose a reason for hiding this comment

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

These checks here are specialized for the Rfactor in our search policy, will the rules continue to be kept like this? @merrymercy

Copy link
Member

@merrymercy merrymercy Jul 27, 2020

Choose a reason for hiding this comment

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

yes. Otherwise, there will be errors when creating the new dag

@jcf94 jcf94 force-pushed the pragma_rfactor_storage_align branch from dab6ae8 to 62a51f2 Compare July 27, 2020 06:58
include/tvm/auto_scheduler/transform_step.h Outdated Show resolved Hide resolved
Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

LGTM. Please note that #6142 changes the print state APIs, so we need to rebase one PR after merging another.

@jcf94
Copy link
Contributor Author

jcf94 commented Jul 28, 2020

LGTM. Please note that #6142 changes the print state APIs, so we need to rebase one PR after merging another.

Ok, let me do the rebase after #6142 has been merged.

@jcf94 jcf94 force-pushed the pragma_rfactor_storage_align branch from 49acf58 to f05ec96 Compare July 29, 2020 02:52
@tqchen
Copy link
Member

tqchen commented Jul 29, 2020

cc @junrushao1994 @jwfromm

@tqchen tqchen closed this Jul 29, 2020
@tqchen tqchen reopened this Jul 29, 2020
@merrymercy merrymercy merged commit 96f6011 into apache:master Jul 29, 2020
@jcf94 jcf94 deleted the pragma_rfactor_storage_align branch July 29, 2020 06:54
@jcf94
Copy link
Contributor Author

jcf94 commented Jul 29, 2020

Thanks to all! It's really great to work with you.
We've successfully merged almost all of the Ansor basic components, except the feature extraction and cost model parts.

Next, @merrymercy will continue to add the cost model while at the same time I'll start to bring our Sketch Search Policy(proposed in our paper) to TVM, and tutorials about how to tune a op/subgraph will together to be added. Hope the PR of Sketch Search Policy comes soon.

The API design and our custom sketch rule support (which works the same as the current AutoTVM template) are ongoing to be refined. We would be happy if anyone has suggestions on this project, and you're welcomed to join us to improve Ansor.

cc @minminsun @comaniac @FrozenGene @yangjunpro @tqchen @junrushao1994 @jroesch

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
…apache#6141)

* Add pragma/storage_align/rfactor step

* Update

* Update

* Update UT

* Update
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
…apache#6141)

* Add pragma/storage_align/rfactor step

* Update

* Update

* Update UT

* Update
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
…apache#6141)

* Add pragma/storage_align/rfactor step

* Update

* Update

* Update UT

* Update
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
…apache#6141)

* Add pragma/storage_align/rfactor step

* Update

* Update

* Update UT

* Update
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
…apache#6141)

* Add pragma/storage_align/rfactor step

* Update

* Update

* Update UT

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

Successfully merging this pull request may close these issues.

4 participants