huggingface / huggingface/diffusers
QuantizedFluxTransformer2DModel save bug
- Lingua principale
- Python
- Stelle
- 34.5k
- Fork
- 7.3k
- Merge medio
- 3g 3h
- PR unite (30g)
- 91
Descrizione
### Describe the bug
QuantizedFluxTransformer2DModel save bug
### Reproduction
```
class QuantizedFluxTransformer2DModel(QuantizedDiffusersModel):
base_class = FluxTransformer2DModel
transformer = FluxTransformer2DModel.from_pretrained(
'black-forest-labs/FLUX.1-Fill-dev', subfolder="transformer", torch_dtype=torch.bfloat16,
).to("cuda")
qtransformer = QuantizedFluxTransformer2DModel.quantize(transformer, weights=qfloat8)
# for param in qtransformer.parameters(): param.data = param.data.contiguous() # useless
qtransformer.save_pretrained('fluxfill_transformer_fp8')
```
### Logs
```shell
ValueError: You are trying to save a non contiguous tensor: `time_text_embed.timestep_embedder.linear_1.weight._data` which is not allowed. It either means you are trying to save tensors which are reference of each other in which case it's recommended to save only the full tensors, and reslice at load time, or simply call `.contiguous()` on your tensor to pack it before saving.
```
### System Info
python==3.12
torch==2.4.0 + cu121
transformers==4.47.0
optimum-quanto==0.2.6
diffusers main from 12.23
### Who can help?
_No response_
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Reproduce the failure using QuantizedFluxTransformer2DModel.quantize and qtransformer.save_pretrained with the supplied environment and model setup. Start by tracing how save_pretrained handles the reported non-contiguous time_text_embed.timestep_embedder.linear_1.weight._data tensor. Done means the quantized transformer saves successfully without requiring the commented manual contiguity workaround.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, pytorch
- Ambito
- machine-learning
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100