Skip to content

Conversation

dg845
Copy link
Contributor

@dg845 dg845 commented Aug 7, 2025

What does this PR do?

This PR implements a pipeline for the Dream 7B diffusion large language model (blog post, weights and code, repo). Dream is a masked (discrete) diffusion model for text which claims to perform comparably to similarly sized SOTA autoregressive LLMs such as Qwen 2.5 7B on NLP tasks and have superior performance on planning tasks.

Fixes #12017.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@yiyixuxu
@a-r-r-o-w
@ntoxeg

@dg845 dg845 mentioned this pull request Aug 7, 2025
2 tasks
@dg845
Copy link
Contributor Author

dg845 commented Aug 15, 2025

@yiyixuxu @a-r-r-o-w the Dream 7B model uses a transformers-style custom tokenizer, which I believe is based on GPT2Tokenizer but with different pre-tokenization rules. Since this tokenizer is not in transformers, should I open a PR there to add it? And if so, do you think the Dream transformer should also be added to transformers? The original transformer implementation is also transformers-compatible.

@a-r-r-o-w
Copy link
Member

In case of certain custom implementations, we try to implement and keep the relevant files within diffusers. Some examples I could quickly find are:

Maybe in this case you could create a tokenizer_gpt.py file within the pipeline directory to use it? WDYT @yiyixuxu?

I don't think the model implementation can live in transformers if we're using it for diffusion sampling. For example, Cosmos 1.0 released with an autoregressive and diffusion version, but we have two different implementations and PRs for support it in both libraries. So, let's maintain it here :)

@dg845
Copy link
Contributor Author

dg845 commented Aug 26, 2025

Hi @a-r-r-o-w, I think this PR is ready for an initial design review :).

@dg845 dg845 marked this pull request as ready for review August 26, 2025 01:36
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

Successfully merging this pull request may close these issues.

Dream 7B
2 participants