Skip to content

vllm.v1.kv_offload.cpu.host_register

Registration of existing host memory for pinned DMA transfers.

Host allocations that the offloading workers share across processes (the SharedOffloadRegion mmap) cannot be allocated through the accelerator's pinned allocator, so they must be registered after the fact. Pinning is a pure bandwidth optimization: when registration is unavailable the transfers still run correctly, just as pageable (slower) copies.

Functions:

  • host_register –

    Register a host range as device-accessible pinned memory.

  • host_unregister –

    Release a host range previously registered by host_register.

host_register(ptr, num_bytes)

Register a host range as device-accessible pinned memory.

Parameters:

  • ptr

    (int) –

    Base address of the host range.

  • num_bytes

    (int) –

    Size of the host range in bytes.

Returns:

  • bool –

    True if the range was registered and later needs host_unregister.

host_unregister(ptr)

Release a host range previously registered by host_register.