From a2e4cf13f3c34f45a213bc5b078fda62b654bed2 Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Fri, 25 Feb 2022 10:01:24 +0800 Subject: [PATCH] upgrade Ascend package 24 Feb 22 --- inc/external/acl/OWNERS | 10 ---- inc/external/acl/acl.h | 2 +- inc/external/acl/acl_base.h | 3 +- inc/external/acl/acl_mdl.h | 2 +- inc/external/acl/acl_op.h | 2 +- inc/external/acl/acl_op_compiler.h | 2 +- inc/external/acl/acl_prof.h | 2 +- inc/external/acl/acl_rt.h | 2 +- inc/external/acl/acl_tdt.h | 2 +- inc/external/acl/acl_tdt_queue.h | 2 +- inc/external/acl/error_codes/ge_error_codes.h | 2 +- inc/external/acl/error_codes/rt_error_codes.h | 2 +- inc/external/acl/ops/acl_cblas.h | 2 +- inc/external/acl/ops/acl_dvpp.h | 2 +- inc/external/acl/ops/acl_fv.h | 2 +- inc/external/ge/ge_api.h | 14 +++--- inc/external/ge/ge_api_error_codes.h | 2 +- inc/external/ge/ge_api_types.h | 2 +- inc/external/ge/ge_error_codes.h | 2 +- inc/external/ge/ge_ir_build.h | 2 +- inc/external/hccl/hccl.h | 2 +- inc/external/hccl/hccl_types.h | 2 +- inc/external/runtime/rt_error_codes.h | 2 +- inc/framework/common/file_constant_util.h | 1 - inc/framework/common/helper/model_helper.h | 1 - inc/framework/common/op/attr_value_util.h | 1 - inc/framework/common/op/ge_op_utils.h | 2 - inc/framework/common/profiling_definitions.h | 15 ++++++ inc/framework/common/scope_guard.h | 1 - inc/framework/common/util.h | 2 - inc/framework/executor/ge_executor.h | 4 ++ inc/framework/omg/parser/op_parser.h | 2 - inc/framework/omg/version.h | 1 - metadef | 2 +- .../inc/external/runtime/rt_error_codes.h | 1 + third_party/fwkacllib/inc/ops/array_ops.h | 20 +++++--- third_party/fwkacllib/inc/ops/ctc_ops.h | 38 +++++++-------- third_party/fwkacllib/inc/ops/image_ops.h | 48 +++++++++++++++++++ third_party/fwkacllib/inc/ops/nn_norm_ops.h | 41 +++++++++++++++- third_party/fwkacllib/inc/ops/quantize_ops.h | 23 +++++++++ third_party/fwkacllib/inc/runtime/dev.h | 15 ++++++ third_party/fwkacllib/inc/runtime/kernel.h | 22 +++++++++ third_party/fwkacllib/inc/runtime/rt_model.h | 10 ++++ third_party/fwkacllib/inc/tdt/tsd_client.h | 28 +++++++++++ .../fwkacllib/inc/toolchain/prof_reporter.h | 4 +- 45 files changed, 268 insertions(+), 81 deletions(-) delete mode 100755 inc/external/acl/OWNERS diff --git a/inc/external/acl/OWNERS b/inc/external/acl/OWNERS deleted file mode 100755 index b4b22068..00000000 --- a/inc/external/acl/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -approvers: -- ji_chen -- wqtshg -- zhangfan_hq -reviewers: -- justin_zhao -- zhangyongfeng88 -- w00267184 -options: - no_parent_owners: true \ No newline at end of file diff --git a/inc/external/acl/acl.h b/inc/external/acl/acl.h index a5194472..99e87e28 100644 --- a/inc/external/acl/acl.h +++ b/inc/external/acl/acl.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/acl_base.h b/inc/external/acl/acl_base.h index c938d4fb..1d9813f3 100644 --- a/inc/external/acl/acl_base.h +++ b/inc/external/acl/acl_base.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -164,6 +164,7 @@ typedef enum { ACL_FORMAT_NC1HWC0 = 3, ACL_FORMAT_FRACTAL_Z = 4, ACL_FORMAT_NC1HWC0_C04 = 12, + ACL_FORMAT_HWCN = 16, ACL_FORMAT_NDHWC = 27, ACL_FORMAT_FRACTAL_NZ = 29, ACL_FORMAT_NCDHW = 30, diff --git a/inc/external/acl/acl_mdl.h b/inc/external/acl/acl_mdl.h index 778fa519..d0e2d145 100644 --- a/inc/external/acl/acl_mdl.h +++ b/inc/external/acl/acl_mdl.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/acl_op.h b/inc/external/acl/acl_op.h index f340b6bc..c49d56db 100644 --- a/inc/external/acl/acl_op.h +++ b/inc/external/acl/acl_op.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/acl_op_compiler.h b/inc/external/acl/acl_op_compiler.h index 8480b89c..9de0ee85 100644 --- a/inc/external/acl/acl_op_compiler.h +++ b/inc/external/acl/acl_op_compiler.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/acl_prof.h b/inc/external/acl/acl_prof.h index b2e1e1f7..01df5992 100644 --- a/inc/external/acl/acl_prof.h +++ b/inc/external/acl/acl_prof.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/acl_rt.h b/inc/external/acl/acl_rt.h index c5e8272c..578f3bdd 100644 --- a/inc/external/acl/acl_rt.h +++ b/inc/external/acl/acl_rt.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/acl_tdt.h b/inc/external/acl/acl_tdt.h index d928a911..75f07241 100644 --- a/inc/external/acl/acl_tdt.h +++ b/inc/external/acl/acl_tdt.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/acl_tdt_queue.h b/inc/external/acl/acl_tdt_queue.h index 01f0eebf..c8ab02a3 100644 --- a/inc/external/acl/acl_tdt_queue.h +++ b/inc/external/acl/acl_tdt_queue.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/error_codes/ge_error_codes.h b/inc/external/acl/error_codes/ge_error_codes.h index 027c83ea..cc3fbedc 100644 --- a/inc/external/acl/error_codes/ge_error_codes.h +++ b/inc/external/acl/error_codes/ge_error_codes.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/error_codes/rt_error_codes.h b/inc/external/acl/error_codes/rt_error_codes.h index d16af89f..a060dfdb 100644 --- a/inc/external/acl/error_codes/rt_error_codes.h +++ b/inc/external/acl/error_codes/rt_error_codes.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/ops/acl_cblas.h b/inc/external/acl/ops/acl_cblas.h index 3d81eb2b..586d06a8 100644 --- a/inc/external/acl/ops/acl_cblas.h +++ b/inc/external/acl/ops/acl_cblas.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/ops/acl_dvpp.h b/inc/external/acl/ops/acl_dvpp.h index 6ab89c49..a46839f8 100644 --- a/inc/external/acl/ops/acl_dvpp.h +++ b/inc/external/acl/ops/acl_dvpp.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/acl/ops/acl_fv.h b/inc/external/acl/ops/acl_fv.h index 4bd392c9..87480461 100644 --- a/inc/external/acl/ops/acl_fv.h +++ b/inc/external/acl/ops/acl_fv.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/ge/ge_api.h b/inc/external/ge/ge_api.h index 1e80ac4e..73753b72 100644 --- a/inc/external/ge/ge_api.h +++ b/inc/external/ge/ge_api.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,7 +72,7 @@ class GE_FUNC_VISIBILITY Session { /// @return Status result of function /// ATTRIBUTED_DEPRECATED(Status AddGraph(uint32_t, const Graph &, const std::map &)) - Status AddGraph(uint32_t graphId, const Graph &graph, const std::map &options); + Status AddGraph(uint32_t graph_id, const Graph &graph, const std::map &options); /// /// @ingroup client @@ -82,7 +82,7 @@ class GE_FUNC_VISIBILITY Session { /// @param [in] options graph options /// @return Status result of function /// - Status AddGraph(uint32_t graphId, const Graph &graph, const std::map &options); + Status AddGraph(uint32_t graph_id, const Graph &graph, const std::map &options); /// /// @ingroup client @@ -119,7 +119,7 @@ class GE_FUNC_VISIBILITY Session { /// @param [out] outputs output data /// @return Status result of function /// - Status RunGraph(uint32_t graphId, const std::vector &inputs, std::vector &outputs); + Status RunGraph(uint32_t graph_id, const std::vector &inputs, std::vector &outputs); /// /// @ingroup ge_graph @@ -140,9 +140,9 @@ class GE_FUNC_VISIBILITY Session { /// @param [in] inputs: input data /// @return Status result of function /// - Status BuildGraph(uint32_t graphId, const std::vector &inputs); + Status BuildGraph(uint32_t graph_id, const std::vector &inputs); - Status BuildGraph(uint32_t graphId, const std::vector &inputs); /*lint !e148*/ + Status BuildGraph(uint32_t graph_id, const std::vector &inputs); /*lint !e148*/ /// /// @ingroup ge_graph @@ -154,7 +154,7 @@ class GE_FUNC_VISIBILITY Session { /// Please ensure that the implementation of the function is trusted. /// @return Status result of function /// - Status RunGraphAsync(uint32_t graphId, const std::vector &inputs, RunAsyncCallback callback); + Status RunGraphAsync(uint32_t graph_id, const std::vector &inputs, RunAsyncCallback callback); /// /// @ingroup ge_graph diff --git a/inc/external/ge/ge_api_error_codes.h b/inc/external/ge/ge_api_error_codes.h index b5cfb115..7d4cab13 100644 --- a/inc/external/ge/ge_api_error_codes.h +++ b/inc/external/ge/ge_api_error_codes.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/ge/ge_api_types.h b/inc/external/ge/ge_api_types.h index 93ebe284..2ad7dd99 100644 --- a/inc/external/ge/ge_api_types.h +++ b/inc/external/ge/ge_api_types.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/ge/ge_error_codes.h b/inc/external/ge/ge_error_codes.h index 027c83ea..cc3fbedc 100644 --- a/inc/external/ge/ge_error_codes.h +++ b/inc/external/ge/ge_error_codes.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/ge/ge_ir_build.h b/inc/external/ge/ge_ir_build.h index d1d6ade9..5a542fd8 100644 --- a/inc/external/ge/ge_ir_build.h +++ b/inc/external/ge/ge_ir_build.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/hccl/hccl.h b/inc/external/hccl/hccl.h index c24b5374..ea077054 100644 --- a/inc/external/hccl/hccl.h +++ b/inc/external/hccl/hccl.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/hccl/hccl_types.h b/inc/external/hccl/hccl_types.h index ea09fa4d..b018227d 100644 --- a/inc/external/hccl/hccl_types.h +++ b/inc/external/hccl/hccl_types.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/external/runtime/rt_error_codes.h b/inc/external/runtime/rt_error_codes.h index d16af89f..a060dfdb 100644 --- a/inc/external/runtime/rt_error_codes.h +++ b/inc/external/runtime/rt_error_codes.h @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020 Huawei Technologies Co., Ltd + * Copyright 2019-2022 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/inc/framework/common/file_constant_util.h b/inc/framework/common/file_constant_util.h index e0763057..a53c5a24 100644 --- a/inc/framework/common/file_constant_util.h +++ b/inc/framework/common/file_constant_util.h @@ -23,7 +23,6 @@ #include "ge/ge_api_error_codes.h" #include "nlohmann/json.hpp" #include "graph/op_desc.h" -#include "graph/types.h" #include "graph/ge_tensor.h" namespace ge { diff --git a/inc/framework/common/helper/model_helper.h b/inc/framework/common/helper/model_helper.h index 4a098b1f..3dc7c704 100644 --- a/inc/framework/common/helper/model_helper.h +++ b/inc/framework/common/helper/model_helper.h @@ -20,7 +20,6 @@ #include #include -#include "framework/common/fmk_types.h" #include "framework/common/helper/om_file_helper.h" #include "common/model/ge_model.h" #include "common/model/ge_root_model.h" diff --git a/inc/framework/common/op/attr_value_util.h b/inc/framework/common/op/attr_value_util.h index d749ae4f..5a41de05 100644 --- a/inc/framework/common/op/attr_value_util.h +++ b/inc/framework/common/op/attr_value_util.h @@ -34,7 +34,6 @@ #include #include #include -#include "external/graph/types.h" #include "graph/debug/ge_attr_define.h" #include "proto/om.pb.h" diff --git a/inc/framework/common/op/ge_op_utils.h b/inc/framework/common/op/ge_op_utils.h index 53e72074..95f1dca1 100644 --- a/inc/framework/common/op/ge_op_utils.h +++ b/inc/framework/common/op/ge_op_utils.h @@ -21,8 +21,6 @@ #include #include "framework/common/op/attr_value_util.h" -#include "register/register_types.h" -#include "register/register_error_codes.h" #include "framework/common/util.h" #include "graph/attr_value.h" #include "graph/ge_tensor.h" diff --git a/inc/framework/common/profiling_definitions.h b/inc/framework/common/profiling_definitions.h index 90f3823a..6522486b 100644 --- a/inc/framework/common/profiling_definitions.h +++ b/inc/framework/common/profiling_definitions.h @@ -52,6 +52,21 @@ enum { kOpExecute, kAllocMem, kCopyH2D, + kPrepareNode, + kWaitForPrepareDone, + kPropgateOutputs, + kOnNodeDoneCallback, + kValidateInputTensor, + kAfterExecuted, + kRtEventSychronize, + kInferShapeWaitDependShape, + kInferShapeWaitInputTensor, + kInferShapeCallInferFunc, + kInferShapePropgate, + // v2 control node + kSelectBranch, + kExecuteSubGraph, + kInitSubGraphExecutor, // Add new definitions here kProfilingIndexEnd diff --git a/inc/framework/common/scope_guard.h b/inc/framework/common/scope_guard.h index ce9e4c51..bda9ffe2 100644 --- a/inc/framework/common/scope_guard.h +++ b/inc/framework/common/scope_guard.h @@ -18,7 +18,6 @@ #define INC_FRAMEWORK_COMMON_SCOPE_GUARD_H_ #include -#include /// Usage: /// Acquire Resource 1 diff --git a/inc/framework/common/util.h b/inc/framework/common/util.h index ca662242..6a7a1455 100644 --- a/inc/framework/common/util.h +++ b/inc/framework/common/util.h @@ -17,11 +17,9 @@ #ifndef AIR_INC_FRAMEWORK_COMMON_UTIL_H_ #define AIR_INC_FRAMEWORK_COMMON_UTIL_H_ -#include #include #include #include -#include #include #include "external/graph/types.h" diff --git a/inc/framework/executor/ge_executor.h b/inc/framework/executor/ge_executor.h index 2929d26b..66b95180 100644 --- a/inc/framework/executor/ge_executor.h +++ b/inc/framework/executor/ge_executor.h @@ -315,6 +315,10 @@ class GE_FUNC_VISIBILITY GeExecutor { static Status LoadDynamicSingleOpV2(const std::string &model_name, const ModelData &model_data, void *const stream, DynamicSingleOp **const single_op, const uint64_t model_id); + static Status UnloadSingleOp(const uint64_t op_id); + + static Status UnloadDynamicSingleOp(const uint64_t op_id); + static Status ExecuteAsync(DynamicSingleOp *const executor, const std::vector &input_desc, const std::vector &inputs, std::vector &output_desc, std::vector &outputs); diff --git a/inc/framework/omg/parser/op_parser.h b/inc/framework/omg/parser/op_parser.h index b511a8b0..f17b6fee 100644 --- a/inc/framework/omg/parser/op_parser.h +++ b/inc/framework/omg/parser/op_parser.h @@ -21,8 +21,6 @@ #include "framework/omg/parser/parser_types.h" #include "framework/omg/omg_inner_types.h" #include "proto/om.pb.h" -#include "graph/ge_tensor.h" -#include "graph/op_desc.h" #include "graph/utils/op_desc_utils.h" using google::protobuf::Message; diff --git a/inc/framework/omg/version.h b/inc/framework/omg/version.h index 53f155fa..e355d284 100644 --- a/inc/framework/omg/version.h +++ b/inc/framework/omg/version.h @@ -18,7 +18,6 @@ #define INC_FRAMEWORK_OMG_VERSION_H_ #include -#include #include "framework/common/debug/log.h" #include "framework/common/string_util.h" diff --git a/metadef b/metadef index 0a233571..ab3207e9 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 0a2335712484f85cd44a0f2402eac6932b22b40a +Subproject commit ab3207e99f94aabf036e1c8b068de0df15ff2d01 diff --git a/third_party/fwkacllib/inc/external/runtime/rt_error_codes.h b/third_party/fwkacllib/inc/external/runtime/rt_error_codes.h index 09ce1f65..248303ef 100644 --- a/third_party/fwkacllib/inc/external/runtime/rt_error_codes.h +++ b/third_party/fwkacllib/inc/external/runtime/rt_error_codes.h @@ -62,6 +62,7 @@ static const int32_t ACL_ERROR_RT_OVER_LIMIT = 207012; // over l static const int32_t ACL_ERROR_RT_QUEUE_EMPTY = 207013; // queue is empty static const int32_t ACL_ERROR_RT_QUEUE_FULL = 207014; // queue is full static const int32_t ACL_ERROR_RT_REPEATED_INIT = 207015; // repeated init +static const int32_t ACL_ERROR_RT_AIVEC_OVER_FLOW = 207016; // aivec over flow static const int32_t ACL_ERROR_RT_INTERNAL_ERROR = 507000; // runtime internal error static const int32_t ACL_ERROR_RT_TS_ERROR = 507001; // ts internel error diff --git a/third_party/fwkacllib/inc/ops/array_ops.h b/third_party/fwkacllib/inc/ops/array_ops.h index 7928db15..ae55234c 100644 --- a/third_party/fwkacllib/inc/ops/array_ops.h +++ b/third_party/fwkacllib/inc/ops/array_ops.h @@ -1496,17 +1496,23 @@ REG_OP(QueueData) /** * @brief Ensures that the tensor's shape matches the expected shape. \n * @par Inputs: -* x: A Tensor. \n +* input: A Tensor. that need to be checked with desired shape +* Must be one of the following types: +* int8, uint8, int16, uint16, int32, int64, float16, float +* double, complex64 complex128 \n * @par Attributes: -* shape: The shape that needs to be checked \n +* shape: required, a desired tensor shape. type: list int \n * @par Outputs: -* y: A tensor. \n +* output: A tensor. has the same type and contents as input +* Must be one of the following types: +* int8, uint8, int16, uint16, int32, int64, float16, float +* double, complex64 complex128 \n */ REG_OP(EnsureShape) - .INPUT(input, TensorType({DT_INT8,DT_UINT8,DT_INT16,DT_UINT16,DT_INT32,DT_INT64,DT_FLOAT16, \ - DT_FLOAT,DT_DOUBLE})) - .OUTPUT(output, TensorType({DT_INT8,DT_UINT8,DT_INT16,DT_UINT16,DT_INT32,DT_INT64,DT_FLOAT16, \ - DT_FLOAT,DT_DOUBLE})) + .INPUT(input, TensorType({DT_INT8,DT_UINT8, DT_INT16, DT_UINT16, DT_INT32, DT_INT64, DT_FLOAT16, \ + DT_FLOAT, DT_DOUBLE, DT_COMPLEX64, DT_COMPLEX128})) + .OUTPUT(output, TensorType({DT_INT8, DT_UINT8, DT_INT16, DT_UINT16, DT_INT32, DT_INT64, DT_FLOAT16, \ + DT_FLOAT,DT_DOUBLE, DT_COMPLEX64, DT_COMPLEX128})) .REQUIRED_ATTR(shape, ListInt) .OP_END_FACTORY_REG(EnsureShape) } // namespace ge diff --git a/third_party/fwkacllib/inc/ops/ctc_ops.h b/third_party/fwkacllib/inc/ops/ctc_ops.h index bf50b24d..17e4eabf 100644 --- a/third_party/fwkacllib/inc/ops/ctc_ops.h +++ b/third_party/fwkacllib/inc/ops/ctc_ops.h @@ -156,16 +156,15 @@ REG_OP(CTCBeamSearchDecoder) *@li log_alpha: The probability of possible trace of input to target. *@par Attributes: -*@li blank : Blank label. Default 0. +*@li blank: Blank label. Default 0. *@li reduction: Specifies the reduction to apply to the output. Default: 'mean'. -*@li zero_infinity : Whether to zero infinite losses and the associated gradients. -*@li label_max : The max length of targets. +*@li zero_infinity: Whether to zero infinite losses and the associated gradients. -*@par Third-party framework compatibility +* @par Third-party framework compatibility: * Compatible with Pytorch CTCLoss operator. *@attention Constraints: -*The limit of Label’s length is 1K. +* The limit of Label’s length is 1K. */ REG_OP(CTCLossV2) .INPUT(log_probs, TensorType({DT_FLOAT, DT_DOUBLE})) @@ -177,38 +176,36 @@ REG_OP(CTCLossV2) .ATTR(blank, Int, 0) .ATTR(reduction, String, "mean") .ATTR(zero_infinity, Bool, false) - .ATTR(label_max, Int, 0) .OP_END_FACTORY_REG(CTCLossV2) /** *@brief The Connectionist Temporal Classification loss grad. -*@par Inputs: +* @par Inputs: *@li grad_out: Gradient renewal coefficient. Tensor of size (N), where N = batch size. -*@li log_probs: Tensor of size (T, N, C), where T =input length, N =batch size, +* @li log_probs: Tensor of size (T, N, C), where T =input length, N =batch size, and C = number of classes (including blank). It represent the logarithmized probabilities of the outputs. *@li targets: Tensor of size (N, S) or sum(target_lengths), where S = max target length. It represent the target sequences. -*@li input_lengths: Tuple or tensor of size (N). It represent the lengths of the inputs. +* @li input_lengths: Tuple or tensor of size (N). It represent the lengths of the inputs. *@li target_lengths: Tuple or tensor of size (N). It represent lengths of the targets. -*@li neg_log_likelihood: A loss value which is differentiable with respect to each input node. -*@li log_alpha: The probability of possible trace of input to target. +* @li neg_log_likelihood: A loss value which is differentiable with respect to each input node. +* @li log_alpha: The probability of possible trace of input to target. -*@par Outputs: +* @par Outputs: *@li grad: Tensor of size (T, N, C), The grad of Connectionist Temporal Classification loss. -*@par Attributes: -*@li blank : Blank label. Default 0. -*@li reduction: Specifies the reduction to apply to the output. Default: 'mean'. -*@li zero_infinity : Whether to zero infinite losses and the associated gradients. -*@li label_max : The max length of targets. +* @par Attributes: +*@li blank: Blank label. Default 0. +* @li reduction: Specifies the reduction to apply to the output. Default: 'mean'. +* @li zero_infinity: Whether to zero infinite losses and the associated gradients. -*@par Third-party framework compatibility +* @par Third-party framework compatibility: * Compatible with Pytorch CTCLoss operator. -*@attention Constraints: -*The limit of Label’s length is 1K. +* @attention Constraints: +* The limit of Label’s length is 1K. */ REG_OP(CTCLossV2Grad) .INPUT(grad_out, TensorType({DT_FLOAT, DT_DOUBLE})) @@ -222,7 +219,6 @@ REG_OP(CTCLossV2Grad) .ATTR(blank, Int, 0) .ATTR(reduction, String, "mean") .ATTR(zero_infinity, Bool, false) - .ATTR(label_max, Int, 0) .OP_END_FACTORY_REG(CTCLossV2Grad) } // namespace ge diff --git a/third_party/fwkacllib/inc/ops/image_ops.h b/third_party/fwkacllib/inc/ops/image_ops.h index bf0846c2..ba4433d1 100644 --- a/third_party/fwkacllib/inc/ops/image_ops.h +++ b/third_party/fwkacllib/inc/ops/image_ops.h @@ -349,6 +349,7 @@ REG_OP(ExtractGlimpse) *y:images converted to RGB . \n *@attention Constraints: +*Input images currently supports DT_FLOAT, DT_DOUBLE . *Last dimension of input x must be size 3 . \n *@par Third-party framework compatibility @@ -2307,5 +2308,52 @@ REG_OP(UpsampleNearest1dGrad) .REQUIRED_ATTR(output_size, ListInt) .ATTR(scales, ListFloat, {}) .OP_END_FACTORY_REG(UpsampleNearest1dGrad) + +/** +* @brief JPEG encode input image with provided compression quality. \n + +* @par Inputs: +* @li images: image is a 3-D uint8 tensor of shape [height, width, channels]. +* @li quality: int32 jpeg compression quality value between 0 and 100, 0-D tensor. + +* @par Outputs: JPEG-encoded image +* contents: an output string. \n + +* @par Third-party framework compatibility. +* Compatible with tensorflow EncodeJpegVariableQuality operator. +*/ + +REG_OP(EncodeJpegVariableQuality) + .INPUT(images, TensorType({DT_UINT8})) + .INPUT(quality, TensorType({DT_INT32})) + .OUTPUT(contents, TensorType({DT_STRING})) + .OP_END_FACTORY_REG(EncodeJpegVariableQuality) + +/** +* @brief image to transforms. \n + +* @par Inputs: +* @li images: [batch, height, width, channels], 4-D tensor. +* @li transforms: [batch, 8] or [1, 8] matrix, 2-D tensor. +* @li outout_shape: [new_height, new_width], 1-D tensor. + +* @par Attributes: +* @li interpolation: Interpolation method, "NEAREST" or "BILINEAR", 0-D tensor. +* @li fill_mode: Defaults to "CONSTANT". Fill mode, "REFLECT", "WRAP", or "CONSTANT", 0-D tensor. + +* @par Outputs +* transformed_images: has the same type as iamges, 4-D tensor with shape[batch, new_height, new_width, channels]. \n + +* @par Third-party framework compatibility. +* Compatible with tensorflow ImageProjectiveTransform operator. +*/ +REG_OP(ImageProjectiveTransform) + .INPUT(images, TensorType({DT_UINT8, DT_INT32, DT_INT64, DT_FLOAT16, DT_FLOAT, DT_DOUBLE})) + .INPUT(transforms, TensorType({DT_FLOAT})) + .INPUT(output_shape, TensorType({DT_INT32})) + .REQUIRED_ATTR(interpolation, String) + .ATTR(fill_mode, String, "CONSTANT") + .OUTPUT(transformed_images, TensorType({DT_UINT8, DT_INT32, DT_INT64, DT_FLOAT16, DT_FLOAT, DT_DOUBLE})) + .OP_END_FACTORY_REG(ImageProjectiveTransform) } // namespace ge #endif // OPS_BUILT_IN_OP_PROTO_INC_IMAGE_OPS_H_ diff --git a/third_party/fwkacllib/inc/ops/nn_norm_ops.h b/third_party/fwkacllib/inc/ops/nn_norm_ops.h index 38e513db..2d4149e2 100644 --- a/third_party/fwkacllib/inc/ops/nn_norm_ops.h +++ b/third_party/fwkacllib/inc/ops/nn_norm_ops.h @@ -1700,6 +1700,45 @@ REG_OP(GroupNormRelu) .REQUIRED_ATTR(num_groups, Int) .ATTR(eps, Float, 0.00001) .OP_END_FACTORY_REG(GroupNormRelu) -} // namespace ge +/** +* @brief Function dropout with softmaxgrad and muls + +* @par Inputs: +* Two inputs, including: +* @li y_grad: A mutable Tensor. The type only support float16. +* @li mask: A mutable Tensor. Must met all of the following rules: +* shape of mask should be 1D. +* dtype of mask should be uint8. +* value of shape should met the following algorithm: +* value = (size(x) + 128 - 1) // 128 * 128 +* @li softmax_output: A mutable Tensor. Must met all of the following rules: +* shape of softmax_output should be NZ. +* dtype of softmax_output should be float16. +* it is the output of softmax + +* @par Attributes: +* @li input_keep_prob:A attribute used to judge which units should be keep. +* Has the same type as "x" . \n +* @li alpha: A attribute used to scale tensor. +* Has the same type as "x" . \n +* @li axes: A list of int. The dimension softmax would be performed on. Defaults +* to "[-1]" . \n + +* @par Outputs: +* x_grad: A mutable Tensor. Has the same type as "x". \n + +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +*/ +REG_OP(DropoutWithMulsAndSoftmaxGrad) + .INPUT(y_grad, TensorType({ DT_FLOAT16 })) + .INPUT(mask, TensorType({ DT_UINT8 })) + .INPUT(softmax_output, TensorType({ DT_FLOAT16 })) + .OUTPUT(x_grad, TensorType({ DT_FLOAT16 })) + .REQUIRED_ATTR(input_keep_prob, Float) + .REQUIRED_ATTR(alpha, Float) + .ATTR(axes, ListInt, { -1 }) + .OP_END_FACTORY_REG(DropoutWithMulsAndSoftmaxGrad) +} // namespace ge #endif // OPS_BUILT_IN_OP_PROTO_INC_NN_NORM_OPS_H_ diff --git a/third_party/fwkacllib/inc/ops/quantize_ops.h b/third_party/fwkacllib/inc/ops/quantize_ops.h index fd855734..f6dd9c2d 100644 --- a/third_party/fwkacllib/inc/ops/quantize_ops.h +++ b/third_party/fwkacllib/inc/ops/quantize_ops.h @@ -241,6 +241,29 @@ REG_OP(AscendRequantS16) .ATTR(dual_output, Bool, false) .ATTR(relu_flag, Bool, false) .OP_END_FACTORY_REG(AscendRequantS16) + +/** +* @brief Quantizes the input of int8 . \n + +* @par Inputs: +* @li x: An FRACTAL_Z tensor of type int8, specifying the input. +* @li offset: An FRACTAL_Z tensor of type int8. + +* @par Attributes: +* @li dst_type: A optional int from: DT_INT8, DT_INT4. Defaults to DT_INT8. + +* @par Outputs: +* @li y: output tensor of type int4 or int8 and with format FRACTAL_Z. + +* @par Third-party framework compatibility +* It is a custom operator. It has no corresponding operator in Caffe, Onnx, Tensorflow or Pythorch. +*/ +REG_OP(AscendWeightQuant) + .INPUT(x, TensorType({DT_INT8})) + .INPUT(offset, TensorType({DT_INT8})) + .OUTPUT(y, TensorType({DT_INT8, DT_INT4})) + .ATTR(dst_type, Int, DT_INT8) + .OP_END_FACTORY_REG(AscendWeightQuant) } // namespace ge #endif // OPS_BUILT_IN_OP_PROTO_INC_QUANTIZE_OPS_H_ diff --git a/third_party/fwkacllib/inc/runtime/dev.h b/third_party/fwkacllib/inc/runtime/dev.h index bce6625b..1c4586e7 100644 --- a/third_party/fwkacllib/inc/runtime/dev.h +++ b/third_party/fwkacllib/inc/runtime/dev.h @@ -82,6 +82,12 @@ typedef enum tagRtDeviceModuleType { RT_MODULE_TYPE_VECTOR_CORE, /**< VECTOR CORE info*/ } rtDeviceModuleType_t; +typedef enum tagRtMemRequestFeature { + MEM_REQUEST_FEATURE_DEFAULT = 0, + MEM_REQUEST_FEATURE_OPP, + MEM_REQUEST_FEATURE_RESERVED +} rtMemRequestFeature_t; + // used for rtGetDevMsg callback function typedef void (*rtGetMsgCallback)(const char_t *msg, uint32_t len); @@ -418,6 +424,15 @@ RTS_API rtError_t rtDeviceResetWithoutTsd(int32_t devId); * @return RT_ERROR_INVALID_VALUE for error input */ RTS_API rtError_t rtGetDevMsg(rtGetDevMsgType_t getMsgType, rtGetMsgCallback callback); + +/** + * @ingroup dvrt_dev + * @brief get ts mem type + * @param [in] rtMemRequestFeature_t mem request feature type + * @param [in] mem request size + * @return RT_MEMORY_TS, RT_MEMORY_HBM, RT_MEMORY_TS | RT_MEMORY_POLICY_HUGE_PAGE_ONLY + */ +RTS_API uint32_t rtGetTsMemType(rtMemRequestFeature_t featureType, uint32_t memSize); #if defined(__cplusplus) } #endif diff --git a/third_party/fwkacllib/inc/runtime/kernel.h b/third_party/fwkacllib/inc/runtime/kernel.h index 1c3f571b..883068a2 100644 --- a/third_party/fwkacllib/inc/runtime/kernel.h +++ b/third_party/fwkacllib/inc/runtime/kernel.h @@ -217,6 +217,13 @@ typedef void (*rtCallback_t)(void *fnData); #define RT_NORMAL_KERNEL_MODE (0x01U) #define RT_ALL_KERNEL_MODE (0x02U) +/** + * @ingroup rt_kernel + * @brief SHAPE kernel type +**/ +#define RT_STATIC_SHAPE_KERNEL (0x00U) +#define RT_DYNAMIC_SHAPE_KERNEL (0x01U) + /** * @ingroup rt_kernel * @brief kernel L1 Fusion Dump bit flags @@ -335,6 +342,21 @@ RTS_API rtError_t rtQueryFunctionRegistered(const char_t *stubName); RTS_API rtError_t rtKernelConfigDump(uint32_t kind, uint32_t dumpSizePerBlock, uint32_t blockDim, void **dumpBaseAddr, rtStream_t stm); +/** +* @ingroup rt_kernel +* @brief get kernel address and prefetchCnt +* @param [in] hdl program for dynamic shape +* @param [in] tilingKey tilingKey for dynamic shape +* @param [in] stubFunc stubFunc for static shape +* @param [in] flag flag for distinguishing between dynamic shape and static shape +* @param [out] addr address of kernel function +* @param [out] prefetchCnt prefetchCnt of kernel function +* @return RT_ERROR_NONE for ok +* @return RT_ERROR_INVALID_VALUE for error input +*/ +RTS_API rtError_t rtKernelGetAddrAndPrefCnt(void *hdl, const uint64_t tilingKey, const void * const stubFunc, + const uint32_t flag, void **addr, uint32_t *prefetchCnt); + /** * @ingroup rt_kernel * @brief launch kernel to device diff --git a/third_party/fwkacllib/inc/runtime/rt_model.h b/third_party/fwkacllib/inc/runtime/rt_model.h index f550887d..883e60a8 100644 --- a/third_party/fwkacllib/inc/runtime/rt_model.h +++ b/third_party/fwkacllib/inc/runtime/rt_model.h @@ -336,6 +336,16 @@ RTS_API rtError_t rtSetTaskGenCallback(rtTaskGenCallback callback); */ RTS_API rtError_t rtModelCreate(rtModel_t *mdl, uint32_t flag); +/** + * @ingroup rt_model + * @brief set ge model id to aicpu + * @param [in] model aicpu model + * @param [in] extid ge model id + * @return RT_ERROR_NONE for ok + * @return RT_ERROR_INVALID_VALUE for error input + */ +rtError_t rtModelSetExtId(rtModel_t mdl, uint32_t extId); + /** * @ingroup rt_model * @brief destroy model instance diff --git a/third_party/fwkacllib/inc/tdt/tsd_client.h b/third_party/fwkacllib/inc/tdt/tsd_client.h index 406ab1c3..a6ecffec 100644 --- a/third_party/fwkacllib/inc/tdt/tsd_client.h +++ b/third_party/fwkacllib/inc/tdt/tsd_client.h @@ -34,6 +34,13 @@ extern "C" { #endif // __cplusplus +struct InitFlowGwInfo { + const char_t *groupName; + uint64_t schedPolicy; + uint64_t reschedInterval; + char_t rsv[128]; +}; + /** * @ingroup Open * @brief Used for the Framework process to communicate with the TSDDaemon process, @@ -101,6 +108,27 @@ TDT_LIB_EXPORT uint32_t TsdOpenEx(const uint32_t logicDeviceId, const uint32_t r */ TDT_LIB_EXPORT uint32_t TsdInitQs(const uint32_t logicDeviceId, const char_t * const groupName = nullptr); +/** +* @ingroup InitFlowGw +* @brief Used for the Framework process to communicate with the TSDDaemon process, +* and notify TSD to complete the initialization of FlowGw processes +* +* @par Function +* Used for the Framework process to communicate with the TSDDaemon process, +* and notify TSD to complete the initialization of other processes +* +* @param logicDeviceId [IN] type #unsigned int. Logic device ID +* @param initInfo [IN] type #InitFlowGwInfo pointer. Initialization parameters +* @retval TDT_OK Success +* @retval OtherValues Failure +* +* @par Dependency +* @li libtsdclient.so: Library to which the interface belongs. +* @li tsd_client.h: Header file where the interface declaration is located. +* @li data_common.h: Header file where 'TDT_StatusT' defined +*/ +TDT_LIB_EXPORT uint32_t TsdInitFlowGw(const uint32_t logicDeviceId, const InitFlowGwInfo * const initInfo); + /** * @ingroup Close * @brief notify TSDClient close resource diff --git a/third_party/fwkacllib/inc/toolchain/prof_reporter.h b/third_party/fwkacllib/inc/toolchain/prof_reporter.h index f0747833..afd4863f 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_reporter.h +++ b/third_party/fwkacllib/inc/toolchain/prof_reporter.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef MSPROF_ENGINE_PROF_REPORTER_H_ -#define MSPROF_ENGINE_PROF_REPORTER_H_ +#ifndef MSPROF_ENGINE_PROF_REPORTER_H +#define MSPROF_ENGINE_PROF_REPORTER_H #if (defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)) #define MSVP_PROF_API __declspec(dllexport)