Command-line tools

Use tnpath to plan and save paths, tnexec to load or generate paths and execute contractions, and the MPI-enabled tnmpi for distributed sliced execution.

On this page

tnpath

bash
cargo run --release --bin tnpath -- \
  network.net.json --method auto --preset heavy --seed 0 \
  --save-path plan.json
Argument Meaning for Light / Heavy
--preset light or heavy
--max-time Search time limit in seconds, checked at algorithm checkpoints
--flops-weight / --read-write-weight Objective weights for FLOPs and memory traffic
--target-size Fixed-path slicing; the Light / Heavy command-line interface does not currently support Dynamic mode
--trials Does not apply to Light / Heavy; the chosen mode determines the search budget

--method accepts auto, greedy, rgreedy, reconf, bisect, budget, optimal, temper, stemper, treesa, orderdp, import, and all. Supported parameters vary by method; see tnpath --help.

tnexec

bash
cargo run --release --bin tnexec -- \
  --net network.net.json --load-path plan.json \
  --single --check

--single selects single-precision floating point, not single-threaded execution; omitting it selects double precision. --check performs a numerical cross-check for problems small enough to permit it.

tnpath --save-path writes a version 2 plan file containing network structure, path, and slicing information. tnexec reads version 1 and version 2 files, but both require a network supplied through --net; version 2 also checks that the saved network matches the supplied one. Older files without a format identifier require explicit --allow-legacy-plan. When tnexec generates a path itself, it supports only greedy or random-greedy search, not Light / Heavy.

tnmpi

bash
cargo build --release --features mpi --bin tnmpi
mpirun -n 8 target/release/tnmpi \
  --load-path plan.json --data tensors.bin