# Choice of torch.compile vs. triton

**URL:** <https://discuss.pytorch.org/t/choice-of-torch-compile-vs-triton/195604>\
**Category:** torch.compile\
**Created:** [January 17, 2024, 10:48pm UTC](https://discuss.pytorch.org/t/choice-of-torch-compile-vs-triton/195604 "2024-01-17T22:48:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![marksaroufim](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/marksaroufim/32/36747_2.png) [@marksaroufim](https://discuss.pytorch.org/u/marksaroufim)\
**Post date:** [January 18, 2024, 11:06pm UTC](https://discuss.pytorch.org/t/choice-of-torch-compile-vs-triton/195604/2 "2024-01-18T23:06:10Z")

</div>

On GPUs `torch.compile()` will apply various compiler optimizations with the most important ones being cuda graphs and fusions. Fusions specifically are done by code generating triton kernels so `torch.compile()` is actually a great starting point for writing triton kernels and you can always take that and try to write something faster yourself.

From a recent talk I gave

 ![image](https://discuss.pytorch.org/uploads/default/original/3X/2/c/2cf008bd2a8bca80d6585c9570e7be3af197112c.jpeg)

---

_[View the full topic](https://discuss.pytorch.org/t/choice-of-torch-compile-vs-triton/195604)._
