vllm.v1.kv_offload.cpu.platforms.base
¶
Abstractions for a platform runtime used by the CPU offload worker.
A runtime supplies everything that is platform-specific: capabilities, host
registration, capture relaxation, and the configuration of the copy mechanism
(see engines/). It does not implement copies itself. The factory that picks
a runtime by platform lives in factory.py.
Classes:
-
DeviceRuntime–Platform-specific services needed by the CPU offload worker.
-
RuntimeCapabilities–What a platform runtime can do for the CPU offload worker.
DeviceRuntime
¶
Bases: ABC
Platform-specific services needed by the CPU offload worker.
Methods:
-
create_copy_engine–Create the copy engine for one transfer direction.
-
register_host–Register a host range for direct device access.
-
relax_stream_capture–Allow host registration while another thread captures a graph.
-
unregister_host–Release a range previously registered by
register_host.
create_copy_engine(*, device_to_cpu, host_memory_is_pinned, page_sizes)
abstractmethod
¶
Create the copy engine for one transfer direction.
register_host(ptr, num_bytes)
¶
Register a host range for direct device access.
Returns True when the range was registered and later needs
unregister_host; registration is a bandwidth optimization, so a
False return only means the range stays pageable.
relax_stream_capture()
¶
Allow host registration while another thread captures a graph.
unregister_host(ptr)
¶
Release a range previously registered by register_host.
RuntimeCapabilities
dataclass
¶
What a platform runtime can do for the CPU offload worker.