Python class
CompiledModel
CompiledModelβ
class max.experimental.nn.CompiledModel(engine_model, input_slots, output_slots, signal_buffers, unary)
Bases: object
Compiled model returned by Module.compile().
Provides two execution paths:
- Tensor path β
compiled(tensor_a, tensor_b)handles distributed Tensors transparently (unflatten shards, append signals, reconstruct). Used by tests and the high-level API. - Buffer path β
compiled.execute_raw(*buffers)passes flat Buffers straight to the engine, auto-appending signal buffers. Returnslist[Buffer]with zero Tensor overhead. Used by pipelineexecute()methods.
For CUDA graph capture/replay, access compiled.engine_model directly:
compiled.engine_model.capture(key, *all_buffers)
compiled.engine_model.replay(key, *all_buffers)For multi-GPU capture, append compiled.signal_buffers to the buffer
list passed to capture/replay.
-
Parameters:
engine_modelβ
property engine_model: Model
The underlying Model for capture/replay.
execute_raw()β
execute_raw(*buffers)
Buffer-in, Buffer-out execution (no Tensor wrapping).
Auto-appends signal buffers for multi-GPU collectives.
signal_buffersβ
Signal buffers for multi-GPU collectives (empty for single-GPU).
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!