# \[TensorIR\] Autotuning TIR script

**URL:** <https://discuss.tvm.apache.org/t/tensorir-autotuning-tir-script/14485>\
**Category:** Questions\
**Created:** [March 8, 2023, 4:13am UTC](https://discuss.tvm.apache.org/t/tensorir-autotuning-tir-script/14485 "2023-03-08T04:13:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jungi-lee](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@Jungi-lee](https://discuss.tvm.apache.org/u/Jungi-lee)\
**Post date:** [March 8, 2023, 4:13am UTC](https://discuss.tvm.apache.org/t/tensorir-autotuning-tir-script/14485/1 "2023-03-08T04:13:15Z")

</div>

Hi, I recently got to know [TensorIR](https://arxiv.org/abs/2207.04296), which has great features that previous tensor expression IR cannot express. I decided to try it out and ran some manually-tuned codes (I referenced a nice document from [tensor\_ir\_blitz\_course](https://tvm.apache.org/docs/tutorial/tensor_ir_blitz_course.html)).

I want to try auto-tuning the tir script (as mentioned in the [TensorIR](https://arxiv.org/abs/2207.04296) paper) with a custom sketch, but I can’t find any related document or example codes. What can be the most widely used way to register the tir script as SearchTask, and specify user-defined sketch rule?

PS, I am aware of adding custom sketch rule using Ansor, as well explained in [how-to-tune-with-autoscheduler-tune-sparse-x86](https://tvm.apache.org/docs/how_to/tune_with_autoscheduler/tune_sparse_x86.html#sphx-glr-how-to-tune-with-autoscheduler-tune-sparse-x86-py). I haven’t tried using meta-scheduler yet.

---

<div class="post-metadata">

**Author:** ![Hzfengsy](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/hzfengsy/32/2961_2.png) [@Hzfengsy](https://discuss.tvm.apache.org/u/Hzfengsy)\
**Post date:** [March 8, 2023, 6:23am UTC](https://discuss.tvm.apache.org/t/tensorir-autotuning-tir-script/14485/2 "2023-03-08T06:23:53Z")

</div>

cc @junrushao to see if you have a plan for the meta-schedule tutorials
