Skip to content

Latest commit

 

History

History
10 lines (9 loc) · 1.02 KB

File metadata and controls

10 lines (9 loc) · 1.02 KB

Working on Triton

Build and Testing Guidelines

  • Before running any tests, run make in the triton directory to rebuild triton.
  • For compiler changes, add tests in python/test/ (pytest) or test (lit). Keep GPU-only tests in python/test/unit/ or python/test/gluon/, name them test_<feature>_<condition>, and avoid creating new test files unless requested.
  • Run pytest with -s --tb=short. Run a single test with pytest 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 run triton-opt /tmp/<file>.mlir --run-reproducer to reproduce locally.