# Optimize AND quantize with Optimum

**URL:** <https://discuss.huggingface.co/t/optimize-and-quantize-with-optimum/23675>\
**Category:** 🤗Optimum\
**Created:** [September 27, 2022, 11:51am UTC](https://discuss.huggingface.co/t/optimize-and-quantize-with-optimum/23675 "2022-09-27T11:51:11Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![ddahlmeier](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@ddahlmeier](https://discuss.huggingface.co/u/ddahlmeier)\
**Post date:** [February 10, 2024, 9:12am UTC](https://discuss.huggingface.co/t/optimize-and-quantize-with-optimum/23675/12 "2024-02-10T09:12:28Z")

</div>

I managed to make the example from the blog [Accelerated Inference with Optimum and Transformers Pipelines](https://huggingface.co/blog/optimum-inference)  
work with the advise from this thread, but since this week the code breaks when quantizing the model  
with this error

```auto
RuntimeError: Unable to find data type for weight_name='/roberta/encoder/layer.0/attention/output/dense/MatMul_output_0'

```

I have created a new post to explain the steps how to reproduce the error [Optimum library optimization and quantization fails - #2 by ddahlmeier](https://discuss.huggingface.co/t/optimum-library-optimization-and-quantization-fails/72629/2)

---

_[View the full topic](https://discuss.huggingface.co/t/optimize-and-quantize-with-optimum/23675)._
