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

Discrepancy in Timestep Ranges between LFM and DiT Repositories #12

Open
denemmy opened this issue Apr 12, 2024 · 0 comments
Open

Discrepancy in Timestep Ranges between LFM and DiT Repositories #12

denemmy opened this issue Apr 12, 2024 · 0 comments

Comments

@denemmy
Copy link

denemmy commented Apr 12, 2024

Hello,

I am currently exploring the use of DiT model for diffusion/flow matching and have been reviewing both the LFM and DiT repositories. I have noticed a potential discrepancy in how timesteps are handled between these two implementations, specifically regarding the range of timesteps and their scaling in the timestep_embedding function.

In the DiT repository, timesteps are scaled from 0 to 1000:
https://github.com/facebookresearch/DiT/blob/ed81ce2229091fd4ecc9a223645f95cf379d582b/train.py#L204

However, in the LFM repository, timesteps appear to be taken from a normalized range of 0 to 1:

t = torch.rand((z_0.size(0),), dtype=dtype, device=device)

But both repositories use a same timestep_embedding function which does not inherently account for different ranges of input timesteps:
DiT: https://github.com/facebookresearch/DiT/blob/ed81ce2229091fd4ecc9a223645f95cf379d582b/models.py#L41
LFM:

def timestep_embedding(t, dim, max_period=10000):

Given the variations in timestep scaling, the resulting embeddings from each model will inherently differ, potentially affecting their performance and behavior.

Could you please clarify if this difference in the range of timesteps is intentional?

Thank you for your help and for the great work on these projects!

Best regards,
Danil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant