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
SymmetricPool
SymmetricPool
class max.driver.SymmetricPool
Bases: object
A driver-owned symmetric multicast pool shared by a set of devices.
The pool is a single fixed-capacity allocation, created once per device set and registered in the driver. It outlives this handle: dropping the Python object does not free device memory, and two handles for the same devices refer to the same allocation.
Not constructible directly. Use allocate() once during session
setup, and lookup() afterwards.
allocate()
allocate(devices: collections.abc.Sequence[max.driver.Device], byte_size: int) → max.driver.SymmetricPool
Allocates the pool over devices and registers it in the driver.
-
Parameters:
-
Returns:
-
The newly registered pool.
-
Return type:
-
Raises:
-
RuntimeError – If a pool is already registered for these devices, fewer than two devices are given, a device lacks multicast support, or the allocation fails.
byte_size
property byte_size
Usable bytes per device; the views are exactly this long.
is_supported()
is_supported(devices: collections.abc.Sequence[max.driver.Device]) → bool
Returns whether devices can back a multicast pool.
Answers before any memory is committed. A device that cannot report its capability counts as unsupported.
lookup()
lookup(devices: collections.abc.Sequence[max.driver.Device]) → max.driver.SymmetricPool | None
Returns the pool registered for devices, or None.
A registry read, never an allocation.
-
Parameters:
-
Returns:
-
The registered pool, if any.
-
Return type:
-
SymmetricPool | None
multicast_view()
multicast_view(device: max.driver.Device) → max.driver.Buffer
Returns the multicast alias the switch reduces through.
Only meaningful to a kernel issuing multimem instructions; host loads and stores through it are undefined.
unicast_view()
unicast_view(device: max.driver.Device) → max.driver.Buffer
Returns the device’s own view of the pool as a flat uint8 buffer.
The buffer is non-owning; the driver owns the memory. Retype a
sub-region with Buffer.view().
-
Parameters:
-
device (Device) – One of the devices the pool spans.
-
Returns:
-
A flat
uint8view,byte_sizebytes long. -
Return type:
-
Raises:
-
RuntimeError – If
deviceis not one the pool spans.