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
28 changed files
with
1,622 additions
and
56 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,91 @@ | ||
# 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__", | ||
"//third_party/triton/python:__subpackages__", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "passes", | ||
hdrs = ["src/passes.h"], | ||
includes = ["src"], | ||
visibility = ["//third_party/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: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", | ||
"//third_party/triton/third_party/nvidia:triton_nvidia", | ||
], | ||
) | ||
|
||
pybind_extension( | ||
name = "triton_launcher", | ||
srcs = [ | ||
"triton/compiler/triton_launcher.c", | ||
], | ||
tags = [ | ||
"config-cuda-only", | ||
"requires-gpu-sm80", | ||
], | ||
deps = [ | ||
"@local_config_cuda//cuda:cuda_headers", | ||
"@local_config_cuda//cuda:cuda_runtime", | ||
], | ||
) | ||
|
||
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,27 @@ | ||
load("//third_party/py/pytest:pytest_defs.bzl", "pytest_multi_tests") | ||
|
||
package( | ||
default_applicable_licenses = ["//:license"], | ||
) | ||
|
||
pytest_multi_tests( | ||
name = "tests", | ||
size = "large", | ||
shard_count = 10, | ||
tags = [ | ||
"config-cuda-only", | ||
"requires-gpu-sm80", | ||
], | ||
tests = glob( | ||
include = ["test_*.py"], | ||
|
||
#TODO(b/321005767): fix failing test | ||
exclude = [ | ||
"test_performance.py", | ||
], | ||
), | ||
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,107 @@ | ||
load("//third_party/py/pytest:pytest_defs.bzl", "pytest_multi_tests") | ||
|
||
package( | ||
default_applicable_licenses = ["//:license"], | ||
) | ||
|
||
pytest_multi_tests( | ||
name = "hopper", | ||
shard_count = 10, | ||
tags = [ | ||
"config-cuda-only", | ||
"requires-gpu-sm80", | ||
], | ||
tests = glob( | ||
include = ["hopper/**/test_*.py"], | ||
), | ||
deps = [ | ||
"//third_party/py/torch:pytorch", | ||
"//third_party/py/triton", | ||
], | ||
) | ||
|
||
pytest_multi_tests( | ||
name = "language", | ||
size = "large", | ||
srcs = [ | ||
"conftest.py", | ||
"language/conftest.py", | ||
"language/test_core.py", | ||
], | ||
shard_count = 10, | ||
tags = [ | ||
"config-cuda-only", | ||
"requires-gpu-sm80", | ||
], | ||
tests = glob( | ||
include = ["language/**/test_*.py"], | ||
exclude = [ | ||
"language/test_subprocess.py", # TODO(b/320224484): fix failing test | ||
"language/test_reproducer.py", # this is not an actual test, but a tool for running reproducers | ||
], | ||
), | ||
deps = [ | ||
"//third_party/py/torch:pytorch", | ||
"//third_party/py/triton", | ||
], | ||
) | ||
|
||
pytest_multi_tests( | ||
name = "operators", | ||
size = "large", | ||
srcs = ["conftest.py"], | ||
shard_count = 10, | ||
tags = [ | ||
"config-cuda-only", | ||
"requires-gpu-sm80", | ||
], | ||
tests = glob( | ||
[ | ||
"operators/**/test_*.py", | ||
], | ||
), | ||
deps = [ | ||
"//third_party/py/torch:pytorch", | ||
"//third_party/py/triton", | ||
], | ||
) | ||
|
||
pytest_multi_tests( | ||
name = "runtime", | ||
tags = [ | ||
"config-cuda-only", | ||
"requires-gpu-sm80", | ||
], | ||
tests = | ||
glob( | ||
include = ["runtime/**/test_*.py"], | ||
exclude = [ | ||
"runtime/test_launch.py", #TODO(b/320226169): fix failing tests | ||
], | ||
), | ||
deps = [ | ||
"//third_party/py/torch:pytorch", | ||
"//third_party/py/triton", | ||
], | ||
) | ||
|
||
pytest_multi_tests( | ||
name = "tools", | ||
size = "large", | ||
shard_count = 10, | ||
tags = [ | ||
"config-cuda-only", | ||
"requires-gpu-sm80", | ||
], | ||
tests = | ||
glob( | ||
include = ["tools/**/test_*.py"], | ||
exclude = [ | ||
"tools/test_aot.py", # TODO(b/320224484): 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 |
---|---|---|
@@ -1 +1 @@ | ||
../../../include/ | ||
../../../include |
Oops, something went wrong.