Skip to content

Some wrong in sd3's lora training script #10591

@CuddleSabe

Description

@CuddleSabe

Describe the bug

transformer.to(accelerator.device, dtype=weight_dtype)

the transformer before accelerator.prepare should not convert to fp16 in mix precision;
it will broken the grad precision and result in worse training result

Reproduction

see the "/examples/research_projects/sd3_lora_colab/train_dreambooth_lora_sd3_miniature.py"

Logs

System Info

diffusers 0.31.0

Who can help?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleIssues that haven't received updates

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions