Skip to content

Commit

Permalink
Merge pull request #194 from Xilinx/bump_to_53992f23
Browse files Browse the repository at this point in the history
[AutoBump] Merge with fixes of 53992f2 (Jul 29) (23)
  • Loading branch information
mgehre-amd authored Sep 26, 2024
2 parents b3cb45a + 8d036c1 commit 7a029e0
Show file tree
Hide file tree
Showing 108 changed files with 407 additions and 188 deletions.
6 changes: 4 additions & 2 deletions src/Accelerators/Accelerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

//===-------------------------- Accelerator.hpp ---------------------------===//
//
// Copyright 2022 The IBM Research Authors.
// Copyright 2022-2024 The IBM Research Authors.
//
// =============================================================================
//
// Accelerator base class
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_ACCELERATOR_H
#define ONNX_MLIR_ACCELERATOR_H

#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
#include "mlir/IR/BuiltinOps.h"
Expand Down Expand Up @@ -164,3 +165,4 @@ extern void initAccelerators(llvm::ArrayRef<Accelerator::Kind> kinds);

} // namespace accel
} // namespace onnx_mlir
#endif
6 changes: 4 additions & 2 deletions src/Accelerators/NNPA/Compiler/NNPACompilerOptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

//===------------------------ NNPACompilerOptions.hpp ---------------------===//
//
// Copyright 2022 The IBM Research Authors.
// Copyright 2022-2024 The IBM Research Authors.
//
// =============================================================================
//
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_NNPA_COMPILER_OPTIONS_H
#define ONNX_MLIR_NNPA_COMPILER_OPTIONS_H

#include "llvm/Support/CommandLine.h"

Expand Down Expand Up @@ -69,3 +70,4 @@ extern llvm::cl::opt<std::string> nnpaSaveDevicePlacementFile;
extern llvm::cl::opt<bool> nnpaEnableSaturation;

} // namespace onnx_mlir
#endif
6 changes: 4 additions & 2 deletions src/Accelerators/NNPA/Compiler/NNPACompilerUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

//===------------------------- NNPACompilerUtils.hpp ----------------------===//
//
// Copyright 2022 The IBM Research Authors.
// Copyright 2022-2024 The IBM Research Authors.
//
// =============================================================================
//
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_NNPA_COMPILER_UTILS_H
#define ONNX_MLIR_NNPA_COMPILER_UTILS_H

#include "mlir/IR/BuiltinOps.h"
#include "mlir/Pass/PassManager.h"
Expand All @@ -37,3 +38,4 @@ void addPassesNNPA(mlir::OwningOpRef<mlir::ModuleOp> &module,
void configurePassesNNPA();

} // namespace onnx_mlir
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

//===-------- DevicePlacementHeuristic.hpp - Place ops using model -------===//
//
// Copyright 2023 The IBM Research Authors.
// Copyright 2023-2024 The IBM Research Authors.
//
// =============================================================================
//
// This file contains heuristics to place operations on CPU or NNPA.
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_HEURISTICS_H
#define ONNX_MLIR_HEURISTICS_H

#include "mlir/IR/BuiltinOps.h"

Expand Down Expand Up @@ -85,3 +86,4 @@ void PlaceBeneficialOpsOnNNPAWithStickUnstick(mlir::MLIRContext *context,
double significantNNPAFactor = 3.0);

} // namespace onnx_mlir
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

//===---------- ONNXLegalityCheck.hpp - Check legality for ONNX ops -------===//
//
// Copyright 2019-2023 The IBM Research Authors.
// Copyright 2019-2024 The IBM Research Authors.
//
// =============================================================================
//
Expand All @@ -14,7 +14,8 @@
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_LEGALITY_H
#define ONNX_MLIR_LEGALITY_H

#include "src/Conversion/ONNXToKrnl/ONNXToKrnlCommon.hpp"
#include "src/Dialect/ONNX/ONNXDimAnalysis.hpp"
Expand Down Expand Up @@ -53,3 +54,5 @@ bool onnxToZHighUnsupportedReport(

bool onnxToZHighInCompatibilityReport(
mlir::Operation *op, std::string inputNNPALevel);

#endif
6 changes: 4 additions & 2 deletions src/Accelerators/NNPA/Conversion/ONNXToZHigh/ONNXToZHigh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

//====------ ONNXToZHigh.hpp - ONNX dialect to ZHigh lowering -------------===//
//
// Copyright 2019-2022 The IBM Research Authors.
// Copyright 2019-2024 The IBM Research Authors.
//
// =============================================================================
//
Expand All @@ -13,7 +13,8 @@
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_ONNX_TO_ZHIGH_H
#define ONNX_MLIR_ONNX_TO_ZHIGH_H

#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/DialectConversion.h"
Expand All @@ -30,3 +31,4 @@ void getONNXToZHighOneOpDynamicallyLegal(
mlir::ConversionTarget *target, const DimAnalysis *dimAnalysis);

} // namespace onnx_mlir
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

//===---------- ONNXToZHigh.hpp - Common functions in ONNXToZHigh ---------===//
//===---------- ONNXToZHighCommon.hpp - Common functions in ONNXToZHigh
//---------===//
//
// Copyright 2019-2024 The IBM Research Authors.
//
Expand All @@ -12,7 +13,8 @@
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_ZHIGH_COMMON_H
#define ONNX_MLIR_ZHIGH_COMMON_H

#include "llvm/ADT/STLExtras.h"

Expand Down Expand Up @@ -115,3 +117,4 @@ mlir::Value getDynShape(
mlir::Location loc, mlir::PatternRewriter &rewriter, mlir::Value x);

} // namespace onnx_mlir
#endif
6 changes: 4 additions & 2 deletions src/Accelerators/NNPA/Conversion/ONNXToZHigh/PerfModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

//===-------- PerfModel.hpp - Estimate if CPU or NNPA is faster ----------===//
//
// Copyright 2023 The IBM Research Authors.
// Copyright 2023-2024 The IBM Research Authors.
//
// =============================================================================
//
Expand All @@ -13,7 +13,8 @@
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_PERF_H
#define ONNX_MLIR_PERF_H

#include "mlir/IR/BuiltinOps.h"

Expand All @@ -32,3 +33,4 @@ double estimateTimeForStickOp(mlir::Value oper);
double estimateTimeForUnstickOp(mlir::Value oper);

} // namespace onnx_mlir
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

//===--- RewriteONNXForZHigh.hpp - Rewrite ONNX ops for ZHigh lowering ----===//
//
// Copyright 2019-2023 The IBM Research Authors.
// Copyright 2019-2024 The IBM Research Authors.
//
// =============================================================================
//
// This file implements pass for rewriting of ONNX operations to generate
// combination of ONNX and ZHigh operations.

#pragma once
#ifndef ONNX_MLIR_REWRITE_ZHIGH_H
#define ONNX_MLIR_REWRITE_ZHIGH_H

#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/DialectConversion.h"
Expand All @@ -28,3 +29,4 @@ void getRewriteONNXForZHighDynamicallyLegal(
mlir::ConversionTarget *target, const DimAnalysis *dimAnalysis);

} // namespace onnx_mlir
#endif
6 changes: 4 additions & 2 deletions src/Accelerators/NNPA/Conversion/ZHighToZLow/ZHighToZLow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

//====------ ZHighToZLow.hpp - ZHigh dialect to ZLow lowering -------------===//
//
// Copyright 2019-2021 The IBM Research Authors.
// Copyright 2019-2024 The IBM Research Authors.
//
// =============================================================================
//
// This file implements the lowering of ZHigh operations to ZLow operations.
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_ZHIGH_TO_ZLOW_H
#define ONNX_MLIR_ZHIGH_TO_ZLOW_H

#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinTypes.h"
Expand Down Expand Up @@ -57,3 +58,4 @@ void populateZHighToZLowConversionPattern(mlir::RewritePatternSet &patterns,

} // namespace zhigh
} // namespace onnx_mlir
#endif
6 changes: 4 additions & 2 deletions src/Accelerators/NNPA/Conversion/ZLowToLLVM/ZLowToLLVM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

//===---------- ZLowToLLVM.hpp - Lowering from ZLow to LLVM ---------------===//
//
// Copyright 2019-2022 The IBM Research Authors.
// Copyright 2019-2024 The IBM Research Authors.
//
// =============================================================================
//
//
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_ZLOW_TO_LLVM_H
#define ONNX_MLIR_ZLOW_TO_LLVM_H

#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
#include "mlir/IR/PatternMatch.h"
Expand All @@ -27,3 +28,4 @@ void populateZLowToLLVMConversionPattern(mlir::RewritePatternSet &patterns,

} // namespace zlow
} // namespace onnx_mlir
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

//===---------- ZLowToLLVMCommon.hpp - Lowering from ZLow to LLVM ---------===//
//
// Copyright 2019-2020 The IBM Research Authors.
// Copyright 2019-2024 The IBM Research Authors.
//
// =============================================================================
//
// This file contains common methods used in lowering ZLow to LLVM
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_ZLOW_TO_LLVM_COMMON_H
#define ONNX_MLIR_ZLOW_TO_LLVM_COMMON_H

#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
Expand Down Expand Up @@ -200,3 +201,4 @@ void fillInZTensor(mlir::PatternRewriter &rewriter, mlir::Location loc,

} // namespace zlow
} // namespace onnx_mlir
#endif
6 changes: 4 additions & 2 deletions src/Accelerators/NNPA/Dialect/ZHigh/ZHighOps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

//===------------------ ZHighOps.hpp - ZHigh Operations -------------------===//
//
// Copyright 2019-2022 The IBM Research Authors.
// Copyright 2019-2024 The IBM Research Authors.
//
// =============================================================================
//
// This file defines the ZHigh operations in the MLIR operation set.
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_ZHIGH_H
#define ONNX_MLIR_ZHIGH_H

#include <map>
#include <string>
Expand Down Expand Up @@ -58,3 +59,4 @@ class SameOperandsAndResultLayout

#define GET_OP_CLASSES
#include "src/Accelerators/NNPA/Dialect/ZHigh/ZHighOps.hpp.inc"
#endif
6 changes: 4 additions & 2 deletions src/Accelerators/NNPA/Dialect/ZHigh/ZHighOps/OpHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

//===-------- ZHighHelper.hpp - ZHigh Helper Functions --------------------===//
//
// Copyright 2019-2022 The IBM Research Authors.
// Copyright 2019-2024 The IBM Research Authors.
//
// =============================================================================
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_OP_HELPER_H
#define ONNX_MLIR_OP_HELPER_H

#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinAttributes.h"
Expand Down Expand Up @@ -89,3 +90,4 @@ mlir::IntegerAttr getDefaultSaturation(mlir::PatternRewriter &rewriter);

} // namespace zhigh
} // namespace onnx_mlir
#endif
6 changes: 4 additions & 2 deletions src/Accelerators/NNPA/Dialect/ZHigh/ZHighOps/ShapeHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

//===----------------ShapeHelper.hpp - shape helpers for ZHigh ------------===//
//
// Copyright 2019-2022 The IBM Research Authors.
// Copyright 2019-2024 The IBM Research Authors.
//
// =============================================================================
//
Expand All @@ -13,7 +13,8 @@
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_ZHIGH_SHAPE_HELPER_H
#define ONNX_MLIR_ZHIGH_SHAPE_HELPER_H

#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinTypes.h"
Expand Down Expand Up @@ -174,3 +175,4 @@ using ZHighFixGRUYOpShapeHelper = ONNXUnaryOpShapeHelper;

} // namespace zhigh
} // namespace onnx_mlir
#endif
6 changes: 4 additions & 2 deletions src/Accelerators/NNPA/Dialect/ZLow/DialectBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

//====--------- DialectBuilder.hpp - ZLow Dialect Builder -----------------===//
//
// Copyright 2022-2023 The IBM Research Authors.
// Copyright 2022-2024 The IBM Research Authors.
//
// =============================================================================
//
// This file declares the ZLow Dialect Builder.
//
//===----------------------------------------------------------------------===//

#pragma once
#ifndef ONNX_MLIR_DIALECT_BUILDER_H
#define ONNX_MLIR_DIALECT_BUILDER_H

#include "src/Dialect/Mlir/DialectBuilder.hpp"
#include "src/Dialect/Mlir/IndexExprBuilder.hpp"
Expand Down Expand Up @@ -53,3 +54,4 @@ struct MultiDialectBuilder<IndexExprBuilderForZLow, Ts...>
};

} // namespace onnx_mlir
#endif
Loading

0 comments on commit 7a029e0

Please sign in to comment.