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

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

Potentially problematic release.


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

Files changed (423) hide show
  1. mindspore/.commit_id +1 -1
  2. mindspore/Third_Party_Open_Source_Software_Notice +0 -1512
  3. mindspore/__init__.py +1 -2
  4. mindspore/_c_dataengine.cpython-39-aarch64-linux-gnu.so +0 -0
  5. mindspore/_c_expression.cpython-39-aarch64-linux-gnu.so +0 -0
  6. mindspore/_c_mindrecord.cpython-39-aarch64-linux-gnu.so +0 -0
  7. mindspore/_checkparam.py +25 -5
  8. mindspore/_extends/graph_kernel/model/graph_parallel.py +1 -1
  9. mindspore/_extends/parse/__init__.py +2 -2
  10. mindspore/_extends/parse/compile_config.py +0 -29
  11. mindspore/_extends/parse/namespace.py +2 -2
  12. mindspore/_extends/parse/parser.py +5 -21
  13. mindspore/_extends/parse/resources.py +7 -5
  14. mindspore/_extends/parse/standard_method.py +59 -40
  15. mindspore/_mindspore_offline_debug.cpython-39-aarch64-linux-gnu.so +0 -0
  16. mindspore/amp.py +5 -26
  17. mindspore/bin/cache_admin +0 -0
  18. mindspore/bin/cache_server +0 -0
  19. mindspore/boost/adasum.py +1 -1
  20. mindspore/boost/base.py +1 -1
  21. mindspore/boost/boost_cell_wrapper.py +1 -1
  22. mindspore/boost/grad_freeze.py +2 -2
  23. mindspore/boost/less_batch_normalization.py +6 -9
  24. mindspore/common/__init__.py +1 -8
  25. mindspore/common/_register_for_tensor.py +9 -8
  26. mindspore/common/api.py +65 -275
  27. mindspore/common/dtype.py +4 -8
  28. mindspore/common/dump.py +5 -2
  29. mindspore/common/jit_config.py +1 -1
  30. mindspore/common/lazy_inline.py +2 -14
  31. mindspore/common/parameter.py +15 -14
  32. mindspore/common/recompute.py +5 -20
  33. mindspore/common/sparse_tensor.py +6 -21
  34. mindspore/common/tensor.py +52 -100
  35. mindspore/communication/__init__.py +11 -6
  36. mindspore/communication/management.py +94 -92
  37. mindspore/context.py +18 -180
  38. mindspore/dataset/engine/datasets.py +46 -69
  39. mindspore/dataset/engine/datasets_user_defined.py +53 -72
  40. mindspore/dataset/engine/datasets_vision.py +2 -2
  41. mindspore/dataset/engine/queue.py +38 -56
  42. mindspore/dataset/engine/validators.py +5 -11
  43. mindspore/dataset/vision/__init__.py +5 -5
  44. mindspore/dataset/vision/c_transforms.py +5 -5
  45. mindspore/dataset/vision/py_transforms_util.py +1 -1
  46. mindspore/dataset/vision/transforms.py +46 -591
  47. mindspore/dataset/vision/utils.py +1 -121
  48. mindspore/dataset/vision/validators.py +3 -9
  49. mindspore/hal/__init__.py +1 -7
  50. mindspore/hal/device.py +1 -1
  51. mindspore/include/api/model.h +0 -3
  52. mindspore/include/dataset/vision.h +2 -54
  53. mindspore/include/mindapi/base/types.h +0 -1
  54. mindspore/lib/libdnnl.so.2 +0 -0
  55. mindspore/lib/libmindspore.so +0 -0
  56. mindspore/lib/libmindspore_backend.so +0 -0
  57. mindspore/lib/libmindspore_common.so +0 -0
  58. mindspore/lib/libmindspore_core.so +0 -0
  59. mindspore/lib/libmindspore_glog.so.0 +0 -0
  60. mindspore/lib/libmindspore_gpr.so.15 +0 -0
  61. mindspore/lib/libmindspore_grpc++.so.1 +0 -0
  62. mindspore/lib/libmindspore_grpc.so.15 +0 -0
  63. mindspore/lib/libmindspore_shared_lib.so +0 -0
  64. mindspore/lib/libmpi_adapter.so +0 -0
  65. mindspore/lib/libmpi_collective.so +0 -0
  66. mindspore/lib/libnnacl.so +0 -0
  67. mindspore/lib/libopencv_core.so.4.5 +0 -0
  68. mindspore/lib/libps_cache.so +0 -0
  69. mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/config/ascend310p/aic-ascend310p-ops-info.json +0 -35
  70. mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/custom_aicore_ops_impl/kv_cache_mgr.py +0 -2
  71. mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/vector_core/tbe/custom_aicore_ops_impl/kv_cache_mgr.py +0 -2
  72. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_cpu_kernels.so +0 -0
  73. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/config/cust_aicpu_kernel.json +0 -72
  74. mindspore/lib/plugin/ascend/custom_aicpu_ops/op_proto/libcust_op_proto.so +0 -0
  75. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/{aclnn_all_finite.h → aclnn_add_custom.h} +11 -9
  76. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/aclnn_decoder_kv_cache.h +1 -1
  77. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/aclnn_prompt_kv_cache.h +1 -1
  78. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/lib/libcust_opapi.so +0 -0
  79. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend310p/aic-ascend310p-ops-info.json +12 -184
  80. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend910/aic-ascend910-ops-info.json +15 -7
  81. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend910b/aic-ascend910b-ops-info.json +15 -7
  82. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/add_custom.cpp +81 -0
  83. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/add_custom.py +134 -0
  84. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/decoder_kv_cache.py +31 -77
  85. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/prompt_kv_cache.py +31 -77
  86. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/op_tiling/lib/linux/aarch64/libcust_opmaster_rt2.0.so +0 -0
  87. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/op_tiling/liboptiling.so +0 -0
  88. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_proto/inc/op_proto.h +5 -4
  89. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_proto/lib/linux/aarch64/libcust_opsproto_rt2.0.so +0 -0
  90. mindspore/lib/plugin/ascend/libascend_collective.so +0 -0
  91. mindspore/lib/plugin/ascend/libdvpp_utils.so +0 -0
  92. mindspore/lib/plugin/ascend/libhccl_plugin.so +0 -0
  93. mindspore/lib/plugin/ascend/liblowlatency_collective.so +0 -0
  94. mindspore/lib/plugin/ascend/libmindspore_cpu_kernels.so +0 -0
  95. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/DeviceBin +0 -0
  96. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/PkgInspect +0 -0
  97. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/op_man +0 -0
  98. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/device/ascend910b/bin/ascend910b.bin +286 -275
  99. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_cann_host.so +0 -0
  100. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_host.so +0 -0
  101. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops.so +0 -0
  102. mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops_static.a +0 -0
  103. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/add/add_impl.h +0 -1
  104. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/apply_rotary_pos_emb_impl.h +0 -1
  105. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/asdop/asd_op_impl.h +0 -3
  106. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/backend_param.h +0 -5
  107. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/cast/cast_tiling.h +45 -1
  108. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/compare/compare_impl.h +0 -1
  109. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/flash_attention_score/flash_attention_score_impl.h +4 -8
  110. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/flash_attention_score/flash_attention_score_tiling.h +4 -11
  111. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/flash_attention_score/kernel/flash_attention_score_mix_hwsync.h +0 -18
  112. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/internal_kernel.h +0 -6
  113. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/internal_rtbackend.h +75 -1
  114. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul/kernel/matmul.h +5 -5
  115. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul/matmul_impl.h +3 -18
  116. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/pp_matmul_common_tiling.h +5 -5
  117. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/pp_matmul_info.h +2 -2
  118. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/tiling_data.h +3 -36
  119. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_stridedslice/kernel/matmul_stridedslice_fusion.h +2 -2
  120. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_stridedslice/matmul_stridedslice_fusion_impl.h +4 -22
  121. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/op_param.h +2 -16
  122. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/kernel/paged_attention_mix_hwsync.h +3 -1
  123. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/paged_attention_impl.h +4 -5
  124. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/paged_attention_tiling.h +4 -9
  125. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/attention_param.h +2 -5
  126. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/matmul_ext_param.h +0 -1
  127. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/matmul_qkv_param.h +4 -10
  128. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/sub_param.h +12 -0
  129. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/rms_norm_impl.h +0 -1
  130. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/sub_impl.h +0 -1
  131. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/tune_repo/matmul_table.h +1 -1
  132. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/backend.h +2 -10
  133. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/elewise_utils.h +1 -5
  134. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log.h +0 -1
  135. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_tiling.h +0 -17
  136. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/math.h +7 -2
  137. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libAdd_impl.so +0 -0
  138. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libSub_impl.so +0 -0
  139. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_layernorm_impl.so +0 -0
  140. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_rms_norm_impl.so +0 -0
  141. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libapply_rotary_pos_emb_impl.so +0 -0
  142. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libcast_impl.so +0 -0
  143. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libgelu_impl.so +0 -0
  144. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_impl.so +0 -0
  145. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_stridedslice_fusion_impl.so +0 -0
  146. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libms_kernels_internal.so +0 -0
  147. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libnot_equal_impl.so +0 -0
  148. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libreshape_and_cache_impl.so +0 -0
  149. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/librms_norm_impl.so +0 -0
  150. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bnsd_full_mix.o +0 -0
  151. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bnsd_tri_mix.o +0 -0
  152. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bsh_full_mix.o +0 -0
  153. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bsh_tri_mix.o +0 -0
  154. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bnsd_full_mix.o +0 -0
  155. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bnsd_tri_mix.o +0 -0
  156. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bsh_full_mix.o +0 -0
  157. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bsh_tri_mix.o +0 -0
  158. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_bf16_bnsd_full_mix.o +0 -0
  159. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_bf16_bsh_full_mix.o +0 -0
  160. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_fp16_bnsd_full_mix.o +0 -0
  161. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_fp16_bsh_full_mix.o +0 -0
  162. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblcal.so +0 -0
  163. mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblccl_wrapper.so +0 -0
  164. mindspore/lib/plugin/libmindspore_ascend.so.2 +0 -0
  165. mindspore/mindrecord/filewriter.py +2 -2
  166. mindspore/mint/__init__.py +40 -720
  167. mindspore/mint/nn/__init__.py +7 -89
  168. mindspore/mint/nn/functional.py +16 -165
  169. mindspore/mint/optim/adamw.py +16 -15
  170. mindspore/nn/__init__.py +2 -0
  171. mindspore/nn/cell.py +98 -97
  172. mindspore/nn/extend/basic.py +2 -2
  173. mindspore/nn/extend/embedding.py +1 -1
  174. mindspore/nn/extend/layer/normalization.py +5 -7
  175. mindspore/nn/generator.py +297 -0
  176. mindspore/nn/layer/activation.py +3 -4
  177. mindspore/nn/layer/basic.py +16 -79
  178. mindspore/nn/layer/conv.py +8 -17
  179. mindspore/nn/layer/embedding.py +4 -1
  180. mindspore/nn/layer/math.py +1 -1
  181. mindspore/nn/layer/normalization.py +1 -1
  182. mindspore/nn/layer/pooling.py +0 -5
  183. mindspore/nn/layer/rnn_cells.py +2 -2
  184. mindspore/nn/loss/loss.py +19 -19
  185. mindspore/nn/optim/adasum.py +1 -1
  186. mindspore/nn/optim/sgd.py +2 -3
  187. mindspore/nn/probability/distribution/exponential.py +1 -1
  188. mindspore/nn/probability/distribution/geometric.py +1 -1
  189. mindspore/nn/probability/distribution/logistic.py +1 -1
  190. mindspore/nn/wrap/cell_wrapper.py +1 -25
  191. mindspore/nn/wrap/loss_scale.py +1 -24
  192. mindspore/numpy/array_ops.py +1 -5
  193. mindspore/numpy/dtypes.py +3 -3
  194. mindspore/numpy/math_ops.py +8 -8
  195. mindspore/ops/__init__.py +1 -1
  196. mindspore/ops/_grad_experimental/grad_comm_ops.py +16 -75
  197. mindspore/ops/_vmap/vmap_array_ops.py +0 -27
  198. mindspore/ops/_vmap/vmap_math_ops.py +1 -29
  199. mindspore/ops/_vmap/vmap_nn_ops.py +18 -19
  200. mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +8 -34
  201. mindspore/ops/auto_generate/gen_arg_dtype_cast.py +9 -2
  202. mindspore/ops/auto_generate/gen_arg_handler.py +0 -26
  203. mindspore/ops/auto_generate/gen_extend_func.py +27 -603
  204. mindspore/ops/auto_generate/gen_ops_def.py +203 -993
  205. mindspore/ops/auto_generate/gen_ops_prim.py +402 -1946
  206. mindspore/ops/auto_generate/pyboost_inner_prim.py +20 -90
  207. mindspore/ops/composite/base.py +6 -3
  208. mindspore/ops/composite/math_ops.py +1 -1
  209. mindspore/ops/composite/multitype_ops/_compile_utils.py +17 -24
  210. mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -1
  211. mindspore/ops/extend/__init__.py +3 -2
  212. mindspore/ops/extend/array_func.py +51 -10
  213. mindspore/ops/extend/nn_func.py +78 -2
  214. mindspore/ops/function/__init__.py +13 -8
  215. mindspore/ops/function/array_func.py +179 -455
  216. mindspore/ops/function/clip_func.py +1 -1
  217. mindspore/ops/function/grad/grad_func.py +3 -3
  218. mindspore/ops/function/math_func.py +103 -117
  219. mindspore/ops/function/nn_func.py +163 -275
  220. mindspore/ops/function/other_func.py +2 -2
  221. mindspore/ops/function/random_func.py +69 -202
  222. mindspore/ops/function/sparse_func.py +4 -4
  223. mindspore/ops/functional.py +327 -332
  224. mindspore/ops/operations/__init__.py +3 -13
  225. mindspore/ops/operations/_grad_ops.py +27 -3
  226. mindspore/ops/operations/_inner_ops.py +356 -53
  227. mindspore/ops/operations/_rl_inner_ops.py +2 -2
  228. mindspore/ops/operations/_tensor_array.py +8 -8
  229. mindspore/ops/operations/array_ops.py +65 -82
  230. mindspore/ops/operations/comm_ops.py +93 -784
  231. mindspore/ops/operations/custom_ops.py +28 -51
  232. mindspore/ops/operations/debug_ops.py +4 -4
  233. mindspore/ops/operations/inner_ops.py +2 -2
  234. mindspore/ops/operations/manually_defined/ops_def.py +4 -304
  235. mindspore/ops/operations/math_ops.py +50 -3
  236. mindspore/ops/operations/nn_ops.py +247 -14
  237. mindspore/ops/operations/other_ops.py +3 -3
  238. mindspore/ops/operations/random_ops.py +1 -1
  239. mindspore/ops/operations/sparse_ops.py +1 -1
  240. mindspore/ops/primitive.py +8 -9
  241. mindspore/ops/silent_check.py +5 -5
  242. mindspore/ops_generate/arg_dtype_cast.py +9 -2
  243. mindspore/ops_generate/arg_handler.py +0 -26
  244. mindspore/ops_generate/gen_aclnn_implement.py +4 -1
  245. mindspore/ops_generate/gen_ops.py +4 -26
  246. mindspore/ops_generate/gen_pyboost_func.py +12 -41
  247. mindspore/ops_generate/gen_utils.py +0 -21
  248. mindspore/ops_generate/pyboost_utils.py +2 -7
  249. mindspore/ops_generate/template.py +0 -1
  250. mindspore/parallel/_auto_parallel_context.py +1 -21
  251. mindspore/parallel/_tensor.py +5 -0
  252. mindspore/parallel/_transformer/transformer.py +1 -1
  253. mindspore/parallel/_utils.py +1 -15
  254. mindspore/parallel/algo_parameter_config.py +3 -1
  255. mindspore/parallel/checkpoint_transform.py +9 -12
  256. mindspore/parallel/cluster/process_entity/_api.py +29 -28
  257. mindspore/parallel/cluster/process_entity/_utils.py +3 -13
  258. mindspore/parallel/cluster/run.py +16 -13
  259. mindspore/parallel/parameter_broadcast.py +2 -2
  260. mindspore/parallel/shard.py +17 -31
  261. mindspore/profiler/__init__.py +2 -3
  262. mindspore/profiler/common/util.py +2 -107
  263. mindspore/profiler/envprofiling.py +1 -1
  264. mindspore/profiler/parser/ascend_analysis/constant.py +21 -8
  265. mindspore/profiler/parser/ascend_analysis/file_manager.py +0 -82
  266. mindspore/profiler/parser/ascend_analysis/function_event.py +28 -43
  267. mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +27 -49
  268. mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +10 -15
  269. mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +20 -25
  270. mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +5 -5
  271. mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +1 -10
  272. mindspore/profiler/parser/ascend_hccl_generator.py +1 -4
  273. mindspore/profiler/parser/ascend_msprof_exporter.py +22 -43
  274. mindspore/profiler/parser/ascend_timeline_generator.py +5 -7
  275. mindspore/profiler/parser/minddata_parser.py +3 -72
  276. mindspore/profiler/profiling.py +59 -176
  277. mindspore/rewrite/api/node.py +1 -1
  278. mindspore/rewrite/common/namespace.py +5 -5
  279. mindspore/rewrite/parsers/assign_parser.py +0 -2
  280. mindspore/rewrite/parsers/class_def_parser.py +4 -8
  281. mindspore/run_check/_check_version.py +1 -1
  282. mindspore/scipy/fft.py +3 -1
  283. mindspore/scipy/linalg.py +3 -2
  284. mindspore/scipy/ops.py +3 -5
  285. mindspore/scipy/optimize/__init__.py +2 -2
  286. mindspore/train/__init__.py +4 -4
  287. mindspore/train/anf_ir_pb2.py +2 -8
  288. mindspore/train/callback/__init__.py +2 -5
  289. mindspore/train/callback/_backup_and_restore.py +2 -2
  290. mindspore/train/callback/_checkpoint.py +16 -104
  291. mindspore/train/callback/_landscape.py +1 -1
  292. mindspore/train/callback/_time_monitor.py +1 -1
  293. mindspore/train/data_sink.py +4 -5
  294. mindspore/train/dataset_helper.py +20 -45
  295. mindspore/train/model.py +38 -266
  296. mindspore/train/serialization.py +105 -256
  297. mindspore/train/summary/_summary_adapter.py +1 -1
  298. mindspore/version.py +1 -1
  299. {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/METADATA +2 -2
  300. {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/RECORD +303 -420
  301. mindspore/_extends/pijit/__init__.py +0 -23
  302. mindspore/_extends/pijit/pijit_func_white_list.py +0 -343
  303. mindspore/common/file_system.py +0 -48
  304. mindspore/common/generator.py +0 -260
  305. mindspore/common/no_inline.py +0 -54
  306. mindspore/common/np_dtype.py +0 -25
  307. mindspore/communication/comm_func.py +0 -1140
  308. mindspore/hal/memory.py +0 -326
  309. mindspore/lib/libavcodec.so.59 +0 -0
  310. mindspore/lib/libavdevice.so.59 +0 -0
  311. mindspore/lib/libavfilter.so.8 +0 -0
  312. mindspore/lib/libavformat.so.59 +0 -0
  313. mindspore/lib/libavutil.so.57 +0 -0
  314. mindspore/lib/libmindspore_np_dtype.so +0 -0
  315. mindspore/lib/libswresample.so.4 +0 -0
  316. mindspore/lib/libswscale.so.6 +0 -0
  317. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/all_finite.cpp +0 -326
  318. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/all_finite.py +0 -180
  319. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_576ceaeef5870c451cab59af55ea46ad.json +0 -58
  320. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_576ceaeef5870c451cab59af55ea46ad.o +0 -0
  321. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_86a73ff6e28d734c96bb8d3054f7dd18.json +0 -58
  322. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_86a73ff6e28d734c96bb8d3054f7dd18.o +0 -0
  323. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_f55e0ebaad1f2f572e43677336992fa0.json +0 -58
  324. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_f55e0ebaad1f2f572e43677336992fa0.o +0 -0
  325. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/config/ascend910b/all_finite.json +0 -109
  326. mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/config/ascend910b/binary_info_config.json +0 -38
  327. mindspore/lib/plugin/ascend/custom_compiler/OWNERS +0 -12
  328. mindspore/lib/plugin/ascend/custom_compiler/setup.py +0 -255
  329. mindspore/lib/plugin/ascend/custom_compiler/start.sh +0 -26
  330. mindspore/lib/plugin/ascend/custom_compiler/template.json +0 -40
  331. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/acme.h +0 -24
  332. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/acme_op.h +0 -69
  333. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/base_type.h +0 -133
  334. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/op_creator.h +0 -32
  335. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/op_param.h +0 -35
  336. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/tiling_info.h +0 -60
  337. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/kernel_register.h +0 -37
  338. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/platform/platform_configs.h +0 -89
  339. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/platform/rt_funcs.h +0 -135
  340. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/add_op.h +0 -34
  341. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_backoff_base.h +0 -62
  342. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_elewise_op.h +0 -33
  343. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_ops.h +0 -88
  344. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_pa_op.h +0 -45
  345. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/cast_op.h +0 -52
  346. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/matmul_op.h +0 -95
  347. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/utils/asd_utils.h +0 -84
  348. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/utils/comm_utils.h +0 -61
  349. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_fp32.h +0 -224
  350. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/and_impl.h +0 -29
  351. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/div_impl.h +0 -29
  352. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/elewise_binary_impl.h +0 -48
  353. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/elewise_binary_tiling.h +0 -25
  354. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/and_kernel.h +0 -46
  355. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/div_kernel.h +0 -46
  356. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/elewise_binary_base.h +0 -260
  357. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/elewise_binary_kernel.h +0 -35
  358. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/max_kernel.h +0 -66
  359. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/min_kernel.h +0 -66
  360. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/mul_kernel.h +0 -66
  361. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/or_kernel.h +0 -46
  362. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/max_impl.h +0 -29
  363. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/min_impl.h +0 -29
  364. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/mul_impl.h +0 -29
  365. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/or_impl.h +0 -29
  366. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/abs_impl.h +0 -29
  367. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/elewise_unary_impl.h +0 -47
  368. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/elewise_unary_tiling.h +0 -24
  369. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/exp_impl.h +0 -29
  370. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/abs_kernel.h +0 -45
  371. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/elewise_unary_base.h +0 -148
  372. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/elewise_unary_kernel.h +0 -31
  373. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/exp_kernel.h +0 -45
  374. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/ln_kernel.h +0 -45
  375. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/not_kernel.h +0 -45
  376. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/reciprocal_kernel.h +0 -45
  377. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/relu_kernel.h +0 -55
  378. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/rsqrt_kernel.h +0 -45
  379. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/sqrt_kernel.h +0 -45
  380. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/ln_impl.h +0 -29
  381. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/not_impl.h +0 -29
  382. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/reciprocal_impl.h +0 -29
  383. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/relu_impl.h +0 -29
  384. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/rsqrt_impl.h +0 -29
  385. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/sqrt_impl.h +0 -29
  386. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/grouped_matmul_impl.h +0 -45
  387. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/grouped_matmul_tiling.h +0 -187
  388. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/kernel/grouped_matmul.h +0 -245
  389. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/kernel/grouped_matmul_interface.h +0 -24
  390. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/kernel/grouped_matmul_utils.h +0 -111
  391. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/tiling_data.h +0 -54
  392. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/compare_param.h +0 -31
  393. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/elewise_param.h +0 -41
  394. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/grouped_matmul_param.h +0 -40
  395. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/profiling_util.h +0 -364
  396. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_utils.h +0 -69
  397. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/register/kernel_creator.h +0 -39
  398. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/register/kernel_registry.h +0 -114
  399. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/utils.h +0 -98
  400. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix.json +0 -19
  401. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix.o +0 -0
  402. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix_mix_aic_0.o +0 -0
  403. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix_mix_aiv_0.o +0 -0
  404. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix.json +0 -19
  405. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix.o +0 -0
  406. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix_mix_aic_0.o +0 -0
  407. mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix_mix_aiv_0.o +0 -0
  408. mindspore/mint/linalg/__init__.py +0 -22
  409. mindspore/nn/layer/embedding_service.py +0 -531
  410. mindspore/nn/layer/embedding_service_layer.py +0 -393
  411. mindspore/ops/function/reshard_func.py +0 -102
  412. mindspore/ops/operations/_infer_ops.py +0 -19
  413. mindspore/ops/operations/reshard_ops.py +0 -53
  414. mindspore/profiler/common/process_pool.py +0 -41
  415. mindspore/profiler/common/singleton.py +0 -28
  416. mindspore/profiler/parser/ascend_integrate_generator.py +0 -42
  417. mindspore/profiler/parser/ascend_memory_generator.py +0 -185
  418. mindspore/train/callback/_cluster_monitor.py +0 -201
  419. mindspore/train/callback/_flops_collector.py +0 -238
  420. mindspore/train/callback/_mindio_ttp.py +0 -443
  421. {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/WHEEL +0 -0
  422. {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/entry_points.txt +0 -0
  423. {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- # Copyright 2019-2024 Huawei Technologies Co., Ltd
1
+ # Copyright 2019-2022 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.
@@ -15,7 +15,6 @@
15
15
  Interpolation Mode, Resampling Filters
16
16
  """
17
17
  from enum import Enum, IntEnum
18
- from fractions import Fraction
19
18
  import numbers
20
19
 
21
20
  import numpy as np
@@ -627,125 +626,6 @@ def read_image(filename, mode=ImageReadMode.UNCHANGED):
627
626
  return cde.read_image(filename, ImageReadMode.to_c_type(mode)).as_array()
628
627
 
629
628
 
630
- def read_video(filename, start_pts=0, end_pts=None, pts_unit="pts"):
631
- """
632
- Read the video, audio, metadata from a video file.
633
-
634
- It supports AVI, H264, H265, MOV, MP4, WMV file formats.
635
-
636
- Args:
637
- filename(str): The path to the video file to be read.
638
- start_pts(Union[float, Fraction, int], optional): The start presentation timestamp of the video. Default: 0.
639
- end_pts(Union[float, Fraction, int], optional): The end presentation timestamp of the video. Default: None.
640
- The None is represented by 2147483647.
641
- pts_unit(str, optional): The unit of the timestamps. It can be any of ["pts", "sec"]. Default: "pts".
642
-
643
- Returns:
644
- - numpy.ndarray, four dimensions uint8 data for video. The format is [T, H, W, C]. `T` is the number of frames,
645
- `H` is the height, `W` is the width, `C` is the channel for RGB.
646
- - numpy.ndarray, two dimensions float for audio. The format is [C, L]. `C` is the number of channels.
647
- `L` is the length of the points in one channel.
648
- - dict, metadata for the video and audio.
649
- It contains video_fps data of type float and audio_fps data of type int.
650
-
651
- Raises:
652
- TypeError: If `filename` is not of type str.
653
- TypeError: If `start_pts` is not of type [float, Fraction, int].
654
- TypeError: If `end_pts` is not of type [float, Fraction, int].
655
- TypeError: If `pts_unit` is not of type str.
656
- RuntimeError: If `filename` does not exist, or not a regular file, or not a supported video file.
657
- ValueError: If `start_pts` is less than 0.
658
- ValueError: If `end_pts` is less than `start_pts`.
659
- ValueError: If `pts_unit` is not in ["pts", "sec"].
660
-
661
- Supported Platforms:
662
- ``CPU``
663
-
664
- Examples:
665
- >>> import mindspore.dataset.vision as vision
666
- >>> video_output, audio_output, metadata_output = vision.read_video("/path/to/file")
667
- """
668
- if not isinstance(filename, str):
669
- raise TypeError("Input filename is not of type {0}, but got: {1}.".format(str, type(filename)))
670
- if not isinstance(start_pts, (float, Fraction, int)):
671
- raise TypeError("Input start_pts is not of type [{0}, {1}, {2}], but got: {3}".format(float, Fraction, int,
672
- type(start_pts)))
673
- if start_pts < 0.0:
674
- err_msg = "Not supported start_pts for " + str(start_pts) + ". The start_pts should be >= 0."
675
- raise ValueError(err_msg)
676
- if end_pts is None:
677
- end_pts = 2147483647.0
678
- if not isinstance(end_pts, (float, Fraction, int)):
679
- raise TypeError("Input end_pts is not of type [{0}, {1}, {2}], but got: {3}".format(float, Fraction, int,
680
- type(end_pts)))
681
- if end_pts < start_pts:
682
- err_msg = "Not supported end_pts for " + str(end_pts) + ". start_pts = " + str(start_pts) + "."
683
- err_msg += " The end_pts should be >= start_pts."
684
- raise ValueError(err_msg)
685
- if not isinstance(pts_unit, str):
686
- raise TypeError("Input pts_unit is not of type {0}, but got: {1}.".format(str, type(pts_unit)))
687
- if pts_unit not in ["pts", "sec"]:
688
- raise ValueError("Not supported pts_unit for " + pts_unit)
689
-
690
- video_output, audio_output, raw_metadata = cde.read_video(filename, float(start_pts), float(end_pts), pts_unit)
691
-
692
- if video_output is not None:
693
- video_output = video_output.as_array()
694
- if audio_output is not None:
695
- audio_output = audio_output.as_array()
696
- metadata_output = {}
697
- for key in raw_metadata:
698
- if key == "video_fps":
699
- metadata_output[key] = float(raw_metadata[key])
700
- continue
701
- if key == "audio_fps":
702
- metadata_output[key] = int(raw_metadata[key])
703
- continue
704
- metadata_output[key] = raw_metadata[key]
705
- return video_output, audio_output, metadata_output
706
-
707
-
708
- def read_video_timestamps(filename, pts_unit="pts"):
709
- """
710
- Read the timestamps and frames per second of a video file.
711
- It supports AVI, H264, H265, MOV, MP4, WMV files.
712
-
713
- Args:
714
- filename(str): The path to the video file to be read.
715
- pts_unit(str, optional): The unit of the timestamps. It can be any of ["pts", "sec"]. Default: "pts".
716
-
717
- Returns:
718
- - list, when `pts_unit` is set to "pts", list[int] is returned, when `pts_unit` is set to "sec",
719
- list[float] is returned.
720
- - float, the frames per second of the video file.
721
-
722
- Raises:
723
- TypeError: If `filename` is not of type str.
724
- TypeError: If `pts_unit` is not of type str.
725
- RuntimeError: If `filename` does not exist, or not a regular file, or not a supported video file.
726
- RuntimeError: If `pts_unit` is not in ["pts", "sec"].
727
-
728
- Supported Platforms:
729
- ``CPU``
730
-
731
- Examples:
732
- >>> import mindspore.dataset.vision as vision
733
- >>> video_timestamps, video_fps = vision.read_video_timestamps("/path/to/file")
734
- """
735
- if not isinstance(filename, str):
736
- raise TypeError("Input filename is not of type {0}, but got: {1}.".format(str, type(filename)))
737
- if not isinstance(pts_unit, str):
738
- raise TypeError("Input pts_unit is not of type {0}, but got: {1}.".format(str, type(pts_unit)))
739
-
740
- video_pts, video_fps, time_base = cde.read_video_timestamps(filename, pts_unit)
741
-
742
- if video_pts == []:
743
- return video_pts, None
744
- if pts_unit == "pts":
745
- return video_pts, video_fps
746
- return [x * time_base for x in video_pts], video_fps
747
-
748
-
749
629
  def write_file(filename, data):
750
630
  """
751
631
  Write the one dimension uint8 data into a file using binary mode.
@@ -59,6 +59,8 @@ def check_affine(method):
59
59
  check_value(shear, [-180, 180], "shear")
60
60
 
61
61
  type_check(resample, (Inter,), "resample")
62
+ if resample in [Inter.ANTIALIAS, Inter.PILCUBIC]:
63
+ raise RuntimeError("Unsupported interpolation, only NEAREST, LINEAR, CUBIC and AREA.")
62
64
 
63
65
  check_fill_value(fill_value)
64
66
 
@@ -286,15 +288,7 @@ def check_erase(method):
286
288
  check_pos_int32(height, "height")
287
289
  check_pos_int32(width, "width")
288
290
  type_check(inplace, (bool,), "inplace")
289
- type_check(value, (float, int, tuple), "value")
290
- if isinstance(value, (float, int)):
291
- value = tuple([value] * 3)
292
- type_check_list(value, (float, int), "value")
293
- if isinstance(value, tuple) and len(value) == 3:
294
- for i, val in enumerate(value):
295
- check_value(val, (UINT8_MIN, UINT8_MAX), "value[{}]".format(i))
296
- else:
297
- raise TypeError("value should be a single integer/float or a 3-tuple.")
291
+ check_fill_value(value)
298
292
 
299
293
  return method(self, *args, **kwargs)
300
294
 
mindspore/hal/__init__.py CHANGED
@@ -24,17 +24,11 @@ from mindspore.hal.device import is_initialized, is_available, device_count, get
24
24
  from mindspore.hal.stream import Stream, synchronize, set_cur_stream, current_stream, default_stream,\
25
25
  StreamCtx
26
26
  from mindspore.hal.event import Event
27
- from mindspore.hal.memory import memory_stats, memory_reserved, max_memory_reserved, empty_cache,\
28
- reset_peak_memory_stats, memory_summary, memory_allocated,\
29
- max_memory_allocated, reset_max_memory_reserved, reset_max_memory_allocated
30
27
 
31
28
  __all__ = [
32
29
  "is_initialized", "is_available", "device_count", "get_device_capability",
33
30
  "get_device_properties", "get_device_name", "get_arch_list",
34
- "Event", "Stream", "synchronize", "set_cur_stream", "current_stream", "default_stream", "StreamCtx",
35
- "memory_stats", "memory_reserved", "max_memory_reserved", "empty_cache", "reset_peak_memory_stats",
36
- "memory_summary", "memory_allocated", "max_memory_allocated", "reset_max_memory_reserved",
37
- "reset_max_memory_allocated"
31
+ "Event", "Stream", "synchronize", "set_cur_stream", "current_stream", "default_stream", "StreamCtx"
38
32
  ]
39
33
 
40
34
  __all__.sort()
mindspore/hal/device.py CHANGED
@@ -152,7 +152,7 @@ def is_initialized(device_target):
152
152
  f"{valid_targets}, but got {device_target}.")
153
153
  _device_context = _device_context_mgr.get_device_context(device_target)
154
154
  if _device_context is None:
155
- logger.info(f"Backend {device_target} is not created yet.")
155
+ logger.warning(f"Backend {device_target} is not created yet.")
156
156
  return False
157
157
  return _device_context.initialized()
158
158
 
@@ -370,9 +370,6 @@ class MS_API Model {
370
370
  /// \return The value of the model info associated with the given key.
371
371
  inline std::string GetModelInfo(const std::string &key);
372
372
 
373
- // release inference resourcec, only used for mindspore_lite's ascend backend now.
374
- Status Finalize();
375
-
376
373
  private:
377
374
  friend class Serialization;
378
375
  // api without std::string
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2020-2024 Huawei Technologies Co., Ltd
2
+ * Copyright 2020-2023 Huawei Technologies Co., Ltd
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
20
20
  #include <map>
21
21
  #include <memory>
22
22
  #include <string>
23
- #include <tuple>
24
23
  #include <utility>
25
24
  #include <vector>
26
25
 
@@ -441,36 +440,6 @@ class DATASET_API CutOut final : public TensorTransform {
441
440
  std::shared_ptr<Data> data_;
442
441
  };
443
442
 
444
- /// \brief Decode the input video.
445
- class DATASET_API DecodeVideo final : public TensorTransform {
446
- public:
447
- /// \brief Constructor. It will decode a vector containing a raw video tensor into a vector containing two tensors.
448
- /// The raw video tensor in the input vector should be 1D array of UINT8.
449
- /// The first tensor in the output vector is a visual tensor, the shape is <T,H,W,C>, the type is DE_UINT8. Pixel
450
- /// order is RGB. The second tensor in the output vector is an audio tensor, the shape is <C, L>.
451
- /// \par Example
452
- /// \code
453
- /// /* Read video file into tensor */
454
- /// mindspore::MSTensor video;
455
- /// ASSERT_OK(mindspore::dataset::vision::ReadFile("/path/to/video/file", &video));
456
- /// std::vector<mindspore::MSTensor> input_tensor;
457
- /// std::vector<mindspore::MSTensor> output_tensor;
458
- /// input_tensor.push_back(video);
459
- /// auto decode_video = vision::DecodeVideo();
460
- /// auto transform = Execute(decode_video);
461
- /// Status rc = transform(input_tensor, &output_tensor);
462
- /// \endcode
463
- DecodeVideo();
464
-
465
- /// \brief Destructor.
466
- ~DecodeVideo() = default;
467
-
468
- protected:
469
- /// \brief The function to convert a TensorTransform object into a TensorOperation object.
470
- /// \return Shared pointer to TensorOperation object.
471
- std::shared_ptr<TensorOperation> Parse() override;
472
- };
473
-
474
443
  /// \brief Encode the image as JPEG data.
475
444
  /// \param[in] image The image to be encoded.
476
445
  /// \param[out] output The Tensor data.
@@ -526,7 +495,7 @@ class DATASET_API Erase final : public TensorTransform {
526
495
  /// std::make_shared<vision::Erase>(10, 10, 10, 10)}, // operations
527
496
  /// {"image"}); // input columns
528
497
  /// \endcode
529
- Erase(int32_t top, int32_t left, int32_t height, int32_t width, const std::vector<float> &value = {0., 0., 0.},
498
+ Erase(int32_t top, int32_t left, int32_t height, int32_t width, const std::vector<uint8_t> &value = {0, 0, 0},
530
499
  bool inplace = false);
531
500
 
532
501
  /// \brief Destructor.
@@ -1717,27 +1686,6 @@ Status DATASET_API ReadFile(const std::string &filename, mindspore::MSTensor *ou
1717
1686
  Status DATASET_API ReadImage(const std::string &filename, mindspore::MSTensor *output,
1718
1687
  ImageReadMode mode = ImageReadMode::kUNCHANGED);
1719
1688
 
1720
- /// \brief Read the video, audio, metadata from a video file. It supports AVI, H264, H265, MOV, MP4, WMV file formats.
1721
- /// \param[in] filename The path to the videoe file to be read.
1722
- /// \param[out] video_output The video frames of the video file.
1723
- /// \param[out] audio_output The audio frames of the video file.
1724
- /// \param[out] metadata_output The metadata contains video_fps, audio_fps.
1725
- /// \param[in] start_pts The start presentation timestamp of the video. Default: 0.0.
1726
- /// \param[in] end_pts The end presentation timestamp of the video. Default: 2147483647.0.
1727
- /// \param[in] pts_unit The unit for the timestamps, can be one of ["pts", "sec"]. Default: "pts".
1728
- /// \return The status code.
1729
- Status DATASET_API ReadVideo(const std::string &filename, mindspore::MSTensor *video_output,
1730
- mindspore::MSTensor *audio_output, std::map<std::string, std::string> *metadata_output,
1731
- float start_pts = 0.0, float end_pts = 2147483647.0, const std::string &pts_unit = "pts");
1732
-
1733
- /// \brief Read the timestamps and frame rate of a video file. It supports AVI, H264, H265, MOV, MP4, WMV files.
1734
- /// \param[in] filename The path to the videoe file to be read.
1735
- /// \param[out] output The tuple(video_timestamps, video_fps) of the video.
1736
- /// \param[in] pts_unit The unit for the timestamps, can be one of ["pts", "sec"]. Default: "pts".
1737
- /// \return The status code.
1738
- Status DATASET_API ReadVideoTimestamps(const std::string &filename, std::tuple<std::vector<float>, float> *output,
1739
- const std::string &pts_unit = "pts");
1740
-
1741
1689
  /// \brief Crop the given image and zoom to the specified size.
1742
1690
  class DATASET_API ResizedCrop final : public TensorTransform {
1743
1691
  public:
@@ -104,7 +104,6 @@ enum Reduction : int64_t {
104
104
  REDUCTION_SUM = 0,
105
105
  MEAN = 1,
106
106
  NONE = 2,
107
- UPDATE = 3,
108
107
  };
109
108
 
110
109
  enum PadMode : int64_t {
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
mindspore/lib/libnnacl.so CHANGED
Binary file
Binary file
Binary file
@@ -89,41 +89,6 @@
89
89
  "paramType":"required"
90
90
  }
91
91
  },
92
- "KVCacheMgr":{
93
- "input0":{
94
- "dtype":"float32, int32, uint32, float16, int16, uint16, int8, uint8",
95
- "format":"ND,ND,ND,ND,ND,ND,ND,ND",
96
- "name":"past",
97
- "paramType":"required"
98
- },
99
- "input1":{
100
- "dtype":"float32, int32, uint32, float16, int16, uint16, int8, uint8",
101
- "format":"ND,ND,ND,ND,ND,ND,ND,ND",
102
- "name":"cur",
103
- "paramType":"required"
104
- },
105
- "input2":{
106
- "dtype":"int32,int32,int32,int32,int32,int32,int32,int32",
107
- "format":"ND,ND,ND,ND,ND,ND,ND,ND",
108
- "name":"index",
109
- "paramType":"required"
110
- },
111
- "needCheckSupport":{
112
- "flag":"true"
113
- },
114
- "opFile":{
115
- "value":"kv_cache_mgr"
116
- },
117
- "opInterface":{
118
- "value":"kv_cache_mgr"
119
- },
120
- "output0":{
121
- "dtype":"float32, int32, uint32, float16, int16, uint16, int8, uint8",
122
- "format":"ND,ND,ND,ND,ND,ND,ND,ND",
123
- "name":"past",
124
- "paramType":"required"
125
- }
126
- },
127
92
  "MatmulTik":{
128
93
  "input0":{
129
94
  "dtype":"int8,uint8,float16",
@@ -180,8 +180,6 @@ class KVCacheImpl(TilingHelper):
180
180
  bs_idx = core_idx * self.each_core_bs_num + each_core_bs_idx
181
181
  # because we fused bs * num_head, we need get the real bs_idx
182
182
  valid_idx.set_as(index_ub[bs_idx // self.num_head])
183
- with self.tik_inst.if_scope(valid_idx >= self.seq_length):
184
- self.tik_inst.tik_continue()
185
183
  with self.tik_inst.if_scope(valid_idx >= 0):
186
184
  dst_offset = bs_idx * dst_bs_stride + valid_idx * self.size_per_head
187
185
  src_offset = each_core_bs_idx * src_bs_stride
@@ -180,8 +180,6 @@ class KVCacheImpl(TilingHelper):
180
180
  bs_idx = core_idx * self.each_core_bs_num + each_core_bs_idx
181
181
  # because we fused bs * num_head, we need get the real bs_idx
182
182
  valid_idx.set_as(index_ub[bs_idx // self.num_head])
183
- with self.tik_inst.if_scope(valid_idx >= self.seq_length):
184
- self.tik_inst.tik_continue()
185
183
  with self.tik_inst.if_scope(valid_idx >= 0):
186
184
  dst_offset = bs_idx * dst_bs_stride + valid_idx * self.size_per_head
187
185
  src_offset = each_core_bs_idx * src_bs_stride
@@ -8029,42 +8029,6 @@
8029
8029
  "type":"DT_FLOAT,DT_FLOAT16,DT_DOUBLE,DT_UINT8,DT_INT8,DT_UINT16,DT_INT16,DT_INT32,DT_UINT32,DT_UINT64,DT_INT64,DT_COMPLEX128,DT_COMPLEX64"
8030
8030
  }
8031
8031
  },
8032
- "CustTopKRouter":{
8033
- "input0":{
8034
- "name":"x",
8035
- "type":"DT_INT32,DT_INT64"
8036
- },
8037
- "input1":{
8038
- "name":"capcity",
8039
- "type":"DT_INT64"
8040
- },
8041
- "input2":{
8042
- "name":"expert_num",
8043
- "type":"DT_INT64"
8044
- },
8045
- "opInfo":{
8046
- "computeCost":"100",
8047
- "engine":"DNN_VM_AICPU",
8048
- "flagAsync":"False",
8049
- "flagPartial":"False",
8050
- "formatAgnostic":"False",
8051
- "functionName":"RunCpuKernel",
8052
- "kernelSo":"libcust_cpu_kernels.so",
8053
- "opKernelLib":"CUSTAICPUKernel",
8054
- "opsFlag":"OPS_FLAG_CLOSE",
8055
- "subTypeOfInferShape":"1",
8056
- "userDefined":"True",
8057
- "workspaceSize":"1024"
8058
- },
8059
- "output0":{
8060
- "name":"dispatch_index",
8061
- "type":"DT_INT32,DT_INT64"
8062
- },
8063
- "output1":{
8064
- "name":"combine_index",
8065
- "type":"DT_INT32,DT_INT64"
8066
- }
8067
- },
8068
8032
  "CustTrace":{
8069
8033
  "input0":{
8070
8034
  "format":"ND",
@@ -13328,42 +13292,6 @@
13328
13292
  "type":"DT_FLOAT,DT_FLOAT16,DT_DOUBLE,DT_UINT8,DT_INT8,DT_UINT16,DT_INT16,DT_INT32,DT_UINT32,DT_UINT64,DT_INT64,DT_COMPLEX128,DT_COMPLEX64"
13329
13293
  }
13330
13294
  },
13331
- "TopKRouter":{
13332
- "input0":{
13333
- "name":"x",
13334
- "type":"DT_INT32,DT_INT64"
13335
- },
13336
- "input1":{
13337
- "name":"capcity",
13338
- "type":"DT_INT64"
13339
- },
13340
- "input2":{
13341
- "name":"expert_num",
13342
- "type":"DT_INT64"
13343
- },
13344
- "opInfo":{
13345
- "computeCost":"100",
13346
- "engine":"DNN_VM_AICPU",
13347
- "flagAsync":"False",
13348
- "flagPartial":"False",
13349
- "formatAgnostic":"False",
13350
- "functionName":"RunCpuKernel",
13351
- "kernelSo":"libcust_cpu_kernels.so",
13352
- "opKernelLib":"CUSTAICPUKernel",
13353
- "opsFlag":"OPS_FLAG_CLOSE",
13354
- "subTypeOfInferShape":"1",
13355
- "userDefined":"True",
13356
- "workspaceSize":"1024"
13357
- },
13358
- "output0":{
13359
- "name":"dispatch_index",
13360
- "type":"DT_INT32,DT_INT64"
13361
- },
13362
- "output1":{
13363
- "name":"combine_index",
13364
- "type":"DT_INT32,DT_INT64"
13365
- }
13366
- },
13367
13295
  "Trace":{
13368
13296
  "input0":{
13369
13297
  "format":"ND",
@@ -3,8 +3,8 @@
3
3
  * calution: this file was generated automaticlly donot change it.
4
4
  */
5
5
 
6
- #ifndef ACLNN_ALL_FINITE_H_
7
- #define ACLNN_ALL_FINITE_H_
6
+ #ifndef ACLNN_ADD_CUSTOM_H_
7
+ #define ACLNN_ADD_CUSTOM_H_
8
8
 
9
9
  #include "aclnn/acl_meta.h"
10
10
 
@@ -12,21 +12,23 @@
12
12
  extern "C" {
13
13
  #endif
14
14
 
15
- /* funtion: aclnnAllFiniteGetWorkspaceSize
15
+ /* funtion: aclnnAddCustomGetWorkspaceSize
16
16
  * parameters :
17
- * gradient : required
17
+ * x : required
18
+ * y : required
18
19
  * out : required
19
20
  * workspaceSize : size of workspace(output).
20
21
  * executor : executor context(output).
21
22
  */
22
23
  __attribute__((visibility("default")))
23
- aclnnStatus aclnnAllFiniteGetWorkspaceSize(
24
- const aclTensor *gradient,
24
+ aclnnStatus aclnnAddCustomGetWorkspaceSize(
25
+ const aclTensor *x,
26
+ const aclTensor *y,
25
27
  const aclTensor *out,
26
28
  uint64_t *workspaceSize,
27
29
  aclOpExecutor **executor);
28
30
 
29
- /* funtion: aclnnAllFinite
31
+ /* funtion: aclnnAddCustom
30
32
  * parameters :
31
33
  * workspace : workspace memory addr(input).
32
34
  * workspaceSize : size of workspace(input).
@@ -34,11 +36,11 @@ aclnnStatus aclnnAllFiniteGetWorkspaceSize(
34
36
  * stream : acl stream.
35
37
  */
36
38
  __attribute__((visibility("default")))
37
- aclnnStatus aclnnAllFinite(
39
+ aclnnStatus aclnnAddCustom(
38
40
  void *workspace,
39
41
  uint64_t workspaceSize,
40
42
  aclOpExecutor *executor,
41
- aclrtStream stream);
43
+ const aclrtStream stream);
42
44
 
43
45
  #ifdef __cplusplus
44
46
  }
@@ -50,7 +50,7 @@ aclnnStatus aclnnDecoderKvCache(
50
50
  void *workspace,
51
51
  uint64_t workspaceSize,
52
52
  aclOpExecutor *executor,
53
- aclrtStream stream);
53
+ const aclrtStream stream);
54
54
 
55
55
  #ifdef __cplusplus
56
56
  }
@@ -50,7 +50,7 @@ aclnnStatus aclnnPromptKvCache(
50
50
  void *workspace,
51
51
  uint64_t workspaceSize,
52
52
  aclOpExecutor *executor,
53
- aclrtStream stream);
53
+ const aclrtStream stream);
54
54
 
55
55
  #ifdef __cplusplus
56
56
  }