Skip to main content

Python class

MemoryStats

MemoryStats

class max.diagnostics.gpu.MemoryStats(total_bytes, free_bytes, used_bytes, reserved_bytes)

Detailed GPU memory usage statistics including total, free, used, and reserved memory.

This class provides comprehensive memory information for a GPU, allowing developers to monitor memory consumption and identify potential memory bottlenecks during model inference or training.

Parameters:

  • total_bytes (int)
  • free_bytes (int)
  • used_bytes (int)
  • reserved_bytes (int | None)

free_bytes

free_bytes: int

Currently allocated GPU memory in bytes.

total_bytes

total_bytes: int

Currently available GPU memory in bytes.

used_bytes

used_bytes: int

Memory reserved by the driver, if available from the GPU vendor.