IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Python function

side_stream

side_stream()​

max.graph.ops.sequence.side_stream(inputs, body_fn, *, result_types, stream_id=1)

source

Run a block of ops on a side device stream via mo.sequence.

The body executes on the device stream selected by stream_id (0 is the default stream), overlapping independent work on the main stream. Inputs map 1:1 to the body’s block arguments and the body returns one value per result_types entry. The graph compiler binds the whole body to a side-stream device-context view and inserts the cross-stream synchronization at the boundary, so callers never manage streams or events directly.

Parameters:

Returns:

One TensorValue per result_types entry.

Return type:

list[TensorValue]