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

[AutoScheduler] Add task scheduler #6663

Merged
merged 9 commits into from
Oct 19, 2020

Conversation

merrymercy
Copy link
Member

@merrymercy merrymercy commented Oct 11, 2020

  • Add a task scheduler (python/tvm/auto_scheduler/task_scheduler.py) to allocate time resources for optimizing all subgraphs in a DNN. It prioritizes important subgraphs (e.g. performance bottleneck, graphs with a large room for improvement) according to a given objective function.
  • Add an interface ContinueSearchOneRound to the search policy to support the task scheduler.
  • Improve docstrings

@merrymercy
Copy link
Member Author

@merrymercy merrymercy force-pushed the pr-task-scheduler branch 4 times, most recently from 050e351 to cfd4b27 Compare October 11, 2020 12:09
@tqchen tqchen changed the base branch from master to main October 11, 2020 18:15
python/tvm/auto_scheduler/measure.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/task_scheduler.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/task_scheduler.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/task_scheduler.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/task_scheduler.py Show resolved Hide resolved
python/tvm/auto_scheduler/task_scheduler.py Show resolved Hide resolved
python/tvm/auto_scheduler/task_scheduler.py Outdated Show resolved Hide resolved
if cost < self.best_costs[task_idx]:
self.best_costs[task_idx] = cost

if len(measure_inputs) == 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if len(measure_inputs) == 0:
if not measure_inputs:

Copy link
Member Author

@merrymercy merrymercy Oct 18, 2020

Choose a reason for hiding this comment

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

measure_inputs is not a python list. It is a tvm::runtime::Array, so we cannot use this idiom.

python/tvm/auto_scheduler/task_scheduler.py Outdated Show resolved Hide resolved
random_states = &temp_random_states;
} else {
random_states->clear();
std::pair<Array<MeasureInput>, Array<MeasureResult>> SketchPolicyNode::ContinueSearchOneRound(
Copy link
Contributor

Choose a reason for hiding this comment

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

From the functionality it doesn't look like "continue" search one round, but more like SearchOneRound. On the other hand, the current search one round it is calling is more like TuneStates.

Copy link
Member Author

Choose a reason for hiding this comment

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

I still prefer the current names.

python/tvm/auto_scheduler/task_scheduler.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/task_scheduler.py Outdated Show resolved Hide resolved
python/tvm/auto_scheduler/task_scheduler.py Outdated Show resolved Hide resolved
@merrymercy
Copy link
Member Author

@jcf94 @comaniac Comments are addressed. Please take another look!

@merrymercy merrymercy force-pushed the pr-task-scheduler branch 2 times, most recently from a341e4b to c5b7842 Compare October 18, 2020 17:28
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. Thanks.

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.

Thanks!

@merrymercy merrymercy merged commit 94679b5 into apache:main Oct 19, 2020
@merrymercy merrymercy deleted the pr-task-scheduler branch October 19, 2020 06:55
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Oct 29, 2020
* Add task scheduler

* fix lint

* fix tests

* fix tests

* fix tests

* fix test cases

* fix test cases

* fix tests

* address comments
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 2, 2020
* Add task scheduler

* fix lint

* fix tests

* fix tests

* fix tests

* fix test cases

* fix test cases

* fix tests

* address comments
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 4, 2020
* Add task scheduler

* fix lint

* fix tests

* fix tests

* fix tests

* fix test cases

* fix test cases

* fix tests

* address comments
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Dec 4, 2020
* Add task scheduler

* fix lint

* fix tests

* fix tests

* fix tests

* fix test cases

* fix test cases

* fix tests

* 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