-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
470 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
import sysconfig | ||
import sys | ||
from pathlib import Path | ||
|
||
|
||
def get_base_dir(): | ||
return os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) | ||
|
||
|
||
def get_cmake_dir(): | ||
plat_name = sysconfig.get_platform() | ||
python_version = sysconfig.get_python_version() | ||
dir_name = f"cmake.{plat_name}-{sys.implementation.name}-{python_version}" | ||
cmake_dir = Path(get_base_dir()) / "python" / "build" / dir_name | ||
cmake_dir.mkdir(parents=True, exist_ok=True) | ||
return cmake_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.