-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Makefile
47 lines (38 loc) · 1.66 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This is not the build system, just a helper to run common development commands.
# Make sure to first initialize the build system with:
# make dev-install
PYTHON := python
BUILD_DIR := $(shell cd python; $(PYTHON) -c 'from build_helpers import get_cmake_dir; print(get_cmake_dir())')
TRITON_OPT := $(BUILD_DIR)/bin/triton-opt
.PHONY: all
all:
ninja -C $(BUILD_DIR)
.PHONY: triton-opt
triton-opt:
ninja -C $(BUILD_DIR) triton-opt
.PHONY: test-lit
test-lit:
ninja -C $(BUILD_DIR) check-triton-lit-tests
.PHONY: test-cpp
test-cpp:
ninja -C $(BUILD_DIR) check-triton-unit-tests
.PHONY: test-python
test-python: all
$(PYTHON) -m pytest python/test/unit
.PHONY: test
test: test-lit test-cpp test-python
.PHONY: dev-install
dev-install:
# build-time dependencies
$(PYTHON) -m pip install ninja cmake wheel pybind11
# test dependencies
$(PYTHON) -m pip install scipy numpy torch pytest lit pandas matplotlib
$(PYTHON) -m pip install -e python --no-build-isolation -v
.PHONY: golden-samples
golden-samples: triton-opt
$(TRITON_OPT) test/TritonGPU/samples/simulated-grouped-gemm.mlir.in -tritongpu-loop-scheduling -tritongpu-pipeline -canonicalize | \
$(PYTHON) utils/generate-test-checks.py --source test/TritonGPU/samples/simulated-grouped-gemm.mlir.in --source_delim_regex="\bmodule" \
-o test/TritonGPU/samples/simulated-grouped-gemm.mlir
$(TRITON_OPT) test/TritonGPU/samples/descriptor-matmul-pipeline.mlir.in -tritongpu-loop-scheduling -tritongpu-pipeline -canonicalize | \
$(PYTHON) utils/generate-test-checks.py --source test/TritonGPU/samples/descriptor-matmul-pipeline.mlir.in --source_delim_regex="\bmodule" \
-o test/TritonGPU/samples/descriptor-matmul-pipeline.mlir