mindspore 2.7.0__cp310-cp310-win_amd64.whl → 2.7.1__cp310-cp310-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 (290) hide show
  1. mindspore/.commit_id +1 -1
  2. mindspore/__init__.py +4 -1
  3. mindspore/_c_dataengine.cp310-win_amd64.pyd +0 -0
  4. mindspore/_c_expression.cp310-win_amd64.pyd +0 -0
  5. mindspore/_c_mindrecord.cp310-win_amd64.pyd +0 -0
  6. mindspore/_extends/parse/compile_config.py +24 -1
  7. mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +6 -2
  8. mindspore/_extends/parse/resources.py +1 -1
  9. mindspore/_extends/parse/standard_method.py +8 -1
  10. mindspore/_extends/parse/trope.py +2 -1
  11. mindspore/_extends/pijit/pijit_func_white_list.py +7 -22
  12. mindspore/avcodec-59.dll +0 -0
  13. mindspore/avdevice-59.dll +0 -0
  14. mindspore/avfilter-8.dll +0 -0
  15. mindspore/avformat-59.dll +0 -0
  16. mindspore/avutil-57.dll +0 -0
  17. mindspore/boost/base.py +29 -2
  18. mindspore/common/_decorator.py +3 -2
  19. mindspore/common/_grad_function.py +3 -1
  20. mindspore/common/_tensor_cpp_method.py +1 -1
  21. mindspore/common/_tensor_docs.py +275 -64
  22. mindspore/common/_utils.py +0 -44
  23. mindspore/common/api.py +285 -35
  24. mindspore/common/dump.py +7 -108
  25. mindspore/common/dynamic_shape/auto_dynamic_shape.py +1 -3
  26. mindspore/common/hook_handle.py +60 -0
  27. mindspore/common/jit_config.py +5 -1
  28. mindspore/common/jit_trace.py +27 -12
  29. mindspore/common/lazy_inline.py +5 -3
  30. mindspore/common/parameter.py +13 -107
  31. mindspore/common/recompute.py +4 -11
  32. mindspore/common/tensor.py +16 -169
  33. mindspore/communication/_comm_helper.py +11 -1
  34. mindspore/communication/comm_func.py +138 -4
  35. mindspore/communication/management.py +85 -1
  36. mindspore/config/op_info.config +0 -15
  37. mindspore/context.py +5 -85
  38. mindspore/dataset/engine/datasets.py +8 -4
  39. mindspore/dataset/engine/datasets_vision.py +1 -1
  40. mindspore/dataset/engine/validators.py +1 -15
  41. mindspore/dnnl.dll +0 -0
  42. mindspore/{experimental/llm_boost/ascend_native → graph}/__init__.py +7 -7
  43. mindspore/graph/custom_pass.py +55 -0
  44. mindspore/include/dataset/execute.h +2 -2
  45. mindspore/jpeg62.dll +0 -0
  46. mindspore/mindrecord/__init__.py +3 -3
  47. mindspore/mindrecord/common/exceptions.py +1 -0
  48. mindspore/mindrecord/config.py +1 -1
  49. mindspore/{parallel/mpi → mindrecord/core}/__init__.py +4 -1
  50. mindspore/mindrecord/{shardheader.py → core/shardheader.py} +2 -1
  51. mindspore/mindrecord/{shardindexgenerator.py → core/shardindexgenerator.py} +1 -1
  52. mindspore/mindrecord/{shardreader.py → core/shardreader.py} +2 -1
  53. mindspore/mindrecord/{shardsegment.py → core/shardsegment.py} +2 -2
  54. mindspore/mindrecord/{shardutils.py → core/shardutils.py} +1 -1
  55. mindspore/mindrecord/{shardwriter.py → core/shardwriter.py} +1 -1
  56. mindspore/mindrecord/filereader.py +4 -4
  57. mindspore/mindrecord/filewriter.py +5 -5
  58. mindspore/mindrecord/mindpage.py +2 -2
  59. mindspore/mindrecord/tools/cifar10.py +1 -1
  60. mindspore/mindrecord/tools/cifar100.py +1 -1
  61. mindspore/mindrecord/tools/cifar100_to_mr.py +1 -1
  62. mindspore/mindrecord/tools/cifar10_to_mr.py +1 -1
  63. mindspore/mindrecord/tools/csv_to_mr.py +1 -1
  64. mindspore/mindrecord/tools/imagenet_to_mr.py +1 -1
  65. mindspore/mindrecord/tools/mnist_to_mr.py +1 -1
  66. mindspore/mindrecord/tools/tfrecord_to_mr.py +1 -1
  67. mindspore/mindspore_backend_common.dll +0 -0
  68. mindspore/mindspore_backend_manager.dll +0 -0
  69. mindspore/mindspore_cluster.dll +0 -0
  70. mindspore/mindspore_common.dll +0 -0
  71. mindspore/mindspore_core.dll +0 -0
  72. mindspore/mindspore_cpu.dll +0 -0
  73. mindspore/mindspore_dump.dll +0 -0
  74. mindspore/mindspore_frontend.dll +0 -0
  75. mindspore/mindspore_glog.dll +0 -0
  76. mindspore/mindspore_hardware_abstract.dll +0 -0
  77. mindspore/mindspore_memory_pool.dll +0 -0
  78. mindspore/mindspore_ms_backend.dll +0 -0
  79. mindspore/mindspore_ops.dll +0 -0
  80. mindspore/{mindspore_ops_host.dll → mindspore_ops_cpu.dll} +0 -0
  81. mindspore/mindspore_profiler.dll +0 -0
  82. mindspore/mindspore_pyboost.dll +0 -0
  83. mindspore/mindspore_pynative.dll +0 -0
  84. mindspore/mindspore_runtime_pipeline.dll +0 -0
  85. mindspore/mindspore_runtime_utils.dll +0 -0
  86. mindspore/mindspore_tools.dll +0 -0
  87. mindspore/mint/__init__.py +15 -10
  88. mindspore/mint/distributed/distributed.py +182 -62
  89. mindspore/mint/nn/__init__.py +2 -16
  90. mindspore/mint/nn/functional.py +4 -110
  91. mindspore/mint/nn/layer/__init__.py +0 -2
  92. mindspore/mint/nn/layer/activation.py +0 -6
  93. mindspore/mint/nn/layer/basic.py +0 -47
  94. mindspore/mint/nn/layer/conv.py +4 -4
  95. mindspore/mint/nn/layer/normalization.py +8 -13
  96. mindspore/mint/nn/layer/pooling.py +0 -4
  97. mindspore/nn/__init__.py +1 -3
  98. mindspore/nn/cell.py +16 -66
  99. mindspore/nn/layer/basic.py +49 -1
  100. mindspore/nn/layer/container.py +16 -0
  101. mindspore/nn/layer/embedding.py +4 -169
  102. mindspore/nn/layer/normalization.py +2 -1
  103. mindspore/nn/layer/thor_layer.py +4 -85
  104. mindspore/nn/optim/ada_grad.py +0 -1
  105. mindspore/nn/optim/adafactor.py +0 -1
  106. mindspore/nn/optim/adam.py +31 -124
  107. mindspore/nn/optim/adamax.py +0 -1
  108. mindspore/nn/optim/asgd.py +0 -1
  109. mindspore/nn/optim/ftrl.py +8 -102
  110. mindspore/nn/optim/lamb.py +0 -1
  111. mindspore/nn/optim/lars.py +0 -3
  112. mindspore/nn/optim/lazyadam.py +25 -218
  113. mindspore/nn/optim/momentum.py +5 -43
  114. mindspore/nn/optim/optimizer.py +6 -55
  115. mindspore/nn/optim/proximal_ada_grad.py +0 -1
  116. mindspore/nn/optim/rmsprop.py +0 -1
  117. mindspore/nn/optim/rprop.py +0 -1
  118. mindspore/nn/optim/sgd.py +0 -1
  119. mindspore/nn/optim/tft_wrapper.py +0 -1
  120. mindspore/nn/optim/thor.py +0 -2
  121. mindspore/nn/probability/bijector/bijector.py +7 -8
  122. mindspore/nn/probability/bijector/gumbel_cdf.py +2 -2
  123. mindspore/nn/probability/bijector/power_transform.py +20 -21
  124. mindspore/nn/probability/bijector/scalar_affine.py +5 -5
  125. mindspore/nn/probability/bijector/softplus.py +13 -14
  126. mindspore/nn/wrap/grad_reducer.py +4 -74
  127. mindspore/numpy/array_creations.py +2 -2
  128. mindspore/numpy/fft.py +9 -9
  129. mindspore/{nn/reinforcement → onnx}/__init__.py +5 -8
  130. mindspore/onnx/onnx_export.py +137 -0
  131. mindspore/opencv_core4110.dll +0 -0
  132. mindspore/opencv_imgcodecs4110.dll +0 -0
  133. mindspore/{opencv_imgproc452.dll → opencv_imgproc4110.dll} +0 -0
  134. mindspore/ops/__init__.py +2 -0
  135. mindspore/ops/_grad_experimental/grad_comm_ops.py +38 -2
  136. mindspore/ops/_op_impl/aicpu/__init__.py +0 -10
  137. mindspore/ops/_op_impl/cpu/__init__.py +0 -5
  138. mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +16 -22
  139. mindspore/ops/auto_generate/gen_extend_func.py +2 -7
  140. mindspore/ops/auto_generate/gen_ops_def.py +98 -141
  141. mindspore/ops/auto_generate/gen_ops_prim.py +12708 -12686
  142. mindspore/ops/communication.py +97 -0
  143. mindspore/ops/composite/__init__.py +5 -2
  144. mindspore/ops/composite/base.py +15 -1
  145. mindspore/ops/composite/multitype_ops/__init__.py +3 -1
  146. mindspore/ops/composite/multitype_ops/_compile_utils.py +150 -8
  147. mindspore/ops/composite/multitype_ops/add_impl.py +7 -0
  148. mindspore/ops/composite/multitype_ops/mod_impl.py +27 -0
  149. mindspore/ops/function/__init__.py +1 -0
  150. mindspore/ops/function/array_func.py +14 -12
  151. mindspore/ops/function/comm_func.py +3883 -0
  152. mindspore/ops/function/debug_func.py +3 -4
  153. mindspore/ops/function/math_func.py +45 -54
  154. mindspore/ops/function/nn_func.py +75 -294
  155. mindspore/ops/function/random_func.py +9 -18
  156. mindspore/ops/functional.py +2 -0
  157. mindspore/ops/functional_overload.py +354 -18
  158. mindspore/ops/operations/__init__.py +2 -5
  159. mindspore/ops/operations/_custom_ops_utils.py +7 -9
  160. mindspore/ops/operations/_inner_ops.py +1 -38
  161. mindspore/ops/operations/_rl_inner_ops.py +0 -933
  162. mindspore/ops/operations/array_ops.py +1 -0
  163. mindspore/ops/operations/comm_ops.py +94 -2
  164. mindspore/ops/operations/custom_ops.py +228 -19
  165. mindspore/ops/operations/debug_ops.py +27 -29
  166. mindspore/ops/operations/manually_defined/ops_def.py +27 -306
  167. mindspore/ops/operations/nn_ops.py +2 -2
  168. mindspore/ops/operations/sparse_ops.py +0 -83
  169. mindspore/ops/primitive.py +1 -17
  170. mindspore/ops/tensor_method.py +72 -3
  171. mindspore/ops_generate/aclnn/aclnn_kernel_register_auto_cc_generator.py +5 -5
  172. mindspore/ops_generate/aclnn/gen_aclnn_implement.py +8 -8
  173. mindspore/ops_generate/api/functions_cc_generator.py +53 -4
  174. mindspore/ops_generate/api/tensor_func_reg_cpp_generator.py +25 -11
  175. mindspore/ops_generate/common/gen_constants.py +11 -10
  176. mindspore/ops_generate/common/op_proto.py +18 -1
  177. mindspore/ops_generate/common/template.py +102 -245
  178. mindspore/ops_generate/common/template_utils.py +212 -0
  179. mindspore/ops_generate/gen_custom_ops.py +69 -0
  180. mindspore/ops_generate/op_def/ops_def_cc_generator.py +78 -7
  181. mindspore/ops_generate/op_def_py/base_op_prim_py_generator.py +360 -0
  182. mindspore/ops_generate/op_def_py/custom_op_prim_py_generator.py +140 -0
  183. mindspore/ops_generate/op_def_py/op_def_py_generator.py +54 -7
  184. mindspore/ops_generate/op_def_py/op_prim_py_generator.py +5 -312
  185. mindspore/ops_generate/pyboost/auto_grad_impl_cc_generator.py +74 -17
  186. mindspore/ops_generate/pyboost/auto_grad_reg_cc_generator.py +22 -5
  187. mindspore/ops_generate/pyboost/op_template_parser.py +3 -2
  188. mindspore/ops_generate/pyboost/pyboost_functions_cpp_generator.py +21 -5
  189. mindspore/ops_generate/pyboost/pyboost_functions_h_generator.py +2 -2
  190. mindspore/ops_generate/pyboost/pyboost_functions_impl_cpp_generator.py +30 -10
  191. mindspore/ops_generate/pyboost/pyboost_grad_function_cpp_generator.py +10 -3
  192. mindspore/ops_generate/pyboost/pyboost_internal_kernel_info_adapter_generator.py +1 -1
  193. mindspore/ops_generate/pyboost/pyboost_native_grad_functions_generator.py +19 -9
  194. mindspore/ops_generate/pyboost/pyboost_op_cpp_code_generator.py +71 -28
  195. mindspore/ops_generate/pyboost/pyboost_overload_functions_cpp_generator.py +10 -9
  196. mindspore/ops_generate/pyboost/pyboost_utils.py +27 -16
  197. mindspore/ops_generate/resources/yaml_loader.py +13 -0
  198. mindspore/ops_generate/tensor_py_cc_generator.py +2 -2
  199. mindspore/parallel/_cell_wrapper.py +1 -1
  200. mindspore/parallel/_parallel_serialization.py +1 -4
  201. mindspore/parallel/_utils.py +29 -6
  202. mindspore/parallel/checkpoint_transform.py +18 -2
  203. mindspore/parallel/cluster/process_entity/_api.py +24 -32
  204. mindspore/parallel/cluster/process_entity/_utils.py +9 -5
  205. mindspore/{experimental/llm_boost/atb → parallel/distributed}/__init__.py +21 -23
  206. mindspore/parallel/distributed/distributed_data_parallel.py +393 -0
  207. mindspore/parallel/distributed/flatten_grad_buffer.py +295 -0
  208. mindspore/parallel/strategy.py +336 -0
  209. mindspore/parallel/transform_safetensors.py +117 -16
  210. mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +3 -0
  211. mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +1 -1
  212. mindspore/profiler/common/constant.py +5 -0
  213. mindspore/profiler/common/file_manager.py +9 -0
  214. mindspore/profiler/common/msprof_cmd_tool.py +38 -2
  215. mindspore/profiler/common/path_manager.py +56 -24
  216. mindspore/profiler/common/profiler_context.py +2 -12
  217. mindspore/profiler/common/profiler_info.py +3 -3
  218. mindspore/profiler/common/profiler_path_manager.py +13 -0
  219. mindspore/profiler/common/util.py +30 -3
  220. mindspore/profiler/experimental_config.py +2 -1
  221. mindspore/profiler/platform/npu_profiler.py +33 -6
  222. mindspore/run_check/_check_version.py +108 -24
  223. mindspore/runtime/__init__.py +3 -2
  224. mindspore/runtime/executor.py +11 -3
  225. mindspore/runtime/memory.py +112 -0
  226. mindspore/swresample-4.dll +0 -0
  227. mindspore/swscale-6.dll +0 -0
  228. mindspore/tinyxml2.dll +0 -0
  229. mindspore/{experimental/llm_boost → tools}/__init__.py +5 -5
  230. mindspore/tools/data_dump.py +130 -0
  231. mindspore/tools/sdc_detect.py +91 -0
  232. mindspore/tools/stress_detect.py +63 -0
  233. mindspore/train/__init__.py +6 -6
  234. mindspore/train/_utils.py +5 -18
  235. mindspore/train/amp.py +6 -4
  236. mindspore/train/callback/_checkpoint.py +0 -9
  237. mindspore/train/callback/_train_fault_tolerance.py +69 -18
  238. mindspore/train/data_sink.py +1 -5
  239. mindspore/train/model.py +38 -211
  240. mindspore/train/serialization.py +126 -387
  241. mindspore/turbojpeg.dll +0 -0
  242. mindspore/utils/__init__.py +6 -3
  243. mindspore/utils/dlpack.py +92 -0
  244. mindspore/utils/dryrun.py +1 -1
  245. mindspore/utils/runtime_execution_order_check.py +10 -0
  246. mindspore/utils/sdc_detect.py +14 -12
  247. mindspore/utils/stress_detect.py +43 -0
  248. mindspore/utils/utils.py +144 -8
  249. mindspore/version.py +1 -1
  250. {mindspore-2.7.0.dist-info → mindspore-2.7.1.dist-info}/METADATA +3 -2
  251. {mindspore-2.7.0.dist-info → mindspore-2.7.1.dist-info}/RECORD +254 -267
  252. mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +0 -210
  253. mindspore/experimental/llm_boost/ascend_native/llm_boost.py +0 -52
  254. mindspore/experimental/llm_boost/atb/boost_base.py +0 -385
  255. mindspore/experimental/llm_boost/atb/llama_boost.py +0 -137
  256. mindspore/experimental/llm_boost/atb/qwen_boost.py +0 -124
  257. mindspore/experimental/llm_boost/register.py +0 -130
  258. mindspore/experimental/llm_boost/utils.py +0 -31
  259. mindspore/include/OWNERS +0 -7
  260. mindspore/mindspore_cpu_res_manager.dll +0 -0
  261. mindspore/mindspore_ops_kernel_common.dll +0 -0
  262. mindspore/mindspore_res_manager.dll +0 -0
  263. mindspore/nn/optim/_dist_optimizer_registry.py +0 -111
  264. mindspore/nn/reinforcement/_batch_read_write.py +0 -142
  265. mindspore/nn/reinforcement/_tensors_queue.py +0 -152
  266. mindspore/nn/reinforcement/tensor_array.py +0 -145
  267. mindspore/opencv_core452.dll +0 -0
  268. mindspore/opencv_imgcodecs452.dll +0 -0
  269. mindspore/ops/_op_impl/aicpu/priority_replay_buffer.py +0 -113
  270. mindspore/ops/_op_impl/aicpu/reservoir_replay_buffer.py +0 -96
  271. mindspore/ops/_op_impl/aicpu/sparse_cross.py +0 -42
  272. mindspore/ops/_op_impl/cpu/buffer_append.py +0 -28
  273. mindspore/ops/_op_impl/cpu/buffer_get.py +0 -28
  274. mindspore/ops/_op_impl/cpu/buffer_sample.py +0 -28
  275. mindspore/ops/_op_impl/cpu/priority_replay_buffer.py +0 -42
  276. mindspore/ops/operations/_tensor_array.py +0 -359
  277. mindspore/ops/operations/rl_ops.py +0 -288
  278. mindspore/parallel/_offload_context.py +0 -275
  279. mindspore/parallel/_recovery_context.py +0 -115
  280. mindspore/parallel/_transformer/__init__.py +0 -35
  281. mindspore/parallel/_transformer/layers.py +0 -765
  282. mindspore/parallel/_transformer/loss.py +0 -251
  283. mindspore/parallel/_transformer/moe.py +0 -693
  284. mindspore/parallel/_transformer/op_parallel_config.py +0 -222
  285. mindspore/parallel/_transformer/transformer.py +0 -3124
  286. mindspore/parallel/mpi/_mpi_config.py +0 -116
  287. mindspore/train/memory_profiling_pb2.py +0 -298
  288. {mindspore-2.7.0.dist-info → mindspore-2.7.1.dist-info}/WHEEL +0 -0
  289. {mindspore-2.7.0.dist-info → mindspore-2.7.1.dist-info}/entry_points.txt +0 -0
  290. {mindspore-2.7.0.dist-info → mindspore-2.7.1.dist-info}/top_level.txt +0 -0
@@ -1558,9 +1558,6 @@ def clone(input):
1558
1558
  r"""
1559
1559
  Returns a copy of the input tensor.
1560
1560
 
1561
- .. warning::
1562
- This is an experimental API that is subject to change or deletion.
1563
-
1564
1561
  Note:
1565
1562
  This function is differentiable, and gradients will flow back directly from the calculation
1566
1563
  result of the function to the `input`.
@@ -1939,9 +1936,6 @@ def count_nonzero(input, dim=None):
1939
1936
  r"""
1940
1937
  Count the number of non-zero elements in the Tensor `input` on a given dimension `dim`. If no dim is specified then all non-zeros in the tensor are counted.
1941
1938
 
1942
- .. warning::
1943
- This is an experimental API that is subject to change or deletion.
1944
-
1945
1939
  Args:
1946
1940
  input (Tensor): Input data is used to count non-zero numbers. With shape
1947
1941
  :math:`(*)` where :math:`*` means, any number of additional dimensions.
@@ -2268,6 +2262,13 @@ def dense(input, weight, bias=None):
2268
2262
  return dense_op(input, weight, bias)
2269
2263
 
2270
2264
 
2265
+ def dequant_swiglu_quant(x, weight_scale, activation_scale, bias=None, quant_scale=None, quant_offset=None, group_index=None, activate_left=False, quant_mode='static'):
2266
+ r"""
2267
+
2268
+ """
2269
+ return dequant_swiglu_quant_op(x, weight_scale, activation_scale, bias, quant_scale, quant_offset, group_index, activate_left, quant_mode)
2270
+
2271
+
2271
2272
  def diagonal(input, offset=0, dim1=0, dim2=1):
2272
2273
  r"""
2273
2274
  Returns diagonals of the input tensor along specified dimension.
@@ -2436,9 +2437,6 @@ def dot(input, other):
2436
2437
  r"""
2437
2438
  Computes the dot product of two 1D tensor.
2438
2439
 
2439
- .. warning::
2440
- This is an experimental API that is subject to change or deletion.
2441
-
2442
2440
  Args:
2443
2441
  input (Tensor): The first input in the dot product, must be 1D.
2444
2442
  other (Tensor): The second input in the dot product, must be 1D.
@@ -2573,104 +2571,6 @@ def elu(input_x, alpha=1.0):
2573
2571
  return elu_op(input_x)
2574
2572
 
2575
2573
 
2576
- def embedding_apply_adam_w(var_handle, beta1_power, beta2_power, lr, weight_decay, beta1, beta2, epsilon, grad, keys, max_grad_norm, global_step, embedding_dim, ams_grad=(0,), mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
2577
- r"""
2578
-
2579
- """
2580
- return embedding_apply_adam_w_op(var_handle, beta1_power, beta2_power, lr, weight_decay, beta1, beta2, epsilon, grad, keys, max_grad_norm, global_step, embedding_dim, ams_grad, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
2581
-
2582
-
2583
- def embedding_apply_adam(var_handle, beta1_power, beta2_power, lr, beta1, beta2, epsilon, grad, keys, global_step, embedding_dim, mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
2584
- r"""
2585
-
2586
- """
2587
- return embedding_apply_adam_op(var_handle, beta1_power, beta2_power, lr, beta1, beta2, epsilon, grad, keys, global_step, embedding_dim, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
2588
-
2589
-
2590
- def embedding_apply_ada_grad(var_handle, lr, grad, keys, global_step, embedding_dim, mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
2591
- r"""
2592
-
2593
- """
2594
- return embedding_apply_ada_grad_op(var_handle, lr, grad, keys, global_step, embedding_dim, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
2595
-
2596
-
2597
- def embedding_apply_ftrl(var_handle, lr, lr_power, lambda1, lambda2, grad, keys, global_step, embedding_dim, mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
2598
- r"""
2599
-
2600
- """
2601
- return embedding_apply_ftrl_op(var_handle, lr, lr_power, lambda1, lambda2, grad, keys, global_step, embedding_dim, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
2602
-
2603
-
2604
- def embedding_apply_rmsprop(var_handle, lr, rho, momentum, epsilon, grad, keys, global_step, embedding_dim, mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
2605
- r"""
2606
-
2607
- """
2608
- return embedding_apply_rmsprop_op(var_handle, lr, rho, momentum, epsilon, grad, keys, global_step, embedding_dim, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
2609
-
2610
-
2611
- def embedding_apply_sgd(var_handle, lr, grad, keys, global_step, embedding_dim, mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
2612
- r"""
2613
-
2614
- """
2615
- return embedding_apply_sgd_op(var_handle, lr, grad, keys, global_step, embedding_dim, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
2616
-
2617
-
2618
- def embedding_feature_mapping_export(file_path, table_name, global_step, values, embedding_dim, feature_id, offset_id):
2619
- r"""
2620
-
2621
- """
2622
- return embedding_feature_mapping_export_op(file_path, table_name, global_step, values, embedding_dim, feature_id, offset_id)
2623
-
2624
-
2625
- def embedding_feature_mapping_file_size(file_path, table_name, global_step, embedding_dim, only_offset_flag=True):
2626
- r"""
2627
-
2628
- """
2629
- return embedding_feature_mapping_file_size_op(file_path, table_name, global_step, embedding_dim, only_offset_flag)
2630
-
2631
-
2632
- def embedding_feature_mapping_find(table_name, feature_size, num=1):
2633
- r"""
2634
-
2635
- """
2636
- return embedding_feature_mapping_find_op(table_name, feature_size, num)
2637
-
2638
-
2639
- def embedding_feature_mapping_import(file_path, teble_name, feature_size, global_step, embedding_dim, only_offset_flag=True, num=1):
2640
- r"""
2641
-
2642
- """
2643
- return embedding_feature_mapping_import_op(file_path, teble_name, feature_size, global_step, embedding_dim, only_offset_flag, num)
2644
-
2645
-
2646
- def embedding_feature_mapping_insert(table_name, num, feature_id, offset_id):
2647
- r"""
2648
-
2649
- """
2650
- return embedding_feature_mapping_insert_op(table_name, num, feature_id, offset_id)
2651
-
2652
-
2653
- def embedding_feature_mapping_table_size(table_name):
2654
- r"""
2655
-
2656
- """
2657
- return embedding_feature_mapping_table_size_op(table_name)
2658
-
2659
-
2660
- def embedding_feature_mapping_v2(table_name, feature_id, table_total_size, table_actual_size):
2661
- r"""
2662
-
2663
- """
2664
- return embedding_feature_mapping_v2_op(table_name, feature_id, table_total_size, table_actual_size)
2665
-
2666
-
2667
- def embedding_table_evict(var_handle, global_step, steps_to_live=0):
2668
- r"""
2669
-
2670
- """
2671
- return embedding_table_evict_op(var_handle, global_step, steps_to_live)
2672
-
2673
-
2674
2574
  def equal(input, other):
2675
2575
  r"""
2676
2576
  Compute the equivalence of the two inputs element-wise.
@@ -3521,6 +3421,43 @@ def floor(input):
3521
3421
  return floor_op(input)
3522
3422
 
3523
3423
 
3424
+ def format_cast(input, acl_format):
3425
+ r"""
3426
+ Change tensor format.
3427
+
3428
+ .. warning::
3429
+ FormatCast will not work in the ge backend, origin input will be returned.
3430
+
3431
+ Args:
3432
+ input (Tensor): The input tensor.
3433
+ acl_format (int): enum value of acl format, the valid values are below:
3434
+ - ``0`` NCHW
3435
+ - ``1`` NHWC
3436
+ - ``2`` ND
3437
+ - ``3`` NC1HWC0
3438
+ - ``4`` FRACTAL_Z
3439
+ - ``27`` NDHWC
3440
+ - ``29`` FRACTAL_NZ
3441
+ - ``30`` NCDHW
3442
+ - ``32`` NDC1HWC0
3443
+ - ``33`` FRACTAL_Z_3D
3444
+
3445
+ Returns:
3446
+ Tensor
3447
+
3448
+ Supported Platforms:
3449
+ ``Ascend``
3450
+
3451
+ Examples:
3452
+ >>> import mindspore
3453
+ >>> input = mindspore.ops.randn((2, 3, 4, 5))
3454
+ >>> output = mindspore.ops.format_cast(input, 2)
3455
+ >>> print(output.shape)
3456
+ (2, 3, 4, 5)
3457
+ """
3458
+ return format_cast_op(input, acl_format)
3459
+
3460
+
3524
3461
  def frac_ext(input):
3525
3462
  r"""
3526
3463
  Calculates the fractional part of each element in the input.
@@ -4016,7 +3953,6 @@ def histc_ext(input, bins=100, min=0, max=0):
4016
3953
  Elements lower than min or higher than max are ignored.
4017
3954
 
4018
3955
  .. warning::
4019
- This is an experimental API that is subject to change or deletion.
4020
3956
  If input is int64, valid values fit within int32; exceeding this may cause precision errors.
4021
3957
 
4022
3958
  Args:
@@ -5184,6 +5120,25 @@ def inplace_scatter_add(input, dim, index, src):
5184
5120
  return inplace_scatter_add_op(input, dim, index, src)
5185
5121
 
5186
5122
 
5123
+ def inplace_sigmoid(input):
5124
+ r"""
5125
+ sigmoid_() -> Tensor
5126
+
5127
+ In-place version of sigmoid().
5128
+
5129
+ .. warning::
5130
+ Only supports Ascend.
5131
+ """
5132
+ return inplace_sigmoid_op(input)
5133
+
5134
+
5135
+ def inplace_sign(input):
5136
+ r"""
5137
+
5138
+ """
5139
+ return inplace_sign_op(input)
5140
+
5141
+
5187
5142
  def inplace_silu(input):
5188
5143
  r"""
5189
5144
  Computes Sigmoid Linear Unit of input element-wise. The SiLU function is defined as:
@@ -5500,7 +5455,7 @@ def isinf(input):
5500
5455
  Return a boolean tensor indicating which elements are +/- inifnity.
5501
5456
 
5502
5457
  .. warning::
5503
- - This is an experimental API that is subject to change.
5458
+ - This is an experimental API that is subject to change or deletion.
5504
5459
  - For Ascend, it is only supported on platforms above Atlas A2.
5505
5460
 
5506
5461
  Args:
@@ -7371,11 +7326,18 @@ def nextafter(input, other):
7371
7326
 
7372
7327
  Examples:
7373
7328
  >>> import mindspore
7374
- >>> input = mindspore.tensor([0.0], mindspore.float32)
7375
- >>> other = mindspore.tensor([0.1], mindspore.float32)
7329
+ >>> import numpy as np
7330
+ >>> eps = np.finfo(np.float32).eps
7331
+ >>> input = mindspore.tensor([1.0], mindspore.float32)
7332
+ >>> other = mindspore.tensor([2.0], mindspore.float32)
7376
7333
  >>> output = mindspore.ops.nextafter(input, other)
7377
- >>> print(output)
7378
- [1.e-45]
7334
+ >>> print(output == eps + 1)
7335
+ [ True]
7336
+ >>> input = mindspore.tensor([1.0, 2.0], mindspore.float32)
7337
+ >>> other = mindspore.tensor([2.0, 1.0], mindspore.float32)
7338
+ >>> output = mindspore.ops.nextafter(input, other)
7339
+ >>> print(output == mindspore.tensor([eps + 1, 2 - eps], mindspore.float32))
7340
+ [ True True]
7379
7341
  """
7380
7342
  return next_after_op(input, other)
7381
7343
 
@@ -7429,9 +7391,6 @@ def outer_ext(input, vec2):
7429
7391
  Return outer product of `input` and `vec2`. If `input` is a vector of size :math:`n`
7430
7392
  and `vec2` is a vector of size :math:`m` , then output must be a matrix of shape :math:`(n, m)` .
7431
7393
 
7432
- .. warning::
7433
- This is an experimental API that is subject to change or deletion.
7434
-
7435
7394
  .. note::
7436
7395
  This function does not broadcast.
7437
7396
 
@@ -7678,12 +7637,13 @@ def range(start, end, step, maxlen=1000000):
7678
7637
  Returns a tensor with a step length of `step` in the interval [ `start` , `end` ).
7679
7638
 
7680
7639
  .. note::
7681
- The types of all 3 inputs must be all integers or floating-point numbers.
7640
+ - The types of all 3 inputs must be all integers or floating-point numbers.
7641
+ - When the input is a tensor, the tensor must contain only one element, whose dtype is Number.
7682
7642
 
7683
7643
  Args:
7684
- start (number): The start value of the interval.
7685
- end (number): The end value of the interval.
7686
- step (number): The interval between each value.
7644
+ start (Union[Number, Tensor]): The start value of the interval.
7645
+ end (Union[Number, Tensor]): The end value of the interval.
7646
+ step (Union[Number, Tensor]): The interval between each value.
7687
7647
  maxlen (int, optional): Memory that can fit `maxlen` many elements
7688
7648
  will be allocated for the output. Optional, must be positive. Default: 1000000.
7689
7649
  If the output has more than `maxlen` elements, a runtime error will occur.
@@ -8186,9 +8146,9 @@ def ring_attention_update(prev_attn_out, prev_softmax_max, prev_softmax_sum, cur
8186
8146
  - This is an experimental API that is subject to change or deletion.
8187
8147
  - When `layout` is ``"TND"``, the last dimension of `prev_attn_out` must be a multiple of 64.
8188
8148
  - When `layout` is ``"TND"``, `actual_seq_qlen` is mandatory.
8189
- - When `layout` is ``"TND"``, N x D must satisfy the constraint:
8190
- (AlignUp(NxD, 64)x(DataSizex6+8))+(AlignUp(Nx8, 64)x56) <= 192x1024.
8191
- DataSize is 4 bytes when `prev_attn_out` dtype is float32, 2 bytes when dtype is float16 / bfloat16.
8149
+ - When `layout` is ``"TND"``, N * D must satisfy the constraint:
8150
+ :math:`(\text{AlignUp}(N*D, 64)*(DataSize*6+8))+(\text{AlignUp}(N*8, 64)*56) <= 192*1024`.
8151
+ :math:`DataSize` is 4 bytes when `prev_attn_out` dtype is float32, 2 bytes when dtype is float16 / bfloat16.
8192
8152
  - When `layout` is ``"TND"``, if `actual_seq_qlen` is not a non-decreasing sequence from 0 to T, the result is undefined.
8193
8153
 
8194
8154
  Args:
@@ -9303,14 +9263,13 @@ def stack_ext(tensors, dim=0):
9303
9263
  :math:`(x_1, x_2, ..., x_{dim}, N, x_{dim+1}, ..., x_R)`.
9304
9264
 
9305
9265
  Args:
9306
- tensors (Union[tuple, list]): A Tuple or list of Tensor objects with the same shape and type.
9266
+ tensors (Union[tuple, list]): A Tuple or list of Tensor objects with the same shape.
9307
9267
  dim (int, optional): Dimension to stack. The range is [-(R+1), R+1). Default: ``0`` .
9308
9268
 
9309
9269
  Returns:
9310
- Tensor. A stacked Tensor with the same type as `tensors`.
9270
+ A stacked Tensor.
9311
9271
 
9312
9272
  Raises:
9313
- TypeError: If the data types of elements in `tensors` are not the same.
9314
9273
  ValueError: If `dim` is out of the range [-(R+1), R+1);
9315
9274
  or if the shapes of elements in `tensors` are not the same.
9316
9275
 
@@ -9946,9 +9905,6 @@ def transpose_ext_view(input, dim0, dim1):
9946
9905
  r"""
9947
9906
  Interchange two axes of a tensor.
9948
9907
 
9949
- .. warning::
9950
- This is an experimental API that is subject to change or deletion.
9951
-
9952
9908
  Args:
9953
9909
  input(Tensor): Input tensor.
9954
9910
  dim0 (int): First axis.
@@ -9976,17 +9932,17 @@ def transpose_ext_view(input, dim0, dim1):
9976
9932
  return transpose_ext_view_op(input, dim0, dim1)
9977
9933
 
9978
9934
 
9979
- def transpose(input, input_perm):
9935
+ def transpose(input, dims):
9980
9936
  r"""
9981
9937
  Transpose dimensions of the input tensor according to input permutation.
9982
9938
 
9983
9939
  Note:
9984
- On GPU and CPU, if the value of `input_perm` is negative, its actual value is `input_perm[i] + rank(input)`.
9985
- Negative value of `input_perm` is not supported on Ascend.
9940
+ On GPU and CPU, if the value of `dims` is negative, its actual value is `dims[i] + rank(input)`.
9941
+ Negative value of `dims` is not supported on Ascend.
9986
9942
 
9987
9943
  Args:
9988
9944
  input (Tensor): The input tensor.
9989
- input_perm (tuple[int]): Specify the new axis ordering.
9945
+ dims (Union[tuple[int], list[int]]): Specify the new axis ordering.
9990
9946
 
9991
9947
  Returns:
9992
9948
  Tensor
@@ -10006,7 +9962,7 @@ def transpose(input, input_perm):
10006
9962
  [ 8. 11.]
10007
9963
  [ 9. 12.]]]
10008
9964
  """
10009
- return transpose_op(input, input_perm)
9965
+ return transpose_op(input, dims)
10010
9966
 
10011
9967
 
10012
9968
  def transpose_view(input, input_perm):
@@ -10120,9 +10076,6 @@ def triu(input, diagonal=0):
10120
10076
  r"""
10121
10077
  Zero the input tensor below the diagonal specified.
10122
10078
 
10123
- .. warning::
10124
- This is an experimental API that is subject to change or deletion.
10125
-
10126
10079
  Args:
10127
10080
  input (Tensor): The input tensor.
10128
10081
  diagonal (int, optional): The diagonal specified of 2-D tensor. Default ``0`` represents the main diagonal.
@@ -10557,7 +10510,7 @@ def grouped_matmul_v2(x, weight, bias=None, scale=None, offset=None, antiquant_s
10557
10510
  return grouped_matmul_v2_op(x, weight, bias, scale, offset, antiquant_scale, antiquant_offset, group_list, split_item, group_type)
10558
10511
 
10559
10512
 
10560
- def grouped_matmul_v4(x, weight, bias=None, scale=None, offset=None, antiquant_scale=None, antiquant_offset=None, pre_token_scale=None, group_list=None, activation_input=None, activation_quant_scale=None, activation_quant_offset=None, split_item=0, group_type=-1, group_list_type=0, act_type=0):
10513
+ def grouped_matmul_v4(x, weight, bias=None, scale=None, offset=None, antiquant_scale=None, antiquant_offset=None, pre_token_scale=None, group_list=None, activation_input=None, activation_quant_scale=None, activation_quant_offset=None, split_item=0, group_type=-1, group_list_type=0, act_type=0, output_dtype=None):
10561
10514
  r"""
10562
10515
  Group calculation matmul.
10563
10516
 
@@ -10572,8 +10525,10 @@ def grouped_matmul_v4(x, weight, bias=None, scale=None, offset=None, antiquant_s
10572
10525
  y_i = x_i\times (weight_i + antiquant\_offset_i) * antiquant\_scale_i + bias_i
10573
10526
 
10574
10527
  .. note::
10575
- Only when `bias` , `scale` , `offset` , `antiquant_scale` and `antiquant_offset` are all None, `group_type` is 0,
10576
- and `split_item` is 3, the reverse derivative is supported.
10528
+ - Only when `bias` , `scale` , `offset` , `antiquant_scale` and `antiquant_offset` are all None, `group_type` is 0,
10529
+ and `split_item` is 3, the reverse derivative is supported.
10530
+ - When `x` type is int8 and `weight` type is int4, the `scale` should be of the uint64 data type,
10531
+ but its memory needs to be arranged in float32 format.
10577
10532
 
10578
10533
  ** Per-Token-Quant **
10579
10534
 
@@ -10613,6 +10568,8 @@ def grouped_matmul_v4(x, weight, bias=None, scale=None, offset=None, antiquant_s
10613
10568
  as the cumsum of grouping size in each group, and 1 represents the positions as the grouping size in
10614
10569
  each group. Default: ``0``.
10615
10570
  act_type (int): Activation function type. Currently not supported. Default: ``0``.
10571
+ output_dtype (mindspore.dtype): Specifies the output data type, currently taking effect only when input x is int8 and weight is int4.
10572
+ If None is passed in, bfloat16 will be used by default. Default: ``None``.
10616
10573
 
10617
10574
 
10618
10575
  Parameter limitations 1
@@ -10703,7 +10660,7 @@ def grouped_matmul_v4(x, weight, bias=None, scale=None, offset=None, antiquant_s
10703
10660
  [108 112]
10704
10661
  [108 112]]
10705
10662
  """
10706
- return grouped_matmul_v4_op(x, weight, bias, scale, offset, antiquant_scale, antiquant_offset, pre_token_scale, group_list, activation_input, activation_quant_scale, activation_quant_offset, split_item, group_type, group_list_type, act_type)
10663
+ return grouped_matmul_v4_op(x, weight, bias, scale, offset, antiquant_scale, antiquant_offset, pre_token_scale, group_list, activation_input, activation_quant_scale, activation_quant_offset, split_item, group_type, group_list_type, act_type, output_dtype)
10707
10664
 
10708
10665
 
10709
10666
  def kv_cache_scatter_update(var, indices, updates, axis, reduce='none'):