forked from triton-lang/triton
-
Notifications
You must be signed in to change notification settings - Fork 6
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
40 changed files
with
2,418 additions
and
70 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
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
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,77 @@ | ||
# NOTE: Do not depend on any targets from this directory, | ||
# but use //third_party/py/triton instead. | ||
|
||
load("@pybind11_bazel//:build_defs.bzl", "pybind_extension") | ||
|
||
package( | ||
default_applicable_licenses = ["//:license"], | ||
default_visibility = [ | ||
"//third_party/py/triton:__pkg__", | ||
"@triton//python:__subpackages__", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "passes", | ||
hdrs = ["src/passes.h"], | ||
includes = ["src"], | ||
visibility = ["@triton//third_party:__subpackages__"], | ||
) | ||
|
||
pybind_extension( | ||
name = "libtriton", | ||
srcs = [ | ||
"src/interpreter.cc", | ||
"src/ir.cc", | ||
"src/llvm.cc", | ||
"src/main.cc", | ||
"src/passes.cc", | ||
], | ||
copts = ["-DTRITON_BACKENDS_TUPLE=(nvidia)"], | ||
deps = [ | ||
":passes", | ||
"@llvm-project//llvm:Core", | ||
"@llvm-project//llvm:IPO", | ||
"@llvm-project//llvm:IRReader", | ||
"@llvm-project//llvm:InstCombine", | ||
"@llvm-project//llvm:Linker", | ||
"@llvm-project//llvm:MC", | ||
"@llvm-project//llvm:Passes", | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//llvm:Target", | ||
"@llvm-project//mlir:BuiltinToLLVMIRTranslation", | ||
"@llvm-project//mlir:BytecodeWriter", | ||
"@llvm-project//mlir:ControlFlowDialect", | ||
"@llvm-project//mlir:ConversionPasses", | ||
"@llvm-project//mlir:IR", | ||
"@llvm-project//mlir:IndexDialect", | ||
"@llvm-project//mlir:LLVMDialect", | ||
"@llvm-project//mlir:LLVMIRTransforms", | ||
"@llvm-project//mlir:LLVMToLLVMIRTranslation", | ||
"@llvm-project//mlir:NVVMToLLVMIRTranslation", | ||
"@llvm-project//mlir:Parser", | ||
"@llvm-project//mlir:Pass", | ||
"@llvm-project//mlir:Support", | ||
"@llvm-project//mlir:ToLLVMIRTranslation", | ||
"@llvm-project//mlir:Transforms", | ||
"//:TritonAnalysis", | ||
"//:TritonDialects", | ||
"//:TritonGPUToLLVM", | ||
"//:TritonGPUTransforms", | ||
"//:TritonHSACO", | ||
"//:TritonLLVMIR", | ||
"//:TritonNvidiaGPUTransforms", | ||
"//:TritonPTX", | ||
"//:TritonToTritonGPU", | ||
"//:TritonTools", | ||
"//:TritonTransforms", | ||
"@triton//third_party/nvidia:triton_nvidia", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "files", | ||
srcs = glob( | ||
include = ["triton/**/*.py"], | ||
), | ||
) |
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,26 @@ | ||
load("//third_party/py/pytest:pytest_defs.bzl", "pytest_multi_tests") | ||
|
||
package( | ||
default_applicable_licenses = ["//:license"], | ||
) | ||
|
||
pytest_multi_tests( | ||
name = "tests", | ||
size = "large", | ||
srcs = ["conftest.py"], | ||
shard_count = 10, | ||
tags = [ | ||
"config-cuda-only", | ||
"requires-gpu-sm80", | ||
], | ||
tests = glob( | ||
include = ["test_*.py"], | ||
exclude = [ | ||
"test_performance.py", #TODO(b/321005767): fix failing test | ||
], | ||
), | ||
deps = [ | ||
"//third_party/py/torch:pytorch", | ||
"//third_party/py/triton", | ||
], | ||
) |
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,12 @@ | ||
# content of conftest.py | ||
|
||
import pytest | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption("--device", action="store", default='cuda') | ||
|
||
|
||
@pytest.fixture | ||
def device(request): | ||
return request.config.getoption("--device") |
Oops, something went wrong.