Skip to content

Set up graphopt ​

This step gets a working dev environment for the research stack. Requires Python 3.13, uv, and (only for the Rust crates) a Rust toolchain — the Python path needs no Rust.

1. Clone and sync ​

sh
git clone https://github.com/handl-lang/graphopt
cd graphopt
uv sync --group bench      # creates .venv/ — dev env + the bench CLI deps

There is no mlopt facade package: import the domain packages directly (mlopt_core, mlopt_torch, mlopt_orchestrator, mlopt_discovery, gamekit, …). .venv/bin/python is the interpreter every command in this track uses. uv sync pulls the substrate and game-kernel packages in as pinned git deps on the eqsat/gamekit repos — the import names are unchanged.

git+ssh pins

The pins fetch over ssh://git@github.com/… — uv sync needs GitHub SSH credentials (a key in your agent). If you authenticate over HTTPS instead, rewrite the scheme once:

sh
git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"

The --group bench flag adds the benchmark CLI's deps (tyro, rich, …); the dev group is always on by default.

2. Smoke-test it ​

sh
.venv/bin/python examples/quickstart.py        # end-to-end pipeline on a toy module (~15 s, CPU)
.venv/bin/python -m bench list                 # catalog the benchmark suites
.venv/bin/python -m pytest -m "not slow" -q    # the dev lane (~6,400 tests)

quickstart.py exercises the whole pipeline — lift a model to the IR, saturate, extract, lower, verify — on CPU with no GPU required.

What you installed ​

pieceimportreporole
the enginemlopt_coreeqsatthe torch-free IR, e-graph, law bank, cost models
the pipelinemlopt_orchestratoreqsatOptimizer, search, lower — backend-neutral
the game layergamekitgamekitBoard protocol, players, scoring, calibration
torch adaptersmlopt_torchgraphoptTorchSource/TorchSink/TorchBackend, runners
discoverymlopt_discoverygraphoptcensus → propose → verify → measure → rank → emit
benchmarksbenchgraphoptharnessed suites + the discovery scorecard

Next ​

→ Your first search()