vllm.distributed.kv_transfer.kv_connector.v1.hisparse.worker
¶
HiSparse worker-side host/hot state and data movement.
Classes:
-
HiSparseConnectorWorker–Own HiSparse host/hot state and execute its worker-side transfers.
HiSparseConnectorWorker
¶
Own HiSparse host/hot state and execute its worker-side transfers.
Methods:
-
invalidate_blocks–Invalidate recycled host slots in this worker's leader runtimes.
-
take_completed_host_copies–Drain host copies this worker has enqueued for this step.
_finish_previous_step()
¶
Mirror the previous step's draft-layer rows, then hand its pages over.
Runs before this step's work, so after the previous step's drafter. Post-forward transfers are ordered behind the draft mirror, so a page is never reported clean, and its resident block never released, before its draft-layer rows reach the host. Both land in the previous step's host write event, which this step waits on before its forward and its host copies, since the scheduler may already have reused the finished requests' blocks they read and write.
_resolve_row_mirrors(state)
¶
Compute the final row mirrors from the staged GPU slot mapping.
_restore_pages(transfers)
¶
Copy host pages into resident pages on every rank before its forward.
Covers imported tails and promoted imports. One batched H2D call per step, instead of one copy per page and layer, keeps a long promoted import from flooding the stream with launches.
_stage_row_mirror_mapping(num_tokens)
¶
Snapshot the rows this forward will write, off the compute stream.
The resident slot mapping is a persistent view bound at registration time, so the rows are already staged by the time the forward launches.
invalidate_blocks(block_ids, request_state_indices)
¶
Invalidate recycled host slots in this worker's leader runtimes.
take_completed_host_copies()
¶
Drain host copies this worker has enqueued for this step.
_select_written_row_mirrors(candidates, source_slots, source_index)
¶
Select and coalesce GPU-written rows from a scheduler-owned envelope.