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 function

init_signal_buffer

def init_signal_buffer(signal_buffer: DeviceBuffer[DType.uint8], ctx: DeviceContext)

Initializes a freshly allocated signal buffer for any comm collective.

Mojo-side equivalent of Signals.buffers() in allreduce.py: zero-fills the whole buffer (the correct start state for the barrier counters and lamport_state), then overwrites the embedded Lamport region with the -0.0 sentinel so the barrier-free Lamport allreduce reads every pack as "not ready". Both memsets are enqueued on ctx's stream, so the sentinel fill is correctly ordered after the zero-fill.

Args:

Was this page helpful?