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

[AutoTVM] Support range in index based tuners #4870

Merged
merged 4 commits into from
Feb 15, 2020

Conversation

comaniac
Copy link
Contributor

@comaniac comaniac commented Feb 12, 2020

This PR includes the following changes in order to let grid search and random tuner accept an index range. This is beneficial for distributed tuning since we can easily separate a tuning space to chunks and distribute them to different machines.

Note: This change will not affect any existing use cases of grid search tuner and random tuner.

  • Support range_idx optional argument when constructing GridSearchTuner and RandomTuner to let them only tune a part of the tuning space.

  • Refactor GridSearchTuner and RandomTuner to have a common base class called IndexBaseTuner. IndexBaseTuner processes range_idx and unifies common fields such as counter.

  • Improve RandomTuner to generate non-repetitive random indices in constant time without increasing memory usage.

  • Unit tests.

@comaniac
Copy link
Contributor Author

@merrymercy could you help to review this PR? Thanks!

python/tvm/autotvm/tuner/index_based_tuner.py Outdated Show resolved Hide resolved
return ret

def __getstate__(self):
return {"visited": self.counter}
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong

Copy link
Contributor Author

@comaniac comaniac Feb 14, 2020

Choose a reason for hiding this comment

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

Should this function return a list of visited config indices (i.e., self.visited)? Then should we change __setstate__ accordingly to make it consistent?

@comaniac comaniac force-pushed the random_tuner_range branch 2 times, most recently from f6a3a56 to 9cee1ab Compare February 14, 2020 17:10
@comaniac
Copy link
Contributor Author

@merrymercy I've removed __setstate__ and __getstate__ from tuners according to the discussion. The only one left is in Task which should be fine I think. Please take another pass. Thanks.

@comaniac
Copy link
Contributor Author

Re-trigger CI since it failed with no sense.

@comaniac comaniac closed this Feb 14, 2020
@comaniac comaniac reopened this Feb 14, 2020
@merrymercy merrymercy merged commit feda150 into apache:master Feb 15, 2020
@comaniac comaniac deleted the random_tuner_range branch February 17, 2020 16:41
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 26, 2020
* Support range in index based tuners

* Address comments

* Remove __*state__

* trigger CI
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 28, 2020
* Support range in index based tuners

* Address comments

* Remove __*state__

* trigger CI
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Mar 2, 2020
* Support range in index based tuners

* Address comments

* Remove __*state__

* trigger CI
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.

3 participants