Fix save_pretrained for quantized models with custom serialization
Author: 480284856
Pull request: yes

## Problem
When calling `save_pretrained()` on mxfp4 quantized models, a `NotImplementedError` was raised because `revert_weight_conversion()` tried to reverse operations that don't implement `reverse_op`.

## Environment

- **Transformers Version**: Commit `a7f29523361b2cc12e51c1f5133d95f122f6f45c` (main branch)
- **Python Version**: 3.10.12
- **Model**: `openai/gpt-oss-20b` (mxfp4 quantized)

## Reproduction Code

```python
from transformers import AutoModelForCausalLM

# Load the mxfp4 quantized model
model = AutoModelForCausalLM.from_pretrained("openai/gpt-oss-20b")

# Attempt to save the model
model.save_pretrained("openai/gpt-oss-20b-hf")
```

## Error Traceback

```
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
Cell In[1], line 3
      1 from transformers import AutoModelForCausalLM
      2 model = AutoModelForCausalLM.from_pretrained("openai/gpt-oss-20b")
----> 3 model.save_pretrained("openai/gpt-oss-20b-hf")

File /workspace/transformers/src/transformers/modeling_utils.py:3237, in PreTrainedModel.save_pretrained(self, save_directory, is_main_process, state_dict, push_to_hub, max_shard_size, variant, token, save_peft_format, save_original_format, **kwargs)
   3235 # Revert all renaming and/or weight operations
   3236 if save_original_format:
-> 3237     state_dict = revert_weight_conversion(model_to_save, state_dict)

File /workspace/transformers/src/transformers/core_model_loading.py:1164, in revert_weight_conversion(model, state_dict)
   1161     return state_dict
   1163 # Reverse all Transform to correctly match keys
-> 1164 reverse_weight_conversion = [conversion.reverse_transform() for conversion in weight_conversions]

File /workspace/transformers/src/transformers/core_model_loading.py:1164, in <listcomp>(.0)
-> 1164 reverse_weight_conversion = [conversion.reverse_transform() for conversion in weight_conversions]

File /workspace/transformers/src/transformers/core_model_loading.py:531, in WeightTransform.reverse_transform(self)
   528 # Add the reverse ops if applicable (it needs to be provided at __init__)
   529 if hasattr(self, "operations"):
   530     # All reverse ops, in reverse order
-> 531     kwargs["operations"] = [op.reverse_op for op in self.operations[::-1]]

File /workspace/transformers/src/transformers/core_model_loading.py:531, in <listcomp>(.0)
-> 531     kwargs["operations"] = [op.reverse_op for op in self.operations[::-1]]

File /workspace/transformers/src/transformers/core_model_loading.py:102, in ConversionOps.reverse_op(self)
   100 @property
   101 def reverse_op(self) -> ConversionOps:
-> 102     raise NotImplementedError

NotImplementedError: 
```
## Solution
Skip `revert_weight_conversion()` when the quantizer has already provided the state_dict via `get_state_dict_and_metadata()`, since quantizers handle their own serialization logic.

## Changes
- Added `quantizer_provided_state_dict` flag to track when quantizer provides state_dict
- Skip `revert_weight_conversion()` when quantizer already provided serialized state_dict

Fixes the issue where mxfp4 quantized models cannot be saved due to missing `reverse_op` implementation.

> by Claude Opus 4.5

Comments:
cc @SunMarc I think we plan to bring back serialization 

hmmm indeed, we need to fix this cc @MekkCyber