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

launch_trace

launch_trace()

max.driver.launch_trace()

source

Records the device operations enqueued within the with block.

Wraps begin_launch_trace() and take_launch_trace() so the process-global recording is always stopped, even if the block raises. Only CUDA and HIP devices record entries; on other devices the list stays empty.

The yielded list is empty while the block runs and is filled with the recorded LaunchTraceEntry values once the block exits, in enqueue order across all streams.

Yields:

The operations enqueued within the block. Empty until the block exits.

Return type:

Iterator[list[LaunchTraceEntry]]

with max.driver.launch_trace() as entries:
    buffer.inplace_copy_from(src)
    model.execute(buffer)