vllm_omni.diffusion.diffusion_engine ¶
DiffusionEngine ¶
The diffusion engine for vLLM-Omni diffusion models.
execute_fn instance-attribute ¶
post_process_func instance-attribute ¶
post_process_func = get_diffusion_post_process_func(
od_config
)
scheduler instance-attribute ¶
scheduler: SchedulerInterface = scheduler or (
StepScheduler()
if step_execution
else RequestScheduler()
)
step_execution instance-attribute ¶
add_req_and_wait_for_response ¶
add_req_and_wait_for_response(
request: OmniDiffusionRequest,
) -> DiffusionOutput
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 |
make_engine staticmethod ¶
make_engine(
config: OmniDiffusionConfig,
scheduler: SchedulerInterface | None = None,
) -> DiffusionEngine
Factory method to create a DiffusionEngine instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config | OmniDiffusionConfig | The configuration for the diffusion engine. | required |
Returns:
| Type | Description |
|---|---|
DiffusionEngine | An instance of DiffusionEngine. |
profile ¶
get_dummy_run_num_frames ¶
Get num_frames for the dummy warmup run. Returns 0 to skip warmup.
get_extra_body_params ¶
Return the set of extra_body keys accepted by a pipeline.
Each pipeline can declare EXTRA_BODY_PARAMS: ClassVar[frozenset[str]] to advertise which request-level parameters should be forwarded from extra_body to OmniDiffusionSamplingParams.extra_args. Returns an empty frozenset when the pipeline does not declare any.
get_extra_output_params ¶
Return the set of custom_output keys to expose in API response metrics.
Each pipeline can declare EXTRA_OUTPUT_PARAMS: ClassVar[frozenset[str]] to advertise which DiffusionOutput.custom_output keys should be copied into the response metrics dict. Returns an empty frozenset when the pipeline does not declare any.
supports_multimodal_input ¶
supports_multimodal_input(
od_config: OmniDiffusionConfig,
) -> tuple[bool, bool]