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).

Mojo module

shmem_context

SHMEM runtime context and multi-GPU launch helper.

Provides SHMEMContext, which wraps the SHMEM runtime lifecycle and exposes a DeviceContext-compatible interface for submitting kernels and managing symmetric-heap buffers. Use shmem_launch to run a per-GPU function across all attached GPUs.

Structs​

  • ​SHMEMContext: Usable as a context manager to run kernels on a GPU with SHMEM support, on exit it will finalize SHMEM and clean up resources.

Functions​

  • ​shmem_launch: Takes a function defining a SHMEM program and launches it on one thread for each GPU you have attached.