main
py 26 lines 1007 Bytes
Raw
1 # SPDX-License-Identifier: Apache-2.0
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 """Configuration for discrete diffusion (dLLM) models."""
4
5 from pydantic import Field
6
7 from vllm.config.utils import config
8
9
10 @config
11 class DiffusionConfig:
12 """Configuration for discrete diffusion language models (dLLMs).
13
14 dLLMs generate tokens via iterative denoising over a fixed-length canvas
15 rather than left-to-right autoregressive decoding. They reuse the
16 speculative-decoding data path (draft token ids, scheduled spec decode
17 tokens) with overloaded semantics for block-based generation.
18 """
19
20 canvas_length: int = Field(default=None, gt=0) # type: ignore[assignment]
21 """Length of the denoising canvas (block). Also determines the number of
22 speculative tokens scheduled per step."""
23
24 max_denoising_steps: int | None = None
25 """Maximum number of denoising iterations per canvas block.
26 If not set, read from the model's generation_config.json."""