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.
[ROCM] Enable ROCM Backend #1: Empty Kernel (triton-lang#1312)
This PR is a first in a series of PRs to import the changes that we have made to enable ROCM on [our fork](https://github.com/ROCmSoftwarePlatform/triton) of triton. The PR contains the major changes to the python frontend and enough changes to the c++ backend to allow compilation and running of the empty kernel. We use the ROCM ci added a few weeks ago to verify things. --------- Co-authored-by: Ronan Keryell <ronan@keryell.fr>
- Loading branch information
1 parent
b1284ab
commit 2ddc73f
Showing
33 changed files
with
1,602 additions
and
131 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
Empty file.
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
set(LLVM_TARGET_DEFINITIONS Passes.td) | ||
mlir_tablegen(Passes.h.inc -gen-pass-decls) | ||
add_public_tablegen_target(TritonConversionPassIncGen) | ||
add_subdirectory(TritonToTritonGPU) | ||
add_subdirectory(TritonGPUToLLVM) |
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,33 @@ | ||
#ifndef TRITON_CONVERSION_TRITON_GPU_TO_LLVM_ASM_FORMAT_H_ | ||
#define TRITON_CONVERSION_TRITON_GPU_TO_LLVM_ASM_FORMAT_H_ | ||
|
||
#include "mlir/IR/Value.h" | ||
#include "triton/Dialect/Triton/IR/Dialect.h" | ||
#include "llvm/ADT/SmallVector.h" | ||
#include "llvm/ADT/StringRef.h" | ||
#include <memory> | ||
#include <string> | ||
|
||
namespace mlir { | ||
class ConversionPatternRewriter; | ||
class Location; | ||
|
||
namespace triton { | ||
using llvm::StringRef; | ||
|
||
inline std::string strJoin(llvm::ArrayRef<std::string> strs, | ||
llvm::StringRef delimiter) { | ||
std::string osStr; | ||
llvm::raw_string_ostream os(osStr); | ||
for (size_t i = 0; !strs.empty() && i < strs.size() - 1; ++i) | ||
os << strs[i] << delimiter; | ||
if (!strs.empty()) | ||
os << strs.back(); | ||
os.flush(); | ||
return osStr; | ||
} | ||
|
||
} // namespace triton | ||
} // namespace mlir | ||
|
||
#endif // TRITON_CONVERSION_TRITON_GPU_TO_LLVM_ASM_FORMAT_H_ |
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,3 @@ | ||
set(LLVM_TARGET_DEFINITIONS Passes.td) | ||
mlir_tablegen(Passes.h.inc -gen-pass-decls --name TritonGPUToLLVM) | ||
add_public_tablegen_target(TritonGPUConversionPassIncGen) |
Oops, something went wrong.