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 2: Evolutionary Search #6310

Merged
merged 6 commits into from
Aug 27, 2020

Conversation

comaniac
Copy link
Contributor

@comaniac comaniac commented Aug 20, 2020

For the full upstream plan, see Ansor RFC.

This PR adds evolutionary search implementations to the auto-scheduler:

  • Genetic algorithm
  • Mutation rule base
  • Mutate tile size
  • Mutate compute_at location
  • Mutate annotation (parallel/vectorize)
  • Required unit tests.

cc @merrymercy @jcf94 @tqchen. The checked 3 parts are ready to be reviewed. It's also fine if you guys prefer to put the rest mutation rules to a separate PR.

@comaniac comaniac marked this pull request as ready for review August 24, 2020 18:39
Copy link
Contributor

@jcf94 jcf94 left a comment

Choose a reason for hiding this comment

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

Overall looks good to me.

@merrymercy merrymercy self-assigned this Aug 25, 2020
src/auto_scheduler/search_policy/sketch_policy.cc Outdated Show resolved Hide resolved
src/auto_scheduler/search_policy/sketch_policy.cc Outdated Show resolved Hide resolved
}
}

*state = policy->search_task->compute_dag.InferBound(*state);
Copy link
Member

@merrymercy merrymercy Aug 25, 2020

Choose a reason for hiding this comment

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

This InferBound is required during SampleInitPopulation. However, it introduces a redundant InferBound during EvolutionarySearch. We should remove it during EvolutionarySearch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Miss this line when moving the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm I realized that it's hard to recognize if this is being used by initial population or mutation. Do you have any suggestions? Or should we just simply remove this mutation in the initial population as @jcf94 suggested?

Copy link
Member

@merrymercy merrymercy Aug 27, 2020

Choose a reason for hiding this comment

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

@comaniac We should not remove it. I think it is useful in SampleInitPopulation and further improvement can be done here to make the initial population better.
To solve the issue, we can create a new function for the common part and create two separate rules.
On rule only calls the common part, while the other rule calls the common part + InferBound.

@comaniac comaniac force-pushed the ansor_evo_search branch 2 times, most recently from 755d1b2 to 2b7a3f8 Compare August 26, 2020 03:52
merrymercy
merrymercy previously approved these changes Aug 27, 2020
@merrymercy
Copy link
Member

The test case looks good to me. The two remaining items:

  1. Resolve my last comment ([Ansor][AutoTVM v2.0] Phase 2: Evolutionary Search #6310 (comment))
  2. Bring this patch (https://github.com/merrymercy/Ansor/pull/98) to this pr.

@comaniac
Copy link
Contributor Author

@merrymercy comment addressed. PTAL.

@merrymercy merrymercy merged commit 1899ad8 into apache:master Aug 27, 2020
@comaniac comaniac deleted the ansor_evo_search branch August 27, 2020 22:22
kevinthesun pushed a commit to kevinthesun/tvm that referenced this pull request Sep 17, 2020
* init commit

* Add rest rules

* refactor

* address comments

* improve test

* address comments
kevinthesun pushed a commit to kevinthesun/tvm that referenced this pull request Sep 18, 2020
* init commit

* Add rest rules

* refactor

* address comments

* improve test

* address comments
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 18, 2020
* init commit

* Add rest rules

* refactor

* address comments

* improve test

* address comments
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.

3 participants