Skip to content

Commit cad7253

Browse files
authored
[DOCS] Add an AGENTS.md (#9532)
We just describe a few basic things for now to help the agent figure out how to use lit tests and pytests effectively.
1 parent 10dc329 commit cad7253

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,5 @@ docs/sg_execution_times.rst
9494

9595
# macOS
9696
.DS_Store
97+
98+
AGENTS.override.md

AGENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Working on Triton
2+
3+
## Build and Testing Guidelines
4+
- Before running any tests, run `make` in the triton directory to rebuild triton.
5+
- 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.
6+
- Run pytest with `-s --tb=short`. Run a single test with `pytest file.py::test_name`.
7+
- The build dir is given by `BUILD_DIR := $(shell cd python; $(PYTHON) -c 'from build_helpers import get_cmake_dir; print(get_cmake_dir())')`
8+
- 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`).
9+
- Lit tests can be run locally (no GPU required).
10+
- 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.

0 commit comments

Comments
 (0)