# How does torch.compile work with autograd?

**URL:** <https://dev-discuss.pytorch.org/t/how-does-torch-compile-work-with-autograd/1621>\
**Category:** Uncategorized\
**Created:** [October 30, 2023, 1:43pm UTC](https://dev-discuss.pytorch.org/t/how-does-torch-compile-work-with-autograd/1621 "2023-10-30T13:43:13Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![youkaichao](https://yyz2.discourse-cdn.com/flex036/user_avatar/dev-discuss.pytorch.org/youkaichao/32/1278_2.png) [@youkaichao](https://dev-discuss.pytorch.org/u/youkaichao)\
**Post date:** [October 31, 2023, 12:38am UTC](https://dev-discuss.pytorch.org/t/how-does-torch-compile-work-with-autograd/1621/7 "2023-10-31T00:38:34Z")

</div>

> [@Chillee](#):
>
> What do you mean by this?

I mean how to determine which intermediate variables to save for the most efficient backward. Still trying to understand the post [Min-cut optimal(\*) recomputation (i.e. activation checkpointing) with AOTAutograd - #9 by Chillee](https://dev-discuss.pytorch.org/t/min-cut-optimal-recomputation-i-e-activation-checkpointing-with-aotautograd/467/9) .

---

_[View the full topic](https://dev-discuss.pytorch.org/t/how-does-torch-compile-work-with-autograd/1621)._
