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:
- signal_buffer (
DeviceBuffer[DType.uint8]): This rank's signal buffer (at leastsizeof(Signal)bytes). - ctx (
DeviceContext): The device context for this rank's GPU.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!