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

Replace RuntimeError in _lookup_task with deferred error. #8421

Merged
merged 3 commits into from
Jul 9, 2021

Conversation

mdw-octoml
Copy link
Contributor

This allows unknown tasks to be created (e.g., when parsing autotvm log files) but not invoked.

This change is needed to allow one to read an autotvm log file created by a build of TVM with a different set of registered tasks than the build in which the script reading the log file is using. For example if one has a log file created by a TVM build with CUDA tasks, but reads the log file on a TVM build without CUDA enabled (e.g., running on a different OS without CUDA support).

The change should be safe in the sense that it raises a RuntimeError if the missing task is actually invoked, but the metadata associated with the task can still exist, allowing the log file to be parsed and analyzed.

This allows unknown tasks to be created (e.g., when parsing
autotvm log files) but not invoked.
@mdw-octoml
Copy link
Contributor Author

Hi @junrushao1994 and @jroesch - Mind taking a look? Thanks!

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

Thanks @mdw-octoml for the contribution! The PR looks good to me!

@junrushao
Copy link
Member

CC @tkonolige @comaniac

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. Just put some thoughts to the error message. Feel free to take or reject.

python/tvm/autotvm/task/task.py Outdated Show resolved Hide resolved
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
@mdw-octoml
Copy link
Contributor Author

Thanks @comaniac - applied your suggestion!

@mdw-octoml
Copy link
Contributor Author

Hi there! Could someone please merge? @tqchen @jroesch

@comaniac comaniac merged commit 6141cac into apache:main Jul 9, 2021
@comaniac
Copy link
Contributor

comaniac commented Jul 9, 2021

Thanks @mdw-octoml @junrushao1994

ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
* Replace RuntimeError in _lookup_task with deferred error.

This allows unknown tasks to be created (e.g., when parsing
autotvm log files) but not invoked.

* Format.

* Update python/tvm/autotvm/task/task.py

Co-authored-by: Cody Yu <comaniac0422@gmail.com>

Co-authored-by: Matt Welsh <mdw@mdw.la>
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
zxy844288792 pushed a commit to zxy844288792/tvm that referenced this pull request Mar 4, 2022
* Replace RuntimeError in _lookup_task with deferred error.

This allows unknown tasks to be created (e.g., when parsing
autotvm log files) but not invoked.

* Format.

* Update python/tvm/autotvm/task/task.py

Co-authored-by: Cody Yu <comaniac0422@gmail.com>

Co-authored-by: Matt Welsh <mdw@mdw.la>
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
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