Load a previously-saved compiled executable into a thin wrapper.
Returns an object exposing __call__(*args) that runs the saved
executable directly. The executable expects every feed in
feed order — that includes both model parameters and runtime
inputs. This is the raw artifact level: there is no automatic
parameter re-binding, because the saved package does not carry the
parameter values (only the graph structure + I/O ids).
For a smoother AOT workflow that re-binds parameters from a live
model, build a thin caller-side helper around load_compiled
that stitches model.parameters() onto the executable's feed
list before invocation.
Parameters
pathstrFilesystem prefix matching a previous
save_compiled
call. Expects both <path>.mpsgraphpackage and
<path>.meta to exist.Returns
objectA callable wrapper. Attributes:
num_inputs: total feed count the executable expects.input_ids: ordered trace ids (debug / introspection).__call__(*feeds): run with feeds ininput_idsorder.
Raises
FileNotFoundErrorEither
.mpsgraphpackage or .meta is missing.RuntimeErrorThe
.meta sidecar is corrupted, the SDK ABI mismatches,
or the saved executable references engine internals that no
longer exist.Examples
>>> import lucid
>>> import lucid.compile as lc
>>> step = lc.load_compiled("/tmp/my_linear")
>>> step.num_inputs
3 # e.g. (W, b, x)
>>> out = step(W, b, x) # all feeds in order