From Source Checkout to Your First Measurement¶
Start from the three side-by-side checkouts shown in the README. Activate a single virtual environment, build the CompilerInfra static SDK, and install the Python bindings, intentdsl, and Intent-Bench. For the GPU starter route, install CUDA-enabled PyTorch and Triton. Running examples/first_kernel.py parses the kernel's AST from its Python file, binds symbolic shapes to actual input tensors, lowers row max and sum into device reductions, and compiles and launches via Triton before checking the full output against PyTorch.
Run the commands below in an empty directory on Linux (requires Git, Python ≥3.10, Ninja, CMake ≥3.22, a C++17 compiler, and LLVM/MLIR 20.1.8 development packages with PIC static archives and TableGen):
git clone https://github.com/Tianchen-ai/compilerinfra.git
git clone https://github.com/Tianchen-ai/Intent.git
git clone https://github.com/Tianchen-ai/Intent-Bench.git
python3 -m venv .venv
. .venv/bin/activate
LLVM_PREFIX=$(llvm-config-20 --prefix)
cmake -S compilerinfra -B build/sdk -G Ninja \
-DMLIR_DIR="$LLVM_PREFIX/lib/cmake/mlir" -DCMAKE_BUILD_TYPE=Release \
-DCOMPILERINFRA_LINK_MLIR_DYLIB=OFF -DCMAKE_INSTALL_PREFIX="$PWD/sdk"
cmake --build build/sdk --parallel 8
cmake --install build/sdk
export CMAKE_PREFIX_PATH="$PWD/sdk:$LLVM_PREFIX"
python -m pip install ./compilerinfra/python ./compilerinfra/agent
python -m pip install ./Intent
python -m pip install -e ./Intent-Bench
python -m pip install torch triton
intentdsl setup --backend tritonverifies the bundled native library, assets, and Python frontend bindings.intentdsl doctor --backend tritonprobes the selected backend's external toolchains and devices (readyvsmissing). Install any missing driver or package and re-run.- From the parent directory, run
python Intent/examples/first_kernel.py(softmax passedconfirms compilation, execution, and numerical verification) andpython Intent/examples/formulas.py(verifies all nine handbook formulas against PyTorch). - Enter
Intent-Bench, run the--check-onlynumerical command first, and then run the timed benchmark (intent-v2:tritonis IntentDSL V2;tritonis the standalone baseline). Inspectresults.jsonunderlatestin your--output-rootforstatus,correctness,median_ms, andsamples_ms. - Run the Python API snippet from the README inside
Intent-Benchto submit the same workload programmatically and print the run directory.