You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by Akhil via Apache TVM Discuss <no...@discuss.tvm.ai> on 2020/09/24 07:25:42 UTC

[Apache TVM Discuss] [Questions] AutoTVM how is the search space being generated


After looking at the tutorial for auto tuning in auto tvm, there seems to two methods to create a search space, one where the user gives an array if possible values to search and the other where tvm generates this space. In the latter case how does tvm model the search space equation, or is just a brute force listing of all possible values ?. Also whats is the difference between auto scheduling and auto tvm, arent both trying to search for the best parameters in the search space ?.

Now after the search space is defined what parameters are used to decide which config is the best, is it just execution time ?.





---
[Visit Topic](https://discuss.tvm.apache.org/t/autotvm-how-is-the-search-space-being-generated/7982/1) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/b6e928cdccd1c8750f6ed42a59e335a92651fc9584dc5c2475a4e1940bf52472).

[Apache TVM Discuss] [Questions] AutoTVM how is the search space being generated

Posted by "Cody H. Yu via Apache TVM Discuss" <no...@discuss.tvm.ai>.

Since the upstream of auto-scheduler is still in progress (~90%), we do not have a clean interface for users to add new sketch generation rules yet. The easiest way for now is referring or modifying an existing rule, such as:

https://github.com/apache/incubator-tvm/search?q=RuleAlwaysInline





---
[Visit Topic](https://discuss.tvm.apache.org/t/autotvm-how-is-the-search-space-being-generated/7982/8) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/c09b45d8554d6bdaa4392e5c73225ed29142c75536452e516a535a3549acd628).

[Apache TVM Discuss] [Questions] AutoTVM how is the search space being generated

Posted by Akhil via Apache TVM Discuss <no...@discuss.tvm.ai>.

Hey @jcf94 and @comaniac  thanks for the response , I was just trying to learn the compiler flow of tvm and how if needed new rules could be added which are hardware specific, As of now there is no immediate need, but thanks nevertheless.





---
[Visit Topic](https://discuss.tvm.apache.org/t/autotvm-how-is-the-search-space-being-generated/7982/10) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/bc120cf0f8d0659d387bdd9de6aabfbaf25322299b6ce2dcc4e6c1ada266e390).

[Apache TVM Discuss] [Questions] AutoTVM how is the search space being generated

Posted by Chenfan via Apache TVM Discuss <no...@discuss.tvm.ai>.

The custom sketch rule support is ready in our develop branch, while the final user interface for it has not been decided yet.

If this is important for you, we can consider to upstream a experimental version of custom sketch.

cc @comaniac @merrymercy





---
[Visit Topic](https://discuss.tvm.apache.org/t/autotvm-how-is-the-search-space-being-generated/7982/9) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/f5393015a7bbd8ccde179041db9d8a28c227fb7b788c6d8f159e43b48af24d1e).

[Apache TVM Discuss] [Questions] AutoTVM how is the search space being generated

Posted by Akhil via Apache TVM Discuss <no...@discuss.tvm.ai>.

Thanks a lot @comaniac . Where could one get started when trying to add their own rules to generate sketches for new hardware ?. 

as mentioned in the paper (section 4.1)
> On the other hand, the
> derivation-based sketch generation in Ansor is flexible enough
> to generate the required structures for emerging algorithms
> and hardware, as we allow users to register new derivation
> rules and integrate them seamlessly with existing rules.





---
[Visit Topic](https://discuss.tvm.apache.org/t/autotvm-how-is-the-search-space-being-generated/7982/7) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/c6a9430ae069903d4d7998220bfdebcd53eeec0f7d374ec1163939288df22f49).

[Apache TVM Discuss] [Questions] AutoTVM how is the search space being generated

Posted by "Cody H. Yu via Apache TVM Discuss" <no...@discuss.tvm.ai>.

1. All functions are implemented already. Many of them are implemented in C++. Is this what you're looking for? 

https://github.com/apache/incubator-tvm/blob/master/src/auto_scheduler/measure.cc

2. Most of them used in the cost model at this moment.





---
[Visit Topic](https://discuss.tvm.apache.org/t/autotvm-how-is-the-search-space-being-generated/7982/6) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/a77dd622cffa92043437e7607eb218aa965efcf00a86d67274b686e3f6a3ac51).

[Apache TVM Discuss] [Questions] AutoTVM how is the search space being generated

Posted by Akhil via Apache TVM Discuss <no...@discuss.tvm.ai>.

Hey @comaniac thanks for the reference it as very helpful in understanding what the auto scheduler does. I had a few doubts
1) Is this auto scheduler already implemented in TVM or is it ongoing, as we were going through some of the files in the auto scheduler folder ([https://github.com/apache/incubator-tvm/blob/master/python/tvm/auto_scheduler/measure.py](https://github.com/apache/incubator-tvm/blob/master/python/tvm/auto_scheduler/measure.py))
Many of the funtions are not implemented.

2) The hardwareparams class implemented in python/tvm/auto_scheduler/auto_schedule.py, are these parameters used while generating the schedule space (by introducing some sort of constrain on the space) or in the cost model





---
[Visit Topic](https://discuss.tvm.apache.org/t/autotvm-how-is-the-search-space-being-generated/7982/5) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/872fbd8b1b91c3cebd90bfb4a983fbfd8b02e5788cef64e418d0ba29814ac6ed).

[Apache TVM Discuss] [Questions] AutoTVM how is the search space being generated

Posted by "Cody H. Yu via Apache TVM Discuss" <no...@discuss.tvm.ai>.

- For auto-schedule details, you can refer to the paper: https://arxiv.org/abs/2006.06762
- XGBoost model also takes some features extracted from the TIR.





---
[Visit Topic](https://discuss.tvm.apache.org/t/autotvm-how-is-the-search-space-being-generated/7982/4) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/f7c1a0b7069eaa2ad17fc050fc67352cfd6b8e3c9628b9b43b5ce0a740b2e048).

[Apache TVM Discuss] [Questions] AutoTVM how is the search space being generated

Posted by Akhil via Apache TVM Discuss <no...@discuss.tvm.ai>.

Hey @comaniac Thanks. Are the hardware parameters like (num of threads, cache size) taken into consideration when auto scheduling is used. Also how does auto scheduling generate schedules from scratch. Does it look at every loop and try to figure out the best transformation based on execution time / GFLOPS ?.

 Also the docs mentioned that XG boost model is used to to pick the next config from the config space (while tuning), Does this model only take the config space as an input and its loss based on execution time ?





---
[Visit Topic](https://discuss.tvm.apache.org/t/autotvm-how-is-the-search-space-being-generated/7982/3) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/d79365c68233365da7432d9831b13e0eea6551a1f1555f16043d3c408bd42826).

[Apache TVM Discuss] [Questions] AutoTVM how is the search space being generated

Posted by "Cody H. Yu via Apache TVM Discuss" <no...@discuss.tvm.ai>.

* The search space is defined in the schedule template, such as:

https://github.com/apache/incubator-tvm/blob/master/python/tvm/topi/cuda/conv2d_direct.py#L31

  This line defines a search parameter, and the candidates are the factors of the length of `f`.

* While AutoTVM needs schedule templates defined in TOPI, auto-scheduler generates schedules from scratch. As a result, the auto-scheduler generated schedules are more flexible and expected to achieve even better performance.

* The execution time is the main metric to judge the schedule quality.





---
[Visit Topic](https://discuss.tvm.apache.org/t/autotvm-how-is-the-search-space-being-generated/7982/2) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/cc332820e78d74786ff58cbdaf79a567a7fdaa70571f96bbc28c0798855a153f).