-
Notifications
You must be signed in to change notification settings - Fork 1.1k
enhancement: extend to dmd2 to image generation + add flux, qwen image pipelines #2974
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
Merged
hsliuustc0106
merged 8 commits into
vllm-project:main
from
ayushag-nv:ayushag/dmd2-enhancement
May 8, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
36c5bc6
chore: added dmd2 config
ayushag-nv a73f65c
chore: added stochastic sampling + defense against scheduler
ayushag-nv 8bba595
chore: add flux and Qwen Image Pipeline
ayushag-nv 5396849
fix: minor fixes
ayushag-nv 3957857
Merge branch 'main' into ayushag/dmd2-enhancement
ayushag-nv f4530ad
Merge branch 'main' into ayushag/dmd2-enhancement
hsliuustc0106 e5f98bd
Merge branch 'main' into ayushag/dmd2-enhancement
ayushag-nv 8803c08
fix: lint
ayushag-nv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
|
|
||
| from vllm_omni.diffusion.models.dmd2.config import DMD2Config | ||
| from vllm_omni.diffusion.models.dmd2.mixin import DMD2PipelineMixin | ||
|
|
||
| __all__ = [ | ||
| "DMD2Config", | ||
| "DMD2PipelineMixin", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from dataclasses import dataclass | ||
| from typing import Literal, get_args | ||
|
|
||
| import torch | ||
|
|
||
| Solver = Literal["ode", "sde"] | ||
|
|
||
|
|
||
| @dataclass | ||
| class DMD2Config: | ||
| """Inference-time contract for a FastGen DMD2-distilled checkpoint.""" | ||
|
|
||
| num_inference_steps: int = 4 | ||
| denoising_timesteps: list[int] | None = None | ||
| solver: Solver = "ode" | ||
| guidance_scale: float = 1.0 | ||
|
|
||
| def __post_init__(self) -> None: | ||
| if self.solver not in get_args(Solver): | ||
| raise ValueError(f"DMD2Config.solver must be one of {list(get_args(Solver))}, got {self.solver!r}") | ||
|
|
||
| @classmethod | ||
| def from_model_index(cls, model_index: dict) -> DMD2Config: | ||
| """Read the `dmd2_config` block from a model_index.json dict. Missing block → defaults.""" | ||
| block = model_index.get("dmd2_config", {}) | ||
| solver = block.get("solver", cls.solver) | ||
| if isinstance(solver, str): | ||
| solver = solver.strip().lower() | ||
| return cls( | ||
| num_inference_steps=block.get("num_inference_steps", cls.num_inference_steps), | ||
| denoising_timesteps=block.get("denoising_timesteps"), | ||
| solver=solver, | ||
| guidance_scale=block.get("guidance_scale", cls.guidance_scale), | ||
| ) | ||
|
|
||
| def resolve_timesteps(self) -> list[int]: | ||
| if self.denoising_timesteps is not None: | ||
| return list(self.denoising_timesteps) | ||
| # Uniformly spaced timesteps from 999 down toward 0, excluding the final 0. | ||
| ts = torch.linspace(999, 0, self.num_inference_steps + 1)[:-1] | ||
| return ts.to(torch.int32).tolist() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.