Skip to content

Running diffusers with torch-DDP leads to warning on stride mismatch #3809

Closed
@eeshandhekane

Description

@eeshandhekane

Describe the bug

Hey folks!
First off, thanks a lot for the amazing work with diffusers!
Recently, we have observed a warning while using diffusers-based models and running scripts.
We also observe similar warning while using only the models provided in diffusers/models/.
While this error might not be critical, we wanted to highlight the issue.
Thanks in advance!

Reproduction

Below are the steps that can be taken to observe this warning:

  1. Download the diffusers repository as mentioned in the documentation.
  2. Set a run with train_unconditional.py script as mentioned in the Unconditional image generation tutorial.
  3. Use vanilla torch DDP.

With this setup, we observe that we hit a warning about stride mismatch in the gradients and the bucket view:
warning-image

Logs

No response

System Info

We are using the following version of different packages:
Diffusers: diffusers==0.15.0
Torch: torch==1.13.0
Python: Python 3.9.16

Who can help?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions