# Optimum vs Accelerate

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-vs-accelerate%2F32528%3E%5C
**Category:** 🤗Optimum\
**Created:** [February 25, 2023, 11:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-vs-accelerate%2F32528 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjeromeku)%5C
**Post date:** [February 25, 2023, 11:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-vs-accelerate%2F32528%2F1 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ffxmarty)%5C
**Post date:** [February 27, 2023, 10:36am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-vs-accelerate%2F32528%2F2 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJingya)%5C
**Post date:** [February 27, 2023, 11:02am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-vs-accelerate%2F32528%2F3 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjeromeku)%5C
**Post date:** [March 2, 2023, 4:20am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-vs-accelerate%2F32528%2F4 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ffxmarty)%5C
**Post date:** [March 2, 2023, 1:53pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-vs-accelerate%2F32528%2F5 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjeromeku)%5C
**Post date:** [March 2, 2023, 11:56pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-vs-accelerate%2F32528%2F6 "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.
