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 Yi Wang via TVM Discuss <no...@discuss.tvm.ai> on 2020/05/11 18:58:03 UTC

[TVM Discuss] [Questions] How to reset Relay to use the default config?


Is there a way to reset Relay to use the default configurations? I want to compare the performance of two tuned logs in one process, but after applying autotvm.apply_history_best() for the first log, it also affect the second run. Is there a way to revert the effect of apply_history_best()? Thank you!





---
[Visit Topic](https://discuss.tvm.ai/t/how-to-reset-relay-to-use-the-default-config/6642/1) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/8199d25ed4ab775f0b6d42d7d6b3dc164a66b25e6d8f3a052439f4fcb72e2a43).

[TVM Discuss] [Questions] How to reset Relay to use the default config?

Posted by Yi Wang via TVM Discuss <no...@discuss.tvm.ai>.

@comaniac Your solution works great! Thanks for the explanation.





---
[Visit Topic](https://discuss.tvm.ai/t/how-to-reset-relay-to-use-the-default-config/6642/3) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/3a65f07e7ab10c52686c4d9c8447c472d36f9fdcd03cd4428d0d4a9caf4c45da).

[TVM Discuss] [Questions] How to reset Relay to use the default config?

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

This is a tricky question. Theoretically you only need to build the module again without `apply_history_best` and measure its latency. However, if you build the same module twice, the compiler engine will use the previous built programs to reduce the build time in the second time. This can be resolved by adding the following lines:

```python
from tvm.relay.backend import compile_engine
...
compile_engine.get().clear()
with apply_history_best(...):
  graph, lib, params = relay.build_module.build(mod, target=target, params=params)
runtime1 = graph_runtime.create(graph, lib, dev_ctx)

compile_engine.get().clear()
graph, lib, params = relay.build_module.build(mod, target=target, params=params)
runtime2 = graph_runtime.create(graph, lib, dev_ctx)
```

The whole idea is to clean the cache in compiler engine and make sure it builds the module from scratch.





---
[Visit Topic](https://discuss.tvm.ai/t/how-to-reset-relay-to-use-the-default-config/6642/2) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/4f503e225a9048043ab89fc80dfed35c356a7d37fe26338e74ae4c6987d47bbd).