Repository: huggingface/optimum

Issue:
Untyped `dataclass` flieds in `OptimizationConfig`
### System Info

```shell
optimum_version: 1.8.3
```


### Who can help?

@regisss

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

```python
from optimum.onnxruntime import OptimizationConfig

OptimizationConfig(disable_group_norm_fusion=True)
```
Raises `TypeError: OptimizationConfig.__init__() got an unexpected keyword argument 'disable_group_norm_fusion'`

### Expected behavior

To set `disable_group_norm_fusion` to True.
The problem is in the [untyped fields](https://github.com/ericvsmith/dataclasses/issues/2) here:

https://github.com/huggingface/optimum/blob/e32ba52e4025692e1979cbbf0b4a55c02a3f2ac6/optimum/onnxruntime/configuration.py#L717-L722

Some of them have different names than in the doc:

https://github.com/huggingface/optimum/blob/e32ba52e4025692e1979cbbf0b4a55c02a3f2ac6/optimum/onnxruntime/configuration.py#L668-L679


Discussion:

Resolving patch:
diff --git a/optimum/onnxruntime/configuration.py b/optimum/onnxruntime/configuration.py
--- a/optimum/onnxruntime/configuration.py
+++ b/optimum/onnxruntime/configuration.py
@@ -669,13 +669,13 @@ class OptimizationConfig:
             Experimental argument. Use MultiHeadAttention instead of Attention operator, which has merged weights for Q/K/V projection,
             which might be faster in some cases since 3 MatMul is merged into one."
             "Note that MultiHeadAttention might be slower than Attention when qkv are not packed. "
-        enable_gemm_fast_gelu (`bool`, defaults to `True`):
+        enable_gemm_fast_gelu_fusion (`bool`, defaults to `False`):
             Enable GemmfastGelu fusion.
         use_raw_attention_mask (`bool`, defaults to `False`):
             Use raw attention mask. Use this option if your input is not right-side padding. This might deactivate fused attention and get worse performance.
-        disable_group_norm (`bool`, defaults to `False`):
+        disable_group_norm_fusion (`bool`, defaults to `True`):
             Do not fuse GroupNorm. Only works for model_type=unet.
-        disable_packed_kv (`bool`, defaults to `False`):
+        disable_packed_kv (`bool`, defaults to `True`):
             Do not use packed kv in cross attention. Only works for model_type=unet.
     """
 
@@ -715,11 +715,11 @@ class OptimizationConfig:
     disable_shape_inference: bool = False
 
     # ONNX Runtime 1.14.0 arguments
-    use_multi_head_attention = False
-    enable_gemm_fast_gelu_fusion = False
-    use_raw_attention_mask = False
-    disable_group_norm_fusion = True
-    disable_packed_kv = True
+    use_multi_head_attention: bool = False
+    enable_gemm_fast_gelu_fusion: bool = False
+    use_raw_attention_mask: bool = False
+    disable_group_norm_fusion: bool = True
+    disable_packed_kv: bool = True
 
     def __post_init__(self):
         def deprecate_renamed_attribute(old_name, new_name, mapping_func=None):


Test patch: