mirror of https://github.com/llvm/torch-mlir
Bump llvm-project to 484b6648fdd4b104eaf7a2504dd07b60af2c9f8d
- add_mlir_doc arg order - fix some dependent dialects on passes that were now causing errors - "encoding" attribute on mlirRankedTensorTypeGetCheckedpull/210/head
parent
b8ad0189ac
commit
544cb4ef54
|
@ -1 +1 @@
|
|||
Subproject commit 223dcdcfbe23affdf17ada7f023ee1872fd76160
|
||||
Subproject commit 484b6648fdd4b104eaf7a2504dd07b60af2c9f8d
|
|
@ -224,8 +224,8 @@ MlirAttribute torch_mlir::converTensorToMlirElementsAttr(at::Tensor tensor,
|
|||
elementType = typeMapper.mapFromTorchScalarType(tensor.scalar_type());
|
||||
}
|
||||
std::vector<int64_t> shape(tensor.sizes().begin(), tensor.sizes().end());
|
||||
MlirType shapedType = mlirRankedTensorTypeGetChecked(loc, shape.size(),
|
||||
shape.data(), elementType);
|
||||
MlirType shapedType = mlirRankedTensorTypeGetChecked(
|
||||
loc, shape.size(), shape.data(), elementType, {nullptr});
|
||||
if (mlirTypeIsNull(shapedType)) {
|
||||
throwUnsupportedTensorError();
|
||||
}
|
||||
|
|
|
@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
|
|||
mlir_tablegen(Passes.h.inc -gen-pass-decls)
|
||||
add_public_tablegen_target(NPCOMPCommonBackendPassIncGen)
|
||||
|
||||
add_mlir_doc(Passes -gen-pass-doc CommonBackendPasses ./)
|
||||
add_mlir_doc(Passes CommonBackendPasses ./ -gen-pass-doc)
|
||||
|
|
|
@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
|
|||
mlir_tablegen(Passes.h.inc -gen-pass-decls)
|
||||
add_public_tablegen_target(NPCOMPIREEBackendPassIncGen)
|
||||
|
||||
add_mlir_doc(Passes -gen-pass-doc IREEBackendPasses ./)
|
||||
add_mlir_doc(Passes IREEBackendPasses ./ -gen-pass-doc)
|
||||
|
|
|
@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
|
|||
mlir_tablegen(Passes.h.inc -gen-pass-decls ${NPCOMP_TABLEGEN_ARGS})
|
||||
add_public_tablegen_target(NPCOMPConversionPassIncGen)
|
||||
|
||||
add_mlir_doc(Passes -gen-pass-doc NPCOMPConversionPasses ./)
|
||||
add_mlir_doc(Passes NPCOMPConversionPasses ./ -gen-pass-doc)
|
||||
|
|
|
@ -15,5 +15,5 @@ mlir_tablegen(ATenOpInterfaces.cpp.inc -gen-op-interface-defs)
|
|||
add_public_tablegen_target(MLIRATenOpInterfacesIncGen)
|
||||
add_dependencies(mlir-generic-headers MLIRATenOpInterfacesIncGen)
|
||||
|
||||
add_mlir_doc(ATenDialect -gen-dialect-doc ATenDialect ATen/)
|
||||
add_mlir_doc(ATenOps -gen-op-doc ATenOps ATen/)
|
||||
add_mlir_doc(ATenDialect ATenDialect ATen/ -gen-dialect-doc)
|
||||
add_mlir_doc(ATenOps ATenOps ATen/ -gen-op-doc)
|
||||
|
|
|
@ -10,5 +10,5 @@ mlir_tablegen(${dialect}Enums.cpp.inc -gen-enum-defs)
|
|||
add_public_tablegen_target(MLIR${dialect}IncGen)
|
||||
add_dependencies(mlir-headers MLIR${dialect}IncGen)
|
||||
|
||||
add_mlir_doc(BasicpyDialect -gen-dialect-doc BasicpyDialect Basicpy/)
|
||||
add_mlir_doc(BasicpyOps -gen-op-doc BasicpyOps Basicpy/)
|
||||
add_mlir_doc(BasicpyDialect BasicpyDialect Basicpy/ -gen-dialect-doc)
|
||||
add_mlir_doc(BasicpyOps BasicpyOps Basicpy/ -gen-op-doc)
|
||||
|
|
|
@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
|
|||
mlir_tablegen(Passes.h.inc -gen-pass-decls)
|
||||
add_public_tablegen_target(NPCOMPBasicpyPassIncGen)
|
||||
|
||||
add_mlir_doc(Passes -gen-pass-doc Transforms ./)
|
||||
add_mlir_doc(Passes Transforms ./ -gen-pass-doc)
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
add_mlir_dialect(NumpyOps numpy)
|
||||
add_mlir_doc(NumpyDialect -gen-dialect-doc NumpyDialect Numpy/)
|
||||
add_mlir_doc(NumpyOps -gen-op-doc NumpyOps Numpy/)
|
||||
add_mlir_doc(NumpyDialect NumpyDialect Numpy/ -gen-dialect-doc)
|
||||
add_mlir_doc(NumpyOps NumpyOps Numpy/ -gen-op-doc)
|
||||
|
|
|
@ -2,5 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
|
|||
mlir_tablegen(Passes.h.inc -gen-pass-decls)
|
||||
add_public_tablegen_target(NPCOMPNumpyPassIncGen)
|
||||
|
||||
add_mlir_doc(Passes -gen-pass-doc NPCOMPNumpyTransforms ./)
|
||||
|
||||
add_mlir_doc(Passes NPCOMPNumpyTransforms ./ -gen-pass-doc)
|
||||
|
|
|
@ -2,5 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
|
|||
mlir_tablegen(Passes.h.inc -gen-pass-decls)
|
||||
add_public_tablegen_target(NPCOMPTCFPassIncGen)
|
||||
|
||||
add_mlir_doc(Passes -gen-pass-doc NPCOMPTCFTransforms ./)
|
||||
|
||||
add_mlir_doc(Passes NPCOMPTCFTransforms ./ -gen-pass-doc)
|
||||
|
|
|
@ -2,5 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
|
|||
mlir_tablegen(Passes.h.inc -gen-pass-decls)
|
||||
add_public_tablegen_target(NPCOMPTCPPassIncGen)
|
||||
|
||||
add_mlir_doc(Passes -gen-pass-doc NPCOMPTCPTransforms ./)
|
||||
|
||||
add_mlir_doc(Passes NPCOMPTCPTransforms ./ -gen-pass-doc)
|
||||
|
|
|
@ -16,5 +16,5 @@ mlir_tablegen(OpInterfaces.cpp.inc -gen-op-interface-defs)
|
|||
add_public_tablegen_target(MLIRTorchOpInterfacesIncGen)
|
||||
add_dependencies(mlir-generic-headers MLIRTorchOpInterfacesIncGen)
|
||||
|
||||
add_mlir_doc(TorchDialect -gen-dialect-doc TorchDialect Torch/)
|
||||
add_mlir_doc(TorchOps -gen-op-doc TorchOps Torch/)
|
||||
add_mlir_doc(TorchDialect TorchDialect Torch/ -gen-dialect-doc)
|
||||
add_mlir_doc(TorchOps TorchOps Torch/ -gen-op-doc)
|
||||
|
|
|
@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
|
|||
mlir_tablegen(Passes.h.inc -gen-pass-decls)
|
||||
add_public_tablegen_target(NPCOMPTorchPassIncGen)
|
||||
|
||||
add_mlir_doc(Passes -gen-pass-doc NPCOMPTorchTransforms ./)
|
||||
add_mlir_doc(Passes NPCOMPTorchTransforms ./ -gen-pass-doc)
|
||||
|
|
|
@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
|
|||
mlir_tablegen(Passes.h.inc -gen-pass-decls)
|
||||
add_public_tablegen_target(NPCOMPRefBackendPassIncGen)
|
||||
|
||||
add_mlir_doc(Passes -gen-pass-doc RefBackendPasses ./)
|
||||
add_mlir_doc(Passes RefBackendPasses ./ -gen-pass-doc)
|
||||
|
|
|
@ -29,7 +29,7 @@ def LowerToRefbackrtABI : Pass<"lower-to-refbackrt-abi", "ModuleOp"> {
|
|||
def LowerAllocMemRefOps : Pass<"lower-alloc-memref-ops", "FuncOp"> {
|
||||
let summary = "Lower AllocMemRefOp's";
|
||||
let constructor = "mlir::NPCOMP::createLowerAllocMemRefOpsPass()";
|
||||
let dependentDialects = ["tensor::TensorDialect"];
|
||||
let dependentDialects = ["tensor::TensorDialect", "memref::MemRefDialect"];
|
||||
}
|
||||
|
||||
def LowerToLLVM : Pass<"refback-lower-to-llvm", "ModuleOp"> {
|
||||
|
|
|
@ -2,4 +2,4 @@ set(LLVM_TARGET_DEFINITIONS Passes.td)
|
|||
mlir_tablegen(Passes.h.inc -gen-pass-decls)
|
||||
add_public_tablegen_target(NPCOMPTypingTransformsPassIncGen)
|
||||
|
||||
#add_mlir_doc(Passes -gen-pass-doc Transforms ./)
|
||||
#add_mlir_doc(Passes Transforms ./ -gen-pass-doc)
|
||||
|
|
|
@ -120,6 +120,7 @@ class ConvertATenToLinalg
|
|||
: public ConvertATenToLinalgBase<ConvertATenToLinalg> {
|
||||
public:
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<linalg::LinalgDialect>();
|
||||
registry.insert<memref::MemRefDialect>();
|
||||
}
|
||||
|
||||
|
|
|
@ -191,8 +191,8 @@ namespace {
|
|||
class ConvertTCFToLinalg : public ConvertTCFToLinalgBase<ConvertTCFToLinalg> {
|
||||
public:
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry
|
||||
.insert<shape::ShapeDialect, tcp::TCPDialect, tensor::TensorDialect>();
|
||||
registry.insert<shape::ShapeDialect, tcp::TCPDialect, tensor::TensorDialect,
|
||||
memref::MemRefDialect, linalg::LinalgDialect>();
|
||||
}
|
||||
|
||||
void runOnOperation() override {
|
||||
|
|
|
@ -136,7 +136,7 @@ namespace {
|
|||
class ConvertTCFToStd : public ConvertTCFToStdBase<ConvertTCFToStd> {
|
||||
public:
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<shape::ShapeDialect>();
|
||||
registry.insert<math::MathDialect, shape::ShapeDialect, tcp::TCPDialect>();
|
||||
}
|
||||
|
||||
void runOnOperation() override {
|
||||
|
|
|
@ -860,7 +860,8 @@ MemRefType convertTensorType(TensorType tensor) {
|
|||
/// FIXME: Audit this for completeness
|
||||
struct ATenLoweringPass : public ATenLoweringBase<ATenLoweringPass> {
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<LLVM::LLVMDialect, StandardOpsDialect>();
|
||||
registry
|
||||
.insert<LLVM::LLVMDialect, StandardOpsDialect, memref::MemRefDialect>();
|
||||
}
|
||||
|
||||
void runOnOperation() override {
|
||||
|
|
|
@ -24,6 +24,7 @@ void NumpyDialect::initialize() {
|
|||
#include "npcomp/Dialect/Numpy/IR/NumpyOps.cpp.inc"
|
||||
>();
|
||||
addTypes<AnyDtypeType, NdArrayType>();
|
||||
getContext()->loadDialect<Basicpy::BasicpyDialect>();
|
||||
}
|
||||
|
||||
Type NumpyDialect::parseType(DialectAsmParser &parser) const {
|
||||
|
|
|
@ -226,6 +226,7 @@ namespace {
|
|||
class TCPBufferizePass : public TCPBufferizeBase<TCPBufferizePass> {
|
||||
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
|
||||
registry.insert<refback::RefbackDialect>();
|
||||
registry.insert<memref::MemRefDialect>();
|
||||
registry.insert<linalg::LinalgDialect>();
|
||||
registry.insert<scf::SCFDialect>();
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "npcomp/Dialect/Torch/Transforms/Passes.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/SetVector.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
|
||||
using namespace mlir;
|
||||
using namespace mlir::NPCOMP;
|
||||
|
|
|
@ -351,6 +351,9 @@ void optimize(FuncOp func, TypeAnalyzer &analyzer) {
|
|||
|
||||
namespace {
|
||||
class RefineTypesPass : public RefineTypesBase<RefineTypesPass> {
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<Numpy::NumpyDialect, aten::ATenDialect>();
|
||||
}
|
||||
void runOnOperation() override {
|
||||
auto func = getOperation();
|
||||
TypeAnalyzer analyzer(&getContext());
|
||||
|
|
|
@ -420,7 +420,7 @@ namespace {
|
|||
class LowerToRefbackrtABI
|
||||
: public LowerToRefbackrtABIBase<LowerToRefbackrtABI> {
|
||||
void getDependentDialects(DialectRegistry ®istry) const override {
|
||||
registry.insert<refbackrt::RefbackrtDialect>();
|
||||
registry.insert<refbackrt::RefbackrtDialect, memref::MemRefDialect>();
|
||||
}
|
||||
|
||||
void runOnOperation() override {
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#ifndef REFBACKEND_PASSDETAIL_H
|
||||
#define REFBACKEND_PASSDETAIL_H
|
||||
|
||||
#include "mlir/Dialect/MemRef/IR/MemRef.h"
|
||||
#include "mlir/Dialect/Tensor/IR/Tensor.h"
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue