- Before running any tests, run
makein the triton directory to rebuild triton. - For compiler changes, add tests in
python/test/(pytest) or test (lit). Keep GPU-only tests inpython/test/unit/orpython/test/gluon/, name themtest_<feature>_<condition>, and avoid creating new test files unless requested. - Run pytest with
-s --tb=short. Run a single test withpytest file.py::test_name. - The build dir is given by
BUILD_DIR := $(shell PYTHONPATH="./python" python3 -c 'from build_helpers import get_cmake_dir; print(get_cmake_dir())') - Run lit from the build dir:
cd BUILD_DIR; ninja triton-opt; lit -v test/<path>.mlir(example:lit -v test/TritonNvidiaGPU/tmem_layouts.mlir). - Lit tests can be run locally (no GPU required).
- Compiler crashes sometimes print an MLIR reproducer (external_resources / mlir_reproducer). Save the full MLIR + {-# ... #-} metadata to
/tmp/<file>.mlir, then runtriton-opt /tmp/<file>.mlir --run-reproducerto reproduce locally.