# Optimum vs Accelerate

**URL:** <https://discuss.huggingface.co/t/optimum-vs-accelerate/32528>\
**Category:** 🤗Optimum\
**Created:** [February 25, 2023, 11:17pm UTC](https://discuss.huggingface.co/t/optimum-vs-accelerate/32528 "2023-02-25T23:17:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeromeku](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jeromeku](https://discuss.huggingface.co/u/jeromeku)\
**Post date:** [February 25, 2023, 11:17pm UTC](https://discuss.huggingface.co/t/optimum-vs-accelerate/32528/1 "2023-02-25T23:17:49Z")

</div>

What are the key differences between HF Accelerate and HF Optimum? Can they be used together?

---

<div class="post-metadata">

**Author:** ![fxmarty](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fxmarty/32/23782_2.png) [@fxmarty](https://discuss.huggingface.co/u/fxmarty)\
**Post date:** [February 27, 2023, 10:36am UTC](https://discuss.huggingface.co/t/optimum-vs-accelerate/32528/2 "2023-02-27T10:36:43Z")

</div>

Hi @jeromeku ,

Accelerate is mainly used for distributed training on a variety of hardware, with techniques as offloading and data parallelism.

Optimum is more a toolkit, giving access to several tools either geared towards speeding up training or inference, or towards deployment:

- ONNX, TFLite export of Transformers and Diffusers models.
- ONNX Runtime integration (including quantization, ORT optimizations)
- [PyTorch’s BetterTransformer](https://pytorch.org/blog/a-better-transformer-for-fast-transformer-encoder-inference/) integration (this one is compatible with accelerate!)
- Integration with OpenVINO, NNCF, Intel Neural Compressor (including quantization & pruning)
- Integration with Habana Gaudi hardware for training
- Integration with Graphcore IPUs for training

Feel free to refer to the documentations: [🤗 Optimum](https://huggingface.co/docs/optimum/) & [Accelerate](https://huggingface.co/docs/accelerate/)

---

<div class="post-metadata">

**Author:** ![Jingya](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/jingya/32/29444_2.png) [@Jingya](https://discuss.huggingface.co/u/Jingya)\
**Post date:** [February 27, 2023, 11:02am UTC](https://discuss.huggingface.co/t/optimum-vs-accelerate/32528/3 "2023-02-27T11:02:28Z")

</div>

Just to extend the previous answer, Optimum.onnxruntime module also supports training acceleration with `ORTTrainer` class.

---

<div class="post-metadata">

**Author:** ![jeromeku](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jeromeku](https://discuss.huggingface.co/u/jeromeku)\
**Post date:** [March 2, 2023, 4:20am UTC](https://discuss.huggingface.co/t/optimum-vs-accelerate/32528/4 "2023-03-02T04:20:54Z")

</div>

Thanks for the responses! So `Accelerate` is a general framework for distributed training / inference while `Optimum` is oriented more towards architecture-specific optimizations which can’t be easily abstracted under a single framework. Would be interesting to compare / learn from other optimization frameworks (e.g., ColossalAI, Alpa) – let me know how I can contribute!

---

<div class="post-metadata">

**Author:** ![fxmarty](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fxmarty/32/23782_2.png) [@fxmarty](https://discuss.huggingface.co/u/fxmarty)\
**Post date:** [March 2, 2023, 1:53pm UTC](https://discuss.huggingface.co/t/optimum-vs-accelerate/32528/5 "2023-03-02T13:53:44Z")

</div>

For sure comparing with what other framework propose is interesting! There are so many out there that it is easy to get lost. On the inference side, I think a comprehensive benchmark across the most-popular deployment tools is still something to be done.

---

<div class="post-metadata">

**Author:** ![jeromeku](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jeromeku](https://discuss.huggingface.co/u/jeromeku)\
**Post date:** [March 2, 2023, 11:56pm UTC](https://discuss.huggingface.co/t/optimum-vs-accelerate/32528/6 "2023-03-02T23:56:11Z")

</div>

Great! Is there a working group around this currently? Perhaps a good starting point is to compile a list of frameworks bucketed by training and inference as well as currently available evaluation datasets / leaderboards by domain / dataset.
