Skip to content

vllm.v1.hisparse.backend

Device operations used by the common HiSparse runtime and connector.

Classes:

HiSparseBackend

Methods:

create_ipc_event()

Create an event that can be exported to another process.

gather_resident_rows(source, destination, row_ids)

Copy resident rows into staging without changing their payload format.

prepare_kv_cache_views(kv_cache_config, kv_caches, forward_context)

Adapt device views before runtime binding; retain allocation ownership.

Called once per cache initialization, inside the common rollback scope. Backends must not put per-step metadata or transfers in this hook.

swap_blocks_batch(src, dst, sizes)

Enqueue device-to-host copies on the current stream.

validate_kv_cache_config(kv_cache_config)

Validate device cache formats before allocating or pinning storage.

ROCmHiSparseBackend

Bases: CUDAHiSparseBackend

The CUDA backend through HIP, with one private host pool per rank.

Local TP ranks do not share one host pool: on ROCm 10 (HIP 7.15) a wait on an interprocess event returns before an earlier async device-to-host copy on the recording stream completes, so readers could see partial mirror writes. Each rank registers its own contiguous pool instead.