IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python class

MemoryStats

MemoryStats

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

source

Bases: Struct

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

source

Currently available GPU memory in bytes.

reserved_bytes

reserved_bytes: int | None

source

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

total_bytes

total_bytes: int

source

Total GPU memory capacity in bytes.

used_bytes

used_bytes: int

source

Currently allocated GPU memory in bytes.