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).
Mojo struct
WaitHostValue
struct WaitHostValue
Stalls the stream until a host-visible flag reaches a given value.
Waits through DeviceStream.wait_for_flag. Accepts a 1-D int64 buffer of
shape [2], mirroring runtime.launch_host_func's payload shape:
payload[0]: raw address of aM::Driver::CompletionFlag(as u64). Typically obtained frommax.driver.CompletionFlag._unsafe_ptrand packed into the buffer by the Python caller; the C++ object must outlive any graph execution that references it.payload[1]: the 64-bit value to wait for (the int64 element is reinterpreted as a u64).
On CUDA and HIP it records into a captured device graph as a wait-value /
batch-mem-op node, so this op can sit inside a captured forward graph just
before the sampling kernel to gate the sampler on the bitmask compute
finishing while the rest of the forward body runs concurrently. On HIP that
node is recorded explicitly by the driver layer, because ROCm's stream
capture does not record hipStreamWaitValue64 itself. Supported on CUDA,
HIP and Metal streams; other backends raise at runtime.
Implemented traitsโ
Methodsโ
executeโ
static def execute(payload: T, ctx: DeviceContext)