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 class
CompileOnlyModel
CompileOnlyModel
class max.engine.CompileOnlyModel(name, compiled)
Bases: object
Stands in for a Model compiled under virtual devices.
A virtual device compiles for hardware that is not attached, so the compile
half of a load finishes and the initialize half has nothing to do. Callers
doing exactly that – cross-compiling, benchmarking a compile – want the
load to return, so it returns this: an object that carries what was compiled
and raises CompileOnlyExecutionError from everything that would
need the device. A stand-in that answered those calls with placeholder
values would move the failure to whatever consumed them.
Input and output metadata, the signature derived from them, and the kernel summaries are the exception: the compile fixes them, so the stand-in reads them from the artifact.
-
Parameters:
-
- name (str)
- compiled (CompiledModel)
execute()
execute(*args, **kwargs)
Raises: a compile-only stand-in has nothing to execute on.
input_metadata
property input_metadata: list[TensorSpec]
See Model.input_metadata.
kernel_summaries
output_metadata
property output_metadata: list[TensorSpec]
signature
property signature: Signature
Get input signature for model.