@@ -387,42 +387,6 @@ MSVP_PROF_API void aclprofDestroyStamp(void *stamp); | |||||
/** | /** | ||||
* @ingroup AscendCL | * @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 | * @brief Record push timestamp | ||||
* | * | ||||
* @retval ACL_SUCCESS The function is successfully executed. | * @retval ACL_SUCCESS The function is successfully executed. | ||||
@@ -28,6 +28,7 @@ | |||||
#include "framework/common/debug/log.h" | #include "framework/common/debug/log.h" | ||||
#include "framework/common/scope_guard.h" | #include "framework/common/scope_guard.h" | ||||
#include "framework/common/ge_inner_error_codes.h" | #include "framework/common/ge_inner_error_codes.h" | ||||
#include "graph/detail/attributes_holder.h" | |||||
#define GE_CHECK_POSITIVE_SIZE_RANGE(size) \ | #define GE_CHECK_POSITIVE_SIZE_RANGE(size) \ | ||||
do { \ | do { \ | ||||
@@ -218,6 +219,13 @@ | |||||
*/ | */ | ||||
#define CEIL(N, n) (((N) + (n)-1) / (n)) | #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 | /// @ingroup domi_common | ||||
/// @brief onverts Vector of a number to a string. | /// @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; | return str_ret; | ||||
} | } | ||||
namespace ge { | |||||
/** | |||||
* @ingroup domi_common | |||||
* @brief version of om.proto file | |||||
*/ | |||||
constexpr int32_t OM_PROTO_VERSION = 2; | |||||
/// | /// | ||||
/// @ingroup domi_common | /// @ingroup domi_common | ||||
/// @brief Reads the proto structure from an array. | /// @brief Reads the proto structure from an array. | ||||
@@ -17,6 +17,7 @@ | |||||
#ifndef INC_FRAMEWORK_MEMORY_MEMORY_API_H_ | #ifndef INC_FRAMEWORK_MEMORY_MEMORY_API_H_ | ||||
#define INC_FRAMEWORK_MEMORY_MEMORY_API_H_ | #define INC_FRAMEWORK_MEMORY_MEMORY_API_H_ | ||||
#include <vector> | |||||
#include "external/ge/ge_api_error_codes.h" | #include "external/ge/ge_api_error_codes.h" | ||||
#include "runtime/mem.h" | #include "runtime/mem.h" | ||||
@@ -1 +1 @@ | |||||
Subproject commit dc5ac26aac4c49b4e72cd91d4e6d6a57bbe03af4 | |||||
Subproject commit 6e621d489340d5b7a836f7664993f1bf34ea7785 |
@@ -126,72 +126,6 @@ extern HcclResult HcomSetGradFusionByIndex(const char *group, u32 segmentNum, co | |||||
* @return HcclResult | * @return HcclResult | ||||
*/ | */ | ||||
extern HcclResult HcomSetGradFusionBySize(const char *group, u32 segmentNum, const float *sizeList); | 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<void(HcclResult status)> 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<HcomRemoteAccessAddrInfo>& addrInfos, | |||||
std::function<void(HcclResult status)> 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<void(HcclResult status)> 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<void(HcclResult status)> 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 | #ifdef __cplusplus | ||||
} | } | ||||
#endif // __cplusplus | #endif // __cplusplus | ||||
@@ -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_ | #ifndef _MMPA_API_H_ | ||||
#define _MMPA_API_H_ | #define _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_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 | #ifndef MMPA_LINUX_MMPA_LINUX_H | ||||
#define MMPA_LINUX_MMPA_LINUX_H | #define MMPA_LINUX_MMPA_LINUX_H | ||||
@@ -79,6 +79,9 @@ typedef long LONG; | |||||
#define MMPA_THREAD_SCHED_OTHER SCHED_OTHER | #define MMPA_THREAD_SCHED_OTHER SCHED_OTHER | ||||
#define MMPA_THREAD_MIN_STACK_SIZE PTHREAD_STACK_MIN | #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 MM_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER | ||||
#define MMPA_MAX_NI 19 | #define MMPA_MAX_NI 19 | ||||
@@ -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_ |
@@ -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 | #ifndef MMPA_WIN_MMPA_WIN_H | ||||
#define MMPA_WIN_MMPA_WIN_H | #define MMPA_WIN_MMPA_WIN_H | ||||
@@ -2119,6 +2119,64 @@ REG_OP(RotatedIou) | |||||
.ATTR(mode, String, "iou") | .ATTR(mode, String, "iou") | ||||
.ATTR(is_cross, Bool, true) | .ATTR(is_cross, Bool, true) | ||||
.OP_END_FACTORY_REG(RotatedIou) | .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 | } // namespace ge | ||||
#endif // OPS_BUILT_IN_OP_PROTO_INC_NN_DETECT_OPS_H_ | #endif // OPS_BUILT_IN_OP_PROTO_INC_NN_DETECT_OPS_H_ | ||||
@@ -25,7 +25,8 @@ | |||||
namespace ge { | 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: | *@par Inputs: | ||||
*One input, including: | *One input, including: | ||||
@@ -144,7 +145,7 @@ REG_OP(GeluGrad) | |||||
.OP_END_FACTORY_REG(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: | *@par Inputs: | ||||
*One input, including: | *One input, including: | ||||
@@ -160,7 +161,8 @@ REG_OP(FastGelu) | |||||
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT})) | .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT})) | ||||
.OP_END_FACTORY_REG(FastGelu) | .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: | *@par Inputs: | ||||
*One input, including: | *One input, including: | ||||
@@ -638,9 +640,7 @@ REG_OP(Elu) | |||||
*x: A float16, float32, for the input data type . \n | *x: A float16, float32, for the input data type . \n | ||||
*@par Attributes: | *@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: | *@par Outputs: | ||||
*y: A float16, float32, for the normalized result . \n | *y: A float16, float32, for the normalized result . \n | ||||
@@ -656,9 +656,7 @@ REG_OP(Elu) | |||||
REG_OP(Celu) | REG_OP(Celu) | ||||
.INPUT(x, TensorType({DT_FLOAT,DT_FLOAT16})) | .INPUT(x, TensorType({DT_FLOAT,DT_FLOAT16})) | ||||
.OUTPUT(y, 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) | .OP_END_FACTORY_REG(Celu) | ||||
/** | /** | ||||
@@ -701,6 +701,27 @@ REG_OP(SegmentMax) | |||||
.OP_END_FACTORY_REG(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. | *@brief: Computes the maximum along segments of a tensor. | ||||
*Computes a tensor such that output[i]=(data[i]) where max is over j | *Computes a tensor such that output[i]=(data[i]) where max is over j | ||||
* such that segment_ids[j] == i. | * such that segment_ids[j] == i. | ||||
@@ -140,6 +140,42 @@ MSVP_PROF_API size_t aclprofGetGraphId(const void *opInfo, size_t opInfoLen, uin | |||||
* @retval void | * @retval void | ||||
*/ | */ | ||||
MSVP_PROF_API int aclprofSetStampPayload(void *stamp, const int32_t type, void *value); | 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 | #ifdef __cplusplus | ||||
} | } | ||||
#endif | #endif | ||||
@@ -51,7 +51,6 @@ struct MsprofMixData { | |||||
char dataStr[MSPROF_MIX_DATA_STRING_LEN]; | char dataStr[MSPROF_MIX_DATA_STRING_LEN]; | ||||
} data; | } data; | ||||
}; | }; | ||||
using MixData = struct MsprofMixData; | |||||
/** | /** | ||||
* @brief profiling command info | * @brief profiling command info | ||||
@@ -97,7 +96,7 @@ struct MsprofGeProfModelLoadData { | |||||
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; | uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; | ||||
uint16_t dataTag = MSPROF_GE_DATA_TAG_MODEL_LOAD; | uint16_t dataTag = MSPROF_GE_DATA_TAG_MODEL_LOAD; | ||||
uint32_t modelId; | uint32_t modelId; | ||||
MixData modelName; | |||||
MsprofMixData modelName; | |||||
uint64_t startTime; | uint64_t startTime; | ||||
uint64_t endTime; | uint64_t endTime; | ||||
uint8_t reserve[MSPROF_GE_MODELLOAD_DATA_RESERVE_BYTES]; | 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 magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; | ||||
uint16_t dataTag = MSPROF_GE_DATA_TAG_FUSION; | uint16_t dataTag = MSPROF_GE_DATA_TAG_FUSION; | ||||
uint32_t modelId; | uint32_t modelId; | ||||
MixData fusionName; | |||||
MsprofMixData fusionName; | |||||
uint64_t inputMemSize; | uint64_t inputMemSize; | ||||
uint64_t outputMemSize; | uint64_t outputMemSize; | ||||
uint64_t weightMemSize; | uint64_t weightMemSize; | ||||
@@ -125,7 +124,7 @@ struct MsprofGeProfInferData { | |||||
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; | uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; | ||||
uint16_t dataTag = MSPROF_GE_DATA_TAG_INFER; | uint16_t dataTag = MSPROF_GE_DATA_TAG_INFER; | ||||
uint32_t modelId; | uint32_t modelId; | ||||
MixData modelName; | |||||
MsprofMixData modelName; | |||||
uint32_t requestId; | uint32_t requestId; | ||||
uint32_t threadId; | uint32_t threadId; | ||||
uint64_t inputDataStartTime; | uint64_t inputDataStartTime; | ||||
@@ -160,7 +159,7 @@ struct MsprofGeProfTaskData { | |||||
uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; | uint16_t magicNumber = MSPROF_DATA_HEAD_MAGIC_NUM; | ||||
uint16_t dataTag = MSPROF_GE_DATA_TAG_TASK; | uint16_t dataTag = MSPROF_GE_DATA_TAG_TASK; | ||||
uint32_t taskType; // MsprofGeTaskType | uint32_t taskType; // MsprofGeTaskType | ||||
MixData opName; | |||||
MsprofMixData opName; | |||||
MsprofGeOpType opType; | MsprofGeOpType opType; | ||||
uint64_t curIterNum; | uint64_t curIterNum; | ||||
uint64_t timeStamp; | uint64_t timeStamp; | ||||