Skip to content

vllm.platforms.xpu

Classes:

Functions:

  • get_mem_info_wrapper –

    Get memory info for a device, matching torch.accelerator.get_memory_info.

XPUPlatform

Bases: Platform

Methods:

insert_blocks_to_device(src_cache, dst_cache, src_block_indices, dst_block_indices) classmethod

Copy blocks from src_cache to dst_cache on XPU.

set_device(device) classmethod

Set the device for the current platform.

support_fp8_query() classmethod

Whether XPU attention takes an FP8 query.

VLLM_XPU_SUPPORT_FP8_QUERY overrides; if unset, on for Xe3p only.

swap_out_blocks_to_host(src_cache, dst_cache, src_block_indices, dst_block_indices) classmethod

Copy blocks from XPU to host (CPU).

get_mem_info_wrapper(device=None)

Get memory info for a device, matching torch.accelerator.get_memory_info.

Parameters:

  • device

    (int | str | device | None, default: None ) –

    Device specification. Can be: - None: Use current XPU device - int: Device index - str: Device string (e.g., "xpu:0", "xpu") - torch.device: Device object

Returns:

  • tuple[int, int] –

    Tuple[int, int]: (free_memory, total_memory) in bytes