mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-05 03:01:17 -04:00
[ROCM] Core Functionality for AMD (#1983)
* this pr adds a third party backend for triton that works on AMD * this expose a lot of the work that has been done in our [fork](https://github.com/ROCmSoftwarePlatform/triton) * most unit tests on `test_core.py` pass * it skips some unit tests for various reasons * we plan to follow up with more prs improving Functionality and Performance in the future --------- Co-authored-by: Philippe Tillet <phil@openai.com>
This commit is contained in:
@@ -53,7 +53,6 @@ llvm_update_compile_flags(triton-translate)
|
||||
TritonNvidiaGPUTransforms
|
||||
TritonLLVMIR
|
||||
TritonPTX
|
||||
TritonHSACO
|
||||
${dialect_libs}
|
||||
${conversion_libs}
|
||||
# tests
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "triton/Dialect/Triton/IR/Dialect.h"
|
||||
#include "triton/Dialect/TritonGPU/IR/Dialect.h"
|
||||
#include "triton/Dialect/TritonNvidiaGPU/IR/Dialect.h"
|
||||
#include "triton/Target/HSACO/HSACOTranslation.h"
|
||||
#include "triton/Target/LLVMIR/LLVMIRTranslation.h"
|
||||
#include "triton/Target/PTX/PTXTranslation.h"
|
||||
#include "llvm/IR/LLVMContext.h"
|
||||
@@ -138,16 +137,11 @@ LogicalResult tritonTranslateMain(int argc, char **argv,
|
||||
llvm::errs() << "Translate to LLVM IR failed";
|
||||
}
|
||||
|
||||
if (targetKind == "llvmir")
|
||||
if (targetKind == "llvmir") {
|
||||
llvm::outs() << *llvmir << '\n';
|
||||
else if (targetKind == "ptx")
|
||||
} else if (targetKind == "ptx") {
|
||||
llvm::outs() << ::triton::translateLLVMIRToPTX(*llvmir, SMArch.getValue(),
|
||||
ptxVersion.getValue());
|
||||
else if (targetKind == "hsaco") {
|
||||
auto [module, hsaco] = ::triton::translateLLVMIRToHSACO(
|
||||
*llvmir, GCNArch.getValue(), GCNTriple.getValue(),
|
||||
GCNFeatures.getValue());
|
||||
llvm::outs() << hsaco;
|
||||
} else {
|
||||
llvm::errs() << "Error: Unknown target specified: " << targetKind << "\n";
|
||||
return failure();
|
||||
|
||||
Reference in New Issue
Block a user