# Why is \`accelerator.save\` saving once for each node?

**URL:** <https://discuss.huggingface.co/t/why-is-accelerator-save-saving-once-for-each-node/22282>\
**Category:** 🤗Accelerate\
**Created:** [August 29, 2022, 7:33pm UTC](https://discuss.huggingface.co/t/why-is-accelerator-save-saving-once-for-each-node/22282 "2022-08-29T19:33:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VictorSanh](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/victorsanh/32/21405_2.png) [@VictorSanh](https://discuss.huggingface.co/u/VictorSanh)\
**Post date:** [August 29, 2022, 7:33pm UTC](https://discuss.huggingface.co/t/why-is-accelerator-save-saving-once-for-each-node/22282/1 "2022-08-29T19:33:10Z")

</div>

Probably a dumb question: why is `accelerator.save` once for each node instead of once for all nodes? i.e. conditioned `local_process_index==0` instead of `process_index==0`

see [accelerate/other.py at cb54e1023e17763fa7f11d1de1307f85ba8b6c31 · huggingface/accelerate · GitHub](https://github.com/huggingface/accelerate/blob/cb54e1023e17763fa7f11d1de1307f85ba8b6c31/src/accelerate/utils/other.py#L75) 🙂

---

<div class="post-metadata">

**Author:** ![smangrul](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/smangrul/32/3791_2.png) [@smangrul](https://discuss.huggingface.co/u/smangrul)\
**Post date:** [August 30, 2022, 4:05am UTC](https://discuss.huggingface.co/t/why-is-accelerator-save-saving-once-for-each-node/22282/2 "2022-08-30T04:05:00Z")

</div>

Hello, I think it is done so that the user can load the model on any node later on. @sgugger and @muellerzr might have more to add on this.

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](https://discuss.huggingface.co/u/sgugger)\
**Post date:** [August 31, 2022, 8:12pm UTC](https://discuss.huggingface.co/t/why-is-accelerator-save-saving-once-for-each-node/22282/3 "2022-08-31T20:12:54Z")

</div>

Exactly. We could add an option for multinode systems that share the same file storage though.
