Browse Source

!2132 upgrade Ascend software package 12 Aug 22

Merge pull request !2132 from yanghaoran/master
pull/2133/head
yanghaoran Gitee 2 years ago
parent
commit
4d9916b3d7
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 78 additions and 4 deletions
  1. +2
    -0
      inc/external/ge/ge_api_types.h
  2. +1
    -1
      metadef
  3. +72
    -0
      third_party/fwkacllib/inc/ops/nn_training_ops.h
  4. +2
    -2
      third_party/fwkacllib/inc/toolchain/prof_acl_api.h
  5. +1
    -1
      third_party/fwkacllib/inc/toolchain/prof_common.h

+ 2
- 0
inc/external/ge/ge_api_types.h View File

@@ -369,6 +369,8 @@ const std::string PERFORMANCE_MODE = "ge.performance_mode";
// shape_precise: Shape will not be generalized, use precise shape. // 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 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 MODIFY_MIXLIST = "ge.exec.modify_mixlist";


const std::string OP_PRECISION_MODE = "ge.exec.op_precision_mode"; const std::string OP_PRECISION_MODE = "ge.exec.op_precision_mode";


+ 1
- 1
metadef

@@ -1 +1 @@
Subproject commit 17536092c004f6f9e08116939f4f49e1e11a99d3
Subproject commit 62c14e1cde161dccf6967f151ece9509f778c416

+ 72
- 0
third_party/fwkacllib/inc/ops/nn_training_ops.h View File

@@ -606,6 +606,78 @@ REG_OP(ApplyAdamWithAmsgrad)
.OP_END_FACTORY_REG(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. *@brief Updates "var" according to the AddSign update.
* t-1 mean previous period. * t-1 mean previous period.


+ 2
- 2
third_party/fwkacllib/inc/toolchain/prof_acl_api.h View File

@@ -36,7 +36,7 @@
#define PROF_SUBTASK_TIME 0x0000040000000ULL #define PROF_SUBTASK_TIME 0x0000040000000ULL
#define PROF_OP_DETAIL 0x0000080000000ULL #define PROF_OP_DETAIL 0x0000080000000ULL


#define PROF_AICPU_MODEL 0x4000000000000000ULL
constexpr uint64_t PROF_AICPU_MODEL = 0x4000000000000000ULL;
#define PROF_MODEL_LOAD 0x8000000000000000ULL #define PROF_MODEL_LOAD 0x8000000000000000ULL


#define PROF_TASK_TRACE (PROF_MODEL_EXECUTE | PROF_RUNTIME_TRACE | PROF_TRAINING_TRACE | \ #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_SUBTASK_TIME_MASK 0x0000040000000ULL
#define PROF_OP_DETAIL_MASK 0x0000080000000ULL #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 #define PROF_MODEL_LOAD_MASK 0x8000000000000000ULL


#if (defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)) #if (defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER))


+ 1
- 1
third_party/fwkacllib/inc/toolchain/prof_common.h View File

@@ -152,7 +152,7 @@ struct MsprofGeProfInferData {
uint8_t reserve[MSPROF_GE_INFER_DATA_RESERVE_BYTES]; 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 #define MSPROF_GE_OP_TYPE_LEN 56
enum MsprofGeTaskType { enum MsprofGeTaskType {
MSPROF_GE_TASK_TYPE_AI_CORE = 0, MSPROF_GE_TASK_TYPE_AI_CORE = 0,


Loading…
Cancel
Save