Skip to content

vllm.distributed.ec_transfer.ec_connector.cpu.utils

Supporting utilities for the ECCPUConnector scheduler.

Functions:

build_block_descs(base_ptr, num_blocks, block_size_bytes, device_id=0)

Per-block (addr, size, device_id) tuples for an ECSharedRegion.

Handed to nixl.get_xfer_descs to build a dlist where descriptor i addresses block i in the mmap. This makes a WRITE to block indices [i1, i2, ...] a simple make_prepped_xfer(..., [i1, i2]) on both ends — no per-request address math.

build_block_descs_array(base_ptr, num_blocks, block_size_bytes, device_id=0)

Nx3 (addr, size, device_id) array form of build_block_descs.

nixl.get_xfer_descs accepts this array directly, so the N-entry descriptor list for a large EC region can be built vectorized instead of as a Python tuple list on the scheduler thread.