IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Python module

max.driver

Devices​

AcceleratorCreates an accelerator device with the specified ID and memory limit.
CPUCreates a CPU device.
DeviceRepresents a compute device available for tensor operations.
DeviceEventProvides access to an event object.
DeviceSpecA device specification containing an ID and device type.
DeviceStreamProvides access to a stream of execution on a device.

Buffers​

BufferDevice-resident buffer representation.
DevicePinnedBufferCreates a pinned host memory allocation tied to the given device.
DLPackArray
load_max_bufferExperimental method for loading serialized MAX buffers.

Device discovery​

accelerator_apiReturns the API used to program the accelerator.
accelerator_architecture_nameReturns the architecture name of the accelerator device.
accelerator_countaccelerator_count() -> int
devices_existReturns True if all specified devices exist.
enable_all_peer_accessenable_all_peer_access() -> None
load_devicesInitializes and returns a list of Device objects from a sequence of DeviceSpec objects.
scan_available_devicesReturns all available accelerators, or a CPU device if none are available.

Virtual devices​

calculate_virtual_device_countCalculates the minimum virtual device count needed for the given device specs.
calculate_virtual_device_count_from_cliCalculates the minimum virtual device count from raw CLI inputs (before parsing).
get_virtual_device_apiget_virtual_device_api() -> str
get_virtual_device_countget_virtual_device_count() -> int
get_virtual_device_target_archget_virtual_device_target_arch() -> str
is_virtual_device_modeis_virtual_device_mode() -> bool
set_virtual_device_apistr) -> None
set_virtual_device_countint) -> None
set_virtual_device_target_archstr) -> None