vllm_omni.diffusion.worker.input_batch ¶
Diffusion input-batch structures following the MRV2-style vLLM layout.
Request states remain the only persistent source of truth. Static tensors are normalized/padded onto the request state once, while :class:InputBatch assembles an ephemeral step-local view. Dynamic tensors are re-gathered every step, and step outputs are scattered back into request states by scatter_latents() using idx_mapping.
InputBatch dataclass ¶
Ephemeral step-level batch view.
Static request-local tensors are normalized and padded onto DiffusionRequestState itself, making the request state the persistent source of truth. InputBatch only assembles a contiguous view for the current step and refreshes dynamic fields in-place when composition is unchanged.
negative_txt_seq_lens class-attribute instance-attribute ¶
make_batch classmethod ¶
make_batch(
states: Sequence[DiffusionRequestState],
idx_mapping: Tensor | None = None,
cached_batch: InputBatch | None = None,
) -> InputBatch
Build a temporary step-local batch view from request states.
scatter_latents ¶
scatter_latents(
states: Sequence[DiffusionRequestState],
input_batch: InputBatch,
) -> None
Scatter the step-updated latents back into persistent request states.
This is the CPU fallback of the vLLM-style post-update path. The mapping is driven entirely by input_batch.idx_mapping_np so the runner remains free to keep request states in its own persistent storage layout.