# Optimize AND quantize with Optimum

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimize-and-quantize-with-optimum%2F23675%3E%5C
**Category:** 🤗Optimum\
**Created:** [September 27, 2022, 11:51am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimize-and-quantize-with-optimum%2F23675 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fddahlmeier)%5C
**Post date:** [February 10, 2024, 9:12am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimize-and-quantize-with-optimum%2F23675%2F12 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimum-library-optimization-and-quantization-fails%2F72629%2F2)

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Foptimize-and-quantize-with-optimum%2F23675)._
