From c888273bc7fef6fc4bfb74020eb4dfc0066d3f15 Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Fri, 31 Dec 2021 09:48:24 +0800 Subject: [PATCH] upgrade Ascend package 30 Dec 21 --- inc/external/acl/acl_prof.h | 36 ----- inc/framework/common/util.h | 15 +- inc/framework/memory/memory_api.h | 1 + metadef | 2 +- third_party/fwkacllib/inc/hccl/hcom.h | 66 -------- third_party/fwkacllib/inc/mmpa/mmpa_api.h | 24 ++- .../fwkacllib/inc/mmpa/sub_inc/mmpa_linux.h | 24 ++- .../inc/mmpa/sub_inc/mmpa_typedef_linux.h | 3 + .../fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_win.h | 169 +++++++++++---------- third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_win.h | 24 ++- third_party/fwkacllib/inc/ops/nn_detect_ops.h | 58 +++++++ third_party/fwkacllib/inc/ops/nonlinear_fuc_ops.h | 16 +- third_party/fwkacllib/inc/ops/selection_ops.h | 21 +++ third_party/fwkacllib/inc/toolchain/prof_acl_api.h | 36 +++++ third_party/fwkacllib/inc/toolchain/prof_common.h | 9 +- 15 files changed, 252 insertions(+), 252 deletions(-) diff --git a/inc/external/acl/acl_prof.h b/inc/external/acl/acl_prof.h index 1f1e38dc..6e78e0b9 100644 --- a/inc/external/acl/acl_prof.h +++ b/inc/external/acl/acl_prof.h @@ -387,42 +387,6 @@ MSVP_PROF_API void aclprofDestroyStamp(void *stamp); /** * @ingroup AscendCL - * @brief set category and name - * - * - * @retval void - */ -MSVP_PROF_API aclError aclprofSetCategoryName(uint32_t category, const char *categoryName); - -/** - * @ingroup AscendCL - * @brief set category to stamp - * - * - * @retval void - */ -MSVP_PROF_API aclError aclprofSetStampCategory(void *stamp, uint32_t category); - -/** - * @ingroup AscendCL - * @brief set message to stamp - * - * - * @retval void - */ -MSVP_PROF_API aclError aclprofSetStampTraceMessage(void *stamp, const char *msg, uint32_t msgLen); - -/** - * @ingroup AscendCL - * @brief Record mark timestamp - * - * @retval ACL_SUCCESS The function is successfully executed. - * @retval OtherValues Failure - */ -MSVP_PROF_API aclError aclprofMark(void *stamp); - -/** - * @ingroup AscendCL * @brief Record push timestamp * * @retval ACL_SUCCESS The function is successfully executed. diff --git a/inc/framework/common/util.h b/inc/framework/common/util.h index aa05997e..b030bfd2 100644 --- a/inc/framework/common/util.h +++ b/inc/framework/common/util.h @@ -28,6 +28,7 @@ #include "framework/common/debug/log.h" #include "framework/common/scope_guard.h" #include "framework/common/ge_inner_error_codes.h" +#include "graph/detail/attributes_holder.h" #define GE_CHECK_POSITIVE_SIZE_RANGE(size) \ do { \ @@ -218,6 +219,13 @@ */ #define CEIL(N, n) (((N) + (n)-1) / (n)) +namespace ge { +/** + * @ingroup domi_common + * @brief version of om.proto file + */ +constexpr int32_t OM_PROTO_VERSION = 2; + /// /// @ingroup domi_common /// @brief onverts Vector of a number to a string. @@ -277,13 +285,6 @@ GE_FUNC_VISIBILITY std::string ToString(const google::protobuf::RepeatedPtrField return str_ret; } -namespace ge { -/** - * @ingroup domi_common - * @brief version of om.proto file - */ -constexpr int32_t OM_PROTO_VERSION = 2; - /// /// @ingroup domi_common /// @brief Reads the proto structure from an array. diff --git a/inc/framework/memory/memory_api.h b/inc/framework/memory/memory_api.h index 30ade3b7..f0f176d5 100644 --- a/inc/framework/memory/memory_api.h +++ b/inc/framework/memory/memory_api.h @@ -17,6 +17,7 @@ #ifndef INC_FRAMEWORK_MEMORY_MEMORY_API_H_ #define INC_FRAMEWORK_MEMORY_MEMORY_API_H_ +#include #include "external/ge/ge_api_error_codes.h" #include "runtime/mem.h" diff --git a/metadef b/metadef index dc5ac26a..6e621d48 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit dc5ac26aac4c49b4e72cd91d4e6d6a57bbe03af4 +Subproject commit 6e621d489340d5b7a836f7664993f1bf34ea7785 diff --git a/third_party/fwkacllib/inc/hccl/hcom.h b/third_party/fwkacllib/inc/hccl/hcom.h index bf1f395b..cdc8d840 100644 --- a/third_party/fwkacllib/inc/hccl/hcom.h +++ b/third_party/fwkacllib/inc/hccl/hcom.h @@ -126,72 +126,6 @@ extern HcclResult HcomSetGradFusionByIndex(const char *group, u32 segmentNum, co * @return HcclResult */ extern HcclResult HcomSetGradFusionBySize(const char *group, u32 segmentNum, const float *sizeList); - -/** - * @brief Initialize hcom executor. - * - * @param void - * @return HcclResult - */ -HcclResult HcomExecInitialize(); - -/** - * @brief Finalize hcom executor. - * - * @param void - * @return HcclResult - */ -HcclResult HcomExecFinalize(); - -/** - * @brief Put collective communication operation into hcom executor. - * - * @param opInfo information about collective communication operation. - * @param callback callback after collective communication operation. - * @return HcclResult - */ -HcclResult HcomExecEnqueueOperation(HcomOperation opInfo, std::function callback); - -/** - * @brief Put remote access operation into hcom executor. - * - * @param remoteAccessType operation type (read or write). - * @param addrInfos address information about collective communication operation. - * @param callback callback after collective communication operation. - * @return HcclResult - */ -HcclResult HcomExecEnqueueRemoteAccess(const std::string& remoteAccessType, - const std::vector& addrInfos, - std::function callback); - -/** - * @brief Put alltoallv communication operation into hcom executor. - * - * @param params information about alltoallv communication operation. - * @param callback callback after collective communication operation. - * @return HcclResult - */ -HcclResult HcomExecEnqueueAllToAllV(HcomAllToAllVParams params, std::function callback); - -/** - * @brief Put agther alltoallv communication operation into hcom executor. - * - * @param params information about agther alltoallv communication operation. - * @param callback callback after collective communication operation. - * @return HcclResult - */ -HcclResult HcomExecEnqueueGatherAllToAllV(HcomGatherAllToAllVParams params, - std::function callback); - -/** - * @brief Register memories and init resources for remote access. - * - * @param addrList memory addresses for remote access. - * @param count number of remote memory addresses. - * @return HcclResult - */ -extern HcclResult HcomRegRemoteAccessMem(const MemRegisterAddr* addrList, u32 count); - #ifdef __cplusplus } #endif // __cplusplus diff --git a/third_party/fwkacllib/inc/mmpa/mmpa_api.h b/third_party/fwkacllib/inc/mmpa/mmpa_api.h index c48aaa63..f7eb7435 100644 --- a/third_party/fwkacllib/inc/mmpa/mmpa_api.h +++ b/third_party/fwkacllib/inc/mmpa/mmpa_api.h @@ -1,18 +1,12 @@ -/** - * Copyright 2019-2020 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* +* @file mmpa_api.h +* +* Copyright (C) Huawei Technologies Co., Ltd. 2019-2021. All Rights Reserved. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ #ifndef _MMPA_API_H_ #define _MMPA_API_H_ diff --git a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_linux.h b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_linux.h index 46fb6e21..fa72aed2 100644 --- a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_linux.h +++ b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_linux.h @@ -1,18 +1,12 @@ -/** - * Copyright 2019-2020 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* +* @file mmpa_linux.h +* +* Copyright (C) Huawei Technologies Co., Ltd. 2019-2021. All Rights Reserved. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ #ifndef MMPA_LINUX_MMPA_LINUX_H #define MMPA_LINUX_MMPA_LINUX_H diff --git a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_linux.h b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_linux.h index 9df5b9ce..9c6f6499 100644 --- a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_linux.h +++ b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_linux.h @@ -79,6 +79,9 @@ typedef long LONG; #define MMPA_THREAD_SCHED_OTHER SCHED_OTHER #define MMPA_THREAD_MIN_STACK_SIZE PTHREAD_STACK_MIN +#define MMPA_PATH_SEPARATOR_STR "/" +#define MMPA_PATH_SEPARATOR_CHAR '/' + #define MM_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER #define MMPA_MAX_NI 19 diff --git a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_win.h b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_win.h index 1627d7a9..9f8a72cd 100644 --- a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_win.h +++ b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_typedef_win.h @@ -1,83 +1,86 @@ -/** - * Copyright 2019-2020 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MMPA_TYPEDEF_WIN_H -#define MMPA_TYPEDEF_WIN_H - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif // __cpluscplus -#endif // __cpluscplus - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#define EN_OK 0 -#define EN_ERR 1 -#define EN_ERROR (-1) -#define EN_INVALID_PARAM (-2) -#define EN_TIMEOUT (-3) - -#define HANDLE_INVALID_VALUE (-1) -#define INVALID_SOCKET_HANDLE INVALID_SOCKET -#define MMPA_MEM_MAX_LEN (0x7fffffff) -#define MMPA_PROCESS_ERROR (0x7fffffff) - -#define MMPA_ONE_THOUSAND 1000 -#define MMPA_COMPUTER_BEGIN_YEAR 1900 -#define SUMMER_TIME_OR_NOT (-1) -#define MMPA_ZERO 0 -#define MMPA_VALUE_ONE 1 -#define MMPA_SOCKET_MAIN_EDITION 2 -#define MMPA_SOCKET_SECOND_EDITION 0 -#define MMPA_PIPE_BUF_SIZE 1024 -#define MMPA_MAX_SCANDIR_COUNT 1024 -#define MAX_IOVEC_SIZE 32 -#define MMPA_PIPE_COUNT 2 -#define MMPA_THREADNAME_SIZE 16 -#define MMPA_MIN_OS_NAME_SIZE (MAX_COMPUTERNAME_LENGTH + 1) -#define MMPA_MIN_OS_VERSION_SIZE 64 - -#define MMPA_MAX_NI 19 -#define MMPA_MIDDLE_NI 5 -#define MMPA_LOW_NI (-5) -#define MMPA_MIN_NI (-20) -#define MMPA_MAX_FILE 128 - -#define MMPA_MAX_THREAD_PIO 99 -#define MMPA_MIDDLE_THREAD_PIO 66 -#define MMPA_LOW_THREAD_PIO 33 -#define MMPA_MIN_THREAD_PIO 1 - -#define MMPA_THREAD_SCHED_RR 0 -#define MMPA_THREAD_SCHED_FIFO 0 -#define MMPA_THREAD_SCHED_OTHER 0 -#define MMPA_THREAD_MIN_STACK_SIZE 0 - -#define MM_MUTEX_INITIALIZER NULL - -#ifdef __cplusplus -#if __cplusplus -} -#endif // __cpluscplus -#endif // __cpluscplus -#endif // _MMPA_TYPEDEF_WIN_H_ +/** + * Copyright 2019-2020 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MMPA_TYPEDEF_WIN_H +#define MMPA_TYPEDEF_WIN_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif // __cpluscplus +#endif // __cpluscplus + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#define EN_OK 0 +#define EN_ERR 1 +#define EN_ERROR (-1) +#define EN_INVALID_PARAM (-2) +#define EN_TIMEOUT (-3) + +#define HANDLE_INVALID_VALUE (-1) +#define INVALID_SOCKET_HANDLE INVALID_SOCKET +#define MMPA_MEM_MAX_LEN (0x7fffffff) +#define MMPA_PROCESS_ERROR (0x7fffffff) + +#define MMPA_ONE_THOUSAND 1000 +#define MMPA_COMPUTER_BEGIN_YEAR 1900 +#define SUMMER_TIME_OR_NOT (-1) +#define MMPA_ZERO 0 +#define MMPA_VALUE_ONE 1 +#define MMPA_SOCKET_MAIN_EDITION 2 +#define MMPA_SOCKET_SECOND_EDITION 0 +#define MMPA_PIPE_BUF_SIZE 1024 +#define MMPA_MAX_SCANDIR_COUNT 1024 +#define MAX_IOVEC_SIZE 32 +#define MMPA_PIPE_COUNT 2 +#define MMPA_THREADNAME_SIZE 16 +#define MMPA_MIN_OS_NAME_SIZE (MAX_COMPUTERNAME_LENGTH + 1) +#define MMPA_MIN_OS_VERSION_SIZE 64 + +#define MMPA_MAX_NI 19 +#define MMPA_MIDDLE_NI 5 +#define MMPA_LOW_NI (-5) +#define MMPA_MIN_NI (-20) +#define MMPA_MAX_FILE 128 + +#define MMPA_PATH_SEPARATOR_STR "\\" +#define MMPA_PATH_SEPARATOR_CHAR '\\' + +#define MMPA_MAX_THREAD_PIO 99 +#define MMPA_MIDDLE_THREAD_PIO 66 +#define MMPA_LOW_THREAD_PIO 33 +#define MMPA_MIN_THREAD_PIO 1 + +#define MMPA_THREAD_SCHED_RR 0 +#define MMPA_THREAD_SCHED_FIFO 0 +#define MMPA_THREAD_SCHED_OTHER 0 +#define MMPA_THREAD_MIN_STACK_SIZE 0 + +#define MM_MUTEX_INITIALIZER NULL + +#ifdef __cplusplus +#if __cplusplus +} +#endif // __cpluscplus +#endif // __cpluscplus +#endif // _MMPA_TYPEDEF_WIN_H_ diff --git a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_win.h b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_win.h index 699fe815..e03131f2 100644 --- a/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_win.h +++ b/third_party/fwkacllib/inc/mmpa/sub_inc/mmpa_win.h @@ -1,18 +1,12 @@ -/** - * Copyright 2019-2020 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* +* @file mmpa_win.h +* +* Copyright (C) Huawei Technologies Co., Ltd. 2019-2021. All Rights Reserved. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ #ifndef MMPA_WIN_MMPA_WIN_H #define MMPA_WIN_MMPA_WIN_H diff --git a/third_party/fwkacllib/inc/ops/nn_detect_ops.h b/third_party/fwkacllib/inc/ops/nn_detect_ops.h index 442d86a1..f68d0ebd 100644 --- a/third_party/fwkacllib/inc/ops/nn_detect_ops.h +++ b/third_party/fwkacllib/inc/ops/nn_detect_ops.h @@ -2119,6 +2119,64 @@ REG_OP(RotatedIou) .ATTR(mode, String, "iou") .ATTR(is_cross, Bool, true) .OP_END_FACTORY_REG(RotatedIou) + +/** +*@brief RotatedBoxEncode. \n + +*@par Inputs: +* Two inputs, including: +*@li anchor_box: A 3D Tensor of float32 (float16) with shape (B, 5, N). +* "B" indicates the number of batch size +* "N" indicates the number of bounding boxes, and the value "5" refers to +* "x0", "x1", "y0", "y1" and "angle". +*@li gt_box: A 3D Tensor of float32 (float16) with shape (B, 5, N). +* "B" indicates the number of batch size +* "N" indicates the number of bounding boxes, and the value "5" refers to +* "x0", "x1", "y0", "y1" and "angle". \n + +*@par Attributes: +*@li weight: A float list for "x0", "x1", "y0", "y1" and "angle", +* defaults to [1.0, 1.0, 1.0, 1.0, 1.0]. + +*@par Outputs: +*@li y: A 3D Tensor of type float32 (float16) with shape (B, 5, N), +* specifying the variations between all anchor boxes and ground truth boxes. +*/ +REG_OP(RotatedBoxEncode) + .INPUT(anchor_box, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(gt_box, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT})) + .ATTR(weight, ListFloat, {1.0, 1.0, 1.0, 1.0, 1.0}) + .OP_END_FACTORY_REG(RotatedBoxEncode) + +/** +*@brief RotatedBoxDecode. \n + +*@par Inputs: +* Two inputs, including: +*@li anchor_box: A 3D Tensor of float32 (float16) with shape (B, 5, N). +* "B" indicates the number of batch size +* "N" indicates the number of bounding boxes, and the value "5" refers to +* "x0", "x1", "y0", "y1" and "angle". +*@li deltas: A 3D Tensor of float32 (float16) with shape (B, 5, N). +* "B" indicates the number of batch size +* "N" indicates the number of bounding boxes, and the value "5" refers to +* "x0", "x1", "y0", "y1" and "angle". \n + +*@par Attributes: +*@li weight: A float list for "x0", "x1", "y0", "y1" and "angle", +* defaults to [1.0, 1.0, 1.0, 1.0, 1.0]. + +*@par Outputs: +*@li y: A 3D Tensor of type float32 (float16) with shape (B, 5, N), +* specifying the variations between all anchor boxes and ground truth boxes. +*/ +REG_OP(RotatedBoxDecode) + .INPUT(anchor_box, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(deltas, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT})) + .ATTR(weight, ListFloat, {1.0, 1.0, 1.0, 1.0, 1.0}) + .OP_END_FACTORY_REG(RotatedBoxDecode) } // namespace ge #endif // OPS_BUILT_IN_OP_PROTO_INC_NN_DETECT_OPS_H_ diff --git a/third_party/fwkacllib/inc/ops/nonlinear_fuc_ops.h b/third_party/fwkacllib/inc/ops/nonlinear_fuc_ops.h index b4f39f2c..fc61815e 100644 --- a/third_party/fwkacllib/inc/ops/nonlinear_fuc_ops.h +++ b/third_party/fwkacllib/inc/ops/nonlinear_fuc_ops.h @@ -25,7 +25,8 @@ namespace ge { /** -*@brief Computes the for the gelu of "x" . \n +*@brief The GELU activation function is x*Φ(x), +* where Φ(x) the standard Gaussian cumulative distribution function. \n *@par Inputs: *One input, including: @@ -144,7 +145,7 @@ REG_OP(GeluGrad) .OP_END_FACTORY_REG(GeluGrad) /** -*@brief Computes the for the fast_gelu of "x" . \n +*@brief The FastGelu activation function is x*e^(0.851*x)*(x-|x|)/(1+e^(-1.702|x|)). \n *@par Inputs: *One input, including: @@ -160,7 +161,8 @@ REG_OP(FastGelu) .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT})) .OP_END_FACTORY_REG(FastGelu) /** -*@brief Computes the for the fast_gelu_v2 of "x" . \n +*@brief The FastGeluV2 activation function is x*(sgn(x)*[(a/2)*(clip(|x|,max=-b)+b)^2+0.5]+0.5), +* where sgn(x) function is (x+0.000000000001)/|(x+0.000000000001)|. \n *@par Inputs: *One input, including: @@ -638,9 +640,7 @@ REG_OP(Elu) *x: A float16, float32, for the input data type . \n *@par Attributes: -*@li alpha1: A float32. Defines at which negative value the ELU saturates. Defaults to "1.0" . -*@li alpha2: A float32. Defines at which negative value the ELU saturates. Defaults to "1.0" . -*@li alpha3: A float32. Defines at which positive value the ELU saturates. Defaults to "1.0" . \n +*li alpha: A float32. Defines at which negative value the ELU saturates. Defaults to "1.0" . *@par Outputs: *y: A float16, float32, for the normalized result . \n @@ -656,9 +656,7 @@ REG_OP(Elu) REG_OP(Celu) .INPUT(x, TensorType({DT_FLOAT,DT_FLOAT16})) .OUTPUT(y, TensorType({DT_FLOAT,DT_FLOAT16})) - .ATTR(alpha1, Float, 1.0) - .ATTR(alpha2, Float, 1.0) - .ATTR(alpha3, Float, 1.0) + .ATTR(alpha, Float, 1.0) .OP_END_FACTORY_REG(Celu) /** diff --git a/third_party/fwkacllib/inc/ops/selection_ops.h b/third_party/fwkacllib/inc/ops/selection_ops.h index b09d08b0..b92af69e 100644 --- a/third_party/fwkacllib/inc/ops/selection_ops.h +++ b/third_party/fwkacllib/inc/ops/selection_ops.h @@ -701,6 +701,27 @@ REG_OP(SegmentMax) .OP_END_FACTORY_REG(SegmentMax) /** +*@brief Computes the sum along segments of a tensor . \n + +*@par Inputs: +*Two inputs, including: +* @li x: A Tensor of type NumberType. +* @li segment_ids: A Tensor of type IndexNumberType, whose shape is a prefix +* of "x.shape". + +*@par Outputs: +*y: A Tensor of type NumberType . \n + +*@par Third-party framework compatibility +* Compatible with the TensorFlow operator SegmentSum. +*/ +REG_OP(SegmentSum) + .INPUT(x, TensorType::NumberType()) + .INPUT(segment_ids, TensorType::IndexNumberType()) + .OUTPUT(y, TensorType::NumberType()) + .OP_END_FACTORY_REG(SegmentSum) + +/** *@brief: Computes the maximum along segments of a tensor. *Computes a tensor such that output[i]=(data[i]) where max is over j * such that segment_ids[j] == i. diff --git a/third_party/fwkacllib/inc/toolchain/prof_acl_api.h b/third_party/fwkacllib/inc/toolchain/prof_acl_api.h index 16aaf26b..40778341 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_acl_api.h +++ b/third_party/fwkacllib/inc/toolchain/prof_acl_api.h @@ -140,6 +140,42 @@ MSVP_PROF_API size_t aclprofGetGraphId(const void *opInfo, size_t opInfoLen, uin * @retval void */ MSVP_PROF_API int aclprofSetStampPayload(void *stamp, const int32_t type, void *value); + +/** +* @ingroup AscendCL +* @brief set category and name +* +* +* @retval void +*/ +MSVP_PROF_API int aclprofSetCategoryName(uint32_t category, const char *categoryName); + +/** +* @ingroup AscendCL +* @brief set category to stamp +* +* +* @retval void +*/ +MSVP_PROF_API int aclprofSetStampCategory(void *stamp, uint32_t category); + +/** +* @ingroup AscendCL +* @brief set message to stamp +* +* +* @retval void +*/ +MSVP_PROF_API int aclprofSetStampTraceMessage(void *stamp, const char *msg, uint32_t msgLen); + +/** +* @ingroup AscendCL +* @brief Record mark timestamp +* +* @retval ACL_SUCCESS The function is successfully executed. +* @retval OtherValues Failure +*/ +MSVP_PROF_API int aclprofMark(void *stamp); #ifdef __cplusplus } #endif diff --git a/third_party/fwkacllib/inc/toolchain/prof_common.h b/third_party/fwkacllib/inc/toolchain/prof_common.h index 93a4cff9..bc56fb7d 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_common.h +++ b/third_party/fwkacllib/inc/toolchain/prof_common.h @@ -51,7 +51,6 @@ struct MsprofMixData { char dataStr[MSPROF_MIX_DATA_STRING_LEN]; } data; }; -using MixData = struct MsprofMixData; /** * @brief profiling command info @@ -97,7 +96,7 @@ struct MsprofGeProfModelLoadData { uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; uint16_t dataTag = MSPROF_GE_DATA_TAG_MODEL_LOAD; uint32_t modelId; - MixData modelName; + MsprofMixData modelName; uint64_t startTime; uint64_t endTime; uint8_t reserve[MSPROF_GE_MODELLOAD_DATA_RESERVE_BYTES]; @@ -109,7 +108,7 @@ struct MsprofGeProfFusionData { uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; uint16_t dataTag = MSPROF_GE_DATA_TAG_FUSION; uint32_t modelId; - MixData fusionName; + MsprofMixData fusionName; uint64_t inputMemSize; uint64_t outputMemSize; uint64_t weightMemSize; @@ -125,7 +124,7 @@ struct MsprofGeProfInferData { uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; uint16_t dataTag = MSPROF_GE_DATA_TAG_INFER; uint32_t modelId; - MixData modelName; + MsprofMixData modelName; uint32_t requestId; uint32_t threadId; uint64_t inputDataStartTime; @@ -160,7 +159,7 @@ struct MsprofGeProfTaskData { uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; uint16_t dataTag = MSPROF_GE_DATA_TAG_TASK; uint32_t taskType; // MsprofGeTaskType - MixData opName; + MsprofMixData opName; MsprofGeOpType opType; uint64_t curIterNum; uint64_t timeStamp;