mindspore 2.6.0rc1__cp311-cp311-win_amd64.whl → 2.7.0__cp311-cp311-win_amd64.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 (458) hide show
  1. mindspore/.commit_id +1 -1
  2. mindspore/Microsoft.VisualStudio.Telemetry.dll +0 -0
  3. mindspore/Newtonsoft.Json.dll +0 -0
  4. mindspore/__init__.py +2 -2
  5. mindspore/_c_dataengine.cp311-win_amd64.pyd +0 -0
  6. mindspore/_c_expression.cp311-win_amd64.pyd +0 -0
  7. mindspore/_c_mindrecord.cp311-win_amd64.pyd +0 -0
  8. mindspore/_checkparam.py +42 -11
  9. mindspore/_extends/builtin_operations.py +3 -3
  10. mindspore/{_deprecated → _extends/optimize}/__init__.py +9 -3
  11. mindspore/_extends/optimize/cell_utils.py +96 -0
  12. mindspore/_extends/parallel_compile/akg_compiler/custom.py +1109 -0
  13. mindspore/_extends/parallel_compile/akg_compiler/gen_custom_op_files.py +1 -1
  14. mindspore/_extends/parse/__init__.py +3 -3
  15. mindspore/_extends/parse/compile_config.py +44 -22
  16. mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +1 -2
  17. mindspore/_extends/parse/parser.py +65 -84
  18. mindspore/_extends/parse/resources.py +39 -0
  19. mindspore/_extends/parse/standard_method.py +58 -14
  20. mindspore/_extends/parse/trope.py +8 -1
  21. mindspore/_extends/pijit/__init__.py +1 -2
  22. mindspore/_extends/pijit/pijit_func_white_list.py +2 -5
  23. mindspore/amp.py +4 -22
  24. mindspore/atlprov.dll +0 -0
  25. mindspore/avcodec-59.dll +0 -0
  26. mindspore/avdevice-59.dll +0 -0
  27. mindspore/avfilter-8.dll +0 -0
  28. mindspore/avformat-59.dll +0 -0
  29. mindspore/avutil-57.dll +0 -0
  30. mindspore/boost/adasum.py +1 -1
  31. mindspore/boost/boost_cell_wrapper.py +4 -4
  32. mindspore/c1.dll +0 -0
  33. mindspore/c1xx.dll +0 -0
  34. mindspore/c2.dll +0 -0
  35. mindspore/common/__init__.py +43 -12
  36. mindspore/common/_grad_function.py +2 -1
  37. mindspore/common/_pijit_context.py +28 -7
  38. mindspore/common/_stub_tensor.py +1 -209
  39. mindspore/common/_tensor_cpp_method.py +1 -1
  40. mindspore/common/_tensor_docs.py +178 -53
  41. mindspore/common/_utils.py +9 -1
  42. mindspore/common/api.py +377 -203
  43. mindspore/common/dtype.py +108 -57
  44. mindspore/common/dump.py +11 -16
  45. mindspore/common/dynamic_shape/__init__.py +0 -0
  46. mindspore/common/{auto_dynamic_shape.py → dynamic_shape/auto_dynamic_shape.py} +17 -23
  47. mindspore/common/dynamic_shape/enable_dynamic.py +197 -0
  48. mindspore/common/file_system.py +59 -9
  49. mindspore/common/generator.py +5 -3
  50. mindspore/common/hook_handle.py +33 -5
  51. mindspore/common/jit_config.py +1 -1
  52. mindspore/common/jit_trace.py +84 -105
  53. mindspore/common/np_dtype.py +3 -3
  54. mindspore/common/parameter.py +27 -29
  55. mindspore/common/recompute.py +5 -7
  56. mindspore/common/sparse_tensor.py +0 -3
  57. mindspore/common/symbol.py +0 -1
  58. mindspore/common/tensor.py +117 -131
  59. mindspore/communication/_comm_helper.py +46 -4
  60. mindspore/communication/management.py +79 -7
  61. mindspore/context.py +67 -55
  62. mindspore/dataset/__init__.py +1 -1
  63. mindspore/dataset/audio/transforms.py +1 -1
  64. mindspore/dataset/core/config.py +38 -4
  65. mindspore/dataset/engine/datasets.py +350 -322
  66. mindspore/dataset/engine/datasets_user_defined.py +70 -24
  67. mindspore/dataset/engine/iterators.py +2 -2
  68. mindspore/dataset/engine/obs/config_loader.py +2 -2
  69. mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +8 -0
  70. mindspore/dataset/transforms/c_transforms.py +2 -2
  71. mindspore/dataset/transforms/py_transforms.py +7 -3
  72. mindspore/dataset/transforms/transforms.py +10 -6
  73. mindspore/dataset/vision/__init__.py +1 -1
  74. mindspore/dataset/vision/py_transforms.py +8 -8
  75. mindspore/dataset/vision/transforms.py +17 -5
  76. mindspore/dataset/vision/utils.py +632 -21
  77. mindspore/dataset/vision/validators.py +1 -0
  78. mindspore/device_context/ascend/device.py +1 -1
  79. mindspore/device_context/ascend/op_tuning.py +35 -1
  80. mindspore/device_context/gpu/__init__.py +2 -2
  81. mindspore/device_context/gpu/device.py +1 -1
  82. mindspore/device_context/gpu/op_precision.py +4 -2
  83. mindspore/device_context/gpu/op_tuning.py +6 -3
  84. mindspore/device_manager.py +16 -9
  85. mindspore/dnnl.dll +0 -0
  86. mindspore/dpcmi.dll +0 -0
  87. mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +3 -4
  88. mindspore/experimental/llm_boost/atb/boost_base.py +2 -3
  89. mindspore/experimental/optim/adadelta.py +13 -20
  90. mindspore/experimental/optim/adagrad.py +15 -22
  91. mindspore/experimental/optim/adam.py +17 -24
  92. mindspore/experimental/optim/adamax.py +14 -22
  93. mindspore/experimental/optim/adamw.py +28 -34
  94. mindspore/experimental/optim/asgd.py +15 -25
  95. mindspore/experimental/optim/lr_scheduler.py +27 -45
  96. mindspore/experimental/optim/nadam.py +14 -24
  97. mindspore/experimental/optim/optimizer.py +13 -23
  98. mindspore/experimental/optim/radam.py +18 -24
  99. mindspore/experimental/optim/rmsprop.py +14 -25
  100. mindspore/experimental/optim/rprop.py +15 -26
  101. mindspore/experimental/optim/sgd.py +9 -19
  102. mindspore/hal/__init__.py +4 -4
  103. mindspore/hal/contiguous_tensors_handle.py +2 -2
  104. mindspore/hal/memory.py +27 -7
  105. mindspore/include/api/cell.h +65 -5
  106. mindspore/include/api/cfg.h +24 -7
  107. mindspore/include/api/context.h +1 -0
  108. mindspore/include/api/delegate.h +10 -2
  109. mindspore/include/api/dual_abi_helper.h +100 -19
  110. mindspore/include/api/graph.h +14 -1
  111. mindspore/include/api/kernel.h +16 -3
  112. mindspore/include/api/kernel_api.h +9 -1
  113. mindspore/include/api/metrics/accuracy.h +9 -0
  114. mindspore/include/api/model.h +8 -1
  115. mindspore/include/api/model_group.h +4 -0
  116. mindspore/include/api/model_parallel_runner.h +2 -0
  117. mindspore/include/api/status.h +48 -10
  118. mindspore/include/api/types.h +8 -3
  119. mindspore/include/c_api/model_c.h +0 -58
  120. mindspore/include/c_api/tensor_c.h +0 -26
  121. mindspore/include/dataset/constants.h +9 -0
  122. mindspore/include/dataset/vision_ascend.h +1 -1
  123. mindspore/jpeg62.dll +0 -0
  124. mindspore/mindrecord/tools/cifar10.py +61 -11
  125. mindspore/mindrecord/tools/cifar10_to_mr.py +5 -0
  126. mindspore/mindspore_backend_common.dll +0 -0
  127. mindspore/mindspore_backend_manager.dll +0 -0
  128. mindspore/mindspore_common.dll +0 -0
  129. mindspore/mindspore_core.dll +0 -0
  130. mindspore/mindspore_cpu_res_manager.dll +0 -0
  131. mindspore/mindspore_dump.dll +0 -0
  132. mindspore/mindspore_frontend.dll +0 -0
  133. mindspore/mindspore_glog.dll +0 -0
  134. mindspore/mindspore_memory_pool.dll +0 -0
  135. mindspore/mindspore_ms_backend.dll +0 -0
  136. mindspore/mindspore_ops.dll +0 -0
  137. mindspore/mindspore_ops_host.dll +0 -0
  138. mindspore/mindspore_ops_kernel_common.dll +0 -0
  139. mindspore/mindspore_profiler.dll +0 -0
  140. mindspore/mindspore_pyboost.dll +0 -0
  141. mindspore/mindspore_pynative.dll +0 -0
  142. mindspore/mindspore_res_manager.dll +0 -0
  143. mindspore/mindspore_runtime_pipeline.dll +0 -0
  144. mindspore/mint/__init__.py +6 -46
  145. mindspore/mint/distributed/__init__.py +5 -0
  146. mindspore/mint/distributed/distributed.py +429 -23
  147. mindspore/mint/nn/__init__.py +1 -1
  148. mindspore/mint/nn/functional.py +53 -6
  149. mindspore/mint/nn/layer/_functions.py +163 -294
  150. mindspore/mint/nn/layer/activation.py +8 -6
  151. mindspore/mint/nn/layer/conv.py +140 -104
  152. mindspore/mint/nn/layer/normalization.py +11 -25
  153. mindspore/mint/optim/adam.py +19 -18
  154. mindspore/mint/optim/adamw.py +14 -8
  155. mindspore/mint/optim/sgd.py +5 -5
  156. mindspore/msobj140.dll +0 -0
  157. mindspore/mspdb140.dll +0 -0
  158. mindspore/mspdbcore.dll +0 -0
  159. mindspore/mspdbst.dll +0 -0
  160. mindspore/mspft140.dll +0 -0
  161. mindspore/msvcdis140.dll +0 -0
  162. mindspore/msvcp140_1.dll +0 -0
  163. mindspore/msvcp140_2.dll +0 -0
  164. mindspore/msvcp140_atomic_wait.dll +0 -0
  165. mindspore/msvcp140_codecvt_ids.dll +0 -0
  166. mindspore/nn/cell.py +491 -623
  167. mindspore/nn/grad/cell_grad.py +11 -12
  168. mindspore/nn/layer/activation.py +36 -36
  169. mindspore/nn/layer/basic.py +74 -77
  170. mindspore/nn/layer/channel_shuffle.py +4 -4
  171. mindspore/nn/layer/combined.py +4 -2
  172. mindspore/nn/layer/conv.py +117 -110
  173. mindspore/nn/layer/dense.py +9 -7
  174. mindspore/nn/layer/embedding.py +50 -52
  175. mindspore/nn/layer/image.py +38 -40
  176. mindspore/nn/layer/math.py +111 -112
  177. mindspore/nn/layer/normalization.py +56 -44
  178. mindspore/nn/layer/pooling.py +58 -63
  179. mindspore/nn/layer/rnn_cells.py +33 -33
  180. mindspore/nn/layer/rnns.py +56 -56
  181. mindspore/nn/layer/thor_layer.py +74 -73
  182. mindspore/nn/layer/transformer.py +11 -1
  183. mindspore/nn/learning_rate_schedule.py +20 -20
  184. mindspore/nn/loss/loss.py +79 -81
  185. mindspore/nn/optim/adam.py +4 -6
  186. mindspore/nn/optim/adasum.py +2 -2
  187. mindspore/nn/optim/asgd.py +2 -0
  188. mindspore/nn/optim/lamb.py +1 -3
  189. mindspore/nn/optim/optimizer.py +1 -1
  190. mindspore/nn/optim/tft_wrapper.py +2 -3
  191. mindspore/nn/optim/thor.py +2 -2
  192. mindspore/nn/probability/distribution/_utils/utils.py +2 -2
  193. mindspore/nn/probability/distribution/exponential.py +2 -1
  194. mindspore/nn/probability/distribution/poisson.py +2 -1
  195. mindspore/nn/sparse/sparse.py +3 -3
  196. mindspore/nn/wrap/cell_wrapper.py +73 -42
  197. mindspore/nn/wrap/grad_reducer.py +37 -52
  198. mindspore/nn/wrap/loss_scale.py +72 -74
  199. mindspore/numpy/array_creations.py +7 -7
  200. mindspore/numpy/fft.py +1 -1
  201. mindspore/numpy/math_ops.py +5 -5
  202. mindspore/numpy/utils_const.py +1 -1
  203. mindspore/opencv_core452.dll +0 -0
  204. mindspore/opencv_imgcodecs452.dll +0 -0
  205. mindspore/opencv_imgproc452.dll +0 -0
  206. mindspore/ops/_grad_experimental/grad_comm_ops.py +51 -13
  207. mindspore/ops/_grad_experimental/grad_debug_ops.py +14 -0
  208. mindspore/ops/_grad_experimental/grad_inner_ops.py +0 -9
  209. mindspore/ops/_op_impl/cpu/__init__.py +1 -0
  210. mindspore/{experimental/es/__init__.py → ops/_op_impl/cpu/joinedstr_op.py} +12 -6
  211. mindspore/ops/_vmap/vmap_array_ops.py +31 -13
  212. mindspore/ops/_vmap/vmap_nn_ops.py +8 -16
  213. mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +54 -13
  214. mindspore/ops/auto_generate/gen_extend_func.py +27 -145
  215. mindspore/ops/auto_generate/gen_ops_def.py +1027 -347
  216. mindspore/ops/auto_generate/gen_ops_prim.py +2341 -1117
  217. mindspore/ops/auto_generate/pyboost_inner_prim.py +31 -1
  218. mindspore/ops/composite/__init__.py +10 -0
  219. mindspore/ops/composite/base.py +9 -5
  220. mindspore/ops/composite/multitype_ops/__init__.py +12 -1
  221. mindspore/ops/composite/multitype_ops/_compile_utils.py +133 -109
  222. mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -1
  223. mindspore/ops/composite/multitype_ops/add_impl.py +70 -2
  224. mindspore/ops/composite/multitype_ops/div_impl.py +49 -0
  225. mindspore/ops/composite/multitype_ops/floordiv_impl.py +29 -0
  226. mindspore/ops/composite/multitype_ops/getitem_impl.py +11 -0
  227. mindspore/ops/composite/multitype_ops/mod_impl.py +5 -3
  228. mindspore/ops/composite/multitype_ops/mul_impl.py +49 -0
  229. mindspore/ops/composite/multitype_ops/setitem_impl.py +57 -0
  230. mindspore/ops/composite/multitype_ops/sub_impl.py +34 -0
  231. mindspore/ops/composite/multitype_ops/zeros_like_impl.py +14 -0
  232. mindspore/ops/function/__init__.py +4 -1
  233. mindspore/ops/function/_add_attr_func.py +11 -6
  234. mindspore/ops/function/array_func.py +19 -102
  235. mindspore/ops/function/debug_func.py +8 -5
  236. mindspore/ops/function/grad/grad_func.py +5 -13
  237. mindspore/ops/function/math_func.py +77 -572
  238. mindspore/ops/function/nn_func.py +46 -94
  239. mindspore/ops/function/other_func.py +4 -1
  240. mindspore/ops/function/random_func.py +44 -5
  241. mindspore/ops/function/vmap_func.py +2 -1
  242. mindspore/ops/functional.py +4 -4
  243. mindspore/ops/functional_overload.py +594 -18
  244. mindspore/ops/op_info_register.py +21 -0
  245. mindspore/ops/operations/__init__.py +16 -11
  246. mindspore/ops/operations/_custom_ops_utils.py +689 -34
  247. mindspore/ops/operations/_inner_ops.py +14 -18
  248. mindspore/ops/operations/_sequence_ops.py +1 -1
  249. mindspore/ops/operations/array_ops.py +5 -51
  250. mindspore/ops/operations/comm_ops.py +186 -41
  251. mindspore/ops/operations/custom_ops.py +303 -177
  252. mindspore/ops/operations/debug_ops.py +59 -4
  253. mindspore/ops/operations/image_ops.py +13 -13
  254. mindspore/ops/operations/manually_defined/ops_def.py +27 -28
  255. mindspore/ops/operations/math_ops.py +8 -9
  256. mindspore/ops/operations/nn_ops.py +8 -40
  257. mindspore/ops/primitive.py +9 -20
  258. mindspore/ops/tensor_method.py +63 -15
  259. mindspore/ops_generate/api/cpp_create_prim_instance_helper_generator.py +1 -1
  260. mindspore/ops_generate/api/functional_map_cpp_generator.py +10 -9
  261. mindspore/ops_generate/api/functions_cc_generator.py +58 -10
  262. mindspore/ops_generate/api/tensor_func_reg_cpp_generator.py +1 -1
  263. mindspore/ops_generate/common/base_generator.py +14 -0
  264. mindspore/ops_generate/common/gen_constants.py +8 -3
  265. mindspore/ops_generate/common/gen_utils.py +0 -19
  266. mindspore/ops_generate/common/op_proto.py +11 -4
  267. mindspore/ops_generate/common/template.py +88 -11
  268. mindspore/ops_generate/gen_ops.py +1 -1
  269. mindspore/ops_generate/op_def/lite_ops_cpp_generator.py +4 -4
  270. mindspore/ops_generate/op_def/ops_def_cc_generator.py +0 -3
  271. mindspore/ops_generate/op_def/ops_name_h_generator.py +0 -3
  272. mindspore/ops_generate/op_def/ops_primitive_h_generator.py +0 -4
  273. mindspore/ops_generate/op_def_py/op_prim_py_generator.py +5 -2
  274. mindspore/ops_generate/pyboost/auto_grad_impl_cc_generator.py +49 -8
  275. mindspore/ops_generate/pyboost/auto_grad_reg_cc_generator.py +2 -2
  276. mindspore/ops_generate/pyboost/gen_pyboost_func.py +31 -16
  277. mindspore/ops_generate/pyboost/op_template_parser.py +98 -72
  278. mindspore/ops_generate/pyboost/pyboost_functions_cpp_generator.py +70 -273
  279. mindspore/ops_generate/pyboost/pyboost_functions_h_generator.py +14 -6
  280. mindspore/ops_generate/pyboost/pyboost_functions_impl_cpp_generator.py +316 -0
  281. mindspore/ops_generate/pyboost/pyboost_functions_py_generator.py +1 -1
  282. mindspore/ops_generate/pyboost/pyboost_grad_function_cpp_generator.py +5 -3
  283. mindspore/ops_generate/pyboost/pyboost_inner_prim_generator.py +1 -1
  284. mindspore/ops_generate/pyboost/pyboost_internal_functions_cpp_generator.py +76 -0
  285. mindspore/ops_generate/pyboost/pyboost_internal_functions_h_generator.py +76 -0
  286. mindspore/ops_generate/pyboost/pyboost_internal_kernel_info_adapter_generator.py +125 -0
  287. mindspore/ops_generate/pyboost/pyboost_native_grad_functions_generator.py +4 -3
  288. mindspore/ops_generate/pyboost/pyboost_op_cpp_code_generator.py +348 -61
  289. mindspore/ops_generate/pyboost/pyboost_overload_functions_cpp_generator.py +1 -1
  290. mindspore/ops_generate/pyboost/pyboost_utils.py +118 -9
  291. mindspore/ops_generate/tensor_py_cc_generator.py +1 -24
  292. mindspore/parallel/_auto_parallel_context.py +16 -23
  293. mindspore/parallel/_cell_wrapper.py +113 -45
  294. mindspore/parallel/_parallel_serialization.py +4 -3
  295. mindspore/parallel/_ps_context.py +4 -6
  296. mindspore/parallel/_tensor.py +167 -12
  297. mindspore/parallel/_transformer/moe.py +1 -1
  298. mindspore/parallel/_transformer/transformer.py +17 -12
  299. mindspore/parallel/_utils.py +5 -11
  300. mindspore/parallel/auto_parallel.py +35 -14
  301. mindspore/parallel/checkpoint_convert.py +3 -3
  302. mindspore/parallel/checkpoint_transform.py +13 -7
  303. mindspore/parallel/cluster/process_entity/_api.py +88 -49
  304. mindspore/parallel/cluster/process_entity/_utils.py +95 -7
  305. mindspore/parallel/cluster/run.py +48 -7
  306. mindspore/parallel/function/__init__.py +8 -1
  307. mindspore/parallel/function/reshard_func.py +12 -12
  308. mindspore/parallel/nn/__init__.py +15 -2
  309. mindspore/parallel/nn/parallel_cell_wrapper.py +50 -14
  310. mindspore/parallel/nn/parallel_grad_reducer.py +7 -14
  311. mindspore/parallel/shard.py +10 -25
  312. mindspore/parallel/transform_safetensors.py +469 -174
  313. mindspore/pgodb140.dll +0 -0
  314. mindspore/pgort140.dll +0 -0
  315. mindspore/profiler/__init__.py +2 -1
  316. mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +7 -7
  317. mindspore/profiler/analysis/parser/timeline_assembly_factory/base_timeline_assembler.py +3 -0
  318. mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +12 -6
  319. mindspore/profiler/analysis/parser/timeline_creator/cpu_op_timeline_creator.py +3 -3
  320. mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +3 -3
  321. mindspore/profiler/analysis/parser/timeline_creator/msprof_timeline_creator.py +4 -4
  322. mindspore/profiler/analysis/parser/timeline_creator/scope_layer_timeline_creator.py +3 -3
  323. mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +4 -1
  324. mindspore/profiler/analysis/parser/timeline_event/timeline_event_pool.py +2 -1
  325. mindspore/profiler/analysis/task_manager.py +1 -1
  326. mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +5 -1
  327. mindspore/profiler/analysis/viewer/ascend_integrate_viewer.py +2 -1
  328. mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +10 -9
  329. mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +43 -23
  330. mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +3 -2
  331. mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +9 -5
  332. mindspore/profiler/analysis/viewer/ms_operator_details_viewer.py +132 -0
  333. mindspore/profiler/common/constant.py +16 -0
  334. mindspore/profiler/common/msprof_cmd_tool.py +2 -2
  335. mindspore/profiler/common/path_manager.py +9 -0
  336. mindspore/profiler/common/profiler_context.py +50 -29
  337. mindspore/profiler/common/profiler_info.py +0 -16
  338. mindspore/profiler/common/profiler_meta_data.py +1 -0
  339. mindspore/profiler/common/profiler_op_analyse.py +239 -0
  340. mindspore/profiler/common/profiler_output_path.py +23 -8
  341. mindspore/profiler/common/profiler_parameters.py +128 -35
  342. mindspore/profiler/dynamic_profile/__init__.py +0 -0
  343. mindspore/profiler/dynamic_profile/dynamic_monitor_proxy.py +39 -0
  344. mindspore/profiler/dynamic_profile/dynamic_profiler_config_context.py +666 -0
  345. mindspore/profiler/dynamic_profile/dynamic_profiler_utils.py +62 -0
  346. mindspore/profiler/dynamic_profiler.py +374 -338
  347. mindspore/profiler/envprofiler.py +42 -12
  348. mindspore/profiler/experimental_config.py +112 -7
  349. mindspore/profiler/mstx.py +33 -12
  350. mindspore/profiler/platform/__init__.py +2 -3
  351. mindspore/profiler/platform/cpu_profiler.py +10 -4
  352. mindspore/profiler/platform/npu_profiler.py +30 -20
  353. mindspore/profiler/profiler.py +218 -154
  354. mindspore/profiler/profiler_action_controller.py +65 -77
  355. mindspore/profiler/profiler_interface.py +2 -2
  356. mindspore/profiler/schedule.py +10 -4
  357. mindspore/rewrite/common/config.py +1 -0
  358. mindspore/rewrite/common/namer.py +1 -0
  359. mindspore/rewrite/common/namespace.py +1 -0
  360. mindspore/rewrite/node/node.py +31 -11
  361. mindspore/rewrite/parsers/assign_parser.py +1 -1
  362. mindspore/rewrite/symbol_tree/symbol_tree.py +2 -2
  363. mindspore/run_check/_check_version.py +7 -10
  364. mindspore/runtime/__init__.py +8 -6
  365. mindspore/runtime/event.py +10 -4
  366. mindspore/runtime/executor.py +87 -45
  367. mindspore/runtime/memory.py +31 -32
  368. mindspore/runtime/thread_bind_core.py +299 -165
  369. mindspore/safeguard/rewrite_obfuscation.py +12 -13
  370. mindspore/swresample-4.dll +0 -0
  371. mindspore/swscale-6.dll +0 -0
  372. mindspore/tbbmalloc.dll +0 -0
  373. mindspore/tinyxml2.dll +0 -0
  374. mindspore/train/_utils.py +17 -7
  375. mindspore/train/amp.py +43 -23
  376. mindspore/train/callback/__init__.py +5 -5
  377. mindspore/train/callback/_callback.py +2 -1
  378. mindspore/train/callback/_checkpoint.py +4 -14
  379. mindspore/train/callback/_flops_collector.py +11 -7
  380. mindspore/train/callback/_landscape.py +0 -1
  381. mindspore/train/callback/_train_fault_tolerance.py +98 -21
  382. mindspore/train/data_sink.py +15 -6
  383. mindspore/train/dataset_helper.py +14 -5
  384. mindspore/train/model.py +133 -69
  385. mindspore/train/serialization.py +168 -126
  386. mindspore/train/summary/summary_record.py +13 -2
  387. mindspore/train/train_thor/model_thor.py +2 -2
  388. mindspore/turbojpeg.dll +0 -0
  389. mindspore/utils/__init__.py +3 -2
  390. mindspore/utils/dryrun.py +0 -6
  391. mindspore/utils/runtime_execution_order_check.py +163 -77
  392. mindspore/utils/sdc_detect.py +68 -0
  393. mindspore/utils/utils.py +14 -17
  394. mindspore/vcmeta.dll +0 -0
  395. mindspore/vcruntime140.dll +0 -0
  396. mindspore/vcruntime140_1.dll +0 -0
  397. mindspore/version.py +1 -1
  398. {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0.dist-info}/METADATA +5 -4
  399. {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0.dist-info}/RECORD +403 -442
  400. mindspore/_deprecated/jit.py +0 -198
  401. mindspore/_extends/remote/kernel_build_server_ascend.py +0 -75
  402. mindspore/communication/_hccl_management.py +0 -297
  403. mindspore/experimental/es/embedding_service.py +0 -891
  404. mindspore/experimental/es/embedding_service_layer.py +0 -581
  405. mindspore/profiler/common/validator/__init__.py +0 -14
  406. mindspore/profiler/common/validator/validate_path.py +0 -84
  407. mindspore/profiler/parser/__init__.py +0 -14
  408. mindspore/profiler/parser/aicpu_data_parser.py +0 -272
  409. mindspore/profiler/parser/ascend_analysis/__init__.py +0 -14
  410. mindspore/profiler/parser/ascend_analysis/constant.py +0 -71
  411. mindspore/profiler/parser/ascend_analysis/file_manager.py +0 -180
  412. mindspore/profiler/parser/ascend_analysis/function_event.py +0 -185
  413. mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +0 -136
  414. mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +0 -131
  415. mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +0 -104
  416. mindspore/profiler/parser/ascend_analysis/path_manager.py +0 -313
  417. mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +0 -123
  418. mindspore/profiler/parser/ascend_analysis/tlv_decoder.py +0 -86
  419. mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +0 -75
  420. mindspore/profiler/parser/ascend_cluster_generator.py +0 -116
  421. mindspore/profiler/parser/ascend_communicate_generator.py +0 -314
  422. mindspore/profiler/parser/ascend_flops_generator.py +0 -116
  423. mindspore/profiler/parser/ascend_fpbp_generator.py +0 -82
  424. mindspore/profiler/parser/ascend_hccl_generator.py +0 -271
  425. mindspore/profiler/parser/ascend_integrate_generator.py +0 -42
  426. mindspore/profiler/parser/ascend_memory_generator.py +0 -185
  427. mindspore/profiler/parser/ascend_msprof_exporter.py +0 -282
  428. mindspore/profiler/parser/ascend_msprof_generator.py +0 -187
  429. mindspore/profiler/parser/ascend_op_generator.py +0 -334
  430. mindspore/profiler/parser/ascend_steptrace_generator.py +0 -94
  431. mindspore/profiler/parser/ascend_timeline_generator.py +0 -545
  432. mindspore/profiler/parser/base_timeline_generator.py +0 -483
  433. mindspore/profiler/parser/container.py +0 -229
  434. mindspore/profiler/parser/cpu_gpu_timeline_generator.py +0 -697
  435. mindspore/profiler/parser/flops_parser.py +0 -531
  436. mindspore/profiler/parser/framework_enum.py +0 -111
  437. mindspore/profiler/parser/framework_parser.py +0 -464
  438. mindspore/profiler/parser/framework_struct.py +0 -61
  439. mindspore/profiler/parser/gpu_analysis/__init__.py +0 -14
  440. mindspore/profiler/parser/gpu_analysis/function_event.py +0 -44
  441. mindspore/profiler/parser/gpu_analysis/fwk_file_parser.py +0 -89
  442. mindspore/profiler/parser/gpu_analysis/profiler_info_parser.py +0 -72
  443. mindspore/profiler/parser/hccl_parser.py +0 -573
  444. mindspore/profiler/parser/hwts_log_parser.py +0 -122
  445. mindspore/profiler/parser/integrator.py +0 -526
  446. mindspore/profiler/parser/memory_usage_parser.py +0 -277
  447. mindspore/profiler/parser/minddata_analyzer.py +0 -800
  448. mindspore/profiler/parser/minddata_parser.py +0 -186
  449. mindspore/profiler/parser/minddata_pipeline_parser.py +0 -299
  450. mindspore/profiler/parser/op_intermediate_parser.py +0 -149
  451. mindspore/profiler/parser/optime_parser.py +0 -250
  452. mindspore/profiler/parser/profiler_info.py +0 -213
  453. mindspore/profiler/parser/step_trace_parser.py +0 -666
  454. mindspore/utils/hooks.py +0 -81
  455. /mindspore/common/{_auto_dynamic.py → dynamic_shape/_auto_dynamic.py} +0 -0
  456. {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0.dist-info}/WHEEL +0 -0
  457. {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0.dist-info}/entry_points.txt +0 -0
  458. {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0.dist-info}/top_level.txt +0 -0
@@ -41,7 +41,7 @@ from mindspore.ops.operations.nn_ops import TripletMarginLoss
41
41
  from mindspore.ops.operations._sequence_ops import TupleToTensor, TensorToTuple, ListToTensor
42
42
  from mindspore.common.api import _function_forbid_reuse
43
43
  from mindspore.ops.auto_generate import log_softmax, dense, prelu, celu, fast_gelu, silu, elu, sigmoid, relu6, \
44
- softmax_impl, swiglu, logsigmoid_op, kl_div_op, divs_op
44
+ softmax_impl, swiglu, logsigmoid_op, kl_div_op, divs_op, l1_loss_ext
45
45
  from mindspore.ops.auto_generate import relu_op, inplace_relu_op
46
46
  from mindspore.ops.auto_generate import group_norm_op, rms_norm, add_rms_norm, layer_norm_ext_op, batch_norm_ext_op,\
47
47
  mse_loss_ext
@@ -49,13 +49,14 @@ from mindspore.ops.auto_generate import group_norm_op, rms_norm, add_rms_norm, l
49
49
  from mindspore.ops.auto_generate import (reflection_pad_1d_op, reflection_pad_2d_op, add_layernorm_v2_op,
50
50
  reflection_pad_3d_op, # pylint: disable=W0611
51
51
  replication_pad_1d_op, replication_pad_2d_op, replication_pad_3d_op,
52
- constant_pad_nd_op, dropout_ext_op, reverse_v2_impl, avg_pool2d_op,
52
+ constant_pad_nd_op, func_dropout_ext_op, reverse_v2_impl, avg_pool2d_op,
53
53
  upsample_nearest1d_op, upsample_nearest2d_op, upsample_nearest3d_op,
54
54
  upsample_linear1d_op, upsample_bilinear2d_op, upsample_bicubic2d_op,
55
55
  upsample_trilinear3d_impl, fill_scalar_op, floor_op, nllloss_2d_op,
56
- masked_fill_op, masked_select, ones, flatten_ext, conv_transpose2d)
56
+ masked_fill_op, masked_select, ones, flatten_ext, conv_transpose2d,
57
+ func_max_pool2d_op)
57
58
  # 2
58
-
59
+ from mindspore.ops.auto_generate.pyboost_inner_prim import grid_sampler_2d_impl, grid_sampler_3d_impl
59
60
  # 3
60
61
 
61
62
  # 4
@@ -91,16 +92,16 @@ from mindspore.ops.auto_generate import avg_pool3d_ext_op
91
92
  # 19
92
93
 
93
94
  # 20
94
-
95
+ from mindspore.ops.functional_overload import conv3d as conv3d_op
95
96
  from mindspore.ops.auto_generate.gen_ops_prim import embedding_op, MaxPoolWithIndices, \
96
97
  PromptFlashAttention, MaxPoolWithMask
97
- from mindspore.ops.auto_generate.gen_ops_prim import conv3d_ext_op, conv3d_padding_op, conv2d_ext_op, \
98
+ from mindspore.ops.auto_generate.gen_ops_prim import conv2d_ext_op, \
98
99
  conv2d_padding_op, conv1d_ext_op, conv1d_padding_op, speed_fusion_attention_op
99
100
  from mindspore.common.generator import default_generator
100
101
  from mindspore.ops.auto_generate import hardshrink, hardsigmoid, hardswish
101
102
  from mindspore.ops.auto_generate import softshrink
102
103
  from mindspore.ops.auto_generate import soft_margin_loss
103
- from mindspore.ops.auto_generate import moe_token_permute, moe_token_unpermute
104
+ from mindspore.ops.auto_generate import moe_token_permute, moe_token_unpermute, ring_attention_update
104
105
  from mindspore.ops.auto_generate import adaptive_avg_pool2d_ext_op
105
106
  from mindspore.ops.auto_generate.pyboost_inner_prim import nllloss_impl
106
107
  from mindspore.ops.auto_generate.pyboost_inner_prim import adaptive_max_pool2d_impl
@@ -1622,7 +1623,6 @@ def dropout_ext(input, p=0.5, training=True, inplace=False):
1622
1623
  - **output** (Tensor) - Zeroed tensor, with the same shape and data type as `input`.
1623
1624
 
1624
1625
  Raises:
1625
- TypeError: If `p` is not a float.
1626
1626
  TypeError: If `input` is not a Tensor.
1627
1627
 
1628
1628
  Supported Platforms:
@@ -1636,16 +1636,8 @@ def dropout_ext(input, p=0.5, training=True, inplace=False):
1636
1636
  >>> print(output.shape)
1637
1637
  (2, 2)
1638
1638
  """
1639
- check_bool_const(training, "training", "dropout_ext")
1640
- check_bool_const(inplace, "inplace", "dropout_ext")
1641
- if not training:
1642
- return input
1643
1639
  seed, offset = default_generator._step(generator_step_) # pylint: disable=protected-access
1644
- out, _ = dropout_ext_op(input, p, seed, offset)
1645
- if inplace:
1646
- input.copy_(out)
1647
- return input
1648
- return out
1640
+ return func_dropout_ext_op(input, p, training, inplace, seed, offset)
1649
1641
 
1650
1642
 
1651
1643
  def dropout1d(input, p=0.5, training=True):
@@ -2394,7 +2386,7 @@ def is_floating_point(input):
2394
2386
  >>> mindspore.ops.is_floating_point(input)
2395
2387
  False
2396
2388
  """
2397
- return input.dtype in [mstype.float32, mstype.bfloat16, mstype.float16, mstype.float64]
2389
+ return input.dtype in mstype.float_type
2398
2390
 
2399
2391
 
2400
2392
  def _is_dim_unknown(shape):
@@ -4302,6 +4294,15 @@ def nll_loss(inputs, target, weight=None, ignore_index=-100, reduction='mean', l
4302
4294
  \sum_{n=1}^{N} l_{n}, & \text { if reduction }=\text { 'sum' }
4303
4295
  \end{array}\right.
4304
4296
 
4297
+ .. warning::
4298
+ - In GE mode, the rank of `inputs` should be 1D or 2D, the rank of `target` and `weight` should be 1D,
4299
+ and the following restraints should be met:
4300
+
4301
+ - when `inputs` is 1D: target_shape[0] == 1 and weight_shape[0] == inputs_shape[0].
4302
+ - when `inputs` is 2D: target_shape[0] == inputs_shape[0] and weight_shape[0] == inputs_shape[1].
4303
+
4304
+ - On GPU or CPU, `inputs` should be 2D.
4305
+
4305
4306
  Args:
4306
4307
  inputs (Tensor): :math:`(N, C)` where `C = number of classes` or :math:`(N, C, H, W)`
4307
4308
  in case of 2D Loss, or :math:`(N, C, d_1, d_2, ..., d_K)`.
@@ -4420,7 +4421,7 @@ def nll_loss_ext(input, target, weight=None, ignore_index=-100, reduction='mean'
4420
4421
  :math:`N` is the batch size, :math:`c` belonging to :math:`[0, C-1]` is class index,
4421
4422
  where :math:`C` is the number of classes.
4422
4423
 
4423
- If `reduction` is not ``'None'`` (default ``'mean'``), then
4424
+ If `reduction` is not ``'none'`` (default ``'mean'``), then
4424
4425
 
4425
4426
  .. math::
4426
4427
 
@@ -4444,7 +4445,7 @@ def nll_loss_ext(input, target, weight=None, ignore_index=-100, reduction='mean'
4444
4445
  weight (Tensor, optional): A rescaling weight applied to the loss of each batch element.
4445
4446
  If not None, the shape is :math:`(C,)`.
4446
4447
  The data type must be float16 or float32 or bfloat16(only supported by Atlas A2 training series products).
4447
- It should have the same data type as `input` . Default: ``'None'`` .
4448
+ It should have the same data type as `input` . Default: ``None`` .
4448
4449
  ignore_index (int, optional): Specifies a target value that is ignored
4449
4450
  and does not contribute to the input gradient. Default: ``-100`` .
4450
4451
  reduction (str, optional): Apply specific reduction method to the output: ``'none'`` , ``'mean'`` ,
@@ -4481,10 +4482,10 @@ def _nllloss_nd(input, target, weight=None, ignore_index=-100, reduction='mean')
4481
4482
  weight = ones(n_classes, input.dtype)
4482
4483
  if input_dim < 1:
4483
4484
  raise ValueError(f"input dim should be less than 1, but got {input_dim}")
4484
- if input_dim != 1 and input.shape[0] != target.shape[0]:
4485
+ if F.isconstant(input_dim) and F.isconstant(target.ndim) and input_dim != 1 and input.shape[0] != target.shape[0]:
4485
4486
  raise ValueError(f"input bacth_size should be equal to target batch_size, but got {input.shape[0]} and "
4486
4487
  f"{target.shape[0]}")
4487
- if input_dim == 1 or input_dim == 2:
4488
+ if input_dim in [1, 2]:
4488
4489
  return nllloss_impl(input, target, weight, reduction, ignore_index)[0]
4489
4490
  if input_dim == 4:
4490
4491
  return nllloss_2d_op(input, target, weight, reduction, ignore_index)[0]
@@ -4845,8 +4846,9 @@ def smooth_l1_loss(input, target, beta=1.0, reduction='none'):
4845
4846
  >>> print(output)
4846
4847
  [0. 0. 0.5]
4847
4848
  """
4848
- _smooth_l1_loss = _get_cache_prim(P.SmoothL1Loss)(beta, reduction)
4849
- return _smooth_l1_loss(input, target)
4849
+ if beta == 0.0:
4850
+ return l1_loss_ext(input, target, reduction)
4851
+ return ops.auto_generate.smooth_l1_loss(input, target, beta=beta, reduction=reduction)
4850
4852
 
4851
4853
 
4852
4854
  def threshold(input, thr, value):
@@ -5365,7 +5367,7 @@ def max_pool3d(x, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=Fal
5365
5367
  return out
5366
5368
 
5367
5369
 
5368
- def grid_sample(input, grid, mode='bilinear', padding_mode='zeros', align_corners=False):
5370
+ def grid_sample(input, grid, mode='bilinear', padding_mode='zeros', align_corners=None):
5369
5371
  """
5370
5372
  Given an `input` and a flow-field `grid`, computes the `output` using `input` values and pixel locations from
5371
5373
  `grid`. Only spatial (4-D) and volumetric (5-D) `input` is supported.
@@ -5411,10 +5413,10 @@ def grid_sample(input, grid, mode='bilinear', padding_mode='zeros', align_corner
5411
5413
  padding_mode (str, optional): An optional string specifying the pad method.
5412
5414
  The optional values are "zeros", "border" or
5413
5415
  "reflection". Default: ``'zeros'`` .
5414
- align_corners (bool, optional): If set to `True`, the extrema (-1 and 1) are considered as referring to
5416
+ align_corners (bool, optional): If set to ``True``, the extrema (-1 and 1) are considered as referring to
5415
5417
  the center points of the input's corner pixels. If set to `False`, they are instead considered as referring
5416
5418
  to the corner points of the input's corner pixels, making the sampling more resolution agnostic. Default:
5417
- ``False`` .
5419
+ ``None``, which is the same as ``False`` .
5418
5420
 
5419
5421
  Returns:
5420
5422
  Tensor, dtype is the same as `input` and whose shape is :math:`(N, C, H_{out}, W_{out})` (4-D) and
@@ -5451,11 +5453,10 @@ def grid_sample(input, grid, mode='bilinear', padding_mode='zeros', align_corner
5451
5453
  [[14.5 ]
5452
5454
  [14.8 ]]]]
5453
5455
  """
5456
+ align_corners = False if align_corners is None else align_corners
5454
5457
  if input.ndim == 4:
5455
- _grid_sampler_2d = _get_cache_prim(NN_OPS.GridSampler2D)(mode, padding_mode, align_corners)
5456
- return _grid_sampler_2d(input, grid)
5457
- _grid_sampler_3d = _get_cache_prim(NN_OPS.GridSampler3D)(mode, padding_mode, align_corners)
5458
- return _grid_sampler_3d(input, grid)
5458
+ return grid_sampler_2d_impl(input, grid, mode, padding_mode, align_corners)
5459
+ return grid_sampler_3d_impl(input, grid, mode, padding_mode, align_corners)
5459
5460
 
5460
5461
 
5461
5462
  @constexpr
@@ -6307,7 +6308,7 @@ def conv1d_ext(input, weight, bias=None, stride=1, padding=0, dilation=1, groups
6307
6308
  this 1D convolution layer also can be called 1D depthwise convolution layer. Default: ``1`` .
6308
6309
 
6309
6310
  - :math:`(C_{in} \text{ % } \text{groups} == 0)` , :math:`(C_{out} \text{ % } \text{groups} == 0)` ,
6310
- :math:`(C_{out} >= \text{groups})` , :math:`(\text{kernel_size[1]} = C_{in} / \text{groups})`。
6311
+ :math:`(C_{out} >= \text{groups})` , :math:`(\text{weight[1]} = C_{in} / \text{groups})`。
6311
6312
 
6312
6313
  Returns:
6313
6314
  Tensor, the value that applied 1D convolution. The shape is :math:`(N, C_{out}, L_{out})`.
@@ -6372,9 +6373,9 @@ def _get_pad_info(dilation, weight):
6372
6373
  for i in range(2):
6373
6374
  d = dilation[i]
6374
6375
  weight_size = weight.shape[i + 2]
6375
- pad = d * (weight_size - 1)
6376
- pad_l += (int(pad / 2),)
6377
- pad_r += (int(pad - pad_l[i]),)
6376
+ pad_item = d * (weight_size - 1)
6377
+ pad_l += (int(pad_item / 2),)
6378
+ pad_r += (int(pad_item - pad_l[i]),)
6378
6379
  if pad_l[i] != pad_r[i]:
6379
6380
  need_pad_nd = True
6380
6381
  return need_pad_nd, pad_l, pad_r
@@ -6438,9 +6439,6 @@ def conv2d_ext(input, weight, bias=None, stride=1, padding=0, dilation=1, groups
6438
6439
  <http://vision.stanford.edu/cs598_spring07/papers/Lecun98.pdf>`_ and
6439
6440
  `ConvNets <http://cs231n.github.io/convolutional-networks/>`_.
6440
6441
 
6441
- .. warning::
6442
- This is an experimental API that is subject to change or deletion.
6443
-
6444
6442
  Args:
6445
6443
  input (Tensor): Tensor of shape :math:`(N, C_{in}, H_{in}, W_{in})` or :math:`(C_{in}, H_{in}, W_{in})`.
6446
6444
  weight (Tensor): Tensor of shape
@@ -6477,7 +6475,7 @@ def conv2d_ext(input, weight, bias=None, stride=1, padding=0, dilation=1, groups
6477
6475
  groups (int, optional): Splits `input` into groups. Default: ``1`` .
6478
6476
 
6479
6477
  - :math:`(C_{in} \text{ % } \text{groups} == 0)` , :math:`(C_{out} \text{ % } \text{groups} == 0)` ,
6480
- :math:`(C_{out} >= \text{groups})` , :math:`(\text{kernel_size[1]} = C_{in} / \text{groups})`
6478
+ :math:`(C_{out} >= \text{groups})` , :math:`(\text{weight[1]} = C_{in} / \text{groups})`
6481
6479
 
6482
6480
  Returns:
6483
6481
  Tensor, the value that applied 2D convolution. The shape is :math:`(N, C_{out}, H_{out}, W_{out})`.
@@ -6981,10 +6979,6 @@ def batch_norm_ext(input, running_mean, running_var, weight=None, bias=None, tra
6981
6979
  [[ 2.1621194 1.2360122]
6982
6980
  [14.810596 10.180061 ]]
6983
6981
  """
6984
- if weight is None:
6985
- weight = ops.ones([input.shape[1]], dtype=input.dtype)
6986
- if bias is None:
6987
- bias = ops.zeros([input.shape[1]], dtype=input.dtype)
6988
6982
  output = batch_norm_ext_op(input, weight, bias, running_mean, running_var, training, momentum, eps)
6989
6983
  return output[0]
6990
6984
 
@@ -7260,39 +7254,8 @@ def conv3d(input, weight, bias=None, stride=1, pad_mode="valid", padding=0, dila
7260
7254
 
7261
7255
  Returns:
7262
7256
  Tensor, the value that applied 3D convolution. The shape is :math:`(N, C_{out}, D_{out}, H_{out}, W_{out})`.
7263
-
7264
- `pad_mode` is ``"same"``:
7265
-
7266
- .. math::
7267
- \begin{array}{ll} \\
7268
- D_{out} = \left \lceil{\frac{D_{in}}{\text{stride[0]}}} \right \rceil \\
7269
- H_{out} = \left \lceil{\frac{H_{in}}{\text{stride[1]}}} \right \rceil \\
7270
- W_{out} = \left \lceil{\frac{W_{in}}{\text{stride[2]}}} \right \rceil \\
7271
- \end{array}
7272
-
7273
- `pad_mode` is ``"valid"``:
7274
-
7275
- .. math::
7276
- \begin{array}{ll} \\
7277
- D_{out} = \left \lfloor{\frac{D_{in} - \text{dilation[0]} \times (\text{kernel_size[0]} - 1) }
7278
- {\text{stride[0]}} + 1} \right \rfloor \\
7279
- H_{out} = \left \lfloor{\frac{H_{in} - \text{dilation[1]} \times (\text{kernel_size[1]} - 1) }
7280
- {\text{stride[1]}} + 1} \right \rfloor \\
7281
- W_{out} = \left \lfloor{\frac{W_{in} - \text{dilation[2]} \times (\text{kernel_size[2]} - 1) }
7282
- {\text{stride[2]}} + 1} \right \rfloor \\
7283
- \end{array}
7284
-
7285
- `pad_mode` is ``"pad"``:
7286
-
7287
- .. math::
7288
- \begin{array}{ll} \\
7289
- D_{out} = \left \lfloor{\frac{D_{in} + padding[0] + padding[1] - (\text{dilation[0]} - 1) \times
7290
- \text{kernel_size[0]} - 1 }{\text{stride[0]}} + 1} \right \rfloor \\
7291
- H_{out} = \left \lfloor{\frac{H_{in} + padding[2] + padding[3] - (\text{dilation[1]} - 1) \times
7292
- \text{kernel_size[1]} - 1 }{\text{stride[1]}} + 1} \right \rfloor \\
7293
- W_{out} = \left \lfloor{\frac{W_{in} + padding[4] + padding[5] - (\text{dilation[2]} - 1) \times
7294
- \text{kernel_size[2]} - 1 }{\text{stride[2]}} + 1} \right \rfloor \\
7295
- \end{array}
7257
+ To see how different pad modes affect the output shape, please refer to
7258
+ :class:`mindspore.nn.Conv3d` for more details.
7296
7259
 
7297
7260
  Raises:
7298
7261
  TypeError: If `out_channel` or `groups` is not an int.
@@ -7413,8 +7376,8 @@ def conv3d_ext(input, weight, bias=None, stride=1, padding=0, dilation=1, groups
7413
7376
  - :math:`H_{out} = (H_{in} + PadUp + PadDown - ((kh - 1) * DilationH + 1)) / StrideH + 1` .
7414
7377
  - :math:`W_{out} = (W_{in} + PadLeft + PadRight - ((kw - 1) * DilationW + 1)) / StrideW + 1` .
7415
7378
  - :math:`D_{out} = (D_{in} + PadFront + PadBack - ((kd - 1) * DilationD + 1)) / StrideD + 1` .
7416
- - :math:`(D_{in}+PadFront+PadBack - ((kd-1)*DilationD+1)) /% StrideD <= PadBack` .
7417
- - :math:`(H_{in}+PadUp+PadDown - ((kh-1)*Dilationh+1)) /% StrideH <= PadDown` .
7379
+ - :math:`(D_{in}+PadFront+PadBack - ((kd-1)*DilationD+1)) \% StrideD <= PadBack` .
7380
+ - :math:`(H_{in}+PadUp+PadDown - ((kh-1)*Dilationh+1)) \% StrideH <= PadDown` .
7418
7381
  - :math:`stride_d <= kernel_d` .
7419
7382
  - :math:`PadUp < kh` and :math:`PadDown < kh` . When `padding` = ``'valid'``, both PadUp and PadDown are zeros.
7420
7383
  When `padding` = ``'same'``, pad can be calculated by
@@ -7427,7 +7390,6 @@ def conv3d_ext(input, weight, bias=None, stride=1, padding=0, dilation=1, groups
7427
7390
 
7428
7391
  .. warning::
7429
7392
  This API does not support Atlas series products.
7430
- This is an experimental API that is subject to change or deletion.
7431
7393
 
7432
7394
  Args:
7433
7395
  input (Tensor): Tensor of shape :math:`(N, C_{in}, D_{in}, H_{in}, W_{in})`.
@@ -7481,12 +7443,7 @@ def conv3d_ext(input, weight, bias=None, stride=1, padding=0, dilation=1, groups
7481
7443
  (12, 26, 59, 47, 5)
7482
7444
  """
7483
7445
 
7484
- if isinstance(padding, (tuple, list, int)):
7485
- return conv3d_ext_op(input, weight, bias, stride, padding, dilation, groups)
7486
- if isinstance(padding, str):
7487
- return conv3d_padding_op(input, weight, bias, stride, padding, dilation, groups)
7488
- raise TypeError(f"For conv3d, the parameter 'padding' must be a tuple/list " \
7489
- f"or a string, but got {type(padding)}")
7446
+ return conv3d_op(input, weight, bias, stride, padding, dilation, groups)
7490
7447
 
7491
7448
 
7492
7449
  @_primexpr
@@ -7554,7 +7511,7 @@ def pixel_shuffle(input, upscale_factor):
7554
7511
  c, h, w = idx[-3:]
7555
7512
  _check_pxiel_shuffle_valid(c, upscale_factor)
7556
7513
  c = c // upscale_factor ** 2
7557
- input_perm = (pre + (c, upscale_factor, upscale_factor, h, w))
7514
+ input_perm = pre + (c, upscale_factor, upscale_factor, h, w)
7558
7515
  input = reshape_(input, input_perm)
7559
7516
  input_perm = [i for i in range(length - 2)]
7560
7517
  input_perm = input_perm + [length, length - 2, length + 1, length - 1]
@@ -7618,7 +7575,7 @@ def pixel_unshuffle(input, downscale_factor):
7618
7575
  _check_pxiel_unshuffle_valid(h, w, downscale_factor)
7619
7576
  h = h // downscale_factor
7620
7577
  w = w // downscale_factor
7621
- input_perm = (pre + (c, h, downscale_factor, w, downscale_factor))
7578
+ input_perm = pre + (c, h, downscale_factor, w, downscale_factor)
7622
7579
  input = reshape_(input, input_perm)
7623
7580
  input_perm = [i for i in range(length - 2)]
7624
7581
  input_perm = input_perm + [length - 1, length + 1, length - 2, length]
@@ -8943,13 +8900,7 @@ def max_pool2d_ext(input, kernel_size, stride=None, padding=0, dilation=1, ceil_
8943
8900
  >>> print(argmax.shape)
8944
8901
  (20, 16, 24, 31)
8945
8902
  """
8946
- strides = stride if (stride is not None) else kernel_size
8947
- if return_indices:
8948
- max_pool_func_ = _get_cache_prim(MaxPoolWithIndices)(kernel_size, strides, padding, dilation, ceil_mode)
8949
- out, indices = max_pool_func_(input)
8950
- else:
8951
- max_pool_func_ = _get_cache_prim(MaxPoolWithMask)(kernel_size, strides, padding, dilation, ceil_mode)
8952
- out, indices = max_pool_func_(input)
8903
+ out, indices = func_max_pool2d_op(input, kernel_size, stride, padding, dilation, ceil_mode, return_indices)
8953
8904
  if return_indices:
8954
8905
  return out, indices
8955
8906
  return out
@@ -9699,6 +9650,7 @@ __all__ = [
9699
9650
  'lp_pool2d',
9700
9651
  'moe_token_permute',
9701
9652
  'moe_token_unpermute',
9653
+ 'ring_attention_update',
9702
9654
  'max_unpool1d',
9703
9655
  'max_unpool2d',
9704
9656
  'max_unpool3d',
@@ -15,6 +15,7 @@
15
15
  """Defines other operators with functional form."""
16
16
  from mindspore.ops import operations as P
17
17
  from mindspore.ops.auto_generate import rotary_position_embedding
18
+ from mindspore.ops.auto_generate import moe_distribute_dispatch, moe_distribute_combine
18
19
  from mindspore.ops.auto_generate.gen_ops_prim import moe_init_routing_v2_op
19
20
 
20
21
  partial_ = P.Partial()
@@ -268,6 +269,8 @@ __all__ = [
268
269
  'partial',
269
270
  'rotary_position_embedding',
270
271
  'move_to',
271
- 'moe_init_routing_v2'
272
+ 'moe_init_routing_v2',
273
+ 'moe_distribute_dispatch',
274
+ 'moe_distribute_combine'
272
275
  ]
273
276
  __all__.sort()
@@ -32,7 +32,7 @@ from mindspore.common.generator import default_generator
32
32
  from mindspore.ops.auto_generate import UniformExt, NormalTensorTensor, \
33
33
  NormalTensorFloat, NormalFloatTensor, NormalFloatFloat, RandExt, RandLikeExt, MultinomialExt, \
34
34
  Randn, RandnLike, RandInt, RandIntLike, RandpermExt, InplaceRandom, InplaceNormal
35
- from mindspore.ops.auto_generate.gen_ops_prim import inplace_uniform_op
35
+ from mindspore.ops.auto_generate.gen_ops_prim import inplace_uniform_op, inplace_exponential_op
36
36
 
37
37
  inplace_normal_ = InplaceNormal()
38
38
  normal_tensor_tensor_op = NormalTensorTensor()
@@ -296,7 +296,7 @@ def uniform_(input, from_=0, to=1, *, generator=None):
296
296
  Returns:
297
297
  Tensor, with the same shape and dtype as `input` tensor.
298
298
 
299
- Raises:
299
+ Raises:
300
300
  TypeError: If `input` is not a Tensor.
301
301
  TypeError: If dtype of `input` is not one of: bool, int8, int16, int32, int64, uint8, float16, float32, float64,
302
302
  bfloat16.
@@ -384,6 +384,18 @@ def uniform(shape, minval, maxval, seed=None, dtype=mstype.float32):
384
384
  return value
385
385
 
386
386
 
387
+
388
+ @_function_forbid_reuse
389
+ def exponential_(input, lambd=1, *, generator=None):
390
+ r"""
391
+ exponential
392
+ """
393
+ if generator is None:
394
+ generator = default_generator
395
+ seed, offset = generator._step(generator_step_) # pylint: disable=protected-access
396
+ return inplace_exponential_op(input, lambd, seed, offset)
397
+
398
+
387
399
  @_function_forbid_reuse
388
400
  def standard_normal(shape, seed=None):
389
401
  r"""
@@ -753,9 +765,9 @@ def normal_ext(mean=0.0, std=1.0, size=None, generator=None):
753
765
  Generates random numbers according to the standard Normal (or Gaussian) random number distribution.
754
766
 
755
767
  Args:
756
- mean (Union[float, Tensor]): Mean value of each element, the shape of the `mean` tensor
768
+ mean (Union[Tensor]): Mean value of each element, the shape of the `mean` tensor
757
769
  should be the same as that of the `std` tensor.
758
- std (Union[float, Tensor]): Standard deviation for each element, the shape of the `std` tensor
770
+ std (Union[Tensor]): Standard deviation for each element, the shape of the `std` tensor
759
771
  should be the same as that of the `mean` tensor. The value of `std` should be greater than or equal to 0.
760
772
 
761
773
  Keyword Args:
@@ -781,6 +793,33 @@ def normal_ext(mean=0.0, std=1.0, size=None, generator=None):
781
793
  >>> print(output.shape)
782
794
  (3,)
783
795
 
796
+ .. function:: normal(mean, std) -> Tensor
797
+ :noindex:
798
+
799
+ Similar to the function above, but the means are shared among all drawn elements.
800
+
801
+ Args:
802
+ mean (float): Mean value of each element.
803
+ std (Tensor): Standard deviation for each element. The value of `std` should be greater
804
+ than or equal to 0.
805
+
806
+ Returns:
807
+ Outputs a tensor with the same shape as `std`.
808
+
809
+ Supported Platforms:
810
+ ``Ascend``
811
+
812
+ Examples:
813
+ >>> import mindspore
814
+ >>> import numpy as np
815
+ >>> from mindspore import ops
816
+ >>> from mindspore import Tensor
817
+ >>> mean = 1.
818
+ >>> std = Tensor(np.array([1.0, 2.0, 3.0]), mindspore.float32)
819
+ >>> output = ops.function.random_func.normal_ext(mean, std)
820
+ >>> print(output.shape)
821
+ (3,)
822
+
784
823
  .. function:: normal(mean, std=1.0) -> Tensor
785
824
  :noindex:
786
825
 
@@ -995,7 +1034,7 @@ def gamma(shape, alpha, beta, seed=None):
995
1034
  (3, 2, 2)
996
1035
  >>> # case 2: alpha_shape is (2, 3), so shape is (3, 1, 3)
997
1036
  >>> shape = (3, 1, 3)
998
- >>> alpha = mindspore.tensor([[1, 3, 4], [2, 5, 6]]), mindspore.float32)
1037
+ >>> alpha = mindspore.tensor([[1, 3, 4], [2, 5, 6]], mindspore.float32)
999
1038
  >>> beta = mindspore.tensor([1.0], mindspore.float32)
1000
1039
  >>> output = mindspore.ops.gamma(shape, alpha, beta, seed=5)
1001
1040
  >>> result = output.shape
@@ -1,4 +1,4 @@
1
- # Copyright 2022 Huawei Technologies Co., Ltd
1
+ # Copyright 2022-2024 Huawei Technologies Co., Ltd
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -102,6 +102,7 @@ def vmap(fn, in_axes=0, out_axes=0):
102
102
  [[-2 1 4]
103
103
  [ 8 9 10]]
104
104
  """
105
+
105
106
  return vmap_instance(fn, in_axes, out_axes)
106
107
 
107
108
 
@@ -20,8 +20,8 @@ from mindspore.common._register_for_tensor import tensor_operator_registry
20
20
  from mindspore.ops import _constants
21
21
  from mindspore.ops.function import *
22
22
  from mindspore.ops.function.array_func import chunk_ext, zero_
23
- from mindspore.ops.function.math_func import all, argmax_ext, float_power_ext, erfinv_, tanh_, bernoulli_ext
24
- from mindspore.ops.function.random_func import random_, uniform_ext, uniform_, normal_
23
+ from mindspore.ops.function.math_func import all, argmax_ext, float_power_ext, erfinv_, tanh_, bernoulli_ext, bernoulli_
24
+ from mindspore.ops.function.random_func import random_, uniform_ext, uniform_, normal_, exponential_
25
25
  from mindspore.ops import operations as P
26
26
  from mindspore.ops.operations import array_ops
27
27
  from mindspore.ops.operations._sequence_ops import TensorToTuple
@@ -33,7 +33,6 @@ from mindspore.ops.operations.nn_ops import AdaptiveMaxPool2D
33
33
  from mindspore.ops.operations.math_ops import Roll
34
34
  from mindspore.ops.composite.math_ops import mm
35
35
  from mindspore.ops.function.math_func import dot
36
- from mindspore.ops.function.array_func import new_empty
37
36
  from mindspore.ops import auto_generate
38
37
  from mindspore.ops.auto_generate import cast
39
38
  from mindspore.ops._utils.arg_dtype_cast import DtypeToEnum
@@ -343,6 +342,7 @@ setattr(tensor_operator_registry, 'tensor_slice', tensor_slice)
343
342
  setattr(tensor_operator_registry, 'select', select)
344
343
  setattr(tensor_operator_registry, 'uniform', uniform_ext)
345
344
  setattr(tensor_operator_registry, 'uniform_', uniform_)
345
+ setattr(tensor_operator_registry, 'exponential_', exponential_)
346
346
  setattr(tensor_operator_registry, 'gather', gather)
347
347
  setattr(tensor_operator_registry, 'gather_d', gather_d)
348
348
  setattr(tensor_operator_registry, 'gather_elements', gather_elements)
@@ -382,7 +382,6 @@ setattr(tensor_operator_registry, 'nanmedian', nanmedian)
382
382
  setattr(tensor_operator_registry, 'csr_to_coo', csr_to_coo)
383
383
  setattr(tensor_operator_registry, 'zeros', zeros)
384
384
  setattr(tensor_operator_registry, 'ones', ones)
385
- setattr(tensor_operator_registry, 'new_empty', new_empty)
386
385
  setattr(tensor_operator_registry, 'unsorted_segment_min', unsorted_segment_min)
387
386
  setattr(tensor_operator_registry, 'unsorted_segment_max', unsorted_segment_max)
388
387
  setattr(tensor_operator_registry, 'unsorted_segment_prod', unsorted_segment_prod)
@@ -398,6 +397,7 @@ setattr(tensor_operator_registry, 'inplace_scatter_add', auto_generate.inplace_s
398
397
  setattr(tensor_operator_registry, 'slice_scatter', slice_scatter)
399
398
  setattr(tensor_operator_registry, 'select_scatter', select_scatter)
400
399
  setattr(tensor_operator_registry, 'bernoulli', bernoulli_ext)
400
+ setattr(tensor_operator_registry, 'bernoulli_', bernoulli_)
401
401
  setattr(tensor_operator_registry, 'poisson', P.Poisson)
402
402
  setattr(tensor_operator_registry, 'randperm', P.Randperm)
403
403
  setattr(tensor_operator_registry, 'multinomial', multinomial)