vllm_omni.diffusion.diffusion_engine ¶
DiffusionEngine ¶
The diffusion engine for vLLM-Omni diffusion models.
action_post_process_func instance-attribute ¶
action_post_process_func = (
get_diffusion_action_post_process_func(od_config)
)
default_diffusion_model_runner_cls class-attribute instance-attribute ¶
default_diffusion_model_runner_cls: str | None = None
post_process_func instance-attribute ¶
post_process_func = get_diffusion_post_process_func(
od_config
)
scheduler instance-attribute ¶
scheduler: SchedulerInterface = scheduler or (
StepScheduler()
if self.step_execution
else RequestScheduler()
)
step_execution instance-attribute ¶
supports_request_batch instance-attribute ¶
add_req_and_wait_for_response ¶
add_req_and_wait_for_response(
request: OmniDiffusionRequest,
) -> DiffusionOutput
async_add_req_and_stream_response ¶
async_add_req_and_stream_response(
request: OmniDiffusionRequest,
) -> AsyncGenerator[DiffusionOutput, None]
async_add_req_and_wait_for_response async ¶
async_add_req_and_wait_for_response(
request: OmniDiffusionRequest,
) -> DiffusionOutput
async_collective_rpc async ¶
async_collective_rpc(
method: str,
timeout: float | None = None,
args: tuple = (),
kwargs: dict | None = None,
unique_reply_rank: int | None = None,
) -> Any
Async variant of :meth:collective_rpc for event-loop callers.
Mirrors :meth:async_add_req_and_wait_for_response: enqueue a task keyed by a future and await the result without blocking the loop.
collective_rpc ¶
collective_rpc(
method: str,
timeout: float | None = None,
args: tuple = (),
kwargs: dict | None = None,
unique_reply_rank: int | None = None,
) -> Any
Call a method on worker processes and get results immediately.
The call is enqueued and executed by the engine's busy loop between scheduler steps, so it is naturally serialized against per-request execute_fn() invocations without any explicit mutual-exclusion lock.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method | str | The method name (str) to execute on workers | required |
timeout | float | None | Optional timeout in seconds | None |
args | tuple | Positional arguments for the method | () |
kwargs | dict | None | Keyword arguments for the method | None |
unique_reply_rank | int | None | If set, only get reply from this rank | None |
Returns:
| Type | Description |
|---|---|
Any | Single result if unique_reply_rank is provided, otherwise list of results |
get_streaming_result async ¶
get_streaming_result(
request_id: str,
) -> AsyncGenerator[DiffusionOutput, None]
Mirrors get_result() in non-streaming mode.
make_engine staticmethod ¶
make_engine(
config: OmniDiffusionConfig,
scheduler: SchedulerInterface | None = None,
) -> DiffusionEngine
Factory method to create the engine selected by config.engine_backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config | OmniDiffusionConfig | The configuration for the diffusion engine. | required |
Returns:
| Type | Description |
|---|---|
DiffusionEngine | An instance of the resolved |
postprocess_output ¶
postprocess_output(
request: OmniDiffusionRequest,
output: DiffusionOutput,
diffusion_engine_start_time: float,
preprocess_time: float,
exec_total_time: float,
) -> list[OmniRequestOutput]
Convert a DiffusionOutput to a list of OmniRequestOutput, attaching profiling metrics.
profile ¶
resolve_engine_class staticmethod ¶
resolve_engine_class(
config: OmniDiffusionConfig,
) -> type[DiffusionEngine]
Resolve the engine class selected by config.engine_backend.
Mirrors DiffusionExecutor.get_class: accepts "default", a DiffusionEngine subclass, or an import-path string (e.g. a deploy config's engine_backend). Kept separate from :meth:make_engine so the selection is testable without constructing an engine (which runs a dummy forward).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config | OmniDiffusionConfig | The configuration for the diffusion engine. | required |
Returns:
| Type | Description |
|---|---|
type[DiffusionEngine] | The |
step_streaming async ¶
step_streaming(
request: OmniDiffusionRequest,
) -> AsyncGenerator[list[OmniRequestOutput], None]
get_dummy_run_num_frames ¶
Get num_frames for the dummy warmup run. Returns 0 to skip warmup.
supports_multimodal_input ¶
supports_multimodal_input(
od_config: OmniDiffusionConfig,
) -> tuple[bool, bool]