Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuantizedFluxTransformer2DModel save bug #10379

Open
huangjun12 opened this issue Dec 25, 2024 · 0 comments
Open

QuantizedFluxTransformer2DModel save bug #10379

huangjun12 opened this issue Dec 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@huangjun12
Copy link

huangjun12 commented Dec 25, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant