vllm.v1.executor.abstract
¶
Classes:
-
Executor–Abstract base class for vLLM executors.
Executor
¶
Bases: ABC
Abstract base class for vLLM executors.
An executor is responsible for executing the model on one device, or it can be a distributed executor that can execute the model on multiple devices.
Methods:
-
check_health–Checks if the executor is healthy. If not, it should raise an
-
collective_rpc–Execute an RPC call on all workers.
-
compile_or_warm_up_model–Compile/warm up the model and capture cudagraphs on workers.
-
disable_extensible_kv_cache–Turn the extensible KV cache off here and on every worker.
-
execute_dummy_batch–Returns the iteration records the output worker has completed.
-
extend_kv_cache–Commit the final size of an extensible KV cache on the workers.
-
extensible_kv_cache_unsupported_reason–Why the extensible KV cache cannot be used on some worker, if so.
-
get_supported_kv_cache_layouts–Layouts each worker's backends support, most preferred first.
-
init_kv_output_aggregator–Init KVOutputAggregator.
-
initialize_from_config–Initialize the KV caches on the underlying workers.
-
register_failure_callback–Register a function to be called if the executor enters a permanent
-
reset_encoder_cache–Reset the encoder cache in each worker to clear cached encoder outputs.
-
reset_mm_cache–Reset the multi-modal cache in each worker.
-
set_kv_cache_layout–Publish the resolved KV cache layout and CP interleave size.
-
set_mamba_block_size–Publish the Mamba block size resolved for the whole model.
-
shutdown–Shutdown the executor.
-
supports_async_scheduling–Whether the executor supports async scheduling.
check_health()
abstractmethod
¶
Checks if the executor is healthy. If not, it should raise an exception.
collective_rpc(method, timeout=None, args=(), kwargs=None, non_block=False)
abstractmethod
¶
Execute an RPC call on all workers.
Parameters:
-
(method¶str | Callable[[WorkerBase], _R]) –Name of the worker method to execute, or a callable that is serialized and sent to all workers to execute.
If the method is a callable, it should accept an additional
selfargument, in addition to the arguments passed inargsandkwargs. Theselfargument will be the worker object. -
(timeout¶float | None, default:None) –Maximum time in seconds to wait for execution. Raises a
TimeoutErroron timeout.Nonemeans wait indefinitely. -
(args¶tuple, default:()) –Positional arguments to pass to the worker method.
-
(kwargs¶dict | None, default:None) –Keyword arguments to pass to the worker method.
-
(non_block¶bool, default:False) –If
True, returns a list of Futures instead of waiting for the results.
Returns:
Note
It is recommended to use this API to only pass control messages, and set up data-plane communication to pass data.
compile_or_warm_up_model()
¶
Compile/warm up the model and capture cudagraphs on workers.
disable_extensible_kv_cache(reason)
¶
Turn the extensible KV cache off here and on every worker.
execute_dummy_batch()
¶
Returns the iteration records the output worker has completed.
extend_kv_cache(num_blocks)
¶
Commit the final size of an extensible KV cache on the workers.
extensible_kv_cache_unsupported_reason(layer_configs)
¶
Why the extensible KV cache cannot be used on some worker, if so.
get_supported_kv_cache_layouts()
¶
Layouts each worker's backends support, most preferred first.
init_kv_output_aggregator(connector)
¶
Init KVOutputAggregator.
initialize_from_config(kv_cache_configs)
¶
Initialize the KV caches on the underlying workers.
register_failure_callback(callback)
¶
Register a function to be called if the executor enters a permanent failed state.
reset_encoder_cache()
¶
Reset the encoder cache in each worker to clear cached encoder outputs.
reset_mm_cache()
¶
Reset the multi-modal cache in each worker.
set_kv_cache_layout(layout_name, cp_kv_cache_interleave_size)
¶
Publish the resolved KV cache layout and CP interleave size.
set_mamba_block_size(mamba_block_size)
¶
Publish the Mamba block size resolved for the whole model.
shutdown()
¶
Shutdown the executor.
supports_async_scheduling()
classmethod
¶
Whether the executor supports async scheduling.
_check_worker_profile_kwargs(worker_cls, kwargs)
¶
Raise if the worker's profile cannot accept the given overrides.