# For PyTorch, what is the recommended mode of operation? Eager mode or Lazy mode?

**URL:** https://forum.habana.ai/t/for-pytorch-what-is-the-recommended-mode-of-operation-eager-mode-or-lazy-mode/116
**Category:** FAQ
**Tags:** pytorch
**Created:** [June 30, 2021, 5:21am UTC](https://forum.habana.ai/t/for-pytorch-what-is-the-recommended-mode-of-operation-eager-mode-or-lazy-mode/116 "2021-06-30T05:21:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Greg\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.habana.ai/greg_s/32/33_2.png) [@Greg\_S](https://forum.habana.ai/u/Greg_S)
#### Post date: [June 30, 2021, 5:21am UTC](https://forum.habana.ai/t/for-pytorch-what-is-the-recommended-mode-of-operation-eager-mode-or-lazy-mode/116/1 "2021-06-30T05:21:24Z")

</div>

While designing a model architecture and debugging it, Eager mode will generally provide the desired level of interaction. However, once the model design is fixed, Lazy mode will generally provide faster training speed.

Users can refer to the [Pytorch User Guide](https://docs.habana.ai/en/latest/PyTorch_User_Guide/PyTorch_User_Guide.html?highlight=hmp#pytorch-habana-processing-unit-hpu-integration-architecture) for a detailed description of the modes and how they work with the SynapseAI SW stack.

---

<div class="post-metadata">

### Author: ![shachar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.habana.ai/shachar/32/159_2.png) [@shachar](https://forum.habana.ai/u/shachar)
#### Post date: [June 10, 2022, 1:09am UTC](https://forum.habana.ai/t/for-pytorch-what-is-the-recommended-mode-of-operation-eager-mode-or-lazy-mode/116/2 "2022-06-10T01:09:54Z")

</div>

Hi Greg,  
Can you estimate by what order of magnitude the Eager mode will generally be slower than the Lazy mode?

---

<div class="post-metadata">

### Author: ![Sayantan\_S](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Sayantan\_S](https://forum.habana.ai/u/Sayantan_S)
#### Post date: [June 15, 2022, 9:45pm UTC](https://forum.habana.ai/t/for-pytorch-what-is-the-recommended-mode-of-operation-eager-mode-or-lazy-mode/116/3 "2022-06-15T21:45:37Z")

</div>

Hi @shachar

Lazy mode will be significantly faster than eager mode, and the exact speedup will depend on the size/complexity of the model.

For a simple mnist example [here](https://github.com/HabanaAI/Model-References/tree/master/PyTorch/examples/computer_vision/hello_world), lazy mode is around 45% faster.
