diff --git a/inc/external/ge/ge_api_types.h b/inc/external/ge/ge_api_types.h index a377c2f7..b77bebfc 100644 --- a/inc/external/ge/ge_api_types.h +++ b/inc/external/ge/ge_api_types.h @@ -369,6 +369,8 @@ const std::string PERFORMANCE_MODE = "ge.performance_mode"; // shape_precise: Shape will not be generalized, use precise shape. const std::string SHAPE_GENERALIZED_BUILD_MODE = "ge.shape_generalized_build_mode"; +const std::string JIT_COMPILE = "ge.jit_compile"; + const std::string MODIFY_MIXLIST = "ge.exec.modify_mixlist"; const std::string OP_PRECISION_MODE = "ge.exec.op_precision_mode"; diff --git a/metadef b/metadef index 17536092..62c14e1c 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 17536092c004f6f9e08116939f4f49e1e11a99d3 +Subproject commit 62c14e1cde161dccf6967f151ece9509f778c416 diff --git a/third_party/fwkacllib/inc/ops/nn_training_ops.h b/third_party/fwkacllib/inc/ops/nn_training_ops.h index 32da707e..d3775260 100644 --- a/third_party/fwkacllib/inc/ops/nn_training_ops.h +++ b/third_party/fwkacllib/inc/ops/nn_training_ops.h @@ -606,6 +606,78 @@ REG_OP(ApplyAdamWithAmsgrad) .OP_END_FACTORY_REG(ApplyAdamWithAmsgrad) +/** +*@brief Updates '*var' according to the Adam algorithm.. +* lr_t := {learning_rate} * sqrt{1 - beta_2^t} / (1 - beta_1^t) +* m_t := beta_1 * m_{t-1} + (1 - beta_1) * g +* v_t := beta_2 * v_{t-1} + (1 - beta_2) * g * g +* vhat_t := max{vhat_{t-1}, v_t} +* variable := variable - lr_t * m_t / (sqrt{vhat_t} + epsilon) +* +*@par Inputs: +*Eleven inputs, including: +*@li var: A mutable tensor. Must be one of the data types defined in +* TensorType::NumberType(). Should be from a Variable(). +*@li m: A mutable tensor. Has the same type as "var". Should be from a +* Variable(). +*@li v: A mutable tensor. Has the same type as "var". Should be from a +* Variable(). +*@li vhat: A mutable tensor. Has the same type as "var". Should be from a +* Variable(). +*@li beta1_power: A mutable tensor. Has the same type as "var". Should be from a +* Variable(). +*@li beta2_power: A mutable tensor. Has the same type as "var". Should be from a +* Variable(). +*@li lr: A tensor for the learning rate. Has the same type as "var". Should be +* from a Variable(). +*@li beta1: A mutable tensor. Has the same type as "var". Should be +* from a Variable(). +*@li beta2: A mutable tensor. Has the same type as "var". Should be +* from a Variable(). +*@li epsilon: A mutable tensor. Has the same type as "var". Should be +* from a Variable(). +*@li grad: A tensor for the gradient. Has the same type as "var". Should be +* from a Variable(). +* +*@par Attribute: +*one attribute, including: +*@li use_locking: An optional bool. Defaults to "False". +* If "True", updating of the "var" tensor is protected by a lock; +* otherwise the behavior is undefined, but may exhibit less contention. +* +*@par Outputs: +*four outputs, including: +*@li var: A mutable tensor. Has the same type as input "var". +*@li m: A mutable tensor. Has the same type as input "var" +*@li v: A mutable tensor. Has the same type as input "var" +*@li vhat: A mutable tensor. Has the same type as input "var" +* +*@attention Constraints: +* The input tensors must have the same shape. +* +*@par Third-party framework compatibility +* Compatible with the TensorFlow operator ResourceApplyKerasMomentum. +* +*/ +REG_OP(ApplyAdamWithAmsgradV2) + .INPUT(var, TensorType({DT_FLOAT})) + .INPUT(m, TensorType({DT_FLOAT})) + .INPUT(v, TensorType({DT_FLOAT})) + .INPUT(vhat, TensorType({DT_FLOAT})) + .INPUT(beta1_power, TensorType({DT_FLOAT})) + .INPUT(beta2_power, TensorType({DT_FLOAT})) + .INPUT(lr, TensorType({DT_FLOAT})) + .INPUT(beta1, TensorType({DT_FLOAT})) + .INPUT(beta2, TensorType({DT_FLOAT})) + .INPUT(epsilon, TensorType({DT_FLOAT})) + .INPUT(grad, TensorType({DT_FLOAT})) + .OUTPUT(var, TensorType({DT_FLOAT})) + .OUTPUT(m, TensorType({DT_FLOAT})) + .OUTPUT(v, TensorType({DT_FLOAT})) + .OUTPUT(vhat, TensorType({DT_FLOAT})) + .ATTR(use_locking, Bool, false) + .OP_END_FACTORY_REG(ApplyAdamWithAmsgradV2) + /** *@brief Updates "var" according to the AddSign update. * t-1 mean previous period. diff --git a/third_party/fwkacllib/inc/toolchain/prof_acl_api.h b/third_party/fwkacllib/inc/toolchain/prof_acl_api.h index 718fc69d..2353d967 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_acl_api.h +++ b/third_party/fwkacllib/inc/toolchain/prof_acl_api.h @@ -36,7 +36,7 @@ #define PROF_SUBTASK_TIME 0x0000040000000ULL #define PROF_OP_DETAIL 0x0000080000000ULL -#define PROF_AICPU_MODEL 0x4000000000000000ULL +constexpr uint64_t PROF_AICPU_MODEL = 0x4000000000000000ULL; #define PROF_MODEL_LOAD 0x8000000000000000ULL #define PROF_TASK_TRACE (PROF_MODEL_EXECUTE | PROF_RUNTIME_TRACE | PROF_TRAINING_TRACE | \ @@ -70,7 +70,7 @@ #define PROF_SUBTASK_TIME_MASK 0x0000040000000ULL #define PROF_OP_DETAIL_MASK 0x0000080000000ULL -#define PROF_AICPU_MODEL_MASK 0x4000000000000000ULL +constexpr uint64_t PROF_AICPU_MODEL_MASK = 0x4000000000000000ULL; #define PROF_MODEL_LOAD_MASK 0x8000000000000000ULL #if (defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)) diff --git a/third_party/fwkacllib/inc/toolchain/prof_common.h b/third_party/fwkacllib/inc/toolchain/prof_common.h index 411d7a29..37702c9b 100644 --- a/third_party/fwkacllib/inc/toolchain/prof_common.h +++ b/third_party/fwkacllib/inc/toolchain/prof_common.h @@ -152,7 +152,7 @@ struct MsprofGeProfInferData { uint8_t reserve[MSPROF_GE_INFER_DATA_RESERVE_BYTES]; }; -#define MSPROF_GE_TASK_DATA_RESERVE_BYTES 12 +constexpr int32_t MSPROF_GE_TASK_DATA_RESERVE_BYTES = 12; #define MSPROF_GE_OP_TYPE_LEN 56 enum MsprofGeTaskType { MSPROF_GE_TASK_TYPE_AI_CORE = 0,