Skip to content

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
  1. intentdsl setup --backend triton verifies the bundled native library, assets, and Python frontend bindings.
  2. intentdsl doctor --backend triton probes the selected backend's external toolchains and devices (ready vs missing). Install any missing driver or package and re-run.
  3. From the parent directory, run python Intent/examples/first_kernel.py (softmax passed confirms compilation, execution, and numerical verification) and python Intent/examples/formulas.py (verifies all nine handbook formulas against PyTorch).
  4. Enter Intent-Bench, run the --check-only numerical command first, and then run the timed benchmark (intent-v2:triton is IntentDSL V2; triton is the standalone baseline). Inspect results.json under latest in your --output-root for status, correctness, median_ms, and samples_ms.
  5. Run the Python API snippet from the README inside Intent-Bench to submit the same workload programmatically and print the run directory.

Back to Home · Handbook · Same-Semantics Scoreboard