Skip to content

Commit

Permalink
MoveTritonGEN dialect into third_party/intel (#1024)
Browse files Browse the repository at this point in the history
Signed-off-by: Tiotto, Ettore <ettore.tiotto@intel.com>
  • Loading branch information
etiotto authored May 2, 2024
1 parent 86b302e commit 9c515cf
Show file tree
Hide file tree
Showing 33 changed files with 59 additions and 36 deletions.
3 changes: 2 additions & 1 deletion bin/RegisterTritonDialects.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#pragma once
#include "third_party/intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "third_party/nvidia/include/Dialect/NVGPU/IR/Dialect.h"

#include "triton/Dialect/Triton/IR/Dialect.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "triton/Dialect/TritonGPU/IR/Dialect.h"
#include "triton/Dialect/TritonIntelGPU/IR/Dialect.h"
#include "triton/Dialect/TritonNvidiaGPU/IR/Dialect.h"
Expand Down
1 change: 0 additions & 1 deletion include/triton/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
add_subdirectory(Triton)
add_subdirectory(TritonGEN)
add_subdirectory(TritonGPU)
add_subdirectory(TritonIntelGPU)
add_subdirectory(TritonNvidiaGPU)
3 changes: 2 additions & 1 deletion include/triton/Dialect/TritonIntelGPU/Transforms/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#define TRITON_DIALECT_TRITON_INTEL_GPU_TRANSFORMS_PASSES_H

#include "mlir/Pass/Pass.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

namespace mlir {
namespace triton {
Expand Down
1 change: 0 additions & 1 deletion lib/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
add_subdirectory(Triton)
add_subdirectory(TritonGEN)
add_subdirectory(TritonGPU)
add_subdirectory(TritonIntelGPU)
add_subdirectory(TritonNvidiaGPU)
1 change: 0 additions & 1 deletion python/src/ir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "triton/Dialect/Triton/IR/Dialect.h"
#include "triton/Dialect/Triton/IR/Types.h"
#include "triton/Dialect/Triton/IR/Utility.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "triton/Tools/Sys/GetEnv.hpp"
#include <pybind11/functional.h>
#include <pybind11/pybind11.h>
Expand Down
4 changes: 2 additions & 2 deletions python/src/llvm.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "mlir/IR/BuiltinOps.h" // mlir::ModuleOp
#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "mlir/IR/BuiltinOps.h" // mlir::ModuleOp
#include "mlir/Target/LLVMIR/ModuleTranslation.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "triton/Target/SPIRV/SPIRVTranslation.h"
#include "triton/Tools/Sys/GetEnv.hpp"
#include "llvm/ADT/SmallVector.h"
Expand Down
2 changes: 1 addition & 1 deletion third_party/intel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_triton_plugin(TritonXPU
${CMAKE_CURRENT_SOURCE_DIR}/triton_xpu.cc

LINK_LIBS
TritonGENToLLVM
TritonIntelGPUToLLVM
TritonIntelGPUTransforms
TritonGENToLLVM
)
1 change: 1 addition & 0 deletions third_party/intel/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
add_subdirectory(Dialect)
add_subdirectory(GPUToTritonGEN)
add_subdirectory(TritonGENToLLVM)
add_subdirectory(TritonIntelGPUToLLVM)
1 change: 1 addition & 0 deletions third_party/intel/include/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(TritonGEN)
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/OpDefinition.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h.inc"
#include "triton/Dialect/TritonGEN/IR/TritonGENOpsEnums.h.inc"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h.inc"
#include "intel/include/Dialect/TritonGEN/IR/TritonGENOpsEnums.h.inc"

#define GET_ATTRDEF_CLASSES
#include "triton/Dialect/TritonGEN/IR/TritonGENOpsAttrDefs.h.inc"
#include "intel/include/Dialect/TritonGEN/IR/TritonGENOpsAttrDefs.h.inc"

#define GET_OP_CLASSES
#include "triton/Dialect/TritonGEN/IR/TritonGENOps.h.inc"
#include "intel/include/Dialect/TritonGEN/IR/TritonGENOps.h.inc"

namespace mlir {
namespace triton {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#ifndef TRITONGEN_OPS
#define TRITONGEN_OPS

include "triton/Dialect/TritonGEN/IR/TritonGENDialect.td"
include "triton/Dialect/TritonGEN/IR/TritonGENAttrDefs.td"
include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.td"
include "intel/include/Dialect/TritonGEN/IR/TritonGENAttrDefs.td"
include "mlir/IR/OpBase.td"
include "mlir/IR/EnumAttr.td"
include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
Expand Down
1 change: 1 addition & 0 deletions third_party/intel/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
add_subdirectory(Dialect)
add_subdirectory(GPUToTritonGEN)
add_subdirectory(TritonGENToLLVM)
add_subdirectory(TritonIntelGPUToLLVM)
Expand Down
1 change: 1 addition & 0 deletions third_party/intel/lib/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(TritonGEN)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/IR/Builders.h"
Expand All @@ -27,20 +27,20 @@ using namespace mlir::triton::TritonGEN;
void TritonGENDialect::initialize() {
addOperations<
#define GET_OP_LIST
#include "triton/Dialect/TritonGEN/IR/TritonGENOps.cpp.inc"
#include "intel/include/Dialect/TritonGEN/IR/TritonGENOps.cpp.inc"
>();
addAttributes<
#define GET_ATTRDEF_LIST
#include "triton/Dialect/TritonGEN/IR/TritonGENOpsAttrDefs.cpp.inc"
#include "intel/include/Dialect/TritonGEN/IR/TritonGENOpsAttrDefs.cpp.inc"
>();

// Support unknown operations because not all GEN operations are registered.
allowUnknownOperations();
}

#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.cpp.inc"
#include "triton/Dialect/TritonGEN/IR/TritonGENOpsEnums.cpp.inc"
#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.cpp.inc"
#include "intel/include/Dialect/TritonGEN/IR/TritonGENOpsEnums.cpp.inc"
#define GET_ATTRDEF_CLASSES
#include "triton/Dialect/TritonGEN/IR/TritonGENOpsAttrDefs.cpp.inc"
#include "intel/include/Dialect/TritonGEN/IR/TritonGENOpsAttrDefs.cpp.inc"
#define GET_OP_CLASSES
#include "triton/Dialect/TritonGEN/IR/TritonGENOps.cpp.inc"
#include "intel/include/Dialect/TritonGEN/IR/TritonGENOps.cpp.inc"
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/OpDefinition.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "llvm/ADT/STLExtras.h"
#include <cstdint>

Expand Down
2 changes: 1 addition & 1 deletion third_party/intel/lib/GPUToTritonGEN/GPUToTritonGEN.td
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

include "mlir/IR/PatternBase.td"
include "mlir/Dialect/GPU/IR/GPUOps.td"
include "triton/Dialect/TritonGEN/IR/TritonGENOps.td"
include "intel/include/Dialect/TritonGEN/IR/TritonGENOps.td"

def : Pat<(GPU_BarrierOp), (TritonGEN_BarrierOp)>;

Expand Down
3 changes: 2 additions & 1 deletion third_party/intel/lib/GPUToTritonGEN/GPUToTritonGENPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/Support/FormatVariadic.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "triton/Conversion/TritonGPUToLLVM/Utility.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "GPUOpsLowering.h"
#include "IndexIntrinsicsOpLowering.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
#include "llvm/Support/ErrorHandling.h"
#include <type_traits>

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "triton/Conversion/TritonGPUToLLVM/Utility.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"

namespace mlir {
namespace triton {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "intel/include/TritonIntelGPUToLLVM/Passes.h"
#include "mlir/Pass/Pass.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "intel/include/TritonIntelGPUToLLVM/Passes.h"

#include "triton/Analysis/Allocation.h"
#include "triton/Analysis/Utility.h"
#include "triton/Dialect/Triton/IR/Dialect.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "triton/Dialect/TritonGPU/IR/Dialect.h"

using namespace mlir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
#include "../Utility.h"

#include "mlir/IR/BuiltinTypes.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "triton/Dialect/TritonIntelGPU/IR/Dialect.h"
#include "triton/Dialect/TritonIntelGPU/Transforms/Utility.h"

#include "llvm/IR/DerivedTypes.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"

#include <optional>
#include <thread>

Expand Down
3 changes: 2 additions & 1 deletion third_party/intel/lib/TritonIntelGPUToLLVM/PrintOpToLLVM.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "PatternTritonGPUOpToLLVM.h"
#include "Utility.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

namespace {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Pass/Pass.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "intel/include/GPUToTritonGEN/GPUToTritonGENPass.h"
#include "intel/include/TritonGENToLLVM/TritonGENToLLVMPass.h"

#include "triton/Analysis/Allocation.h"
#include "triton/Analysis/AxisInfo.h"
#include "triton/Analysis/Membar.h"
#include "triton/Dialect/Triton/IR/Dialect.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "triton/Dialect/TritonGPU/IR/Dialect.h"
#include "triton/Dialect/TritonIntelGPU/IR/Dialect.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include "PatternTritonGPUOpToLLVM.h"
#include "triton/Analysis/Utility.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "triton/Analysis/Utility.h"
#include "triton/Dialect/Triton/IR/Dialect.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"

using namespace mlir;
using namespace mlir::triton;
Expand Down
4 changes: 3 additions & 1 deletion third_party/intel/lib/TritonIntelGPUToLLVM/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
#define TRITON_CONVERSION_TRITONINTELGPU_TO_LLVM_UTILITY_H

#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "triton/Conversion/TritonGPUToLLVM/Utility.h"
#include "triton/Dialect/Triton/IR/Utility.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "triton/Dialect/TritonIntelGPU/IR/Dialect.h"

#define DEBUG_TYPE "ttgpu_to_llvm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/TypeUtilities.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "triton/Dialect/Triton/IR/Utility.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "triton/Dialect/TritonGPU/IR/Dialect.h"
#include "triton/Dialect/TritonGPU/Transforms/Utility.h"
#include "triton/Dialect/TritonIntelGPU/IR/Dialect.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "triton/Dialect/Triton/IR/Dialect.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"
#include "triton/Dialect/TritonGPU/IR/Dialect.h"
#include "triton/Dialect/TritonIntelGPU/IR/Dialect.h"
#include "triton/Dialect/TritonIntelGPU/Transforms/Passes.h"
Expand Down
4 changes: 3 additions & 1 deletion third_party/intel/triton_xpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#include "mlir/Pass/PassManager.h"
#include "passes.h"
#include "triton/Conversion/TritonToTritonGPU/Passes.h"
#include "triton/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h"

#include "triton/Dialect/TritonIntelGPU/IR/Dialect.h"
#include "triton/Dialect/TritonIntelGPU/Transforms/Passes.h"
#include "triton/Dialect/TritonNvidiaGPU/IR/Dialect.h"
Expand Down

0 comments on commit 9c515cf

Please sign in to comment.