mindspore 2.3.0rc1__cp38-none-any.whl → 2.3.0rc2__cp38-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 (318) 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-38-aarch64-linux-gnu.so +0 -0
  5. mindspore/_c_expression.cpython-38-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-38-aarch64-linux-gnu.so +0 -0
  10. mindspore/amp.py +5 -5
  11. mindspore/bin/cache_admin +0 -0
  12. mindspore/bin/cache_server +0 -0
  13. mindspore/boost/boost_cell_wrapper.py +1 -1
  14. mindspore/boost/group_loss_scale_manager.py +1 -1
  15. mindspore/common/__init__.py +4 -2
  16. mindspore/common/_register_for_recompute.py +48 -0
  17. mindspore/common/_stub_tensor.py +1 -0
  18. mindspore/common/api.py +56 -4
  19. mindspore/common/dtype.py +5 -3
  20. mindspore/common/dump.py +2 -2
  21. mindspore/common/hook_handle.py +51 -4
  22. mindspore/common/initializer.py +1 -1
  23. mindspore/common/jit_config.py +17 -6
  24. mindspore/common/parameter.py +7 -2
  25. mindspore/common/recompute.py +247 -0
  26. mindspore/common/sparse_tensor.py +2 -2
  27. mindspore/common/symbol.py +1 -1
  28. mindspore/common/tensor.py +74 -36
  29. mindspore/communication/__init__.py +3 -3
  30. mindspore/communication/management.py +30 -30
  31. mindspore/context.py +28 -15
  32. mindspore/dataset/__init__.py +5 -5
  33. mindspore/dataset/audio/__init__.py +2 -2
  34. mindspore/dataset/audio/transforms.py +51 -51
  35. mindspore/dataset/callback/ds_callback.py +2 -2
  36. mindspore/dataset/engine/cache_client.py +1 -1
  37. mindspore/dataset/engine/datasets.py +3 -3
  38. mindspore/dataset/engine/datasets_audio.py +14 -14
  39. mindspore/dataset/engine/datasets_standard_format.py +3 -3
  40. mindspore/dataset/engine/datasets_text.py +38 -38
  41. mindspore/dataset/engine/datasets_user_defined.py +3 -3
  42. mindspore/dataset/engine/datasets_vision.py +68 -68
  43. mindspore/dataset/text/__init__.py +3 -3
  44. mindspore/dataset/text/transforms.py +26 -26
  45. mindspore/dataset/transforms/__init__.py +1 -1
  46. mindspore/dataset/vision/__init__.py +3 -3
  47. mindspore/dataset/vision/transforms.py +92 -92
  48. mindspore/dataset/vision/utils.py +1 -1
  49. mindspore/experimental/optim/adadelta.py +2 -2
  50. mindspore/experimental/optim/adagrad.py +2 -2
  51. mindspore/experimental/optim/adam.py +2 -2
  52. mindspore/experimental/optim/adamax.py +2 -2
  53. mindspore/experimental/optim/adamw.py +2 -2
  54. mindspore/experimental/optim/asgd.py +2 -2
  55. mindspore/experimental/optim/lr_scheduler.py +24 -20
  56. mindspore/experimental/optim/nadam.py +2 -2
  57. mindspore/experimental/optim/optimizer.py +1 -1
  58. mindspore/experimental/optim/radam.py +2 -2
  59. mindspore/experimental/optim/rmsprop.py +2 -2
  60. mindspore/experimental/optim/rprop.py +2 -2
  61. mindspore/experimental/optim/sgd.py +2 -2
  62. mindspore/hal/stream.py +2 -0
  63. mindspore/include/mindapi/base/types.h +5 -0
  64. mindspore/lib/libdnnl.so.2 +0 -0
  65. mindspore/lib/libmindspore.so +0 -0
  66. mindspore/lib/libmindspore_backend.so +0 -0
  67. mindspore/lib/libmindspore_common.so +0 -0
  68. mindspore/lib/libmindspore_core.so +0 -0
  69. mindspore/lib/libmindspore_glog.so.0 +0 -0
  70. mindspore/lib/libmindspore_gpr.so.15 +0 -0
  71. mindspore/lib/libmindspore_grpc.so.15 +0 -0
  72. mindspore/lib/libmindspore_shared_lib.so +0 -0
  73. mindspore/lib/libopencv_core.so.4.5 +0 -0
  74. mindspore/lib/libopencv_imgcodecs.so.4.5 +0 -0
  75. mindspore/lib/libopencv_imgproc.so.4.5 +0 -0
  76. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_cpu_kernels.so +0 -0
  77. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/config/cust_aicpu_kernel.json +6 -6
  78. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_proto/libcust_op_proto.so +0 -0
  79. mindspore/lib/plugin/ascend/libdvpp_utils.so +0 -0
  80. mindspore/lib/plugin/ascend/liblowlatency_collective.so +0 -0
  81. mindspore/lib/plugin/ascend/libmindspore_cpu_kernels.so +0 -0
  82. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/DeviceBin +0 -0
  83. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/PkgInspect +0 -0
  84. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/op_man +0 -0
  85. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/device/ascend910b/bin/ascend910b.bin +101787 -98559
  86. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_cann_host.so +0 -0
  87. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_host.so +0 -0
  88. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/base/op_register.h +2 -2
  89. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/params/mix.h +8 -1
  90. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/params/norm.h +5 -3
  91. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/params/reduce.h +2 -2
  92. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/utils/rt/backend/backend.h +3 -3
  93. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/utils/rt/backend/rtbackend.h +3 -3
  94. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/utils/rt/base/types.h +0 -1
  95. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/utils/rt/module/module.h +3 -3
  96. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/include/asdops/utils/svector/svector.h +3 -2
  97. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops.so +0 -0
  98. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops_static.a +0 -0
  99. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/add/tiling/add_tiling.h +9 -9
  100. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/apply_rotary_pos_emb_impl.h +2 -6
  101. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb.h +2 -2
  102. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_base.h +460 -0
  103. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_bf16.h +217 -0
  104. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_fp16.h +116 -0
  105. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_tiling.h +16 -24
  106. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_value.h +27 -0
  107. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/asdop/asd_op_impl.h +0 -4
  108. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{attention/FlashAttentionScore_impl.h → flash_attention_score/flash_attention_score_impl.h} +2 -1
  109. 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
  110. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/gelu/tiling/gelu_tiling.h +7 -9
  111. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/lccl/lccl_wrapper.h +58 -0
  112. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul/matmul_impl.h +19 -8
  113. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{matmul → matmul_common}/pp_matmul_common_tiling.h +18 -8
  114. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{matmul → matmul_common}/pp_matmul_info.h +7 -4
  115. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{matmul → matmul_common}/tiling_data.h +44 -6
  116. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/tiling_utils.h +65 -0
  117. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_stridedslice/matmul_stridedslice_fusion_impl.h +10 -6
  118. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/op_param.h +4 -1
  119. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/kernel/paged_attention_mix_hwsync.h +41 -0
  120. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{attention/PagedAttention_impl.h → paged_attention/paged_attention_impl.h} +1 -1
  121. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/paged_attention_tiling.h +63 -0
  122. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/add_param.h +2 -2
  123. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/{attention_param.h → param/attention_param.h} +11 -2
  124. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/matmul_ext_param.h +37 -0
  125. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/sub_param.h +45 -0
  126. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/reshape_and_cache/reshape_and_cache_tiling.h +1 -2
  127. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/kernel/rms_norm.h +23 -0
  128. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/kernel/rms_norm_base.h +175 -0
  129. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/kernel/rms_norm_normal.h +276 -0
  130. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/kernel/rms_norm_split_d.h +280 -0
  131. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/kernel/tiling_data.h +35 -0
  132. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/rms_norm_impl.h +45 -0
  133. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/kernel/sub_kernel.h +20 -0
  134. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/sub_impl.h +47 -0
  135. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/sub_tiling.h +25 -0
  136. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/tune_repo/matmul_table.h +323 -23
  137. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/types.h +15 -4
  138. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_tiling.h +8 -0
  139. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libAdd_impl.so +0 -0
  140. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libSub_impl.so +0 -0
  141. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_layernorm_impl.so +0 -0
  142. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_rms_norm_impl.so +0 -0
  143. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libapply_rotary_pos_emb_impl.so +0 -0
  144. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libcast_impl.so +0 -0
  145. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libgelu_impl.so +0 -0
  146. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_impl.so +0 -0
  147. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_stridedslice_fusion_impl.so +0 -0
  148. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libms_kernels_internal.so +0 -0
  149. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libnot_equal_impl.so +0 -0
  150. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libreshape_and_cache_impl.so +0 -0
  151. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/librms_norm_impl.so +0 -0
  152. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bnsd_full_mix.o +0 -0
  153. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bnsd_tri_mix.o +0 -0
  154. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bsh_full_mix.o +0 -0
  155. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bsh_tri_mix.o +0 -0
  156. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bnsd_full_mix.o +0 -0
  157. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bnsd_tri_mix.o +0 -0
  158. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bsh_full_mix.o +0 -0
  159. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bsh_tri_mix.o +0 -0
  160. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_bf16_bnsd_full_mix.o +0 -0
  161. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_bf16_bsh_full_mix.o +0 -0
  162. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_fp16_bnsd_full_mix.o +0 -0
  163. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_fp16_bsh_full_mix.o +0 -0
  164. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lcal.h +22 -0
  165. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lcal_comm.h +70 -0
  166. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lcal_types.h +103 -0
  167. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lccl.h +47 -0
  168. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lccl_wrapper.h +58 -0
  169. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/include/lcoc.h +154 -0
  170. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblcal.so +0 -0
  171. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblccl_wrapper.so +0 -0
  172. mindspore/lib/plugin/libmindspore_ascend.so.2 +0 -0
  173. mindspore/log.py +2 -2
  174. mindspore/mint/__init__.py +457 -0
  175. mindspore/mint/nn/__init__.py +430 -0
  176. mindspore/mint/nn/functional.py +424 -0
  177. mindspore/mint/optim/__init__.py +24 -0
  178. mindspore/mint/optim/adamw.py +186 -0
  179. mindspore/multiprocessing/__init__.py +4 -0
  180. mindspore/nn/__init__.py +3 -0
  181. mindspore/nn/cell.py +51 -47
  182. mindspore/nn/extend/__init__.py +29 -0
  183. mindspore/nn/extend/basic.py +140 -0
  184. mindspore/nn/extend/embedding.py +143 -0
  185. mindspore/nn/extend/layer/__init__.py +27 -0
  186. mindspore/nn/extend/layer/normalization.py +107 -0
  187. mindspore/nn/extend/pooling.py +117 -0
  188. mindspore/nn/generator.py +297 -0
  189. mindspore/nn/layer/basic.py +109 -1
  190. mindspore/nn/layer/container.py +2 -2
  191. mindspore/nn/layer/conv.py +6 -6
  192. mindspore/nn/layer/embedding.py +1 -1
  193. mindspore/nn/layer/normalization.py +21 -43
  194. mindspore/nn/layer/padding.py +4 -0
  195. mindspore/nn/optim/ada_grad.py +2 -2
  196. mindspore/nn/optim/adadelta.py +1 -1
  197. mindspore/nn/optim/adafactor.py +1 -1
  198. mindspore/nn/optim/adam.py +7 -7
  199. mindspore/nn/optim/adamax.py +2 -2
  200. mindspore/nn/optim/adasum.py +2 -2
  201. mindspore/nn/optim/asgd.py +2 -2
  202. mindspore/nn/optim/ftrl.py +1 -1
  203. mindspore/nn/optim/lamb.py +3 -3
  204. mindspore/nn/optim/lars.py +1 -1
  205. mindspore/nn/optim/lazyadam.py +2 -2
  206. mindspore/nn/optim/momentum.py +2 -2
  207. mindspore/nn/optim/optimizer.py +2 -2
  208. mindspore/nn/optim/proximal_ada_grad.py +2 -2
  209. mindspore/nn/optim/rmsprop.py +2 -2
  210. mindspore/nn/optim/rprop.py +2 -2
  211. mindspore/nn/optim/sgd.py +2 -2
  212. mindspore/nn/optim/thor.py +2 -2
  213. mindspore/nn/wrap/cell_wrapper.py +9 -9
  214. mindspore/nn/wrap/grad_reducer.py +5 -5
  215. mindspore/ops/_grad_experimental/grad_comm_ops.py +4 -2
  216. mindspore/ops/_vmap/vmap_grad_nn_ops.py +41 -2
  217. mindspore/ops/_vmap/vmap_math_ops.py +27 -8
  218. mindspore/ops/_vmap/vmap_nn_ops.py +66 -8
  219. mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +73 -1
  220. mindspore/ops/auto_generate/gen_arg_dtype_cast.py +12 -3
  221. mindspore/ops/auto_generate/gen_arg_handler.py +24 -0
  222. mindspore/ops/auto_generate/gen_extend_func.py +274 -0
  223. mindspore/ops/auto_generate/gen_ops_def.py +889 -22
  224. mindspore/ops/auto_generate/gen_ops_prim.py +3541 -253
  225. mindspore/ops/auto_generate/pyboost_inner_prim.py +282 -0
  226. mindspore/ops/composite/multitype_ops/_compile_utils.py +2 -1
  227. mindspore/ops/composite/multitype_ops/_constexpr_utils.py +9 -0
  228. mindspore/ops/extend/__init__.py +9 -1
  229. mindspore/ops/extend/array_func.py +134 -27
  230. mindspore/ops/extend/math_func.py +3 -3
  231. mindspore/ops/extend/nn_func.py +363 -2
  232. mindspore/ops/function/__init__.py +19 -2
  233. mindspore/ops/function/array_func.py +463 -439
  234. mindspore/ops/function/clip_func.py +7 -18
  235. mindspore/ops/function/grad/grad_func.py +5 -5
  236. mindspore/ops/function/linalg_func.py +4 -4
  237. mindspore/ops/function/math_func.py +260 -243
  238. mindspore/ops/function/nn_func.py +825 -62
  239. mindspore/ops/function/random_func.py +73 -4
  240. mindspore/ops/function/sparse_unary_func.py +1 -1
  241. mindspore/ops/function/vmap_func.py +1 -1
  242. mindspore/ops/functional.py +2 -2
  243. mindspore/ops/op_info_register.py +1 -31
  244. mindspore/ops/operations/__init__.py +2 -3
  245. mindspore/ops/operations/_grad_ops.py +2 -107
  246. mindspore/ops/operations/_inner_ops.py +5 -5
  247. mindspore/ops/operations/_sequence_ops.py +2 -2
  248. mindspore/ops/operations/array_ops.py +11 -233
  249. mindspore/ops/operations/comm_ops.py +32 -32
  250. mindspore/ops/operations/custom_ops.py +7 -89
  251. mindspore/ops/operations/manually_defined/ops_def.py +329 -4
  252. mindspore/ops/operations/math_ops.py +13 -163
  253. mindspore/ops/operations/nn_ops.py +9 -316
  254. mindspore/ops/operations/random_ops.py +1 -1
  255. mindspore/ops/operations/sparse_ops.py +3 -3
  256. mindspore/ops/primitive.py +2 -2
  257. mindspore/ops_generate/arg_dtype_cast.py +12 -3
  258. mindspore/ops_generate/arg_handler.py +24 -0
  259. mindspore/ops_generate/gen_ops_inner_prim.py +2 -0
  260. mindspore/ops_generate/gen_pyboost_func.py +13 -6
  261. mindspore/ops_generate/pyboost_utils.py +2 -17
  262. mindspore/parallel/__init__.py +3 -2
  263. mindspore/parallel/_auto_parallel_context.py +106 -1
  264. mindspore/parallel/_parallel_serialization.py +34 -2
  265. mindspore/parallel/_utils.py +16 -0
  266. mindspore/parallel/algo_parameter_config.py +4 -4
  267. mindspore/parallel/checkpoint_transform.py +249 -77
  268. mindspore/parallel/cluster/process_entity/_api.py +1 -1
  269. mindspore/parallel/parameter_broadcast.py +1 -1
  270. mindspore/parallel/shard.py +1 -1
  271. mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +1 -0
  272. mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +17 -5
  273. mindspore/profiler/parser/ascend_msprof_exporter.py +3 -3
  274. mindspore/profiler/parser/ascend_msprof_generator.py +10 -3
  275. mindspore/profiler/parser/ascend_op_generator.py +26 -9
  276. mindspore/profiler/parser/ascend_timeline_generator.py +7 -4
  277. mindspore/profiler/parser/profiler_info.py +11 -1
  278. mindspore/profiler/profiling.py +13 -5
  279. mindspore/rewrite/api/node.py +12 -12
  280. mindspore/rewrite/api/symbol_tree.py +11 -11
  281. mindspore/run_check/_check_version.py +1 -1
  282. mindspore/safeguard/rewrite_obfuscation.py +2 -2
  283. mindspore/train/amp.py +4 -4
  284. mindspore/train/anf_ir_pb2.py +8 -2
  285. mindspore/train/callback/_backup_and_restore.py +2 -2
  286. mindspore/train/callback/_callback.py +4 -4
  287. mindspore/train/callback/_checkpoint.py +2 -2
  288. mindspore/train/callback/_early_stop.py +2 -2
  289. mindspore/train/callback/_landscape.py +4 -4
  290. mindspore/train/callback/_loss_monitor.py +2 -2
  291. mindspore/train/callback/_on_request_exit.py +2 -2
  292. mindspore/train/callback/_reduce_lr_on_plateau.py +2 -2
  293. mindspore/train/callback/_summary_collector.py +2 -2
  294. mindspore/train/callback/_time_monitor.py +2 -2
  295. mindspore/train/dataset_helper.py +8 -3
  296. mindspore/train/loss_scale_manager.py +2 -2
  297. mindspore/train/metrics/metric.py +3 -3
  298. mindspore/train/mind_ir_pb2.py +22 -17
  299. mindspore/train/model.py +15 -15
  300. mindspore/train/serialization.py +18 -18
  301. mindspore/train/summary/summary_record.py +7 -7
  302. mindspore/train/train_thor/convert_utils.py +3 -3
  303. mindspore/version.py +1 -1
  304. {mindspore-2.3.0rc1.dist-info → mindspore-2.3.0rc2.dist-info}/METADATA +1 -1
  305. {mindspore-2.3.0rc1.dist-info → mindspore-2.3.0rc2.dist-info}/RECORD +309 -262
  306. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_stridedslice/tiling_data.h +0 -59
  307. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/FlashAttentionScore_bf16_BNSD_mix.o +0 -0
  308. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/FlashAttentionScore_bf16_BSH_mix.o +0 -0
  309. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/FlashAttentionScore_fp16_BNSD_mix.o +0 -0
  310. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/FlashAttentionScore_fp16_BSH_mix.o +0 -0
  311. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/PagedAttention_bf16_BNSD_mix.o +0 -0
  312. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/PagedAttention_bf16_BSH_mix.o +0 -0
  313. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/PagedAttention_fp16_BNSD_mix.o +0 -0
  314. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/PagedAttention_fp16_BSH_mix.o +0 -0
  315. /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
  316. {mindspore-2.3.0rc1.dist-info → mindspore-2.3.0rc2.dist-info}/WHEEL +0 -0
  317. {mindspore-2.3.0rc1.dist-info → mindspore-2.3.0rc2.dist-info}/entry_points.txt +0 -0
  318. {mindspore-2.3.0rc1.dist-info → mindspore-2.3.0rc2.dist-info}/top_level.txt +0 -0
@@ -35,12 +35,14 @@ from mindspore.common import Tensor, CSRTensor, COOTensor
35
35
  from mindspore._c_expression import Tensor as Tensor_
36
36
  from mindspore._c_expression import CSRTensor as CSRTensor_
37
37
  from mindspore._c_expression import COOTensor as COOTensor_
38
- from ..auto_generate import (ExpandDims, Reshape, TensorShape, Transpose, Gather, OnesLike, ZerosLike, Argmax,
39
- ReverseV2, Diag, Eye, ScatterNd, ResizeNearestNeighborV2, GatherNd, GatherD,
40
- Range, MaskedFill, RightShift, NonZero, ResizeNearestNeighbor, Identity, Split,
41
- CumSum, CumProd, Cummax, Cummin, Argmin, Concat, UnsortedSegmentSum, ScalarToTensor,
42
- BroadcastTo, StridedSlice, Select)
43
- from .manually_defined import Rank, Shape, Tile, Cast
38
+ from ..auto_generate import (ExpandDims, Reshape, TensorShape, Transpose, Gather,
39
+ OnesLike, ZerosLike, Argmax, ArgMaxExt,
40
+ ReverseV2, Diag, Eye, ScatterNd, ResizeNearestNeighborV2,
41
+ GatherNd, GatherD, Range, MaskedFill, RightShift, NonZero,
42
+ ResizeNearestNeighbor, Identity, Split, CumSum, CumProd,
43
+ Cummax, Cummin, Argmin, Concat, UnsortedSegmentSum, ScalarToTensor,
44
+ Tril, Triu, BroadcastTo, StridedSlice, Select, TopkExt)
45
+ from .manually_defined import Rank, Shape, Tile, Cast, Ones, Zeros
44
46
  from ..auto_generate import ArgMaxWithValue, ArgMinWithValue
45
47
 
46
48
  class _ScatterOp(PrimitiveWithInfer):
@@ -817,7 +819,7 @@ class Size(Primitive):
817
819
 
818
820
  Inputs:
819
821
  - **input_x** (Tensor) - Input parameters, the shape of tensor is :math:`(x_1, x_2, ..., x_R)`. The data type is
820
- `number <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.html#mindspore.dtype>`_.
822
+ `number <https://www.mindspore.cn/docs/en/master/api_python/mindspore.html#mindspore.dtype>`_.
821
823
 
822
824
  Outputs:
823
825
  int. A scalar representing the elements' size of `input_x`, tensor is the number of elements
@@ -1289,81 +1291,6 @@ class FillV2(PrimitiveWithCheck):
1289
1291
  return Tensor(np.full(dims, x.asnumpy()))
1290
1292
 
1291
1293
 
1292
- class Ones(Primitive):
1293
- r"""
1294
- Creates a tensor filled with value ones.
1295
-
1296
- Refer to :func:`mindspore.ops.ones` for more details.
1297
-
1298
- Inputs:
1299
- - **shape** (Union[tuple[int], int]) - The specified shape of output tensor.
1300
- - **type** (:class:`mindspore.dtype`) - The specified type of output tensor.
1301
-
1302
- Outputs:
1303
- Tensor, has the same type and shape as input shape value.
1304
-
1305
- Supported Platforms:
1306
- ``Ascend`` ``GPU`` ``CPU``
1307
-
1308
- Examples:
1309
- >>> import mindspore
1310
- >>> from mindspore import ops
1311
- >>> ones = ops.Ones()
1312
- >>> output = ones((2, 2), mindspore.float32)
1313
- >>> print(output)
1314
- [[1. 1.]
1315
- [1. 1.]]
1316
- >>> output = ones((3, 3), mindspore.float32)
1317
- >>> print(output)
1318
- [[1. 1. 1.]
1319
- [1. 1. 1.]
1320
- [1. 1. 1.]]
1321
- """
1322
-
1323
- @prim_attr_register
1324
- def __init__(self):
1325
- """Initialize Ones"""
1326
-
1327
-
1328
- class Zeros(Primitive):
1329
- r"""
1330
- Zeros will be deprecated in the future. Please use class `mindspore.ops.zeros` instead.
1331
-
1332
- Creates a tensor filled with value zeros.
1333
-
1334
- Creates a tensor with shape described by the first argument and
1335
- fills it with value zeros in type of the second argument.
1336
-
1337
- Inputs:
1338
- - **shape** (Union[tuple[int], int]) - The specified shape of output tensor.
1339
- - **type** (mindspore.dtype) - The specified type of output tensor.
1340
-
1341
- Outputs:
1342
- Tensor, has the same type and shape as input shape value.
1343
-
1344
- Raises:
1345
- TypeError: If `shape` is neither int nor tuple.
1346
- TypeError: If `shape` is a tuple whose elements are not all int.
1347
-
1348
- Supported Platforms:
1349
- Deprecated
1350
-
1351
- Examples:
1352
- >>> import mindspore
1353
- >>> from mindspore import ops
1354
- >>> zeros = ops.Zeros()
1355
- >>> output = zeros((2, 2), mindspore.float32)
1356
- >>> print(output)
1357
- [[0. 0.]
1358
- [0. 0.]]
1359
-
1360
- """
1361
-
1362
- @prim_attr_register
1363
- def __init__(self):
1364
- """Initialize Zeros"""
1365
-
1366
-
1367
1294
  class TupleToArray(PrimitiveWithInfer):
1368
1295
  """
1369
1296
  Converts a tuple to a tensor.
@@ -2836,80 +2763,6 @@ class ScatterSub(Primitive):
2836
2763
  self.add_prim_attr('side_effect_mem', True)
2837
2764
 
2838
2765
 
2839
- class Triu(Primitive):
2840
- """
2841
- Returns the upper triangular portion of the 2-D matrix or the set of matrices
2842
- in a batch. The remaining elements of the resulting Tensor are assigned a value of 0.
2843
- The upper triangular section of the matrix comprises of the
2844
- elements present on and above the main diagonal.
2845
-
2846
- .. warning::
2847
- This is an experimental API that is subject to change or deletion.
2848
-
2849
- Args:
2850
- diagonal (int, optional): The index of diagonal. Default: ``0`` , indicating the main diagonal.
2851
-
2852
- Inputs:
2853
- - **x** (Tensor) - The input tensor with shape :math:`(M, N, *)`
2854
- where :math:`*` means any number of additional dimensions.
2855
-
2856
- Outputs:
2857
- - **y** (Tensor) - A tensor has the same shape and data type as input.
2858
-
2859
- Raises:
2860
- TypeError: If `x` is not a Tensor.
2861
- TypeError: If `diagonal` is not an int.
2862
- ValueError: If the dimension of `input` is less than 2.
2863
-
2864
- Supported Platforms:
2865
- ``Ascend`` ``GPU`` ``CPU``
2866
-
2867
- Examples:
2868
- >>> import numpy as np
2869
- >>> from mindspore import Tensor, ops
2870
- >>> x = Tensor(np.array([[ 1, 2, 3, 4],
2871
- ... [ 5, 6, 7, 8],
2872
- ... [10, 11, 12, 13],
2873
- ... [14, 15, 16, 17]]))
2874
- >>> triu = ops.Triu()
2875
- >>> result = triu(x)
2876
- >>> print(result)
2877
- [[ 1 2 3 4]
2878
- [ 0 6 7 8]
2879
- [ 0 0 12 13]
2880
- [ 0 0 0 17]]
2881
- >>> x = Tensor(np.array([[ 1, 2, 3, 4],
2882
- ... [ 5, 6, 7, 8],
2883
- ... [10, 11, 12, 13],
2884
- ... [14, 15, 16, 17]]))
2885
- >>> triu = ops.Triu(diagonal=1)
2886
- >>> result = triu(x)
2887
- >>> print(result)
2888
- [[ 0 2 3 4]
2889
- [ 0 0 7 8]
2890
- [ 0 0 0 13]
2891
- [ 0 0 0 0]]
2892
- >>> x = Tensor(np.array([[ 1, 2, 3, 4],
2893
- ... [ 5, 6, 7, 8],
2894
- ... [10, 11, 12, 13],
2895
- ... [14, 15, 16, 17]]))
2896
- >>> triu = ops.Triu(diagonal=-1)
2897
- >>> result = triu(x)
2898
- >>> print(result)
2899
- [[ 1 2 3 4]
2900
- [ 5 6 7 8]
2901
- [ 0 11 12 13]
2902
- [ 0 0 16 17]]
2903
- """
2904
-
2905
- @prim_attr_register
2906
- def __init__(self, diagonal=0):
2907
- """Initialize Triu"""
2908
- validator.check_value_type("diagonal", diagonal, [int], self.name)
2909
- self.diagonal = diagonal
2910
- self.init_prim_io_names(inputs=['x'], outputs=['y'])
2911
-
2912
-
2913
2766
  class ScatterMul(_ScatterOpDynamic):
2914
2767
  r"""
2915
2768
  Updates the value of the input tensor through the multiply operation.
@@ -5190,8 +5043,6 @@ class TensorScatterElements(Primitive):
5190
5043
  - **indices** (Tensor) - The index of `input_x` to do scatter operation whose data type must be int32 or
5191
5044
  int64. It has the same rank as `data`. And accepted range is [-s, s) where s is the size along axis.
5192
5045
  - **updates** (Tensor) - The tensor doing the scatter operation with `data`,
5193
- it has the same shape and type as `data`.
5194
- - **update** (Tensor) - The tensor doing the scatter operation with `data`,
5195
5046
  it has the same type as `data` and the same shape as `indices`.
5196
5047
 
5197
5048
  Outputs:
@@ -5560,80 +5411,6 @@ class LogSpace(Primitive):
5560
5411
  self.init_prim_io_names(inputs=['start', 'end'], outputs=['y'])
5561
5412
 
5562
5413
 
5563
- class Tril(Primitive):
5564
- """
5565
- Returns the lower triangular portion of the 2-D matrix or the set of matrices
5566
- in a batch. The remaining elements of the resulting Tensor are assigned a value of 0.
5567
- The lower triangular section of the matrix comprises of the
5568
- elements present on and below the main diagonal.
5569
-
5570
- .. warning::
5571
- This is an experimental API that is subject to change or deletion.
5572
-
5573
- Args:
5574
- diagonal (int, optional): An optional attribute indicates the diagonal to consider, default: ``0`` ,
5575
- indicating the main diagonal.
5576
-
5577
- Inputs:
5578
- - **x** (Tensor) - The input tensor with shape :math:`(M, N, *)`
5579
- where :math:`*` means any number of additional dimensions.
5580
-
5581
- Outputs:
5582
- Tensor, the same shape and data type as the input `x`.
5583
-
5584
- Raises:
5585
- TypeError: If `x` is not a Tensor.
5586
- TypeError: If `diagonal` is not an int.
5587
- ValueError: If the rank of `x` is less than 2.
5588
-
5589
- Supported Platforms:
5590
- ``Ascend`` ``GPU`` ``CPU``
5591
-
5592
- Examples:
5593
- >>> import numpy as np
5594
- >>> from mindspore import Tensor, ops
5595
- >>> x = Tensor(np.array([[ 1, 2, 3, 4],
5596
- ... [ 5, 6, 7, 8],
5597
- ... [10, 11, 12, 13],
5598
- ... [14, 15, 16, 17]]))
5599
- >>> tril = ops.Tril()
5600
- >>> result = tril(x)
5601
- >>> print(result)
5602
- [[ 1 0 0 0]
5603
- [ 5 6 0 0]
5604
- [10 11 12 0]
5605
- [14 15 16 17]]
5606
- >>> x = Tensor(np.array([[ 1, 2, 3, 4],
5607
- ... [ 5, 6, 7, 8],
5608
- ... [10, 11, 12, 13],
5609
- ... [14, 15, 16, 17]]))
5610
- >>> tril = ops.Tril(diagonal=1)
5611
- >>> result = tril(x)
5612
- >>> print(result)
5613
- [[ 1 2 0 0]
5614
- [ 5 6 7 0]
5615
- [10 11 12 13]
5616
- [14 15 16 17]]
5617
- >>> x = Tensor(np.array([[ 1, 2, 3, 4],
5618
- ... [ 5, 6, 7, 8],
5619
- ... [10, 11, 12, 13],
5620
- ... [14, 15, 16, 17]]))
5621
- >>> tril = ops.Tril(diagonal=-1)
5622
- >>> result = tril(x)
5623
- >>> print(result)
5624
- [[ 0 0 0 0]
5625
- [ 5 0 0 0]
5626
- [10 11 0 0]
5627
- [14 15 16 0]]
5628
- """
5629
-
5630
- @prim_attr_register
5631
- def __init__(self, diagonal=0):
5632
- """Initialize Tril."""
5633
- self.init_prim_io_names(inputs=["x"], outputs=["y"])
5634
- validator.check_value_type("diagonal", diagonal, [int], self.name)
5635
-
5636
-
5637
5414
  class IndexFill(Primitive):
5638
5415
  """
5639
5416
  Fills the elements under the `dim` dimension of the input Tensor `x` with the input `value`
@@ -6338,7 +6115,8 @@ class TopK(Primitive):
6338
6115
  - GPU: float16, float32.
6339
6116
  - CPU: all numeric types.
6340
6117
 
6341
- - **k** (int) - The number of top elements to be computed along the last dimension, constant input is needed.
6118
+ - **k** (Union(Tensor, int)) - The number of top elements to be computed along the last dimension.
6119
+ If `k` is a Tensor, the supported dtype is int32 and it should be 0-D or 1-D with shape :math:`(1, )` .
6342
6120
 
6343
6121
  Outputs:
6344
6122
  A tuple consisting of `values` and `indexes`.
@@ -53,14 +53,14 @@ class ReduceOp:
53
53
 
54
54
  For the Ascend devices, users need to prepare the rank table, set rank_id and device_id.
55
55
  Please see the `rank table Startup
56
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/rank_table.html>`_
56
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/rank_table.html>`_
57
57
  for more details.
58
58
 
59
59
  For the GPU devices, users need to prepare the host file and mpi, please see the `mpirun Startup
60
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/mpirun.html>`_ .
60
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/mpirun.html>`_ .
61
61
 
62
62
  For the CPU device, users need to write a dynamic cluster startup script, please see the `Dynamic Cluster
63
- Startup <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/dynamic_cluster.html>`_ .
63
+ Startup <https://www.mindspore.cn/tutorials/experts/en/master/parallel/dynamic_cluster.html>`_ .
64
64
 
65
65
  This example should be run with multiple devices.
66
66
 
@@ -144,14 +144,14 @@ class AllReduce(Primitive):
144
144
 
145
145
  For the Ascend devices, users need to prepare the rank table, set rank_id and device_id.
146
146
  Please see the `rank table Startup
147
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/rank_table.html>`_
147
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/rank_table.html>`_
148
148
  for more details.
149
149
 
150
150
  For the GPU devices, users need to prepare the host file and mpi, please see the `mpirun Startup
151
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/mpirun.html>`_ .
151
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/mpirun.html>`_ .
152
152
 
153
153
  For the CPU device, users need to write a dynamic cluster startup script, please see the `Dynamic Cluster
154
- Startup <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/dynamic_cluster.html>`_ .
154
+ Startup <https://www.mindspore.cn/tutorials/experts/en/master/parallel/dynamic_cluster.html>`_ .
155
155
 
156
156
  This example should be run with 2 devices.
157
157
 
@@ -180,7 +180,7 @@ class AllReduce(Primitive):
180
180
 
181
181
  Tutorial Examples:
182
182
  - `Distributed Set Communication Primitives - AllReduce
183
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/samples/ops/communicate_ops.html#allreduce>`_
183
+ <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#allreduce>`_
184
184
 
185
185
  """
186
186
 
@@ -233,14 +233,14 @@ class AllGather(PrimitiveWithInfer):
233
233
 
234
234
  For the Ascend devices, users need to prepare the rank table, set rank_id and device_id.
235
235
  Please see the `rank table Startup
236
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/rank_table.html>`_
236
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/rank_table.html>`_
237
237
  for more details.
238
238
 
239
239
  For the GPU devices, users need to prepare the host file and mpi, please see the `mpirun Startup
240
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/mpirun.html>`_ .
240
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/mpirun.html>`_ .
241
241
 
242
242
  For the CPU device, users need to write a dynamic cluster startup script, please see the `Dynamic Cluster
243
- Startup <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/dynamic_cluster.html>`_ .
243
+ Startup <https://www.mindspore.cn/tutorials/experts/en/master/parallel/dynamic_cluster.html>`_ .
244
244
 
245
245
  This example should be run with 2 devices.
246
246
 
@@ -272,7 +272,7 @@ class AllGather(PrimitiveWithInfer):
272
272
 
273
273
  Tutorial Examples:
274
274
  - `Distributed Set Communication Primitives - AllGather
275
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/samples/ops/communicate_ops.html#allgather>`_
275
+ <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#allgather>`_
276
276
 
277
277
  """
278
278
 
@@ -458,14 +458,14 @@ class ReduceScatter(Primitive):
458
458
 
459
459
  For the Ascend devices, users need to prepare the rank table, set rank_id and device_id.
460
460
  Please see the `rank table Startup
461
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/rank_table.html>`_
461
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/rank_table.html>`_
462
462
  for more details.
463
463
 
464
464
  For the GPU devices, users need to prepare the host file and mpi, please see the `mpirun Startup
465
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/mpirun.html>`_ .
465
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/mpirun.html>`_ .
466
466
 
467
467
  For the CPU device, users need to write a dynamic cluster startup script, please see the `Dynamic Cluster
468
- Startup <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/dynamic_cluster.html>`_ .
468
+ Startup <https://www.mindspore.cn/tutorials/experts/en/master/parallel/dynamic_cluster.html>`_ .
469
469
 
470
470
  This example should be run with 2 devices.
471
471
 
@@ -498,7 +498,7 @@ class ReduceScatter(Primitive):
498
498
 
499
499
  Tutorial Examples:
500
500
  - `Distributed Set Communication Primitives - ReduceScatter
501
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/samples/ops/communicate_ops.html#reducescatter>`_
501
+ <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#reducescatter>`_
502
502
 
503
503
  """
504
504
 
@@ -600,14 +600,14 @@ class Broadcast(PrimitiveWithInfer):
600
600
 
601
601
  For the Ascend devices, users need to prepare the rank table, set rank_id and device_id.
602
602
  Please see the `rank table Startup
603
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/rank_table.html>`_
603
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/rank_table.html>`_
604
604
  for more details.
605
605
 
606
606
  For the GPU devices, users need to prepare the host file and mpi, please see the `mpirun Startup
607
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/mpirun.html>`_ .
607
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/mpirun.html>`_ .
608
608
 
609
609
  For the CPU device, users need to write a dynamic cluster startup script, please see the `Dynamic Cluster
610
- Startup <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/dynamic_cluster.html>`_ .
610
+ Startup <https://www.mindspore.cn/tutorials/experts/en/master/parallel/dynamic_cluster.html>`_ .
611
611
 
612
612
  This example should be run with multiple devices.
613
613
 
@@ -638,7 +638,7 @@ class Broadcast(PrimitiveWithInfer):
638
638
 
639
639
  Tutorial Examples:
640
640
  - `Distributed Set Communication Primitives - Broadcast
641
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/samples/ops/communicate_ops.html#broadcast>`_
641
+ <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#broadcast>`_
642
642
 
643
643
  """
644
644
 
@@ -718,11 +718,11 @@ class NeighborExchange(Primitive):
718
718
  The user needs to preset
719
719
  communication environment variables before running the following example, please check the details on the
720
720
  official website of `MindSpore \
721
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/mindspore.ops.primitive.html#communication-operator>`_.
721
+ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.ops.primitive.html#communication-operator>`_.
722
722
 
723
723
  This operator requires a full-mesh network topology, each device has the same vlan id, and the ip & mask are
724
724
  in the same subnet, please check the `details \
725
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/samples/ops/communicate_ops.html#notes>`_.
725
+ <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#notes>`_.
726
726
 
727
727
  Args:
728
728
  send_rank_ids (list(int)): Ranks which the data is sent to.
@@ -771,7 +771,7 @@ class NeighborExchange(Primitive):
771
771
 
772
772
  Tutorial Examples:
773
773
  - `Distributed Set Communication Primitives - NeighborExchange
774
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/samples/ops/communicate_ops.html#neighborexchange>`_
774
+ <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#neighborexchange>`_
775
775
 
776
776
  """
777
777
 
@@ -804,7 +804,7 @@ class AlltoAll(PrimitiveWithInfer):
804
804
  Note:
805
805
  This operator requires a full-mesh network topology, each device has the same vlan id, and the ip & mask are
806
806
  in the same subnet, please check the `details \
807
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/samples/ops/communicate_ops.html#notes>`_.
807
+ <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#notes>`_.
808
808
 
809
809
  Args:
810
810
  split_count (int): On each process, divide blocks into split_count number.
@@ -835,14 +835,14 @@ class AlltoAll(PrimitiveWithInfer):
835
835
 
836
836
  For the Ascend devices, users need to prepare the rank table, set rank_id and device_id.
837
837
  Please see the `rank table Startup
838
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/rank_table.html>`_
838
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/rank_table.html>`_
839
839
  for more details.
840
840
 
841
841
  For the GPU devices, users need to prepare the host file and mpi, please see the `mpirun Startup
842
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/mpirun.html>`_ .
842
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/mpirun.html>`_ .
843
843
 
844
844
  For the CPU device, users need to write a dynamic cluster startup script, please see the `Dynamic Cluster
845
- Startup <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/dynamic_cluster.html>`_ .
845
+ Startup <https://www.mindspore.cn/tutorials/experts/en/master/parallel/dynamic_cluster.html>`_ .
846
846
 
847
847
  This example should be run with 8 devices.
848
848
 
@@ -873,7 +873,7 @@ class AlltoAll(PrimitiveWithInfer):
873
873
 
874
874
  Tutorial Examples:
875
875
  - `Distributed Set Communication Primitives - AlltoAll
876
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/samples/ops/communicate_ops.html#alltoall>`_
876
+ <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#alltoall>`_
877
877
 
878
878
  """
879
879
 
@@ -921,7 +921,7 @@ class NeighborExchangeV2(Primitive):
921
921
  Note:
922
922
  This operator requires a full-mesh network topology, each device has the same vlan id, and the ip & mask are
923
923
  in the same subnet, please check the `details \
924
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/samples/ops/communicate_ops.html#notes>`_.
924
+ <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#notes>`_.
925
925
 
926
926
  Args:
927
927
  send_rank_ids (list(int)): Ranks which the data is sent to. 8 rank_ids represents 8 directions, if one
@@ -959,14 +959,14 @@ class NeighborExchangeV2(Primitive):
959
959
 
960
960
  For the Ascend devices, users need to prepare the rank table, set rank_id and device_id.
961
961
  Please see the `rank table Startup
962
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/rank_table.html>`_
962
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/rank_table.html>`_
963
963
  for more details.
964
964
 
965
965
  For the GPU devices, users need to prepare the host file and mpi, please see the `mpirun Startup
966
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/mpirun.html>`_ .
966
+ <https://www.mindspore.cn/tutorials/experts/en/master/parallel/mpirun.html>`_ .
967
967
 
968
968
  For the CPU device, users need to write a dynamic cluster startup script, please see the `Dynamic Cluster
969
- Startup <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/parallel/dynamic_cluster.html>`_ .
969
+ Startup <https://www.mindspore.cn/tutorials/experts/en/master/parallel/dynamic_cluster.html>`_ .
970
970
 
971
971
  This example should be run with 2 devices.
972
972
 
@@ -1017,7 +1017,7 @@ class NeighborExchangeV2(Primitive):
1017
1017
 
1018
1018
  Tutorial Examples:
1019
1019
  - `Distributed Set Communication Primitives - NeighborExchangeV2
1020
- <https://www.mindspore.cn/docs/en/r2.3.q1/api_python/samples/ops/communicate_ops.html#neighborexchangev2>`_
1020
+ <https://www.mindspore.cn/docs/en/master/api_python/samples/ops/communicate_ops.html#neighborexchangev2>`_
1021
1021
 
1022
1022
  """
1023
1023
 
@@ -164,7 +164,7 @@ class Custom(ops.PrimitiveWithInfer):
164
164
  function if needed. Then these `Custom` objects can be directly used in neural networks.
165
165
  Detailed description and introduction of user-defined operators, including correct writing of parameters,
166
166
  please refer to `Custom Operators Tutorial
167
- <https://www.mindspore.cn/tutorials/experts/en/r2.3.q1/operation/op_custom.html>`_ .
167
+ <https://www.mindspore.cn/tutorials/experts/en/master/operation/op_custom.html>`_ .
168
168
 
169
169
  .. warning::
170
170
  - This is an experimental API that is subject to change.
@@ -172,19 +172,11 @@ class Custom(ops.PrimitiveWithInfer):
172
172
  .. note::
173
173
  The supported platforms are determined by the input `func_type`. The supported platforms are as follows:
174
174
 
175
- - "hybrid": supports ["Ascend", "GPU", "CPU"].
176
- - "akg": supports ["Ascend", "GPU", "CPU"].
177
- - "tbe": supports ["Ascend"].
175
+ - "hybrid": supports ["GPU", "CPU"].
176
+ - "akg": supports ["GPU", "CPU"].
178
177
  - "aot": supports ["GPU", "CPU"].
179
178
  - "pyfunc": supports ["CPU"].
180
179
  - "julia": supports ["CPU"].
181
- - "aicpu": supports ["Ascend"].
182
-
183
- If run on ge backend, use `CustomRegOp` to generate the registration information of "aicpu" and "tbe" operator,
184
- use `custom_info_register` to bind the registration information to the `func` of the "tbe" operator,
185
- then save the registration information of "aicpu" operator and the `func` implementation of "tbe" operator to
186
- a file or separate files, keep these files in a separate directory, and set the absolute path of this directory
187
- to environment variable "MS_DEV_CUSTOM_OPP_PATH" before running the network.
188
180
 
189
181
  Args:
190
182
  func (Union[function, str]):
@@ -193,9 +185,8 @@ class Custom(ops.PrimitiveWithInfer):
193
185
  computation logic of a user defined operator. The function can be one of the following:
194
186
 
195
187
  1. A AKG operator implementation function, which can use ir builder/tvm compute/hybrid grammar.
196
- 2. A TBE operator implementation function.
197
- 3. A pure python function
198
- 4. An kernel decorated function written by the Hybrid DSL.
188
+ 2. A pure python function
189
+ 3. An kernel decorated function written by the Hybrid DSL.
199
190
 
200
191
  - str: If func is of str type, then str should be a path of file along with a function name.
201
192
  This could be used when func_type is "aot" or "julia".
@@ -299,18 +290,7 @@ class Custom(ops.PrimitiveWithInfer):
299
290
 
300
291
  func_type (str): The implementation type of `func`, should be one of
301
292
 
302
- [ ``"hybrid"`` , ``"akg"`` , ``"tbe"`` , ``"aot"`` , ``"pyfunc"`` , ``"julia"`` , ``"aicpu"`` ].
303
-
304
- Each `func_type` only supports specific platforms(targets). Default: ``"hybrid"`` .
305
- The supported platforms of `func_type`:
306
-
307
- - ``"hybrid"``: supports ["Ascend", "GPU", "CPU"].
308
- - ``"akg"``: supports ["Ascend", "GPU", "CPU"].
309
- - ``"tbe"``: supports ["Ascend"].
310
- - ``"aot"``: supports ["GPU", "CPU"].
311
- - ``"pyfunc"``: supports ["CPU"].
312
- - ``"julia"``: supports ["CPU"].
313
- - ``"aicpu"``: supports ["Ascend"].
293
+ [ ``"hybrid"`` , ``"akg"`` , ``"aot"`` , ``"pyfunc"`` , ``"julia"`` ].
314
294
 
315
295
  bprop (function): The back propagation function of `func`. Default: ``None`` .
316
296
  reg_info (Union[str, dict, list, tuple]): Represents the registration information(reg info) of `func` with
@@ -343,7 +323,7 @@ class Custom(ops.PrimitiveWithInfer):
343
323
  or the attributes of `func` differs in different targets.
344
324
 
345
325
  Supported Platforms:
346
- ``Ascend`` ``GPU`` ``CPU``
326
+ ``GPU`` ``CPU``
347
327
 
348
328
  Examples:
349
329
  >>> import numpy as np
@@ -372,68 +352,6 @@ class Custom(ops.PrimitiveWithInfer):
372
352
  >>> # the result will be a 16 * 16 tensor with all elements 2
373
353
  >>> print(output.shape)
374
354
  (16, 16)
375
- >>> # Example, func_type = "tbe"
376
- >>> square_with_bias_op_info = CustomRegOp() \
377
- ... .fusion_type("OPAQUE") \
378
- ... .attr("bias", "required", "float") \
379
- ... .input(0, "x") \
380
- ... .output(0, "y") \
381
- ... .dtype_format(DataType.F32_Default, DataType.F32_Default) \
382
- ... .dtype_format(DataType.F16_Default, DataType.F16_Default) \
383
- ... .target("Ascend") \
384
- ... .get_op_info()
385
- >>>
386
- >>> @custom_info_register(square_with_bias_op_info)
387
- ... def square_with_bias(input_x, output_y, bias=0.0, kernel_name="square_with_bias"):
388
- ... import te.lang.cce
389
- ... from te import tvm
390
- ... from topi.cce import util
391
- ...
392
- ... shape = input_x.get("shape")
393
- ... dtype = input_x.get("dtype").lower()
394
- ...
395
- ... shape = util.shape_refine(shape)
396
- ... data = tvm.placeholder(shape, name="data", dtype=dtype)
397
- ...
398
- ... with tvm.target.cce():
399
- ... res0 = te.lang.cce.vmul(data, data)
400
- ... res = te.lang.cce.vadds(res0, bias)
401
- ... sch = te.lang.cce.auto_schedule(res)
402
- ...
403
- ... config = {"print_ir": False,
404
- ... "name": kernel_name,
405
- ... "tensor_list": [data, res]}
406
- ...
407
- ... te.lang.cce.cce_build_code(sch, config)
408
- >>>
409
- >>> def test_tbe():
410
- ... square_with_bias = ops.Custom(square_with_bias, out_shape=lambda x, _: x, \
411
- ... out_dtype=lambda x, _: x, func_type="tbe")
412
- ... res = self.square_with_bias(input_x, 1.0)
413
- ... return res
414
- >>>
415
- >>> # Example, func_type = "aicpu"
416
- >>> resize_bilinear_op_info = CustomRegOp("ResizeBilinear") \
417
- ... .fusion_type("OPAQUE") \
418
- ... .input(0, "input", "required") \
419
- ... .output(1, "output", "required") \
420
- ... .attr("align_corners", "required", "bool") \
421
- ... .attr("cust_aicpu", "optional", "str", "aicpu_kernels") \
422
- ... .dtype_format(DataType.F32_Default, DataType.F32_Default) \
423
- ... .dtype_format(DataType.F16_Default, DataType.F32_Default) \
424
- ... .target("Ascend") \
425
- ... .get_op_info()
426
- >>>
427
- >>> @custom_info_register(resize_bilinear_op_info)
428
- ... def resize_bilinear_aicpu():
429
- ... return
430
- >>>
431
- >>> def test_aicpu(x):
432
- ... resize_bilinear_op = ops.Custom(resize_bilinear_aicpu, out_shape=[1, 1, 9, 9], \
433
- ... out_dtype=mstype.float32, func_type="aicpu")
434
- ... res = resize_bilinear_op(x, True, "aicpu_kernels")
435
- ... return res
436
- >>>
437
355
  >>> # Example, func_type = "aot"
438
356
  >>> def test_aot(x, y, out_shapes, out_types):
439
357
  ... program = ops.Custom("./reorganize.so:CustomReorganize", out_shapes, out_types, "aot")