Rate this Page

torch.xpu.memory.memory_snapshot#

torch.xpu.memory.memory_snapshot(mempool_id=None)[source]#

Return a snapshot of the XPU memory allocator state across all devices. Provides detailed information for each memory segment managed by the allocator including its size, owning pool, associated stream, call stack traces, and other relevant attributes.

Parameters:

mempool_id (tuple[int, int] or None, optional) – The memory pool id. If None, the default memory pool is used.

Returns:

List of memory segments and their attributes.

Return type:

list[dict[str, Any]]