executable

command
v0.6.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command executable demonstrates the MPSGraphExecutable deployment path: compile a graph once, ship the compiled package, load it later without rebuilding the graph.

An MPSGraph is a description. Running it with MPSGraph.run repeats the compile work the graph needs before the GPU sees anything. Compiling the graph yields an MPSGraphExecutable, which holds the specialized result and takes its inputs positionally instead of through a feeds dictionary. An executable can be serialized to an .mpsgraphpackage directory and read back on another process or machine, so the graph-building code does not have to ship with the program that runs it.

The example builds a two-layer network (matmul, ReLU, matmul, bias), then runs it three ways and compares the results elementwise:

interpreted   MPSGraph.run with a feeds dictionary
compiled      MPSGraphExecutable.run from compile(with:feeds:...)
reloaded      MPSGraphExecutable.init(package:descriptor:) after serialize

All three must agree exactly; the measured deltas are printed.

Usage:

executable [-out dir]

Without -out the package is written to a temporary directory and removed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL