Skip to content

Conversation

@zxybazh
Copy link
Member

@zxybazh zxybazh commented Jan 27, 2022

This PR is part of the stage M4a of the meta schedule project (#8473).

The architecture is re-designed by Junru and Xiyou. In this PR we introduced the tuning scripts for tir, te & relay workloads with meta schedule. Unittests are added for each type of tuning, and for relay workloads we added tests of ResNet18, MobileNetV2 and BertBase.

Thanks to all co-authors for contributing!

Co-authored-by: Junru Shao <[email protected]>
Co-authored-by: Bohan Hou <[email protected]>
Co-authored-by: Ruihang Lai <[email protected]>
Co-authored-by: Hongyi Jin <[email protected]>
Co-authored-by: Wuwei Lin <[email protected]>
Co-authored-by: Siyuan Feng <[email protected]>

@junrushao
Copy link
Member

Let's wait for the rest 3 rules to be upstreamed before merging this PR :-)

@junrushao junrushao changed the title [MetaSchedule][M4a] Add Tuning Scripts for TIR / TE / Relay [MetaSchedule][M4a] User-API: Tune-TE/TIR/Relay Jan 27, 2022
@zxybazh zxybazh force-pushed the meta-schedule/upstream/2022-01-26/tune-scripts branch from 490dfcc to 512ac20 Compare January 28, 2022 00:59
Co-authored-by: Junru Shao <[email protected]>
Co-authored-by: Bohan Hou <[email protected]>
Co-authored-by: Ruihang Lai <[email protected]>
Co-authored-by: Hongyi Jin <[email protected]>
Co-authored-by: Wuwei Lin <[email protected]>
Co-authored-by: Siyuan Feng <[email protected]>

Minor fix.

Nits.

Add back tests.
@junrushao junrushao force-pushed the meta-schedule/upstream/2022-01-26/tune-scripts branch from 512ac20 to e213c9c Compare January 29, 2022 22:38
Comment on lines +146 to +151
test_meta_schedule_tune_relay("resnet18", 1, "llvm --num-cores=16")
test_meta_schedule_tune_relay("resnet18", 1, "nvidia/geforce-rtx-3070")
test_meta_schedule_tune_relay("mobilenet_v2", 1, "llvm --num-cores=16")
test_meta_schedule_tune_relay("mobilenet_v2", 1, "nvidia/geforce-rtx-3070")
test_meta_schedule_tune_relay("bert_base", 1, "llvm --num-cores=16")
test_meta_schedule_tune_relay("bert_base", 1, "nvidia/geforce-rtx-3070")
Copy link
Member

Choose a reason for hiding this comment

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

Wonder how long would these 6 unittests take in total?

Copy link
Member Author

Choose a reason for hiding this comment

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

Around 30 minutes.

@Hzfengsy Hzfengsy merged commit 779dc51 into apache:main Jan 30, 2022
ylc pushed a commit to ylc/tvm that referenced this pull request Feb 16, 2022
* Add tuning scripts for tir, te & relay.

Co-authored-by: Junru Shao <[email protected]>
Co-authored-by: Bohan Hou <[email protected]>
Co-authored-by: Ruihang Lai <[email protected]>
Co-authored-by: Hongyi Jin <[email protected]>
Co-authored-by: Wuwei Lin <[email protected]>
Co-authored-by: Siyuan Feng <[email protected]>

Minor fix.

Nits.

Add back tests.

* slightly improve tune.py

Co-authored-by: Junru Shao <[email protected]>
int running_tasks = tasks.size();
for (int task_id; (task_id = NextTaskId()) != -1;) {
LOG(INFO) << "Scheduler picks Task #" << task_id << ": " << tasks[task_id]->task_name;
LOG(INFO) << "Scheduler picks Task #" << task_id + 1 << ": " << tasks[task_id]->task_name;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi Xiyou! I'm curious about this change. After this change the printed ids at several places differ (here with + 1 while others without.)

LOG(INFO) << "Initializing task " << task_id << ": " << task->task_name << ", mod =\n"

os << '#' << task_id << ": " << task->task_name;

Perhaps it's better to keep them consistent 👀?

Copy link
Member Author

@zxybazh zxybazh Mar 3, 2022

Choose a reason for hiding this comment

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

Hi, thanks for pointing that out. The reason for this change is previously we have task 0/18 to task 17/18 which seems confusing to me. I intend to make sure the log is consistent but I might missed a couple places. After second thoughts I think it might be better to keep the task_id the same way it is so that it would be easier for debugging later. See #10478.

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