[Quant] Fix accuracy_level config option for MatMul 4bits quantizer (#20146)

### Description
Fixes code that extracts the accuracy level when creating a MatMulNBits
node in the `DefaultWeightOnlyQuantizer` class.


### Motivation and Context
Error from line 443: `AttributeError: 'DefaultWeightOnlyQuantizer'
object has no attribute 'accuracy_level'`. The solution is to access
`self.config.accuracy_level` instead of `self.accuracy_level`.

Relevant commit: https://github.com/microsoft/onnxruntime/pull/19106
This commit is contained in:
Adrian Lizarraga 2024-03-29 11:54:55 -07:00 committed by GitHub
parent 17919717b5
commit b1a5eb255e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -440,7 +440,7 @@ class DefaultWeightOnlyQuantizer:
kwargs["bits"] = 4
kwargs["block_size"] = self.config.block_size
if self.config.accuracy_level is not None:
kwargs["accuracy_level"] = self.accuracy_level
kwargs["accuracy_level"] = self.config.accuracy_level
matmul_q4_node = onnx.helper.make_node(
"MatMulNBits",