-
Notifications
You must be signed in to change notification settings - Fork 0
Native CPU
Native CPU is the baseline complete execution path. It is the right choice for scripting, file-backed data, traces, reproducible experiments, broad model compatibility, and workloads too long for the browser but too small or unsupported for an accelerator fast path.
cd sw-mlpl/components/cli
cargo run -p mlpl-repl
cargo run -p mlpl-repl -- -f ../../demos/tiny_mlp.mlplUse release builds for meaningful timing:
cargo run --release -p mlpl-repl -- -f ../../demos/tiny_lm.mlplflowchart LR
Source[MLPL source] --> Lexer[Lexer and parser]
Lexer --> AST[AST]
AST --> Eval[Evaluator and environment]
Eval --> Arrays[Dense CPU arrays]
Eval --> Tape[Autograd tape]
Arrays --> Result[Value or visualization]
Tape --> Optim[Optimizer update]
Optim --> Eval
Result --> REPL[Terminal, file, or server response]
- Read data underneath an explicit
--data-dirsandbox. - Persist experiment records under
--exp-dir. - Export structured execution traces.
- Store visualization artifacts in
MLPL_CACHE_DIRrather than printing raw markup. - Call allowed HTTP services such as an Ollama-compatible endpoint.
- Run a long-lived server, multiple clients, and persistent sessions.
- Build the Rust embedding and native compilation paths.
The CPU evaluator supports the broadest set of language semantics and arbitrary tape-based training. Small tensor sizes often favor CPU because GPU transfer and launch costs dominate. CPU is also the correctness reference for fp32 accelerator parity tests.
The interactive evaluator maximizes language coverage. The mlpl! procedural macro and mlpl build command lower a supported subset to Rust/native code. Use this when startup and deployment simplicity matter, and use interpreter-versus-compiled parity tests for the features in scope.
Read compiler guide, compilation design, and benchmarks in the source repository.