# Model being occupying 2.5x the size - loading and running

**URL:** <https://discuss.pytorch.org/t/model-being-occupying-2-5x-the-size-loading-and-running/205523>\
**Category:** Uncategorized\
**Created:** [June 29, 2024, 10:13pm UTC](https://discuss.pytorch.org/t/model-being-occupying-2-5x-the-size-loading-and-running/205523 "2024-06-29T22:13:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [June 30, 2024, 9:27pm UTC](https://discuss.pytorch.org/t/model-being-occupying-2-5x-the-size-loading-and-running/205523/3 "2024-06-30T21:27:25Z")

</div>

Besides the model parameters and buffers, the model execution will also use memory to store intermediate forward activations needed to compute the gradients. You could use e.g. [this until.](https://discuss.pytorch.org/t/number-of-activations-without-loading-the-model/202419/2) to estimate the memory usage.

If you don’t want to compute the gradients at all, you should wrap the forward pass into a `torch.no_grad()` context, if that’s not already done.

---

_[View the full topic](https://discuss.pytorch.org/t/model-being-occupying-2-5x-the-size-loading-and-running/205523)._
