mindspore 2.3.0rc1__cp39-none-any.whl → 2.3.0rc2__cp39-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mindspore might be problematic. Click here for more details.

Files changed (316) hide show
  1. mindspore/.commit_id +1 -1
  2. mindspore/__init__.py +1 -1
  3. mindspore/_akg/akg/utils/tbe_codegen_utils.py +13 -3
  4. mindspore/_c_dataengine.cpython-39-aarch64-linux-gnu.so +0 -0
  5. mindspore/_c_expression.cpython-39-aarch64-linux-gnu.so +0 -0
  6. mindspore/_checkparam.py +20 -0
  7. mindspore/_extends/parse/parser.py +1 -1
  8. mindspore/_extends/parse/standard_method.py +6 -5
  9. mindspore/_mindspore_offline_debug.cpython-39-aarch64-linux-gnu.so +0 -0
  10. mindspore/amp.py +5 -5
  11. mindspore/boost/boost_cell_wrapper.py +1 -1
  12. mindspore/boost/group_loss_scale_manager.py +1 -1
  13. mindspore/common/__init__.py +4 -2
  14. mindspore/common/_register_for_recompute.py +48 -0
  15. mindspore/common/_stub_tensor.py +1 -0
  16. mindspore/common/api.py +56 -4
  17. mindspore/common/dtype.py +5 -3
  18. mindspore/common/dump.py +2 -2
  19. mindspore/common/hook_handle.py +51 -4
  20. mindspore/common/initializer.py +1 -1
  21. mindspore/common/jit_config.py +17 -6
  22. mindspore/common/parameter.py +7 -2
  23. mindspore/common/recompute.py +247 -0
  24. mindspore/common/sparse_tensor.py +2 -2
  25. mindspore/common/symbol.py +1 -1
  26. mindspore/common/tensor.py +74 -36
  27. mindspore/communication/__init__.py +3 -3
  28. mindspore/communication/management.py +30 -30
  29. mindspore/context.py +28 -15
  30. mindspore/dataset/__init__.py +5 -5
  31. mindspore/dataset/audio/__init__.py +2 -2
  32. mindspore/dataset/audio/transforms.py +51 -51
  33. mindspore/dataset/callback/ds_callback.py +2 -2
  34. mindspore/dataset/engine/cache_client.py +1 -1
  35. mindspore/dataset/engine/datasets.py +3 -3
  36. mindspore/dataset/engine/datasets_audio.py +14 -14
  37. mindspore/dataset/engine/datasets_standard_format.py +3 -3
  38. mindspore/dataset/engine/datasets_text.py +38 -38
  39. mindspore/dataset/engine/datasets_user_defined.py +3 -3
  40. mindspore/dataset/engine/datasets_vision.py +68 -68
  41. mindspore/dataset/text/__init__.py +3 -3
  42. mindspore/dataset/text/transforms.py +26 -26
  43. mindspore/dataset/transforms/__init__.py +1 -1
  44. mindspore/dataset/vision/__init__.py +3 -3
  45. mindspore/dataset/vision/transforms.py +92 -92
  46. mindspore/dataset/vision/utils.py +1 -1
  47. mindspore/experimental/optim/adadelta.py +2 -2
  48. mindspore/experimental/optim/adagrad.py +2 -2
  49. mindspore/experimental/optim/adam.py +2 -2
  50. mindspore/experimental/optim/adamax.py +2 -2
  51. mindspore/experimental/optim/adamw.py +2 -2
  52. mindspore/experimental/optim/asgd.py +2 -2
  53. mindspore/experimental/optim/lr_scheduler.py +24 -20
  54. mindspore/experimental/optim/nadam.py +2 -2
  55. mindspore/experimental/optim/optimizer.py +1 -1
  56. mindspore/experimental/optim/radam.py +2 -2
  57. mindspore/experimental/optim/rmsprop.py +2 -2
  58. mindspore/experimental/optim/rprop.py +2 -2
  59. mindspore/experimental/optim/sgd.py +2 -2
  60. mindspore/hal/stream.py +2 -0
  61. mindspore/include/mindapi/base/types.h +5 -0
  62. mindspore/lib/libdnnl.so.2 +0 -0
  63. mindspore/lib/libmindspore.so +0 -0
  64. mindspore/lib/libmindspore_backend.so +0 -0
  65. mindspore/lib/libmindspore_common.so +0 -0
  66. mindspore/lib/libmindspore_core.so +0 -0
  67. mindspore/lib/libmindspore_gpr.so.15 +0 -0
  68. mindspore/lib/libmindspore_grpc++.so.1 +0 -0
  69. mindspore/lib/libmindspore_grpc.so.15 +0 -0
  70. mindspore/lib/libmindspore_shared_lib.so +0 -0
  71. mindspore/lib/libopencv_core.so.4.5 +0 -0
  72. mindspore/lib/libopencv_imgcodecs.so.4.5 +0 -0
  73. mindspore/lib/libopencv_imgproc.so.4.5 +0 -0
  74. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_cpu_kernels.so +0 -0
  75. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/config/cust_aicpu_kernel.json +6 -6
  76. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_proto/libcust_op_proto.so +0 -0
  77. mindspore/lib/plugin/ascend/libdvpp_utils.so +0 -0
  78. mindspore/lib/plugin/ascend/liblowlatency_collective.so +0 -0
  79. mindspore/lib/plugin/ascend/libmindspore_cpu_kernels.so +0 -0
  80. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/DeviceBin +0 -0
  81. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/PkgInspect +0 -0
  82. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/op_man +0 -0
  83. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/device/ascend910b/bin/ascend910b.bin +101787 -98559
  84. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_cann_host.so +0 -0
  85. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_host.so +0 -0
  86. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/base/op_register.h +2 -2
  87. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/params/mix.h +8 -1
  88. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/params/norm.h +5 -3
  89. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/params/reduce.h +2 -2
  90. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/utils/rt/backend/backend.h +3 -3
  91. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/utils/rt/backend/rtbackend.h +3 -3
  92. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/utils/rt/base/types.h +0 -1
  93. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/utils/rt/module/module.h +3 -3
  94. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/utils/svector/svector.h +3 -2
  95. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops.so +0 -0
  96. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops_static.a +0 -0
  97. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/add/tiling/add_tiling.h +9 -9
  98. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/apply_rotary_pos_emb_impl.h +2 -6
  99. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb.h +2 -2
  100. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_base.h +460 -0
  101. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_bf16.h +217 -0
  102. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_fp16.h +116 -0
  103. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_tiling.h +16 -24
  104. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_value.h +27 -0
  105. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/asdop/asd_op_impl.h +0 -4
  106. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{attention/FlashAttentionScore_impl.h → flash_attention_score/flash_attention_score_impl.h} +2 -1
  107. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{attention/bs_attention_tiling.h → flash_attention_score/flash_attention_score_tiling.h} +15 -19
  108. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/gelu/tiling/gelu_tiling.h +7 -9
  109. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/lccl/lccl_wrapper.h +58 -0
  110. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul/matmul_impl.h +19 -8
  111. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{matmul → matmul_common}/pp_matmul_common_tiling.h +18 -8
  112. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{matmul → matmul_common}/pp_matmul_info.h +7 -4
  113. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{matmul → matmul_common}/tiling_data.h +44 -6
  114. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/tiling_utils.h +65 -0
  115. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_stridedslice/matmul_stridedslice_fusion_impl.h +10 -6
  116. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/op_param.h +4 -1
  117. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/kernel/paged_attention_mix_hwsync.h +41 -0
  118. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{attention/PagedAttention_impl.h → paged_attention/paged_attention_impl.h} +1 -1
  119. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/paged_attention_tiling.h +63 -0
  120. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/add_param.h +2 -2
  121. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{attention_param.h → param/attention_param.h} +11 -2
  122. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/matmul_ext_param.h +37 -0
  123. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/sub_param.h +45 -0
  124. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/reshape_and_cache/reshape_and_cache_tiling.h +1 -2
  125. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/kernel/rms_norm.h +23 -0
  126. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/kernel/rms_norm_base.h +175 -0
  127. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/kernel/rms_norm_normal.h +276 -0
  128. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/kernel/rms_norm_split_d.h +280 -0
  129. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/kernel/tiling_data.h +35 -0
  130. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/rms_norm_impl.h +45 -0
  131. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/kernel/sub_kernel.h +20 -0
  132. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/sub_impl.h +47 -0
  133. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/sub_tiling.h +25 -0
  134. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/tune_repo/matmul_table.h +323 -23
  135. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/types.h +15 -4
  136. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_tiling.h +8 -0
  137. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libAdd_impl.so +0 -0
  138. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libSub_impl.so +0 -0
  139. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_layernorm_impl.so +0 -0
  140. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_rms_norm_impl.so +0 -0
  141. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libapply_rotary_pos_emb_impl.so +0 -0
  142. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libcast_impl.so +0 -0
  143. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libgelu_impl.so +0 -0
  144. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_impl.so +0 -0
  145. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_stridedslice_fusion_impl.so +0 -0
  146. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libms_kernels_internal.so +0 -0
  147. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libnot_equal_impl.so +0 -0
  148. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libreshape_and_cache_impl.so +0 -0
  149. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/librms_norm_impl.so +0 -0
  150. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bnsd_full_mix.o +0 -0
  151. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bnsd_tri_mix.o +0 -0
  152. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bsh_full_mix.o +0 -0
  153. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bsh_tri_mix.o +0 -0
  154. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bnsd_full_mix.o +0 -0
  155. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bnsd_tri_mix.o +0 -0
  156. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bsh_full_mix.o +0 -0
  157. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bsh_tri_mix.o +0 -0
  158. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_bf16_bnsd_full_mix.o +0 -0
  159. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_bf16_bsh_full_mix.o +0 -0
  160. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_fp16_bnsd_full_mix.o +0 -0
  161. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_fp16_bsh_full_mix.o +0 -0
  162. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lcal.h +22 -0
  163. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lcal_comm.h +70 -0
  164. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lcal_types.h +103 -0
  165. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lccl.h +47 -0
  166. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lccl_wrapper.h +58 -0
  167. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lcoc.h +154 -0
  168. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblcal.so +0 -0
  169. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblccl_wrapper.so +0 -0
  170. mindspore/lib/plugin/libmindspore_ascend.so.2 +0 -0
  171. mindspore/log.py +2 -2
  172. mindspore/mint/__init__.py +457 -0
  173. mindspore/mint/nn/__init__.py +430 -0
  174. mindspore/mint/nn/functional.py +424 -0
  175. mindspore/mint/optim/__init__.py +24 -0
  176. mindspore/mint/optim/adamw.py +186 -0
  177. mindspore/multiprocessing/__init__.py +4 -0
  178. mindspore/nn/__init__.py +3 -0
  179. mindspore/nn/cell.py +51 -47
  180. mindspore/nn/extend/__init__.py +29 -0
  181. mindspore/nn/extend/basic.py +140 -0
  182. mindspore/nn/extend/embedding.py +143 -0
  183. mindspore/nn/extend/layer/__init__.py +27 -0
  184. mindspore/nn/extend/layer/normalization.py +107 -0
  185. mindspore/nn/extend/pooling.py +117 -0
  186. mindspore/nn/generator.py +297 -0
  187. mindspore/nn/layer/basic.py +109 -1
  188. mindspore/nn/layer/container.py +2 -2
  189. mindspore/nn/layer/conv.py +6 -6
  190. mindspore/nn/layer/embedding.py +1 -1
  191. mindspore/nn/layer/normalization.py +21 -43
  192. mindspore/nn/layer/padding.py +4 -0
  193. mindspore/nn/optim/ada_grad.py +2 -2
  194. mindspore/nn/optim/adadelta.py +1 -1
  195. mindspore/nn/optim/adafactor.py +1 -1
  196. mindspore/nn/optim/adam.py +7 -7
  197. mindspore/nn/optim/adamax.py +2 -2
  198. mindspore/nn/optim/adasum.py +2 -2
  199. mindspore/nn/optim/asgd.py +2 -2
  200. mindspore/nn/optim/ftrl.py +1 -1
  201. mindspore/nn/optim/lamb.py +3 -3
  202. mindspore/nn/optim/lars.py +1 -1
  203. mindspore/nn/optim/lazyadam.py +2 -2
  204. mindspore/nn/optim/momentum.py +2 -2
  205. mindspore/nn/optim/optimizer.py +2 -2
  206. mindspore/nn/optim/proximal_ada_grad.py +2 -2
  207. mindspore/nn/optim/rmsprop.py +2 -2
  208. mindspore/nn/optim/rprop.py +2 -2
  209. mindspore/nn/optim/sgd.py +2 -2
  210. mindspore/nn/optim/thor.py +2 -2
  211. mindspore/nn/wrap/cell_wrapper.py +9 -9
  212. mindspore/nn/wrap/grad_reducer.py +5 -5
  213. mindspore/ops/_grad_experimental/grad_comm_ops.py +4 -2
  214. mindspore/ops/_vmap/vmap_grad_nn_ops.py +41 -2
  215. mindspore/ops/_vmap/vmap_math_ops.py +27 -8
  216. mindspore/ops/_vmap/vmap_nn_ops.py +66 -8
  217. mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +73 -1
  218. mindspore/ops/auto_generate/gen_arg_dtype_cast.py +12 -3
  219. mindspore/ops/auto_generate/gen_arg_handler.py +24 -0
  220. mindspore/ops/auto_generate/gen_extend_func.py +274 -0
  221. mindspore/ops/auto_generate/gen_ops_def.py +889 -22
  222. mindspore/ops/auto_generate/gen_ops_prim.py +3541 -253
  223. mindspore/ops/auto_generate/pyboost_inner_prim.py +282 -0
  224. mindspore/ops/composite/multitype_ops/_compile_utils.py +2 -1
  225. mindspore/ops/composite/multitype_ops/_constexpr_utils.py +9 -0
  226. mindspore/ops/extend/__init__.py +9 -1
  227. mindspore/ops/extend/array_func.py +134 -27
  228. mindspore/ops/extend/math_func.py +3 -3
  229. mindspore/ops/extend/nn_func.py +363 -2
  230. mindspore/ops/function/__init__.py +19 -2
  231. mindspore/ops/function/array_func.py +463 -439
  232. mindspore/ops/function/clip_func.py +7 -18
  233. mindspore/ops/function/grad/grad_func.py +5 -5
  234. mindspore/ops/function/linalg_func.py +4 -4
  235. mindspore/ops/function/math_func.py +260 -243
  236. mindspore/ops/function/nn_func.py +825 -62
  237. mindspore/ops/function/random_func.py +73 -4
  238. mindspore/ops/function/sparse_unary_func.py +1 -1
  239. mindspore/ops/function/vmap_func.py +1 -1
  240. mindspore/ops/functional.py +2 -2
  241. mindspore/ops/op_info_register.py +1 -31
  242. mindspore/ops/operations/__init__.py +2 -3
  243. mindspore/ops/operations/_grad_ops.py +2 -107
  244. mindspore/ops/operations/_inner_ops.py +5 -5
  245. mindspore/ops/operations/_sequence_ops.py +2 -2
  246. mindspore/ops/operations/array_ops.py +11 -233
  247. mindspore/ops/operations/comm_ops.py +32 -32
  248. mindspore/ops/operations/custom_ops.py +7 -89
  249. mindspore/ops/operations/manually_defined/ops_def.py +329 -4
  250. mindspore/ops/operations/math_ops.py +13 -163
  251. mindspore/ops/operations/nn_ops.py +9 -316
  252. mindspore/ops/operations/random_ops.py +1 -1
  253. mindspore/ops/operations/sparse_ops.py +3 -3
  254. mindspore/ops/primitive.py +2 -2
  255. mindspore/ops_generate/arg_dtype_cast.py +12 -3
  256. mindspore/ops_generate/arg_handler.py +24 -0
  257. mindspore/ops_generate/gen_ops_inner_prim.py +2 -0
  258. mindspore/ops_generate/gen_pyboost_func.py +13 -6
  259. mindspore/ops_generate/pyboost_utils.py +2 -17
  260. mindspore/parallel/__init__.py +3 -2
  261. mindspore/parallel/_auto_parallel_context.py +106 -1
  262. mindspore/parallel/_parallel_serialization.py +34 -2
  263. mindspore/parallel/_utils.py +16 -0
  264. mindspore/parallel/algo_parameter_config.py +4 -4
  265. mindspore/parallel/checkpoint_transform.py +249 -77
  266. mindspore/parallel/cluster/process_entity/_api.py +1 -1
  267. mindspore/parallel/parameter_broadcast.py +1 -1
  268. mindspore/parallel/shard.py +1 -1
  269. mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +1 -0
  270. mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +17 -5
  271. mindspore/profiler/parser/ascend_msprof_exporter.py +3 -3
  272. mindspore/profiler/parser/ascend_msprof_generator.py +10 -3
  273. mindspore/profiler/parser/ascend_op_generator.py +26 -9
  274. mindspore/profiler/parser/ascend_timeline_generator.py +7 -4
  275. mindspore/profiler/parser/profiler_info.py +11 -1
  276. mindspore/profiler/profiling.py +13 -5
  277. mindspore/rewrite/api/node.py +12 -12
  278. mindspore/rewrite/api/symbol_tree.py +11 -11
  279. mindspore/run_check/_check_version.py +1 -1
  280. mindspore/safeguard/rewrite_obfuscation.py +2 -2
  281. mindspore/train/amp.py +4 -4
  282. mindspore/train/anf_ir_pb2.py +8 -2
  283. mindspore/train/callback/_backup_and_restore.py +2 -2
  284. mindspore/train/callback/_callback.py +4 -4
  285. mindspore/train/callback/_checkpoint.py +2 -2
  286. mindspore/train/callback/_early_stop.py +2 -2
  287. mindspore/train/callback/_landscape.py +4 -4
  288. mindspore/train/callback/_loss_monitor.py +2 -2
  289. mindspore/train/callback/_on_request_exit.py +2 -2
  290. mindspore/train/callback/_reduce_lr_on_plateau.py +2 -2
  291. mindspore/train/callback/_summary_collector.py +2 -2
  292. mindspore/train/callback/_time_monitor.py +2 -2
  293. mindspore/train/dataset_helper.py +8 -3
  294. mindspore/train/loss_scale_manager.py +2 -2
  295. mindspore/train/metrics/metric.py +3 -3
  296. mindspore/train/mind_ir_pb2.py +22 -17
  297. mindspore/train/model.py +15 -15
  298. mindspore/train/serialization.py +18 -18
  299. mindspore/train/summary/summary_record.py +7 -7
  300. mindspore/train/train_thor/convert_utils.py +3 -3
  301. mindspore/version.py +1 -1
  302. {mindspore-2.3.0rc1.dist-info → mindspore-2.3.0rc2.dist-info}/METADATA +1 -1
  303. {mindspore-2.3.0rc1.dist-info → mindspore-2.3.0rc2.dist-info}/RECORD +307 -260
  304. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_stridedslice/tiling_data.h +0 -59
  305. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/FlashAttentionScore_bf16_BNSD_mix.o +0 -0
  306. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/FlashAttentionScore_bf16_BSH_mix.o +0 -0
  307. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/FlashAttentionScore_fp16_BNSD_mix.o +0 -0
  308. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/FlashAttentionScore_fp16_BSH_mix.o +0 -0
  309. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/PagedAttention_bf16_BNSD_mix.o +0 -0
  310. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/PagedAttention_bf16_BSH_mix.o +0 -0
  311. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/PagedAttention_fp16_BNSD_mix.o +0 -0
  312. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/PagedAttention_fp16_BSH_mix.o +0 -0
  313. /mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{attention/bs_attention_mix_hwsync.h → flash_attention_score/kernel/flash_attention_score_mix_hwsync.h} +0 -0
  314. {mindspore-2.3.0rc1.dist-info → mindspore-2.3.0rc2.dist-info}/WHEEL +0 -0
  315. {mindspore-2.3.0rc1.dist-info → mindspore-2.3.0rc2.dist-info}/entry_points.txt +0 -0
  316. {mindspore-2.3.0rc1.dist-info → mindspore-2.3.0rc2.dist-info}/top_level.txt +0 -0
@@ -242,11 +242,11 @@ class Conv2d(_Conv):
242
242
  distributions as well as constant ``'One'`` and ``'Zero'`` distributions are possible. Alias
243
243
  ``'xavier_uniform'`` , ``'he_uniform'`` , ``'ones'`` and ``'zeros'`` are acceptable. Uppercase and
244
244
  lowercase are both acceptable. Refer to the values of
245
- `Initializer <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_,
245
+ `Initializer <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_,
246
246
  for more details. Default: ``None`` , weight will be initialized using ``'HeUniform'``.
247
247
  bias_init (Union[Tensor, str, Initializer, numbers.Number], optional): Initialization method of bias parameter.
248
248
  Available initialization methods are the same as 'weight_init'. Refer to the values of
249
- `Initializer <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_,
249
+ `Initializer <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_,
250
250
  for more details. Default: ``None`` , bias will be initialized using ``'Uniform'`` .
251
251
  data_format (str, optional): The optional value for data format, is ``'NHWC'`` or ``'NCHW'`` .
252
252
  Default: ``'NCHW'`` . (NHWC is only supported in GPU now.)
@@ -458,11 +458,11 @@ class Conv1d(_Conv):
458
458
  distributions as well as constant 'One' and 'Zero' distributions are possible. Alias ``'xavier_uniform'`` ,
459
459
  ``'he_uniform'`` , ``'ones'`` and ``'zeros'`` are acceptable. Uppercase and lowercase are both acceptable.
460
460
  Refer to the values of
461
- `Initializer <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_,
461
+ `Initializer <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_,
462
462
  for more details. Default: ``None`` , weight will be initialized using ``'HeUniform'``.
463
463
  bias_init (Union[Tensor, str, Initializer, numbers.Number], optional): Initialization method of bias parameter.
464
464
  Available initialization methods are the same as 'weight_init'. Refer to the values of
465
- `Initializer <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_,
465
+ `Initializer <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_,
466
466
  for more details. Default: ``None`` , bias will be initialized using ``'Uniform'``.
467
467
  dtype (:class:`mindspore.dtype`): Dtype of Parameters. Default: ``mstype.float32`` .
468
468
 
@@ -691,11 +691,11 @@ class Conv3d(_Conv):
691
691
  distributions as well as constant ``'One'`` and ``'Zero'`` distributions are possible. Alias
692
692
  ``'xavier_uniform'`` , ``'he_uniform'`` , ``'ones'`` and ``'zeros'`` are acceptable. Uppercase and
693
693
  lowercase are both acceptable. Refer to the values of
694
- `Initializer <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_,
694
+ `Initializer <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_,
695
695
  for more details. Default: ``None`` , weight will be initialized using ``'HeUniform'``.
696
696
  bias_init (Union[Tensor, str, Initializer, numbers.Number], optional): Initialization method of bias parameter.
697
697
  Available initialization methods are the same as 'weight_init'. Refer to the values of
698
- `Initializer <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_,
698
+ `Initializer <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_,
699
699
  for more details. Default: ``None`` , bias will be initialized using ``'Uniform'`` .
700
700
  data_format (str, optional): The optional value for data format. Currently only support ``'NCDHW'`` .
701
701
  dtype (:class:`mindspore.dtype`): Dtype of Parameters. Default: ``mstype.float32`` .
@@ -66,7 +66,7 @@ class Embedding(Cell):
66
66
  use_one_hot (bool): Specifies whether to apply one_hot encoding form. Default: ``False`` .
67
67
  embedding_table (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the embedding_table.
68
68
  Refer to class `mindspore.common.initializer
69
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
69
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
70
70
  for the values of string when a string is specified. Default: ``'normal'`` .
71
71
  dtype (:class:`mindspore.dtype`): Data type of `x`. Default: ``mstype.float32`` .
72
72
  padding_idx (int, None): When the padding_idx encounters index, the output embedding vector of this index
@@ -21,7 +21,6 @@ import numbers
21
21
  import hashlib
22
22
 
23
23
  from mindspore.ops import operations as P
24
- from mindspore.ops import functional as F
25
24
  from mindspore.ops.operations import _inner_ops as inner
26
25
  from mindspore.common.parameter import Parameter
27
26
  from mindspore.common.initializer import initializer, Initializer
@@ -36,6 +35,7 @@ from mindspore.common import dtype as mstype
36
35
  from mindspore.parallel._utils import _is_in_auto_parallel_mode
37
36
  from mindspore.nn.cell import Cell
38
37
  from mindspore import log as logger
38
+ from mindspore.ops import group_norm
39
39
 
40
40
  __all__ = ['BatchNorm1d', 'BatchNorm2d', 'BatchNorm3d', 'LayerNorm', 'GroupNorm',
41
41
  'SyncBatchNorm', 'InstanceNorm1d', 'InstanceNorm2d', 'InstanceNorm3d']
@@ -206,19 +206,19 @@ class BatchNorm1d(_BatchNorm):
206
206
  Default: ``True`` .
207
207
  gamma_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the :math:`\gamma` weight.
208
208
  The values of str refer to the function `mindspore.common.initializer
209
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
209
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
210
210
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'ones'`` .
211
211
  beta_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the :math:`\beta` weight.
212
212
  The values of str refer to the function `mindspore.common.initializer
213
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
213
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
214
214
  including ``'zeros'`` , ``'ones'``, etc. Default: ``'zeros'`` .
215
215
  moving_mean_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the moving mean.
216
216
  The values of str refer to the function `mindspore.common.initializer
217
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
217
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
218
218
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'zeros'`` .
219
219
  moving_var_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the moving variance.
220
220
  The values of str refer to the function `mindspore.common.initializer
221
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
221
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
222
222
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'ones'`` .
223
223
  use_batch_statistics (bool): If ``true`` , use the mean value and variance value of current batch data. If
224
224
  ``false`` , use the mean value and variance value of specified value. If ``None`` , the training process
@@ -302,19 +302,19 @@ class BatchNorm2d(_BatchNorm):
302
302
  Default: ``True`` .
303
303
  gamma_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the :math:`\gamma` weight.
304
304
  The values of str refer to the function `mindspore.common.initializer
305
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
305
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
306
306
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'ones'`` .
307
307
  beta_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the :math:`\beta` weight.
308
308
  The values of str refer to the function `mindspore.common.initializer
309
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
309
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
310
310
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'zeros'`` .
311
311
  moving_mean_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the moving mean.
312
312
  The values of str refer to the function `mindspore.common.initializer
313
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
313
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
314
314
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'zeros'`` .
315
315
  moving_var_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the moving variance.
316
316
  The values of str refer to the function `mindspore.common.initializer
317
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
317
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
318
318
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'ones'`` .
319
319
  use_batch_statistics (bool): Default: ``None`` .
320
320
 
@@ -391,19 +391,19 @@ class BatchNorm3d(Cell):
391
391
  affine (bool): A bool value. When set to ``True`` , gamma and beta can be learned. Default: ``True`` .
392
392
  gamma_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the gamma weight.
393
393
  The values of str refer to the function `mindspore.common.initializer
394
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
394
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
395
395
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'ones'`` .
396
396
  beta_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the beta weight.
397
397
  The values of str refer to the function `mindspore.common.initializer
398
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
398
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
399
399
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'zeros'`` .
400
400
  moving_mean_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the moving mean.
401
401
  The values of str refer to the function `mindspore.common.initializer
402
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
402
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
403
403
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'zeros'`` .
404
404
  moving_var_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the moving variance.
405
405
  The values of str refer to the function `mindspore.common.initializer
406
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.common.initializer.html>`_
406
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.common.initializer.html>`_
407
407
  including ``'zeros'`` , ``'ones'`` , etc. Default: ``'ones'`` .
408
408
  use_batch_statistics (bool): If true, use the mean value and variance value of current batch data. If
409
409
  ``false``, use the mean value and variance value of specified value. If ``None`` , the training process
@@ -558,14 +558,14 @@ class SyncBatchNorm(_BatchNorm):
558
558
 
559
559
  For the Ascend devices, users need to prepare the rank table, set rank_id and device_id.
560
560
  Please see the `Ascend tutorial
561
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/rank_table.html>`_
561
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/rank_table.html>`_
562
562
  for more details.
563
563
 
564
564
  For the GPU devices, users need to prepare the host file and mpi, please see the `mpirun Startup
565
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/mpirun.html>`_ .
565
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/mpirun.html>`_ .
566
566
 
567
567
  For the CPU device, users need to write a dynamic cluster startup script, please see the `Dynamic Cluster
568
- Startup <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/dynamic_cluster.html>`_ .
568
+ Startup <https://www.mindspore.cn/tutorials/experts/en/master/parallel/dynamic_cluster.html>`_ .
569
569
 
570
570
  This example should be run with multiple devices.
571
571
 
@@ -1100,7 +1100,8 @@ class GroupNorm(Cell):
1100
1100
  dtype (:class:`mindspore.dtype`): Dtype of Parameters. Default: ``mstype.float32`` .
1101
1101
 
1102
1102
  Inputs:
1103
- - **x** (Tensor) - The input feature with shape :math:`(N, C, H, W)` .
1103
+ - **x** (Tensor) - The input feature with shape :math:`(N, C, *)`, where :math:`*` means, any number of
1104
+ additional dimensions.
1104
1105
 
1105
1106
  Outputs:
1106
1107
  Tensor, the normalized and scaled offset tensor, has the same shape and data type as the `x`.
@@ -1145,34 +1146,13 @@ class GroupNorm(Cell):
1145
1146
  self.affine = validator.check_bool(affine, arg_name="affine", prim_name=self.cls_name)
1146
1147
 
1147
1148
  self.gamma = Parameter(initializer(
1148
- gamma_init, num_channels, dtype=dtype), name="gamma", requires_grad=affine)
1149
+ gamma_init, self.num_channels, dtype=dtype), name="gamma", requires_grad=affine)
1149
1150
  self.beta = Parameter(initializer(
1150
- beta_init, num_channels, dtype=dtype), name="beta", requires_grad=affine)
1151
- self.reduce_mean = P.ReduceMean(keep_dims=True)
1152
- self.reduce_sum = P.ReduceSum(keep_dims=True)
1153
- self.shape = F.shape
1154
- self.reshape = F.reshape
1155
- self.square = F.square
1156
- self.sqrt = P.Sqrt()
1151
+ beta_init, self.num_channels, dtype=dtype), name="beta", requires_grad=affine)
1157
1152
 
1158
1153
  def _cal_output(self, x):
1159
1154
  """calculate groupnorm output"""
1160
- batch, channel, height, width = F.shape(x)
1161
- self._channel_check(channel, self.num_channels, self.cls_name)
1162
- x = F.reshape(x, (batch, self.num_groups, -1))
1163
- mean = self.reduce_mean(x, 2)
1164
- var = F.div(self.reduce_sum(F.square(F.sub(x, mean)), 2), (channel * height * width / self.num_groups))
1165
- std = self.sqrt(var + self.eps)
1166
- x = F.div(F.sub(x, mean), std)
1167
- x = F.reshape(x, (batch, channel, height, width))
1168
- output = F.add(x * F.reshape(self.gamma, (-1, 1, 1)), F.reshape(self.beta, (-1, 1, 1)))
1169
- return output
1170
-
1171
- @staticmethod
1172
- @_primexpr
1173
- def _check_input_dim(shape, cls_name):
1174
- dim = len(shape)
1175
- _check_dim(dim, 4, cls_name)
1155
+ return group_norm(x, self.num_groups, self.gamma, self.beta, self.eps)
1176
1156
 
1177
1157
  @staticmethod
1178
1158
  @_primexpr
@@ -1193,7 +1173,5 @@ class GroupNorm(Cell):
1193
1173
  return 'num_groups={}, num_channels={}'.format(self.num_groups, self.num_channels)
1194
1174
 
1195
1175
  def construct(self, x):
1196
- self._check_input_dim(F.shape(x), self.cls_name)
1197
- self._check_dtype(x.dtype, [mstype.float16, mstype.float32], self.cls_name)
1198
1176
  output = self._cal_output(x)
1199
1177
  return output
@@ -630,6 +630,10 @@ class ZeroPad2d(_ConstantPadNd):
630
630
  The remaining dimensions of the output are consistent with those of the input.
631
631
  Only support non-negative value while running in Ascend.
632
632
 
633
+ Inputs:
634
+ - **x** (Tensor) - shape is :math:`(N, *)`, where :math:`*` means, any number of additional dimensions.
635
+ It is not supported that the size of dimensions is greater than 5 while running in Ascend.
636
+
633
637
  Returns:
634
638
  Tensor, the tensor after padding.
635
639
 
@@ -126,7 +126,7 @@ class Adagrad(Optimizer):
126
126
 
127
127
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
128
128
  `LearningRateSchedule
129
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
129
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
130
130
  with step as the input to get the learning rate of current step.
131
131
 
132
132
  update_slots (bool): Whether the :math:`h` will be updated. Default: ``True`` .
@@ -168,7 +168,7 @@ class Adagrad(Optimizer):
168
168
  >>> import mindspore.nn as nn
169
169
  >>>
170
170
  >>> # Define the network structure of LeNet5. Refer to
171
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
171
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
172
172
  >>> net = LeNet5()
173
173
  >>> #1) All parameters use the same learning rate and weight decay
174
174
  >>> optim = nn.Adagrad(params=net.trainable_params())
@@ -106,7 +106,7 @@ class Adadelta(Optimizer):
106
106
 
107
107
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
108
108
  `LearningRateSchedule
109
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
109
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
110
110
  with step as the input to get the learning rate of current step.
111
111
 
112
112
  rho (float): Decay rate, must be in range [0.0, 1.0]. Default: ``0.9`` .
@@ -264,7 +264,7 @@ class AdaFactor(Optimizer):
264
264
  >>> from mindspore import nn
265
265
  >>>
266
266
  >>> # Define the network structure of LeNet5. Refer to
267
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
267
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
268
268
  >>> net = LeNet5()
269
269
  >>> #1) Parameters use the default learning rate with None and weight decay with 0.
270
270
  >>> optim = nn.AdaFactor(params=net.trainable_params())
@@ -579,7 +579,7 @@ class Adam(Optimizer):
579
579
 
580
580
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
581
581
  `LearningRateSchedule
582
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
582
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
583
583
  with step as the input to get the learning rate of current step.
584
584
 
585
585
  beta1 (float): The exponential decay rate for the 1st moment estimations. Should be in range (0.0, 1.0).
@@ -652,7 +652,7 @@ class Adam(Optimizer):
652
652
  >>> from mindspore import nn
653
653
  >>>
654
654
  >>> # Define the network structure of LeNet5. Refer to
655
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
655
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
656
656
  >>> net = LeNet5()
657
657
  >>> #1) All parameters use the same learning rate and weight decay
658
658
  >>> optim = nn.Adam(params=net.trainable_params())
@@ -906,7 +906,7 @@ class AdamWeightDecay(Optimizer):
906
906
  There is usually no connection between a optimizer and mixed precision. But when `FixedLossScaleManager` is used
907
907
  and `drop_overflow_update` in `FixedLossScaleManager` is set to False, optimizer needs to set the 'loss_scale'.
908
908
  As this optimizer has no argument of `loss_scale`, so `loss_scale` needs to be processed by other means, refer
909
- document `LossScale <https://www.mindspore.cn/tutorials/en/r2.3.q1/advanced/mixed_precision.html>`_ to
909
+ document `LossScale <https://www.mindspore.cn/tutorials/en/master/advanced/mixed_precision.html>`_ to
910
910
  process `loss_scale` correctly.
911
911
 
912
912
  If parameters are not grouped, the `weight_decay` in optimizer will be applied on the network parameters without
@@ -950,7 +950,7 @@ class AdamWeightDecay(Optimizer):
950
950
 
951
951
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
952
952
  `LearningRateSchedule
953
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
953
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
954
954
  with step as the input to get the learning rate of current step.
955
955
 
956
956
  beta1 (float): The exponential decay rate for the 1st moment estimations. Default: ``0.9`` .
@@ -992,7 +992,7 @@ class AdamWeightDecay(Optimizer):
992
992
  >>> from mindspore import nn
993
993
  >>>
994
994
  >>> # Define the network structure of LeNet5. Refer to
995
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
995
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
996
996
  >>> net = LeNet5()
997
997
  >>> #1) All parameters use the same learning rate and weight decay
998
998
  >>> optim = nn.AdamWeightDecay(params=net.trainable_params())
@@ -1150,7 +1150,7 @@ class AdamOffload(Optimizer):
1150
1150
 
1151
1151
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
1152
1152
  `LearningRateSchedule
1153
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
1153
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
1154
1154
  with step as the input to get the learning rate of current step.
1155
1155
 
1156
1156
  beta1 (float): The exponential decay rate for the 1st moment estimations. Should be in range (0.0, 1.0).
@@ -1205,7 +1205,7 @@ class AdamOffload(Optimizer):
1205
1205
  >>> from mindspore import nn
1206
1206
  >>>
1207
1207
  >>> # Define the network structure of LeNet5. Refer to
1208
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
1208
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
1209
1209
  >>> net = LeNet5()
1210
1210
  >>> #1) All parameters use the same learning rate and weight decay
1211
1211
  >>> optim = nn.AdamOffload(params=net.trainable_params())
@@ -115,7 +115,7 @@ class AdaMax(Optimizer):
115
115
 
116
116
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
117
117
  `LearningRateSchedule
118
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
118
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
119
119
  with step as the input to get the learning rate of current step.
120
120
 
121
121
  beta1 (float): The exponential decay rate for the 1st moment estimations. Should be in range (0.0, 1.0).
@@ -163,7 +163,7 @@ class AdaMax(Optimizer):
163
163
  >>> from mindspore import nn
164
164
  >>>
165
165
  >>> # Define the network structure of LeNet5. Refer to
166
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
166
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
167
167
  >>> net = LeNet5()
168
168
  >>> #1) All parameters use the same learning rate and weight decay
169
169
  >>> optim = nn.AdaMax(params=net.trainable_params())
@@ -445,7 +445,7 @@ class AdaSumByGradWrapCell(Cell):
445
445
  >>> import mindspore as ms
446
446
  >>> from mindspore import nn
447
447
  >>> # Define the network structure of LeNet5. Refer to
448
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
448
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
449
449
  >>> net = LeNet5()
450
450
  >>> optim = nn.AdaSumByGradWrapCell(nn.Momentum(params=net.trainable_params(), learning_rate=0.1, momentum=0.9))
451
451
  >>> loss = nn.SoftmaxCrossEntropyWithLogits()
@@ -514,7 +514,7 @@ class AdaSumByDeltaWeightWrapCell(Cell):
514
514
  >>> import mindspore as ms
515
515
  >>> from mindspore import nn
516
516
  >>> # Define the network structure of LeNet5. Refer to
517
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
517
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
518
518
  >>> net = LeNet5()
519
519
  >>> optim = nn.AdaSumByDeltaWeightWrapCell(nn.Momentum(params=net.trainable_params(),
520
520
  ... learning_rate=0.1, momentum=0.9))
@@ -94,7 +94,7 @@ class ASGD(Optimizer):
94
94
 
95
95
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
96
96
  `LearningRateSchedule
97
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
97
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
98
98
  with step as the input to get the learning rate of current step.
99
99
 
100
100
  lambd (float): The decay term. Default: ``1e-4`` .
@@ -130,7 +130,7 @@ class ASGD(Optimizer):
130
130
  >>> from mindspore import nn
131
131
  >>>
132
132
  >>> # Define the network structure of LeNet5. Refer to
133
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
133
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
134
134
  >>> net = LeNet5()
135
135
  >>> #1) All parameters use the same learning rate and weight decay
136
136
  >>> optim = nn.ASGD(params=net.trainable_params())
@@ -275,7 +275,7 @@ class FTRL(Optimizer):
275
275
  >>> from mindspore import nn
276
276
  >>>
277
277
  >>> # Define the network structure of LeNet5. Refer to
278
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
278
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
279
279
  >>> net = LeNet5()
280
280
  >>> #1) All parameters use the same learning rate and weight decay
281
281
  >>> optim = nn.FTRL(params=net.trainable_params())
@@ -132,7 +132,7 @@ class Lamb(Optimizer):
132
132
  There is usually no connection between a optimizer and mixed precision. But when `FixedLossScaleManager` is used
133
133
  and `drop_overflow_update` in `FixedLossScaleManager` is set to False, optimizer needs to set the 'loss_scale'.
134
134
  As this optimizer has no argument of `loss_scale`, so `loss_scale` needs to be processed by other means. Refer
135
- document `LossScale <https://www.mindspore.cn/tutorials/en/r2.3.q1/advanced/mixed_precision.html>`_ to
135
+ document `LossScale <https://www.mindspore.cn/tutorials/en/master/advanced/mixed_precision.html>`_ to
136
136
  process `loss_scale` correctly.
137
137
 
138
138
  If parameters are not grouped, the `weight_decay` in optimizer will be applied on the network parameters without
@@ -184,7 +184,7 @@ class Lamb(Optimizer):
184
184
 
185
185
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
186
186
  `LearningRateSchedule
187
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
187
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
188
188
  with step as the input to get the learning rate of current step.
189
189
 
190
190
  beta1 (float): The exponential decay rate for the 1st moment estimations. Default: ``0.9`` .
@@ -226,7 +226,7 @@ class Lamb(Optimizer):
226
226
  >>> from mindspore import nn
227
227
  >>>
228
228
  >>> # Define the network structure of LeNet5. Refer to
229
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
229
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
230
230
  >>> net = LeNet5()
231
231
  >>> #1) All parameters use the same learning rate and weight decay
232
232
  >>> optim = nn.Lamb(params=net.trainable_params(), learning_rate=0.1)
@@ -109,7 +109,7 @@ class LARS(Optimizer):
109
109
  >>> from mindspore import nn
110
110
  >>>
111
111
  >>> # Define the network structure of LeNet5. Refer to
112
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
112
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
113
113
  >>> net = LeNet5()
114
114
  >>> loss = nn.SoftmaxCrossEntropyWithLogits()
115
115
  >>> opt = nn.Momentum(net.trainable_params(), 0.1, 0.9)
@@ -334,7 +334,7 @@ class LazyAdam(Optimizer):
334
334
 
335
335
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
336
336
  `LearningRateSchedule
337
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
337
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
338
338
  with step as the input to get the learning rate of current step.
339
339
 
340
340
  beta1 (float): The exponential decay rate for the 1st moment estimations. Should be in range (0.0, 1.0).
@@ -390,7 +390,7 @@ class LazyAdam(Optimizer):
390
390
  >>> from mindspore import nn
391
391
  >>>
392
392
  >>> # Define the network structure of LeNet5. Refer to
393
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
393
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
394
394
  >>> net = LeNet5()
395
395
  >>> #1) All parameters use the same learning rate and weight decay
396
396
  >>> optim = nn.LazyAdam(params=net.trainable_params())
@@ -116,7 +116,7 @@ class Momentum(Optimizer):
116
116
 
117
117
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
118
118
  `LearningRateSchedule
119
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
119
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
120
120
  with step as the input to get the learning rate of current step.
121
121
 
122
122
  momentum (float): Hyperparameter of type float, means momentum for the moving average.
@@ -161,7 +161,7 @@ class Momentum(Optimizer):
161
161
  >>> from mindspore import nn
162
162
  >>>
163
163
  >>> # Define the network structure of LeNet5. Refer to
164
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
164
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
165
165
  >>> net = LeNet5()
166
166
  >>> #1) All parameters use the same learning rate and weight decay
167
167
  >>> optim = nn.Momentum(params=net.trainable_params(), learning_rate=0.1, momentum=0.9)
@@ -96,7 +96,7 @@ class Optimizer(Cell):
96
96
 
97
97
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
98
98
  `LearningRateSchedule
99
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
99
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
100
100
  with step as the input to get the learning rate
101
101
  of current step.
102
102
 
@@ -774,7 +774,7 @@ class Optimizer(Cell):
774
774
  Examples:
775
775
  >>> from mindspore import nn
776
776
  >>> # Define the network structure of LeNet5. Refer to
777
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
777
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
778
778
  >>> net = LeNet5()
779
779
  >>> conv_params = list(filter(lambda x: 'conv' in x.name, net.trainable_params()))
780
780
  >>> no_conv_params = list(filter(lambda x: 'conv' not in x.name, net.trainable_params()))
@@ -122,7 +122,7 @@ class ProximalAdagrad(Optimizer):
122
122
 
123
123
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
124
124
  `LearningRateSchedule
125
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
125
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
126
126
  with step as the input to get the learning rate of the current step.
127
127
 
128
128
  l1 (float): l1 regularization strength, must be greater than or equal to zero. Default: ``0.0`` .
@@ -165,7 +165,7 @@ class ProximalAdagrad(Optimizer):
165
165
  >>> from mindspore import nn
166
166
  >>>
167
167
  >>> # Define the network structure of LeNet5. Refer to
168
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
168
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
169
169
  >>> net = LeNet5()
170
170
  >>> #1) All parameters use the same learning rate and weight decay
171
171
  >>> optim = nn.ProximalAdagrad(params=net.trainable_params())
@@ -137,7 +137,7 @@ class RMSProp(Optimizer):
137
137
 
138
138
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
139
139
  `LearningRateSchedule
140
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
140
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
141
141
  with step as the input to get the learning rate of the current step.
142
142
 
143
143
  decay (float): Decay rate. Should be equal to or greater than 0. Default: ``0.9`` .
@@ -186,7 +186,7 @@ class RMSProp(Optimizer):
186
186
  >>> from mindspore import nn
187
187
  >>>
188
188
  >>> # Define the network structure of LeNet5. Refer to
189
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
189
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
190
190
  >>> net = LeNet5()
191
191
  >>> #1) All parameters use the same learning rate and weight decay
192
192
  >>> optim = nn.RMSProp(params=net.trainable_params(), learning_rate=0.1)
@@ -96,7 +96,7 @@ class Rprop(Optimizer):
96
96
 
97
97
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
98
98
  `LearningRateSchedule
99
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
99
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
100
100
  with step as the input to get the learning rate of current step.
101
101
 
102
102
  etas (tuple[float, float]): The factor of multiplicative increasing or
@@ -137,7 +137,7 @@ class Rprop(Optimizer):
137
137
  >>> from mindspore import nn
138
138
  >>>
139
139
  >>> # Define the network structure of LeNet5. Refer to
140
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
140
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
141
141
  >>> net = LeNet5()
142
142
  >>> #1) All parameters use the same learning rate and weight decay
143
143
  >>> optim = nn.Rprop(params=net.trainable_params())
mindspore/nn/optim/sgd.py CHANGED
@@ -103,7 +103,7 @@ class SGD(Optimizer):
103
103
 
104
104
  - LearningRateSchedule: Learning rate is dynamic. During training, the optimizer calls the instance of
105
105
  `LearningRateSchedule
106
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.nn.html#learningrateschedule-class>`_
106
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.nn.html#learningrateschedule-class>`_
107
107
  with step as the input to get the learning rate of current step.
108
108
 
109
109
  momentum (float): A floating point value the momentum. must be at least 0.0. Default: ``0.0`` .
@@ -134,7 +134,7 @@ class SGD(Optimizer):
134
134
  >>> from mindspore import nn
135
135
  >>>
136
136
  >>> # Define the network structure of LeNet5. Refer to
137
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
137
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
138
138
  >>> net = LeNet5()
139
139
  >>> #1) All parameters use the same learning rate and weight decay
140
140
  >>> optim = nn.SGD(params=net.trainable_params())
@@ -339,10 +339,10 @@ def thor(net, learning_rate, damping, momentum, weight_decay=0.0, loss_scale=1.0
339
339
  >>> from mindspore import Tensor
340
340
  >>>
341
341
  >>> # Define the network structure of LeNet5. Refer to
342
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
342
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
343
343
  >>> net = LeNet5()
344
344
  >>> # Create the dataset taking MNIST as an example. Refer to
345
- >>> # https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/mnist.py
345
+ >>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/mnist.py
346
346
  >>> dataset = create_dataset()
347
347
  >>> temp = Tensor([4e-4, 1e-4, 1e-5, 1e-5], mstype.float32)
348
348
  >>> optim = nn.thor(net, learning_rate=temp, damping=temp, momentum=0.9, loss_scale=128, frequency=4)