vllm.distributed.ec_transfer.ec_connector.cpu.worker.descriptor_buffers ¶
Reusable pool of (src_ptrs, dst_ptrs, sizes) tensor triples.
Used by ECCPUWorker to batch swap_blocks_batch descriptors without per-step allocation overhead.
Classes:
-
DescriptorBufferPool–Pool of descriptor buffer triples for swap_blocks_batch.
-
DescriptorBuffers–
DescriptorBufferPool ¶
Pool of descriptor buffer triples for swap_blocks_batch.
Each buffer is a DescriptorBuffers namedtuple of three 1-D tensors (dtype _PTR_DTYPE, platform-dependent) of equal length, paired with numpy aliases used to fill them. Buffers are recycled across steps; if a returned buffer is too small it is discarded and a fresh one allocated.
Methods:
-
acquire–Get a buffer triple with capacity >= n.
-
release–Return a buffer triple to the pool for reuse.
Source code in vllm/distributed/ec_transfer/ec_connector/cpu/worker/descriptor_buffers.py
acquire(n) ¶
Get a buffer triple with capacity >= n.
Source code in vllm/distributed/ec_transfer/ec_connector/cpu/worker/descriptor_buffers.py
DescriptorBuffers ¶
Bases: NamedTuple
Methods:
-
set_ptrs–Record the source and destination address of descriptor idx.
Source code in vllm/distributed/ec_transfer/ec_connector/cpu/worker/descriptor_buffers.py
set_ptrs(idx, src, dst) ¶
Record the source and destination address of descriptor idx.
TODO(torch>=2.14): drop this indirection and assign the tensors directly once the minimum supported torch is 2.14. The numpy detour exists only because torch's setitem unpacks the value as a signed long long before 2.14 (pytorch#191458), rejecting XPU USM pointers
= 2**63, while the two's-complement rewrite those versions accept is in turn rejected by uint64 from 2.14 on. Numpy casts against the array dtype and so works on either.
sizesholds byte counts and needs no such care.