mindspore 2.5.0__cp311-cp311-win_amd64.whl → 2.6.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 (493) 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 +6 -4
  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/_check_jit_forbidden_api.py +3 -0
  9. mindspore/_checkparam.py +3 -33
  10. mindspore/_deprecated/__init__.py +17 -0
  11. mindspore/_deprecated/jit.py +198 -0
  12. mindspore/_extends/builtin_operations.py +1 -1
  13. mindspore/_extends/parse/__init__.py +6 -7
  14. mindspore/_extends/parse/compile_config.py +19 -0
  15. mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +22 -3
  16. mindspore/_extends/parse/jit_fallback_modules/__init__.py +0 -0
  17. mindspore/_extends/parse/jit_fallback_modules/check_utils.py +123 -0
  18. mindspore/_extends/parse/jit_fallback_modules/third_party_modules.py +50 -0
  19. mindspore/_extends/parse/parser.py +25 -194
  20. mindspore/_extends/parse/resources.py +1 -5
  21. mindspore/_extends/parse/standard_method.py +109 -75
  22. mindspore/_extends/pijit/__init__.py +2 -2
  23. mindspore/_extends/pijit/pijit_func_white_list.py +16 -11
  24. mindspore/_extends/pijit/tensor_func_list.py +27 -0
  25. mindspore/_extends/utils.py +1 -1
  26. mindspore/amp.py +4 -4
  27. mindspore/atlprov.dll +0 -0
  28. mindspore/avcodec-59.dll +0 -0
  29. mindspore/avdevice-59.dll +0 -0
  30. mindspore/avfilter-8.dll +0 -0
  31. mindspore/avformat-59.dll +0 -0
  32. mindspore/avutil-57.dll +0 -0
  33. mindspore/boost/__init__.py +2 -2
  34. mindspore/boost/base.py +3 -7
  35. mindspore/boost/boost_cell_wrapper.py +2 -2
  36. mindspore/c1.dll +0 -0
  37. mindspore/c1xx.dll +0 -0
  38. mindspore/c2.dll +0 -0
  39. mindspore/common/__init__.py +4 -3
  40. mindspore/common/_grad_function.py +56 -0
  41. mindspore/common/_pijit_context.py +14 -5
  42. mindspore/common/_register_for_tensor.py +1 -1
  43. mindspore/common/_stub_tensor.py +5 -10
  44. mindspore/common/_tensor_cpp_method.py +1 -1
  45. mindspore/common/_tensor_docs.py +2014 -3386
  46. mindspore/common/api.py +386 -355
  47. mindspore/common/auto_dynamic_shape.py +41 -44
  48. mindspore/common/dtype.py +5 -2
  49. mindspore/common/dump.py +7 -5
  50. mindspore/common/file_system.py +3 -0
  51. mindspore/common/generator.py +3 -0
  52. mindspore/common/hook_handle.py +5 -3
  53. mindspore/common/initializer.py +10 -6
  54. mindspore/common/jit_begin_end.py +94 -0
  55. mindspore/common/jit_config.py +6 -1
  56. mindspore/common/jit_context.py +76 -0
  57. mindspore/common/jit_trace.py +378 -0
  58. mindspore/common/lazy_inline.py +2 -2
  59. mindspore/common/mutable.py +5 -4
  60. mindspore/common/parameter.py +106 -39
  61. mindspore/common/seed.py +2 -2
  62. mindspore/common/sparse_tensor.py +23 -17
  63. mindspore/common/tensor.py +332 -714
  64. mindspore/communication/__init__.py +7 -5
  65. mindspore/communication/_comm_helper.py +47 -2
  66. mindspore/communication/comm_func.py +70 -53
  67. mindspore/communication/management.py +83 -17
  68. mindspore/context.py +228 -571
  69. mindspore/dataset/__init__.py +44 -20
  70. mindspore/dataset/audio/__init__.py +2 -8
  71. mindspore/dataset/audio/transforms.py +3 -17
  72. mindspore/dataset/core/config.py +3 -3
  73. mindspore/dataset/engine/cache_client.py +1 -1
  74. mindspore/dataset/engine/datasets.py +102 -120
  75. mindspore/dataset/engine/datasets_audio.py +22 -22
  76. mindspore/dataset/engine/datasets_standard_format.py +43 -24
  77. mindspore/dataset/engine/datasets_text.py +78 -85
  78. mindspore/dataset/engine/datasets_user_defined.py +109 -77
  79. mindspore/dataset/engine/datasets_vision.py +111 -108
  80. mindspore/dataset/engine/iterators.py +5 -3
  81. mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +1 -1
  82. mindspore/dataset/engine/samplers.py +279 -57
  83. mindspore/dataset/engine/serializer_deserializer.py +2 -1
  84. mindspore/dataset/engine/validators.py +10 -0
  85. mindspore/dataset/text/__init__.py +7 -6
  86. mindspore/dataset/text/transforms.py +6 -5
  87. mindspore/dataset/text/utils.py +3 -3
  88. mindspore/dataset/transforms/__init__.py +0 -9
  89. mindspore/dataset/transforms/transforms.py +3 -3
  90. mindspore/dataset/utils/browse_dataset.py +1 -1
  91. mindspore/dataset/vision/__init__.py +2 -9
  92. mindspore/dataset/vision/transforms.py +202 -158
  93. mindspore/dataset/vision/utils.py +7 -5
  94. mindspore/device_context/ascend/op_debug.py +60 -1
  95. mindspore/device_context/ascend/op_tuning.py +0 -4
  96. mindspore/device_manager.py +39 -3
  97. mindspore/dnnl.dll +0 -0
  98. mindspore/dpcmi.dll +0 -0
  99. mindspore/experimental/es/embedding_service.py +35 -27
  100. mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +0 -2
  101. mindspore/experimental/map_parameter.py +4 -4
  102. mindspore/experimental/optim/adadelta.py +22 -26
  103. mindspore/experimental/optim/adagrad.py +4 -4
  104. mindspore/experimental/optim/adam.py +4 -0
  105. mindspore/experimental/optim/adamax.py +4 -4
  106. mindspore/experimental/optim/adamw.py +4 -0
  107. mindspore/experimental/optim/asgd.py +1 -1
  108. mindspore/experimental/optim/lr_scheduler.py +40 -22
  109. mindspore/experimental/optim/radam.py +5 -5
  110. mindspore/experimental/optim/rprop.py +1 -1
  111. mindspore/experimental/optim/sgd.py +1 -1
  112. mindspore/hal/contiguous_tensors_handle.py +6 -10
  113. mindspore/hal/device.py +55 -81
  114. mindspore/hal/event.py +38 -55
  115. mindspore/hal/memory.py +115 -147
  116. mindspore/hal/stream.py +81 -125
  117. mindspore/include/dataset/constants.h +7 -4
  118. mindspore/include/dataset/execute.h +2 -2
  119. mindspore/jpeg62.dll +0 -0
  120. mindspore/log.py +40 -2
  121. mindspore/mindrecord/__init__.py +20 -7
  122. mindspore/mindspore_backend_common.dll +0 -0
  123. mindspore/mindspore_backend_manager.dll +0 -0
  124. mindspore/mindspore_common.dll +0 -0
  125. mindspore/mindspore_core.dll +0 -0
  126. mindspore/mindspore_dump.dll +0 -0
  127. mindspore/mindspore_frontend.dll +0 -0
  128. mindspore/mindspore_glog.dll +0 -0
  129. mindspore/mindspore_memory_pool.dll +0 -0
  130. mindspore/mindspore_ms_backend.dll +0 -0
  131. mindspore/mindspore_ops.dll +0 -0
  132. mindspore/{mindspore_backend.dll → mindspore_ops_host.dll} +0 -0
  133. mindspore/mindspore_ops_kernel_common.dll +0 -0
  134. mindspore/mindspore_profiler.dll +0 -0
  135. mindspore/mindspore_pyboost.dll +0 -0
  136. mindspore/mindspore_pynative.dll +0 -0
  137. mindspore/mindspore_res_manager.dll +0 -0
  138. mindspore/mindspore_runtime_pipeline.dll +0 -0
  139. mindspore/mint/__init__.py +133 -702
  140. mindspore/mint/distributed/__init__.py +5 -1
  141. mindspore/mint/distributed/distributed.py +198 -113
  142. mindspore/mint/linalg/__init__.py +2 -0
  143. mindspore/mint/nn/__init__.py +280 -18
  144. mindspore/mint/nn/functional.py +282 -64
  145. mindspore/mint/nn/layer/__init__.py +4 -0
  146. mindspore/mint/nn/layer/_functions.py +7 -3
  147. mindspore/mint/nn/layer/activation.py +120 -13
  148. mindspore/mint/nn/layer/conv.py +234 -28
  149. mindspore/mint/nn/layer/normalization.py +15 -16
  150. mindspore/mint/nn/layer/padding.py +1 -1
  151. mindspore/mint/nn/layer/pooling.py +66 -1
  152. mindspore/mint/optim/__init__.py +2 -1
  153. mindspore/mint/optim/sgd.py +171 -0
  154. mindspore/msobj140.dll +0 -0
  155. mindspore/mspdb140.dll +0 -0
  156. mindspore/mspdbcore.dll +0 -0
  157. mindspore/mspdbst.dll +0 -0
  158. mindspore/mspft140.dll +0 -0
  159. mindspore/msvcdis140.dll +0 -0
  160. mindspore/msvcp140_1.dll +0 -0
  161. mindspore/msvcp140_2.dll +0 -0
  162. mindspore/msvcp140_atomic_wait.dll +0 -0
  163. mindspore/msvcp140_codecvt_ids.dll +0 -0
  164. mindspore/nn/__init__.py +4 -1
  165. mindspore/nn/cell.py +1253 -179
  166. mindspore/nn/layer/activation.py +23 -21
  167. mindspore/nn/layer/basic.py +22 -16
  168. mindspore/nn/layer/container.py +1 -1
  169. mindspore/nn/layer/conv.py +53 -42
  170. mindspore/nn/layer/embedding.py +9 -8
  171. mindspore/nn/layer/normalization.py +48 -42
  172. mindspore/nn/layer/pooling.py +75 -31
  173. mindspore/nn/layer/transformer.py +11 -10
  174. mindspore/nn/learning_rate_schedule.py +4 -2
  175. mindspore/nn/loss/loss.py +27 -19
  176. mindspore/nn/optim/ada_grad.py +6 -5
  177. mindspore/nn/optim/adadelta.py +9 -7
  178. mindspore/nn/optim/adafactor.py +1 -1
  179. mindspore/nn/optim/adam.py +18 -14
  180. mindspore/nn/optim/adamax.py +8 -7
  181. mindspore/nn/optim/adasum.py +5 -5
  182. mindspore/nn/optim/asgd.py +3 -1
  183. mindspore/nn/optim/ftrl.py +11 -9
  184. mindspore/nn/optim/lamb.py +1 -1
  185. mindspore/nn/optim/lazyadam.py +12 -10
  186. mindspore/nn/optim/momentum.py +7 -6
  187. mindspore/nn/optim/optimizer.py +2 -2
  188. mindspore/nn/optim/proximal_ada_grad.py +12 -10
  189. mindspore/nn/optim/rmsprop.py +13 -12
  190. mindspore/nn/optim/rprop.py +9 -7
  191. mindspore/nn/optim/sgd.py +9 -6
  192. mindspore/nn/optim/tft_wrapper.py +5 -2
  193. mindspore/nn/probability/bijector/bijector.py +17 -11
  194. mindspore/nn/probability/bijector/gumbel_cdf.py +5 -5
  195. mindspore/nn/probability/bijector/invert.py +2 -2
  196. mindspore/nn/probability/bijector/scalar_affine.py +3 -3
  197. mindspore/nn/probability/bijector/softplus.py +3 -2
  198. mindspore/nn/probability/distribution/beta.py +3 -3
  199. mindspore/nn/probability/distribution/categorical.py +1 -1
  200. mindspore/nn/probability/distribution/cauchy.py +4 -2
  201. mindspore/nn/probability/distribution/exponential.py +6 -7
  202. mindspore/nn/probability/distribution/gamma.py +2 -2
  203. mindspore/nn/probability/distribution/gumbel.py +2 -2
  204. mindspore/nn/probability/distribution/half_normal.py +5 -3
  205. mindspore/nn/probability/distribution/logistic.py +5 -3
  206. mindspore/nn/probability/distribution/poisson.py +1 -1
  207. mindspore/nn/probability/distribution/uniform.py +5 -3
  208. mindspore/nn/reinforcement/_tensors_queue.py +1 -1
  209. mindspore/nn/reinforcement/tensor_array.py +1 -1
  210. mindspore/nn/wrap/__init__.py +6 -6
  211. mindspore/nn/wrap/cell_wrapper.py +178 -117
  212. mindspore/nn/wrap/grad_reducer.py +45 -36
  213. mindspore/nn/wrap/loss_scale.py +3 -3
  214. mindspore/numpy/array_creations.py +3 -3
  215. mindspore/numpy/array_ops.py +1 -1
  216. mindspore/numpy/utils.py +1 -2
  217. mindspore/numpy/utils_const.py +1 -2
  218. mindspore/opencv_core452.dll +0 -0
  219. mindspore/opencv_imgcodecs452.dll +0 -0
  220. mindspore/opencv_imgproc452.dll +0 -0
  221. mindspore/ops/__init__.py +3 -2
  222. mindspore/ops/_grad_experimental/grad_comm_ops.py +18 -3
  223. mindspore/ops/_grad_experimental/grad_debug_ops.py +8 -1
  224. mindspore/ops/_grad_experimental/taylor_rule.py +29 -0
  225. mindspore/ops/_register_for_op.py +0 -11
  226. mindspore/{ops_generate → ops/_utils}/arg_dtype_cast.py +123 -4
  227. mindspore/{ops_generate → ops/_utils}/arg_handler.py +3 -4
  228. mindspore/ops/_vmap/vmap_array_ops.py +32 -6
  229. mindspore/ops/_vmap/vmap_grad_nn_ops.py +2 -1
  230. mindspore/ops/_vmap/vmap_math_ops.py +4 -7
  231. mindspore/ops/_vmap/vmap_nn_ops.py +9 -8
  232. mindspore/ops/auto_generate/__init__.py +4 -3
  233. mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +127 -52
  234. mindspore/ops/auto_generate/gen_extend_func.py +286 -208
  235. mindspore/ops/auto_generate/gen_ops_def.py +2783 -2335
  236. mindspore/ops/auto_generate/gen_ops_prim.py +8992 -2686
  237. mindspore/ops/auto_generate/pyboost_inner_prim.py +106 -76
  238. mindspore/ops/composite/__init__.py +2 -1
  239. mindspore/ops/composite/base.py +19 -24
  240. mindspore/ops/composite/math_ops.py +6 -16
  241. mindspore/ops/composite/multitype_ops/__init__.py +5 -2
  242. mindspore/ops/composite/multitype_ops/_compile_utils.py +4 -5
  243. mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -2
  244. mindspore/ops/composite/multitype_ops/add_impl.py +2 -1
  245. mindspore/ops/composite/multitype_ops/bitwise_and_impl.py +2 -1
  246. mindspore/ops/composite/multitype_ops/bitwise_or_impl.py +2 -1
  247. mindspore/ops/composite/multitype_ops/bitwise_xor_impl.py +2 -1
  248. mindspore/ops/composite/multitype_ops/div_impl.py +6 -4
  249. mindspore/ops/composite/multitype_ops/equal_impl.py +4 -3
  250. mindspore/ops/composite/multitype_ops/floordiv_impl.py +2 -1
  251. mindspore/ops/composite/multitype_ops/getitem_impl.py +3 -2
  252. mindspore/ops/composite/multitype_ops/greater_equal_impl.py +4 -3
  253. mindspore/ops/composite/multitype_ops/greater_impl.py +4 -3
  254. mindspore/ops/composite/multitype_ops/in_impl.py +2 -1
  255. mindspore/ops/composite/multitype_ops/invert_impl.py +50 -0
  256. mindspore/ops/composite/multitype_ops/left_shift_impl.py +2 -1
  257. mindspore/ops/composite/multitype_ops/less_equal_impl.py +4 -3
  258. mindspore/ops/composite/multitype_ops/less_impl.py +4 -3
  259. mindspore/ops/composite/multitype_ops/logic_not_impl.py +3 -2
  260. mindspore/ops/composite/multitype_ops/logical_and_impl.py +2 -1
  261. mindspore/ops/composite/multitype_ops/logical_or_impl.py +2 -1
  262. mindspore/ops/composite/multitype_ops/mod_impl.py +2 -1
  263. mindspore/ops/composite/multitype_ops/mul_impl.py +3 -2
  264. mindspore/ops/composite/multitype_ops/negative_impl.py +2 -1
  265. mindspore/ops/composite/multitype_ops/not_equal_impl.py +2 -1
  266. mindspore/ops/composite/multitype_ops/not_in_impl.py +2 -1
  267. mindspore/ops/composite/multitype_ops/ones_like_impl.py +18 -0
  268. mindspore/ops/composite/multitype_ops/pow_impl.py +2 -1
  269. mindspore/ops/composite/multitype_ops/right_shift_impl.py +2 -1
  270. mindspore/ops/composite/multitype_ops/setitem_impl.py +2 -1
  271. mindspore/ops/composite/multitype_ops/sub_impl.py +2 -1
  272. mindspore/ops/function/__init__.py +28 -2
  273. mindspore/ops/function/_add_attr_func.py +58 -0
  274. mindspore/ops/function/array_func.py +1631 -2347
  275. mindspore/ops/function/clip_func.py +38 -45
  276. mindspore/ops/function/debug_func.py +36 -44
  277. mindspore/ops/function/grad/__init__.py +1 -0
  278. mindspore/ops/function/grad/grad_func.py +104 -71
  279. mindspore/ops/function/image_func.py +1 -1
  280. mindspore/ops/function/linalg_func.py +46 -78
  281. mindspore/ops/function/math_func.py +3024 -3855
  282. mindspore/ops/function/nn_func.py +678 -274
  283. mindspore/ops/function/other_func.py +159 -1
  284. mindspore/ops/function/parameter_func.py +17 -30
  285. mindspore/ops/function/random_func.py +216 -361
  286. mindspore/ops/function/reshard_func.py +4 -70
  287. mindspore/ops/function/sparse_func.py +3 -3
  288. mindspore/ops/function/sparse_unary_func.py +5 -5
  289. mindspore/ops/function/spectral_func.py +25 -58
  290. mindspore/ops/function/vmap_func.py +26 -18
  291. mindspore/ops/functional.py +8 -5
  292. mindspore/ops/functional_overload.py +655 -4
  293. mindspore/ops/op_info_register.py +32 -244
  294. mindspore/ops/operations/__init__.py +21 -14
  295. mindspore/ops/operations/_custom_ops_utils.py +235 -0
  296. mindspore/ops/operations/_grad_ops.py +1 -10
  297. mindspore/ops/operations/_inner_ops.py +5 -76
  298. mindspore/ops/operations/_ms_kernel.py +4 -10
  299. mindspore/ops/operations/_rl_inner_ops.py +1 -1
  300. mindspore/ops/operations/_scalar_ops.py +3 -2
  301. mindspore/ops/operations/_sequence_ops.py +1 -1
  302. mindspore/ops/operations/_tensor_array.py +1 -1
  303. mindspore/ops/operations/array_ops.py +39 -24
  304. mindspore/ops/operations/comm_ops.py +150 -107
  305. mindspore/ops/operations/custom_ops.py +287 -32
  306. mindspore/ops/operations/debug_ops.py +119 -16
  307. mindspore/ops/operations/inner_ops.py +1 -1
  308. mindspore/ops/operations/linalg_ops.py +1 -58
  309. mindspore/ops/operations/manually_defined/_inner.py +1 -1
  310. mindspore/ops/operations/manually_defined/ops_def.py +746 -79
  311. mindspore/ops/operations/math_ops.py +21 -18
  312. mindspore/ops/operations/nn_ops.py +67 -224
  313. mindspore/ops/operations/other_ops.py +62 -9
  314. mindspore/ops/operations/random_ops.py +13 -7
  315. mindspore/ops/operations/reshard_ops.py +1 -1
  316. mindspore/ops/operations/sparse_ops.py +2 -2
  317. mindspore/ops/primitive.py +43 -32
  318. mindspore/ops/tensor_method.py +243 -17
  319. mindspore/ops_generate/__init__.py +0 -5
  320. mindspore/ops_generate/aclnn/__init__.py +0 -0
  321. mindspore/ops_generate/{aclnn_kernel_register_auto_cc_generator.py → aclnn/aclnn_kernel_register_auto_cc_generator.py} +43 -18
  322. mindspore/ops_generate/{gen_aclnn_implement.py → aclnn/gen_aclnn_implement.py} +49 -51
  323. mindspore/ops_generate/api/__init__.py +0 -0
  324. mindspore/ops_generate/{add_tensor_docs_generator.py → api/add_tensor_docs_generator.py} +9 -7
  325. mindspore/ops_generate/{cpp_create_prim_instance_helper_generator.py → api/cpp_create_prim_instance_helper_generator.py} +6 -9
  326. mindspore/ops_generate/{functional_map_cpp_generator.py → api/functional_map_cpp_generator.py} +25 -12
  327. mindspore/ops_generate/{functional_overload_py_generator.py → api/functional_overload_py_generator.py} +8 -6
  328. mindspore/ops_generate/{functions_cc_generator.py → api/functions_cc_generator.py} +14 -10
  329. mindspore/ops_generate/api/gen_api.py +103 -0
  330. mindspore/ops_generate/{op_api_proto.py → api/op_api_proto.py} +98 -69
  331. mindspore/ops_generate/{tensor_func_reg_cpp_generator.py → api/tensor_func_reg_cpp_generator.py} +82 -43
  332. mindspore/ops_generate/common/__init__.py +0 -0
  333. mindspore/ops_generate/common/gen_constants.py +91 -0
  334. mindspore/ops_generate/{gen_utils.py → common/gen_utils.py} +72 -19
  335. mindspore/ops_generate/{op_proto.py → common/op_proto.py} +64 -1
  336. mindspore/ops_generate/{template.py → common/template.py} +96 -84
  337. mindspore/ops_generate/gen_ops.py +23 -325
  338. mindspore/ops_generate/op_def/__init__.py +0 -0
  339. mindspore/ops_generate/op_def/gen_op_def.py +90 -0
  340. mindspore/ops_generate/{lite_ops_cpp_generator.py → op_def/lite_ops_cpp_generator.py} +47 -11
  341. mindspore/ops_generate/{ops_def_cc_generator.py → op_def/ops_def_cc_generator.py} +18 -10
  342. mindspore/ops_generate/{ops_def_h_generator.py → op_def/ops_def_h_generator.py} +5 -5
  343. mindspore/ops_generate/{ops_name_h_generator.py → op_def/ops_name_h_generator.py} +30 -15
  344. mindspore/ops_generate/op_def/ops_primitive_h_generator.py +125 -0
  345. mindspore/ops_generate/op_def_py/__init__.py +0 -0
  346. mindspore/ops_generate/op_def_py/gen_op_def_py.py +47 -0
  347. mindspore/ops_generate/{op_def_py_generator.py → op_def_py/op_def_py_generator.py} +6 -5
  348. mindspore/ops_generate/{op_prim_py_generator.py → op_def_py/op_prim_py_generator.py} +24 -15
  349. mindspore/ops_generate/pyboost/__init__.py +0 -0
  350. mindspore/ops_generate/{auto_grad_impl_cc_generator.py → pyboost/auto_grad_impl_cc_generator.py} +11 -7
  351. mindspore/ops_generate/{auto_grad_reg_cc_generator.py → pyboost/auto_grad_reg_cc_generator.py} +7 -7
  352. mindspore/ops_generate/{gen_pyboost_func.py → pyboost/gen_pyboost_func.py} +40 -16
  353. mindspore/ops_generate/{op_template_parser.py → pyboost/op_template_parser.py} +105 -24
  354. mindspore/ops_generate/{pyboost_functions_cpp_generator.py → pyboost/pyboost_functions_cpp_generator.py} +55 -18
  355. mindspore/ops_generate/{pyboost_functions_h_generator.py → pyboost/pyboost_functions_h_generator.py} +42 -10
  356. mindspore/ops_generate/{pyboost_functions_py_generator.py → pyboost/pyboost_functions_py_generator.py} +6 -6
  357. mindspore/ops_generate/{pyboost_grad_function_cpp_generator.py → pyboost/pyboost_grad_function_cpp_generator.py} +11 -10
  358. mindspore/ops_generate/{pyboost_inner_prim_generator.py → pyboost/pyboost_inner_prim_generator.py} +8 -7
  359. mindspore/ops_generate/{pyboost_native_grad_functions_generator.py → pyboost/pyboost_native_grad_functions_generator.py} +14 -10
  360. mindspore/ops_generate/{pyboost_op_cpp_code_generator.py → pyboost/pyboost_op_cpp_code_generator.py} +140 -53
  361. mindspore/ops_generate/{pyboost_overload_functions_cpp_generator.py → pyboost/pyboost_overload_functions_cpp_generator.py} +28 -15
  362. mindspore/ops_generate/{pyboost_utils.py → pyboost/pyboost_utils.py} +88 -4
  363. mindspore/ops_generate/resources/__init__.py +0 -0
  364. mindspore/ops_generate/resources/resource_list.py +30 -0
  365. mindspore/ops_generate/resources/resource_loader.py +36 -0
  366. mindspore/ops_generate/resources/resource_manager.py +64 -0
  367. mindspore/ops_generate/resources/yaml_loader.py +88 -0
  368. mindspore/ops_generate/tensor_py_cc_generator.py +122 -0
  369. mindspore/parallel/__init__.py +6 -2
  370. mindspore/parallel/_auto_parallel_context.py +140 -12
  371. mindspore/parallel/_cell_wrapper.py +132 -15
  372. mindspore/parallel/_parallel_serialization.py +95 -4
  373. mindspore/parallel/_ps_context.py +1 -1
  374. mindspore/parallel/_recovery_context.py +7 -2
  375. mindspore/parallel/_tensor.py +142 -18
  376. mindspore/parallel/_utils.py +198 -25
  377. mindspore/parallel/algo_parameter_config.py +3 -3
  378. mindspore/parallel/auto_parallel.py +732 -0
  379. mindspore/parallel/checkpoint_convert.py +159 -0
  380. mindspore/parallel/checkpoint_transform.py +658 -37
  381. mindspore/parallel/cluster/process_entity/_api.py +151 -19
  382. mindspore/parallel/cluster/run.py +1 -1
  383. mindspore/parallel/function/__init__.py +24 -0
  384. mindspore/parallel/function/reshard_func.py +258 -0
  385. mindspore/parallel/nn/__init__.py +25 -0
  386. mindspore/parallel/nn/parallel_cell_wrapper.py +263 -0
  387. mindspore/parallel/nn/parallel_grad_reducer.py +169 -0
  388. mindspore/parallel/parameter_broadcast.py +24 -13
  389. mindspore/parallel/shard.py +137 -62
  390. mindspore/parallel/transform_safetensors.py +288 -95
  391. mindspore/pgodb140.dll +0 -0
  392. mindspore/pgort140.dll +0 -0
  393. mindspore/profiler/__init__.py +9 -5
  394. mindspore/profiler/analysis/parser/ascend_cann_parser.py +6 -2
  395. mindspore/profiler/analysis/parser/ms_framework_parser.py +4 -4
  396. mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +7 -4
  397. mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +25 -0
  398. mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +3 -3
  399. mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +241 -86
  400. mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +41 -2
  401. mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +33 -35
  402. mindspore/profiler/analysis/viewer/ascend_memory_viewer.py +7 -0
  403. mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +8 -3
  404. mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +141 -30
  405. mindspore/profiler/analysis/viewer/ms_dataset_viewer.py +5 -6
  406. mindspore/profiler/common/ascend_msprof_exporter.py +5 -4
  407. mindspore/profiler/common/constant.py +12 -0
  408. mindspore/profiler/common/msprof_cmd_tool.py +42 -23
  409. mindspore/profiler/common/path_manager.py +24 -0
  410. mindspore/profiler/common/profiler_context.py +26 -2
  411. mindspore/profiler/common/profiler_meta_data.py +74 -0
  412. mindspore/profiler/common/profiler_parameters.py +59 -18
  413. mindspore/profiler/common/profiler_path_manager.py +66 -7
  414. mindspore/profiler/dynamic_profiler.py +112 -79
  415. mindspore/profiler/envprofiler.py +26 -1
  416. mindspore/profiler/experimental_config.py +197 -0
  417. mindspore/profiler/mstx.py +57 -14
  418. mindspore/profiler/platform/npu_profiler.py +33 -7
  419. mindspore/profiler/profiler.py +541 -45
  420. mindspore/profiler/profiler_action_controller.py +1 -1
  421. mindspore/profiler/profiler_interface.py +4 -0
  422. mindspore/profiler/schedule.py +57 -22
  423. mindspore/rewrite/api/node.py +15 -13
  424. mindspore/rewrite/api/symbol_tree.py +1 -1
  425. mindspore/run_check/_check_version.py +25 -14
  426. mindspore/run_check/run_check.py +1 -1
  427. mindspore/runtime/__init__.py +2 -2
  428. mindspore/runtime/executor.py +40 -11
  429. mindspore/runtime/memory.py +37 -13
  430. mindspore/safeguard/rewrite_obfuscation.py +12 -9
  431. mindspore/swresample-4.dll +0 -0
  432. mindspore/swscale-6.dll +0 -0
  433. mindspore/tbbmalloc.dll +0 -0
  434. mindspore/tinyxml2.dll +0 -0
  435. mindspore/train/__init__.py +8 -8
  436. mindspore/train/_utils.py +43 -9
  437. mindspore/train/amp.py +1 -1
  438. mindspore/train/callback/__init__.py +2 -2
  439. mindspore/train/callback/_callback.py +2 -16
  440. mindspore/train/callback/_checkpoint.py +24 -40
  441. mindspore/train/callback/_cluster_monitor.py +14 -18
  442. mindspore/train/callback/_flops_collector.py +2 -3
  443. mindspore/train/callback/_history.py +7 -4
  444. mindspore/train/callback/_lambda_callback.py +2 -2
  445. mindspore/train/callback/_landscape.py +0 -3
  446. mindspore/train/callback/_loss_monitor.py +2 -1
  447. mindspore/train/callback/_on_request_exit.py +6 -5
  448. mindspore/train/callback/_reduce_lr_on_plateau.py +11 -6
  449. mindspore/train/callback/_summary_collector.py +8 -13
  450. mindspore/train/callback/_time_monitor.py +2 -1
  451. mindspore/train/callback/{_tft_register.py → _train_fault_tolerance.py} +204 -105
  452. mindspore/train/data_sink.py +25 -2
  453. mindspore/train/dataset_helper.py +4 -5
  454. mindspore/train/loss_scale_manager.py +8 -7
  455. mindspore/train/metrics/accuracy.py +3 -3
  456. mindspore/train/metrics/confusion_matrix.py +9 -9
  457. mindspore/train/metrics/error.py +3 -3
  458. mindspore/train/metrics/hausdorff_distance.py +4 -4
  459. mindspore/train/metrics/mean_surface_distance.py +3 -3
  460. mindspore/train/metrics/metric.py +0 -12
  461. mindspore/train/metrics/occlusion_sensitivity.py +4 -2
  462. mindspore/train/metrics/precision.py +8 -6
  463. mindspore/train/metrics/recall.py +9 -9
  464. mindspore/train/metrics/root_mean_square_surface_distance.py +2 -2
  465. mindspore/train/mind_ir_pb2.py +19 -12
  466. mindspore/train/model.py +262 -127
  467. mindspore/train/serialization.py +246 -988
  468. mindspore/train/summary/_summary_adapter.py +2 -2
  469. mindspore/train/summary/summary_record.py +1 -1
  470. mindspore/turbojpeg.dll +0 -0
  471. mindspore/utils/__init__.py +3 -2
  472. mindspore/utils/dryrun.py +4 -2
  473. mindspore/utils/hooks.py +81 -0
  474. mindspore/utils/runtime_execution_order_check.py +2 -0
  475. mindspore/utils/utils.py +138 -4
  476. mindspore/vcmeta.dll +0 -0
  477. mindspore/vcruntime140.dll +0 -0
  478. mindspore/vcruntime140_1.dll +0 -0
  479. mindspore/version.py +1 -1
  480. {mindspore-2.5.0.dist-info → mindspore-2.6.0.dist-info}/METADATA +2 -1
  481. {mindspore-2.5.0.dist-info → mindspore-2.6.0.dist-info}/RECORD +485 -440
  482. mindspore/_install_custom.py +0 -43
  483. mindspore/common/_register_for_adapter.py +0 -74
  484. mindspore/ops/auto_generate/gen_arg_dtype_cast.py +0 -252
  485. mindspore/ops/auto_generate/gen_arg_handler.py +0 -136
  486. mindspore/ops/operations/_opaque_predicate_registry.py +0 -41
  487. mindspore/ops_generate/gen_constants.py +0 -190
  488. mindspore/ops_generate/gen_ops_inner_prim.py +0 -131
  489. mindspore/ops_generate/ops_primitive_h_generator.py +0 -81
  490. /mindspore/ops_generate/{base_generator.py → common/base_generator.py} +0 -0
  491. {mindspore-2.5.0.dist-info → mindspore-2.6.0.dist-info}/WHEEL +0 -0
  492. {mindspore-2.5.0.dist-info → mindspore-2.6.0.dist-info}/entry_points.txt +0 -0
  493. {mindspore-2.5.0.dist-info → mindspore-2.6.0.dist-info}/top_level.txt +0 -0
mindspore/context.py CHANGED
@@ -335,8 +335,8 @@ class _Context:
335
335
  default not enabled, only supports ``"oom"`` currently.
336
336
  ``"oom"``: Detect memory out of bounds.
337
337
  - ge_options (dict): Global or session CANN options.
338
- - exception_dump (str): Enable exception dump for Ascend operators. ``"0"`` , ``"1"`` and ``"2"``.
339
- Default: ``"2"`` .
338
+ - exception_dump (str): Has been deprecated since MindSpore 2.6. Please use
339
+ api :func:`mindspore.device_context.ascend.op_debug.aclinit_config` instead.
340
340
  - parallel_speed_up_json_path(Union[str, None]): The path to the parallel speed up json file.
341
341
  If its value is None or '', it does not take effect. Default None.
342
342
  - host_scheduling_max_threshold(int): The host scheduling max threshold.
@@ -370,7 +370,7 @@ class _Context:
370
370
  'atomic_clean_policy': self._get_ascend_config_setter('atomic_clean_policy', str),
371
371
  'matmul_allow_hf32': self._get_ascend_config_setter('matmul_allow_hf32', lambda v: "1" if v else "0"),
372
372
  'conv_allow_hf32': self._get_ascend_config_setter('conv_allow_hf32', lambda v: "1" if v else "0"),
373
- 'exception_dump': self._get_ascend_config_setter('exception_dump'),
373
+ 'exception_dump': lambda x: x,
374
374
  'op_debug_option': self._set_op_debug_option,
375
375
  'op_precision_mode': self._set_op_precision_mode,
376
376
  'ge_options': self._set_ge_options,
@@ -383,11 +383,24 @@ class _Context:
383
383
  'hccl_watchdog': self._set_hccl_watchdog,
384
384
  'topo_order': self._set_topo_order
385
385
  }
386
+ invalid_context_dict = {
387
+ 'exception_dump': {'version': '2.6', 'interface': 'device_context.ascend.op_debug.aclinit_config()'}
388
+ }
386
389
  ascend_cfg_set = tuple(ascend_cfg_modes.keys())
387
390
  for ascend_key, ascend_value in ascend_config.items():
388
391
  if ascend_key not in ascend_cfg_set:
389
392
  raise ValueError(f"For 'context.set_context', the key of argument 'ascend_config' must be one of "
390
393
  f"{ascend_cfg_set}, but got {ascend_key}.")
394
+ if ascend_key in invalid_context_dict:
395
+ key = invalid_context_dict.get(ascend_key)
396
+ deprecated_version, new_interface = key.get('version'), key.get('interface')
397
+ log = (
398
+ f"For 'ascend_config', the parameter '{ascend_key}' has been removed"
399
+ f" since MindSpore {deprecated_version} version."
400
+ )
401
+ if new_interface:
402
+ log += f" Please use the {new_interface} instead."
403
+ raise ValueError(log)
391
404
  supported_modes = ascend_cfg_modes.get(ascend_key)
392
405
  if isinstance(supported_modes, list) and ascend_value not in supported_modes:
393
406
  raise ValueError(f"For 'ascend_config', the value of argument {ascend_key} must be one of "
@@ -836,14 +849,22 @@ class _Context:
836
849
  f"'parallel_speed_up_json_path' is correct.")
837
850
  try:
838
851
  valid_option = {"recompute_comm_overlap": (ms_ctx_param.recompute_comm_overlap, bool),
852
+ "recomputation_communication_overlap": (ms_ctx_param.recompute_comm_overlap, bool),
839
853
  "matmul_grad_comm_overlap": (ms_ctx_param.matmul_grad_comm_overlap, bool),
854
+ "grad_matmul_communication_overlap": (ms_ctx_param.matmul_grad_comm_overlap, bool),
840
855
  "enable_task_opt": (ms_ctx_param.enable_task_opt, bool),
856
+ "enable_communication_fusion": (ms_ctx_param.enable_task_opt, bool),
841
857
  "enable_grad_comm_opt": (ms_ctx_param.enable_grad_comm_opt, bool),
858
+ "grad_computation_allreduce_overlap": (ms_ctx_param.enable_grad_comm_opt, bool),
842
859
  "recompute_allgather_overlap_fagrad":
843
860
  (ms_ctx_param.recompute_allgather_overlap_fagrad, bool),
861
+ "grad_fa_allgather_overlap":
862
+ (ms_ctx_param.recompute_allgather_overlap_fagrad, bool),
844
863
  "interleaved_matmul_comm": (ms_ctx_param.interleaved_matmul_comm, bool),
845
864
  "bias_add_comm_swap": (ms_ctx_param.bias_add_comm_swap, bool),
865
+ "allreduce_and_biasadd_swap": (ms_ctx_param.bias_add_comm_swap, bool),
846
866
  "enable_opt_shard_comm_opt": (ms_ctx_param.enable_opt_shard_comm_opt, bool),
867
+ "computation_allgather_overlap": (ms_ctx_param.enable_opt_shard_comm_opt, bool),
847
868
  "enable_begin_end_inline_opt": (ms_ctx_param.enable_begin_end_inline_opt, bool),
848
869
  "enable_concat_eliminate_opt": (ms_ctx_param.enable_concat_eliminate_opt, bool),
849
870
  "interleaved_layernorm_comm": (ms_ctx_param.interleaved_layernorm_comm, bool),
@@ -856,10 +877,24 @@ class _Context:
856
877
  "enable_offloading_packed_experts": (ms_ctx_param.enable_offloading_packed_experts, bool),
857
878
  "compute_communicate_fusion_level":
858
879
  (ms_ctx_param.compute_communicate_fusion_level, int),
880
+ "computation_communication_fusion_level":
881
+ (ms_ctx_param.compute_communicate_fusion_level, int),
859
882
  "enable_flash_attention_load_balance":
860
883
  (ms_ctx_param.enable_flash_attention_load_balance, bool),
884
+ "pp_1f1b_overlap":
885
+ (ms_ctx_param.pp_1f1b_overlap, str),
861
886
  "dataset_broadcast_opt_level":
862
887
  (ms_ctx_param.dataset_broadcast_opt_level, int)}
888
+ name_replace = {
889
+ "recompute_comm_overlap": "recomputation_communication_overlap",
890
+ "matmul_grad_comm_overlap": "grad_matmul_communication_overlap",
891
+ "recompute_allgather_overlap_fagrad": "grad_fa_allgather_overlap",
892
+ "enable_task_opt": "enable_communication_fusion",
893
+ "enable_grad_comm_opt": "grad_computation_allreduce_overlap",
894
+ "enable_opt_shard_comm_opt": "computation_allgather_overlap",
895
+ "compute_communicate_fusion_level": "computation_communication_fusion_level",
896
+ "dataset_broadcast_opt_level": "dataset_broadcast_opt_level",
897
+ "bias_add_comm_swap": "allreduce_and_biasadd_swap"}
863
898
  with open(speedup_config_real_path, 'r') as f:
864
899
  speedup_config = json.load(f)
865
900
  for key, value in speedup_config.items():
@@ -867,10 +902,22 @@ class _Context:
867
902
  raise TypeError("key {} is not a str".format(key))
868
903
  if key not in valid_option:
869
904
  raise ValueError("key {} should be one of {}.".format(key, valid_option.keys()))
905
+ if key in name_replace:
906
+ logger.warning(f"For 'context.set_context', '{key}' parameter is deprecated, "
907
+ "and will be removed in the next version, "
908
+ f"Please use '{name_replace.get(key)}' instead.")
870
909
  set_func, valid_type = valid_option.get(key)
871
910
  if not isinstance(value, valid_type):
872
911
  raise TypeError(f"The value type of {key} must be {valid_type}, "
873
912
  f"but got value is {value} and type is {type(value)}.")
913
+ if key == "pp_1f1b_overlap":
914
+ values = value.split(",")
915
+ for v in values:
916
+ if v not in ['AlltoAll', 'AlltoAllV', 'MorphAllGather',
917
+ 'AllGather', 'ReduceScatter', 'MorphReduceScatter']:
918
+ raise ValueError("{} 's value should be subset of ['AlltoAll', 'AlltoAllV',"
919
+ " 'MorphAllGather', 'AllGather', 'ReduceScatter',"
920
+ " 'MorphReduceScatter'].".format(key))
874
921
  self.set_param(set_func, value)
875
922
  except (TypeError, ValueError) as exo:
876
923
  raise ValueError(str(exo) + "\nFor 'context.set_context', "
@@ -913,15 +960,11 @@ def _context():
913
960
  comm_fusion=dict, strategy_ckpt_config=dict, force_fp32_communication=bool)
914
961
  def set_auto_parallel_context(**kwargs):
915
962
  r"""
916
- Set auto parallel context, only data parallel supported on CPU.
963
+ Set auto parallel context, this api will be deprecated and removed in future versions, please use the api
964
+ :class:`mindspore.parallel.auto_parallel.AutoParallel` instead.
917
965
 
918
966
  Note:
919
- Attribute name is required for setting attributes.
920
- If a program has tasks on different parallel modes, before setting a new parallel mode for the
921
- next task, interface :func:`mindspore.reset_auto_parallel_context` should be called to reset
922
- the configuration.
923
- Setting or changing parallel modes must be called before creating any Initializer, otherwise,
924
- it may have RuntimeError when compiling the network.
967
+ CPU only support data parallel.
925
968
 
926
969
  Some configurations are parallel mode specific, see the below table for details:
927
970
 
@@ -971,13 +1014,15 @@ def set_auto_parallel_context(**kwargs):
971
1014
  - auto_parallel: Achieving parallelism automatically.
972
1015
  search_mode (str): There are three kinds of shard strategy search modes: ``"recursive_programming"`` ,
973
1016
  ``"sharding_propagation"`` and ``"dynamic_programming"`` (Not recommended).
1017
+ Only works in ``"auto_parallel"`` mode.
974
1018
  Default: ``"recursive_programming"`` .
975
1019
 
976
1020
  - recursive_programming: Recursive programming search mode. In order to obtain optimal performance,
977
1021
  it is recommended that users set the batch size to be greater than or equal to the product of
978
1022
  the number of devices and the number of multi-copy parallelism.
979
1023
 
980
- - sharding_propagation: Propagate shardings from configured ops to non-configured ops.
1024
+ - sharding_propagation: Propagate shardings from configured ops to non-configured ops. Dynamic
1025
+ shapes are not supported currently.
981
1026
 
982
1027
  - dynamic_programming: Dynamic programming search mode.
983
1028
  auto_parallel_search_mode (str): This is the old version of 'search_mode'. Here, remaining this attribute is
@@ -1001,7 +1046,8 @@ def set_auto_parallel_context(**kwargs):
1001
1046
  equal to full_batch=True. For execution mode is 'GRAPH_MODE' and dataset load into net by model
1002
1047
  parallel strategy likes ds_stra ((1, 8), (1, 8)), it requires using
1003
1048
  set_auto_parallel_context(dataset_strategy=ds_stra). The dataset sharding strategy is not
1004
- affected by the currently configured parallel mode.
1049
+ affected by the currently configured parallel mode. parallel strategy also supports tuple of
1050
+ Layout.
1005
1051
  enable_parallel_optimizer (bool): This is a developing feature, which shards the weight update computation for
1006
1052
  data parallel training in the benefit of time and memory saving. Currently, auto and semi auto
1007
1053
  parallel mode support all optimizers in both Ascend and GPU. Data parallel mode only supports
@@ -1025,14 +1071,17 @@ def set_auto_parallel_context(**kwargs):
1025
1071
 
1026
1072
  - pipeline_interleave(bool): Indicates whether to enable the interleaved execution mode.
1027
1073
  - pipeline_scheduler(str): Indicates the scheduling mode for pipeline parallelism. Only support
1028
- ``gpipe/1f1b/seqpipe``.
1074
+ ``gpipe/1f1b/seqpipe/seqvpp/seqsmartvpp``. When applying seqsmartvpp, the pipeline parallel
1075
+ must be an even number.
1029
1076
  parallel_optimizer_config (dict): A dict contains the keys and values for setting the parallel optimizer
1030
1077
  configure. The configure provides more detailed behavior control about parallel training
1031
1078
  when parallel optimizer is enabled. The configure will be effective when we use
1032
1079
  mindspore.set_auto_parallel_context(enable_parallel_optimizer=True).
1033
1080
  It supports the following keys.
1034
1081
 
1035
- - gradient_accumulation_shard(bool): If ``true`` , the accumulation gradient parameters will be
1082
+ - gradient_accumulation_shard(bool): Please using optimizer_level: ``level2`` to replace
1083
+ this config.
1084
+ If ``true`` , the accumulation gradient parameters will be
1036
1085
  sharded across the data parallel devices. This will
1037
1086
  introduce additional communication(ReduceScatter) at
1038
1087
  each step when accumulate the gradients, but saves a
@@ -1043,7 +1092,8 @@ def set_auto_parallel_context(**kwargs):
1043
1092
 
1044
1093
  - parallel_optimizer_threshold(int): Set the threshold of parallel optimizer. When parallel
1045
1094
  optimizer is enabled, parameters with size smaller than this threshold will not be sharded
1046
- across the devices. Parameter size = shape[0] \* ... \* shape[n] \* size(dtype). Non-negative.
1095
+ across the devices. Parameter size is calculated as:
1096
+ shape[0] \* ... \* shape[n] \* size(dtype). Non-negative.
1047
1097
  Unit: KB. Default: ``64`` .
1048
1098
 
1049
1099
  - optimizer_weight_shard_size(int): Set the optimizer weight shard group size, if you want to
@@ -1054,6 +1104,17 @@ def set_auto_parallel_context(**kwargs):
1054
1104
  communication group size will not take effect. Default value is ``-1`` , which means the
1055
1105
  optimizer weight shard group size will be the size of data parallel group of each parameter.
1056
1106
 
1107
+ - optimizer_level(str, optional): optimizer_level configuration is used to specify
1108
+ the splitting level for optimizer sharding. It is important to note that the implementation
1109
+ of optimizer sharding in static graph is inconsistent with dynamic graph like megatron,
1110
+ but the memory optimization effect is the same. When optimizer_level= ``level1`` ,
1111
+ splitting is performed on weights and optimizer state. When optimizer_level= ``level2`` ,
1112
+ splitting is performed on weights, optimizer state, and gradients.
1113
+ When optimizer_level= ``level3`` , splitting is performed on weights, optimizer state,
1114
+ gradients, additionally, before the backward pass, the weights are further applied with
1115
+ allgather communication to release the memory used by the forward pass allgather.
1116
+ It must be one of [``level1``, ``level2``, ``level3``]. Default: ``level1``.
1117
+
1057
1118
  comm_fusion (dict): A dict contains the types and configurations for setting the communication fusion. each
1058
1119
  communication fusion config has two keys: "mode" and "config".
1059
1120
  It supports following communication fusion types and configurations:
@@ -1128,7 +1189,7 @@ def set_auto_parallel_context(**kwargs):
1128
1189
  >>> ms.set_auto_parallel_context(pipeline_stages=2)
1129
1190
  >>> ms.set_auto_parallel_context(pipeline_stages=2, pipeline_result_broadcast=True)
1130
1191
  >>> parallel_config = {"gradient_accumulation_shard": True, "parallel_optimizer_threshold": 24,
1131
- ... "optimizer_weight_shard_size": 2}
1192
+ ... "optimizer_weight_shard_size": 2, "optimizer_level": "level3"}
1132
1193
  >>> ms.set_auto_parallel_context(parallel_optimizer_config=parallel_config, enable_parallel_optimizer=True)
1133
1194
  >>> config = {"allreduce": {"mode": "size", "config": 32}, "allgather": {"mode": "size", "config": 32}}
1134
1195
  >>> ms.set_auto_parallel_context(comm_fusion=config)
@@ -1140,7 +1201,8 @@ def set_auto_parallel_context(**kwargs):
1140
1201
 
1141
1202
  def get_auto_parallel_context(attr_key):
1142
1203
  """
1143
- Get auto parallel context attribute value according to the key.
1204
+ Get auto parallel context attribute value according to the key, this api will be deprecated and removed in future
1205
+ versions.
1144
1206
 
1145
1207
  Args:
1146
1208
  attr_key (str): The key of the attribute.
@@ -1161,7 +1223,8 @@ def get_auto_parallel_context(attr_key):
1161
1223
 
1162
1224
  def reset_auto_parallel_context():
1163
1225
  """
1164
- Reset auto parallel context attributes to the default values.
1226
+ Reset auto parallel context attributes to the default values, this api will be deprecated and removed in future
1227
+ versions, please use the api :class:`mindspore.parallel.auto_parallel.AutoParallel` instead.
1165
1228
 
1166
1229
  - device_num: 1.
1167
1230
  - global_rank: 0.
@@ -1196,8 +1259,8 @@ def reset_auto_parallel_context():
1196
1259
  @args_type_check(offload_config=dict)
1197
1260
  def set_offload_context(offload_config):
1198
1261
  r"""
1199
- Configure heterogeneous training detailed parameters to adjust the offload strategy. This function is deprecated and
1200
- will be removed in future versions.
1262
+ Configure heterogeneous training detailed parameters to adjust the offload strategy, this api will be deprecated
1263
+ and removed in future versions.
1201
1264
 
1202
1265
  Note:
1203
1266
  The offload configuration is only used if the memory offload feature is enabled
@@ -1237,9 +1300,10 @@ def set_offload_context(offload_config):
1237
1300
 
1238
1301
  def get_offload_context():
1239
1302
  """
1240
- Gets the offload configuration parameters. Configure through interface mindspore.set_offload_context().
1241
- If the user is not set, the default configuration is obtained. This function is deprecated and will be removed in
1242
- future versions.
1303
+ Gets the offload configuration parameters, this api will be deprecated and removed in future versions.
1304
+
1305
+ Configure through interface mindspore.set_offload_context(). If the user is not set, the default configuration is
1306
+ obtained.
1243
1307
 
1244
1308
  Returns:
1245
1309
  Dict, heterogeneous training offload detailed configuration parameters.
@@ -1278,7 +1342,7 @@ def _check_target_specific_cfgs(device, arg_key):
1278
1342
  def _check_ascend_device_context_initialized(device_target, settings):
1279
1343
  if device_target == 'Ascend' and is_initialized(device_target):
1280
1344
  for key, _ in settings.items():
1281
- if key in ('ascend_config', 'deterministic', 'jit_compile', 'exception_dump', 'device_id'):
1345
+ if key in ('ascend_config', 'deterministic', 'jit_compile', 'device_id'):
1282
1346
  logger.warning(f"For 'context.set_context' in Ascend backend, the backend is already initialized, "
1283
1347
  "please set it before the definition of any Tensor and Parameter, and the "
1284
1348
  "instantiation and execution of any operation and net, otherwise the settings may not "
@@ -1328,12 +1392,24 @@ def _check_context_deprecated(key):
1328
1392
  mindspore.device_context.gpu.op_precision.conv_dgrad_algo()''',
1329
1393
  'runtime_num_threads': 'api mindspore.device_context.cpu.op_tuning.threads_num()',
1330
1394
  'memory_offload': "`device` parameter of `mindspore.Parameter`"}
1395
+ invalid_context_dict = {
1396
+ 'exception_dump': {'version': '2.6', 'interface': 'device_context.ascend.op_debug.aclinit_config()'}
1397
+ }
1331
1398
  if key in deprecated_context_dict:
1332
1399
  log = f"For 'context.set_context', the parameter '{key}' will be deprecated and removed in a future version."
1333
1400
  if deprecated_context_dict.get(key) != '':
1334
1401
  log += f" Please use the {deprecated_context_dict.get(key)} instead."
1335
1402
  logger.warning(log)
1336
-
1403
+ if key in invalid_context_dict:
1404
+ info = invalid_context_dict.get(key)
1405
+ deprecated_version, new_interface = info.get('version'), info.get('interface')
1406
+ log = (
1407
+ f"For 'context.set_context', the parameter '{key}' has been removed"
1408
+ f" since MindSpore {deprecated_version} version."
1409
+ )
1410
+ if new_interface:
1411
+ log += f" Please use the {new_interface} instead."
1412
+ raise ValueError(log)
1337
1413
 
1338
1414
  @args_type_check(mode=int, precompile_only=bool, device_target=str, device_id=int, save_graphs=(bool, int),
1339
1415
  save_graphs_path=str, aoe_tune_mode=str, aoe_config=dict,
@@ -1347,565 +1423,141 @@ def _check_context_deprecated(key):
1347
1423
  jit_enable_inplace_ops=bool, gpu_config=dict, jit_config=dict, enable_compile_cache=bool)
1348
1424
  def set_context(**kwargs):
1349
1425
  r"""
1350
- Set context for running environment.
1351
-
1352
- Context should be configured before running your program. If there is no configuration,
1353
- it will be automatically set according to the device target by default.
1354
-
1355
- Note:
1356
- Attribute name is required for setting attributes.
1357
- The mode is not recommended to be changed after net was initialized because the implementations of some
1358
- operations are different in graph mode and pynative mode. Default: ``PYNATIVE_MODE`` .
1359
-
1360
- Some configurations are device specific, and some parameters will be deprecated and removed in the future version
1361
- (marked ``D`` in the second column), please use the replacement in the fourth column.
1362
- see the below table for details:
1363
-
1364
- +-------------------------+------------------------------+---------------------------+----------------------------+
1365
- | Function Classification | Configuration Parameters | Hardware Platform Support| Replacement |
1366
- +=========================+==============================+===========================+============================+
1367
- | System Configuration | device_id (D) | CPU/GPU/Ascend | :func:`~.set_device` |
1368
- | +------------------------------+---------------------------+----------------------------+
1369
- | | device_target (D) | CPU/GPU/Ascend | :func:`~.set_device` |
1370
- | +------------------------------+---------------------------+----------------------------+
1371
- | | max_device_memory(D) | GPU/Ascend | :func:`~.set_memory` |
1372
- | +------------------------------+---------------------------+----------------------------+
1373
- | | variable_memory_max_size (D) | Ascend | :func:`~.set_memory` |
1374
- | +------------------------------+---------------------------+----------------------------+
1375
- | | mempool_block_size (D) | GPU/Ascend | :func:`~.set_memory` |
1376
- | +------------------------------+---------------------------+----------------------------+
1377
- | | op_timeout (D) | Ascend | :func:`~.execute_timeout` |
1378
- +-------------------------+------------------------------+---------------------------+----------------------------+
1379
- | Debug Configuration | save_graphs (D) | CPU/GPU/Ascend | MS_DEV_SAVE_GRAPHS |
1380
- | +------------------------------+---------------------------+----------------------------+
1381
- | | save_graphs_path (D) | CPU/GPU/Ascend | MS_DEV_SAVE_GRAPHS_PATH |
1382
- | +------------------------------+---------------------------+----------------------------+
1383
- | | deterministic (D) | Ascend |:func:`~.set_deterministic` |
1384
- | +------------------------------+---------------------------+----------------------------+
1385
- | | print_file_path | Ascend | NA |
1386
- | +------------------------------+---------------------------+----------------------------+
1387
- | | env_config_path | CPU/GPU/Ascend | NA |
1388
- | +------------------------------+---------------------------+----------------------------+
1389
- | | precompile_only (D) | CPU/GPU/Ascend | MS_DEV_PRECOMPILE_ONLY |
1390
- | +------------------------------+---------------------------+----------------------------+
1391
- | | reserve_class_name_in_scope | CPU/GPU/Ascend | NA |
1392
- | +------------------------------+---------------------------+----------------------------+
1393
- | | pynative_synchronize (D) | CPU/GPU/Ascend | :func:`~.launch_blocking` |
1394
- | +------------------------------+---------------------------+----------------------------+
1395
- | | debug_level (D) | CPU/GPU/Ascend | NA |
1396
- +-------------------------+------------------------------+---------------------------+----------------------------+
1397
- | Executive Control | mode | CPU/GPU/Ascend | NA |
1398
- | +------------------------------+---------------------------+----------------------------+
1399
- | | enable_reduce_precision | Ascend | NA |
1400
- | +------------------------------+---------------------------+----------------------------+
1401
- | | aoe_tune_mode (D) | Ascend | :func:`~.aoe_tune_mode` |
1402
- | +------------------------------+---------------------------+----------------------------+
1403
- | | aoe_config (D) | Ascend | :func:`~.aoe_job_type` |
1404
- | +------------------------------+---------------------------+----------------------------+
1405
- | | check_bprop (D) | CPU/GPU/Ascend | NA |
1406
- | +------------------------------+---------------------------+----------------------------+
1407
- | | max_call_depth (D) | CPU/GPU/Ascend | :func:`~.set_recur\ |
1408
- | | | | sion_limit` |
1409
- | +------------------------------+---------------------------+----------------------------+
1410
- | | grad_for_scalar (D) | CPU/GPU/Ascend | derivative |
1411
- | +------------------------------+---------------------------+----------------------------+
1412
- | | enable_compile_cache (D) | CPU/GPU/Ascend | MS_COMPILER_CACHE_ENABLE |
1413
- | +------------------------------+---------------------------+----------------------------+
1414
- | | inter_op_parallel_num (D) | CPU/GPU/Ascend | :func:`~.dispatch\ |
1415
- | | | | _threads_num` |
1416
- | +------------------------------+---------------------------+----------------------------+
1417
- | |runtime_num_threads (D) | CPU/GPU/Ascend | :func:`~.threads_num` |
1418
- | +------------------------------+---------------------------+----------------------------+
1419
- | | compile_cache_path | CPU/GPU/Ascend | NA |
1420
- | +------------------------------+---------------------------+----------------------------+
1421
- | | disable_format_transform | GPU | NA |
1422
- | +------------------------------+---------------------------+----------------------------+
1423
- | | support_binary | CPU/GPU/Ascend | NA |
1424
- | +------------------------------+---------------------------+----------------------------+
1425
- | | memory_optimize_level (D) | CPU/GPU/Ascend | :func:`~.set_memory` |
1426
- | +------------------------------+---------------------------+----------------------------+
1427
- | | memory_offload | GPU/Ascend | NA |
1428
- | +------------------------------+---------------------------+----------------------------+
1429
- | | ascend_config (D) | Ascend | :func:`~.precision_mode` |
1430
- | | | | |
1431
- | | | | :func:`~.op_precision_mode`|
1432
- | | | | |
1433
- | | | | :func:`~.matmul_allow_hf32`|
1434
- | | | | |
1435
- | | | | :func:`~.conv_allow_hf32` |
1436
- | | | | |
1437
- | | | | :func:`~.op_compile` |
1438
- | | | | |
1439
- | | | | :func:`~.debug_option` |
1440
- | +------------------------------+---------------------------+----------------------------+
1441
- | | jit_syntax_level | CPU/GPU/Ascend | NA |
1442
- | +------------------------------+---------------------------+----------------------------+
1443
- | | gpu_config (D) | GPU | :func:`~.conv_allow_tf32` |
1444
- | | | | |
1445
- | | | | :func:`~.matmul_allow_tf32`|
1446
- | | | | |
1447
- | | | | :func:`~.conv_fprop_algo` |
1448
- | | | | |
1449
- | | | | :func:`~.conv_wgrad_algo` |
1450
- | | | | |
1451
- | | | | :func:`~.conv_dgrad_algo` |
1452
- | +------------------------------+---------------------------+----------------------------+
1453
- | | jit_config | CPU/GPU/Ascend | NA |
1454
- | +------------------------------+---------------------------+----------------------------+
1455
- | | exec_order | Ascend | NA |
1456
- +-------------------------+------------------------------+---------------------------+----------------------------+
1426
+ Set context for running environment, this interface will be deprecated in future versions, and its
1427
+ parameter-related functionalities will be provided through new APIs.
1457
1428
 
1458
1429
  Args:
1459
- device_id (int): ID of the target device, the value must be in [0, device_num_per_host-1],
1460
- while device_num_per_host should be no more than 4096. Default: ``0`` . This parameter will be deprecated
1461
- and will be removed in future versions.Please use api :func:`mindspore.set_device`
1462
- with 'device_target' instead.
1463
- device_target (str): The target device to run, support "Ascend", "GPU", and "CPU".
1464
- If device target is not set, the version of MindSpore package is used. This parameter will be deprecated
1465
- and will be removed in future versions.Please use api :func:`mindspore.set_device`
1466
- with 'device_id' instead.
1467
- max_device_memory (str): Set the maximum memory available for devices. The format is "xxGB".
1468
- Default: ``" 1024GB"`` . The actual used memory size is the minimum of the available memory of the device
1469
- and max_device_memory. 'max_device_memory' should be set before the program runs. When virtual memory is
1470
- enabled, a too small 'max_device_memory' will cause frequent defragmentation, affecting performance.
1471
- This parameter will be deprecated and will be removed in future versions. Please use the
1472
- api :func:`mindspore.runtime.set_memory` instead.
1473
- variable_memory_max_size (str): This parameter will be deprecated and will be removed in future versions. Please
1474
- use the api :func:`mindspore.runtime.set_memory` instead.
1475
- mempool_block_size (str): It takes effect when virtual memory is turned off, set the size of the memory pool
1476
- block for devices. The format is "xxGB". Default: ``"1GB"`` . Minimum size is "1G". The actual used memory
1477
- block size is the minimum of the available memory of the device and mempool_block_size. When there is
1478
- enough memory, the memory will be expanded by this value.
1479
- This parameter will be deprecated and will be removed in future versions. Please use the
1480
- api :func:`mindspore.runtime.set_memory` instead.
1481
- op_timeout (int): Set the maximum duration of executing an operator in seconds.
1482
- If the execution time exceeds this value, system will terminate the task.
1483
- 0 means endless wait. The defaults for AI Core and AICPU operators vary on different hardware.
1484
- For more information,
1485
- please refer to `Ascend Community document about aclrtSetOpExecuteTimeOut
1486
- <https://www.hiascend.com/document/detail/en/CANNCommunityEdition/600alphaX/infacldevg/aclcppdevg/aclcppdevg_03_0069.html>`_.
1487
- Default: ``900`` .
1488
- This parameter will be deprecated and will be removed in future versions. Please use the
1430
+ mode (int): GRAPH_MODE(0) or PYNATIVE_MODE(1). Default ``PYNATIVE_MODE`` .
1431
+ device_id (int): ID of the target device. Default ``0`` . This parameter will be deprecated
1432
+ and removed in future versions. Please use the api :func:`mindspore.set_device` instead.
1433
+ device_target (str): The target device to run, support ``"Ascend"``, ``"GPU"``, and ``"CPU"``. This parameter
1434
+ will be deprecated and removed in future versions. Please use the api :func:`mindspore.set_device` instead.
1435
+ deterministic (str): Deterministic computation of operators. Default ``"OFF"`` .
1436
+ This parameter will be deprecated and removed in future versions. Please use the api
1437
+ :func:`mindspore.set_deterministic` instead.
1438
+ max_call_depth (int): The maximum depth of function call. Default ``1000`` .
1439
+ This parameter will be deprecated and removed in a future version. Please use the api
1440
+ :func:`mindspore.set_recursion_limit` instead.
1441
+ variable_memory_max_size (str): This parameter will be deprecated and removed in future versions.
1442
+ Please use the api :func:`mindspore.runtime.set_memory` instead.
1443
+ mempool_block_size (str): Set the size of the memory pool block for devices. Default ``"1GB"`` .
1444
+ This parameter will be deprecated and removed in future versions. Please use
1445
+ the api :func:`mindspore.runtime.set_memory` instead.
1446
+ memory_optimize_level (str): The memory optimize level. Default ``"O0"``.
1447
+ This parameter will be deprecated and removed in future versions. Please use
1448
+ the api :func:`mindspore.runtime.set_memory` instead.
1449
+ max_device_memory (str): Set the maximum memory available for devices.
1450
+ Default ``"1024GB"`` . This parameter will be deprecated and removed in future versions. Please use
1451
+ the api :func:`mindspore.runtime.set_memory` instead.
1452
+ pynative_synchronize (bool): Whether to enable synchronous execution of the device in PyNative mode.
1453
+ Default ``False`` . This parameter will be deprecated and removed in future versions.Please use
1454
+ the api :func:`mindspore.runtime.launch_blocking` instead.
1455
+ compile_cache_path (str): Path to save the compile cache. Default ``"."``.
1456
+ This parameter will be deprecated and removed in a future version. Please use the environment variable
1457
+ `MS_COMPILER_CACHE_PATH` instead.
1458
+ inter_op_parallel_num(int): The thread number of op parallel at the same time.
1459
+ Default ``0`` . This parameter will be deprecated and removed in future versions.
1460
+ Please use the api :func:`mindspore.runtime.dispatch_threads_num` instead.
1461
+ memory_offload (str): Whether to enable the memory offload function. Default ``"OFF"`` .
1462
+ This parameter will be deprecated and removed in future versions. Please use the api
1463
+ :func:`mindspore.nn.Cell.offload` instead.
1464
+ disable_format_transform (bool): Whether to disable the automatic format transform function from NCHW
1465
+ to NHWC. Default ``False`` . This parameter will be deprecated and removed in future versions. Please
1466
+ use the related parameter of :func:`mindspore.jit` instead.
1467
+ jit_syntax_level (int): Set JIT syntax support level. Default ``LAX`` . This parameter is deprecated
1468
+ and removed in future versions. Please use the related parameter of :func:`mindspore.jit` instead.
1469
+ jit_config (dict): Set the global jit config for compile. This parameter is deprecated
1470
+ and removed in future versions. Please use the related parameter of :func:`mindspore.jit` instead.
1471
+ exec_order (str): The sorting method for operator execution. This parameter is deprecated
1472
+ and removed in future versions. Please use the related parameter of :func:`mindspore.jit` instead.
1473
+ op_timeout (int): Set the maximum duration of executing an operator in seconds. Default ``900`` .
1474
+ This parameter will be deprecated and removed in future versions. Please use the
1489
1475
  api :func:`mindspore.device_context.ascend.op_debug.execute_timeout` instead.
1490
- save_graphs (bool or int): Whether to save intermediate compilation graphs. Default: ``0`` .
1491
- Available values are:
1492
-
1493
- - False or 0: disable saving of intermediate compilation graphs.
1494
- - 1: some intermediate files will be generated during graph compilation.
1495
- - True or 2: Generate more ir files related to backend process.
1496
- - 3: Generate visualization computing graphs and detailed frontend ir graphs.
1497
-
1498
- When the network structure is complex, setting `save_graphs` attribute to ``2`` or ``3`` may take too long.
1499
- If you need quick problem locating, you can switch to ``1`` first.
1500
-
1501
- When the `save_graphs` attribute is set as ``True`` , ``1`` , ``2`` or ``3`` , attribute of
1502
- `save_graphs_path` is used to set the intermediate compilation graph storage path. By default, the graphs
1503
- are saved in the current directory.
1476
+ aoe_tune_mode (str): AOE tuning mode.
1477
+ This parameter will be deprecated and removed in future versions. Please use the
1478
+ api :func:`mindspore.device_context.ascend.op_tuning.aoe_tune_mode` instead.
1479
+ aoe_config (dict): AOE-specific parameters. This parameter will be deprecated and removed in future
1480
+ versions. Please use the api :func:`mindspore.device_context.ascend.op_tuning.aoe_job_type` instead.
1481
+ runtime_num_threads(int): The thread pool number of cpu kernel used in runtime. Default ``30`` .
1482
+ This parameter will be deprecated and removed in future versions. Please use the
1483
+ api :func:`mindspore.device_context.cpu.op_tuning.threads_num` instead.
1484
+ save_graphs (bool or int): Whether to save intermediate compilation graphs. Default ``0`` .
1504
1485
  This parameter will be deprecated and removed in a future version. Please use the environment variable
1505
1486
  `MS_DEV_SAVE_GRAPHS` instead.
1506
- save_graphs_path (str): Path to save graphs. Default: ``"."``.
1507
- If the specified directory does not exist, the system will automatically create the directory.
1508
- During distributed training, graphs will be saved to the directory of
1509
- `save_graphs_path/rank_${rank_id}/`. `rank_id` is the ID of the current device in the cluster.
1487
+ save_graphs_path (str): Path to save graphs. Default ``"."``.
1510
1488
  This parameter will be deprecated and removed in a future version. Please use the environment variable
1511
1489
  `MS_DEV_SAVE_GRAPHS_PATH` instead.
1512
- deterministic (str): Whether to enable op run in deterministic mode. The value must be in the
1513
- range of ['ON', 'OFF'], and the default value is ``'OFF'`` .
1514
-
1515
- - "ON": Enable operator deterministic running mode.
1516
- - "OFF": Disable operator deterministic running mode.
1517
-
1518
- When deterministic mode is on, model ops will be deterministic in Ascend. This means that if op run
1519
- multiple times with the same inputs on the same hardware, it will have the exact same outputs each time.
1520
- This is useful for debugging models.
1521
- In distributed scenario, we suggest user to set deterministic mode before
1522
- calling :func:`mindspore.communication.init` to enable deterministic operation for
1523
- communication operators in the global communication group.
1524
- This parameter will be deprecated and will be removed in
1525
- future versions. Please use the api :func:`mindspore.set_deterministic` instead.
1526
- print_file_path (str): This parameter will be deprecated and will be removed in future versions.
1527
- env_config_path (str): This parameter will be deprecated and will be removed in future versions.
1528
-
1529
- precompile_only (bool): Whether to only precompile the network. Default: ``False`` .
1530
- If set to ``True`` , the network will only be compiled, not executed.
1490
+ precompile_only (bool): Whether to only precompile the network. Default ``False`` .
1531
1491
  This parameter will be deprecated and removed in a future version. Please use the environment variable
1532
1492
  `MS_DEV_PRECOMPILE_ONLY` instead.
1533
- reserve_class_name_in_scope (bool): This parameter will be deprecated and will be removed in future versions.
1534
- pynative_synchronize (bool): Whether to enable synchronous execution of the device in PyNative mode.
1535
- Default: ``False`` . When the value is set to ``False`` , the operator is executed asynchronously on the
1536
- device. When an error occurs in the execution of the operator, the specific error script code location
1537
- cannot be located, when the value is set to ``True`` , the operator is executed synchronously on the
1538
- device. It will reduce the execution performance of the program. At this time, when an error occurs in the
1539
- execution of the operator, the location of the error script code can be located according to the call stack
1540
- of the error. This parameter will be deprecated and will be removed in future versions.Please use
1541
- the api :func:`mindspore.runtime.launch_blocking` instead.
1542
- mode (int): Running in GRAPH_MODE(0) or PYNATIVE_MODE(1).
1543
- Both modes support all backends. Default: ``PYNATIVE_MODE`` .
1544
- enable_reduce_precision (bool): Whether to enable precision reduction.
1545
- If the operator does not support the user-specified precision, the precision will
1546
- be changed automatically. Default: ``True`` .
1547
- aoe_tune_mode (str): AOE tuning mode setting, which is not set by default.
1548
- When set to ``"online"`` , the tuning in online function is turned on.
1549
- When set to ``"offline"`` , ge graph will be save for offline tuning.
1550
- This parameter will be deprecated and will be removed in future versions. Please use the
1551
- api :func:`mindspore.device_context.ascend.op_tuning.aoe_tune_mode` instead.
1552
- aoe_config (dict): Set the parameters specific to Ascend Optimization Engine. It is not set by default.
1553
-
1554
- - job_type (str): Mode type setting, default value is ``"2"``.
1555
-
1556
- - ``"1"``: subgraph tuning;
1557
- - ``"2"``: operator tuning.
1558
-
1559
- This parameter will be deprecated and will be removed in future versions. Please use the
1560
- api :func:`mindspore.device_context.ascend.op_tuning.aoe_job_type` instead.
1561
-
1562
- check_bprop (bool): Whether to check back propagation nodes. The checking ensures that the shape and dtype
1563
- of back propagation node outputs is the same as input parameters. Default: ``False`` .
1564
- This parameter will be deprecated and removed in a future version.
1565
- max_call_depth (int): Specify the maximum depth of function call. Must be positive integer. Default: ``1000`` .
1566
- The max_call_depth parameter needs to be set when the nested call is too deep or the number
1567
- of subgraphs is too large. If max_call_depth is set larger than before, the system max stack depth should be
1568
- set larger too, otherwise a `core dumped` exception may be raised because of system stack overflow.
1569
- This parameter will be deprecated and removed in a future version. Please use the api
1570
- :func:`mindspore.set_recursion_limit` instead.
1571
- grad_for_scalar (bool): Whether to get gradient for scalar. Default: ``False`` .
1572
- When grad_for_scalar is set to ``True`` , the function's scalar input can be derived.
1573
- The default value is ``False`` . Because the back-end does not support scaling operations currently,
1574
- this interface only supports simple operations that can be deduced by the front-end.
1575
- This parameter will be deprecated and removed in a future version. Please take the tensor derivative.
1576
1493
  enable_compile_cache (bool): Whether to save or load the compiled cache of the graph.
1577
- After enable_compile_cache is set to ``True`` , during the first execution, a compilation cache is
1578
- generated and exported to a MINDIR file. When the network is executed again, if enable_compile_cache is
1579
- still set to ``True`` and the network scripts are not changed, the compile cache is loaded.
1580
- Note that only limited automatic detection for the changes of python scripts is supported by now,
1581
- which means that there is a correctness risk. Default: ``False`` .
1582
- Currently, do not support the graph which is larger than 2G after compiled.
1583
- This is an experimental prototype that is subject to change and/or deletion.
1494
+ Default ``False`` . This is an experimental prototype that is subject to change and/or deletion.
1584
1495
  This parameter will be deprecated and removed in a future version. Please use the environment variable
1585
1496
  `MS_COMPILER_CACHE_ENABLE` instead.
1586
- compile_cache_path (str): Path to save the compile cache. Default: ``"."``.
1587
- If the specified directory does not exist, the system will automatically create the directory.
1588
- The cache will be saved to the directory of `compile_cache_path/rank_${rank_id}/`. The `rank_id` is
1589
- the ID of the current device in the cluster.
1590
- This parameter will be deprecated and removed in a future version. Please use the environment variable
1591
- `MS_COMPILER_CACHE_PATH` instead.
1592
- inter_op_parallel_num(int): The thread number of op parallel at the same time. Default value is ``0`` ,
1593
- which means use the default num. This parameter will be deprecated and will be removed in future versions.
1594
- Please use the api :func:`mindspore.runtime.dispatch_threads_num` instead.
1595
- runtime_num_threads(int): The thread pool number of cpu kernel used in runtime,
1596
- which must bigger than or equal to 0. Default value is ``30`` , if you run many processes at
1597
- the same time, you should set the value smaller to avoid thread contention. If set runtime_num_threads to 1,
1598
- the runtime asynchronous pipeline capability cannot be enabled, which may affect performance.
1599
- This parameter will be deprecated and will be removed in future versions. Please use the
1600
- api :func:`mindspore.device_context.cpu.op_tuning.threads_num` instead.
1601
- disable_format_transform (bool): Whether to disable the automatic format transform function from NCHW to NHWC.
1602
- When the network training performance of fp16 is worse than fp32, `disable_format_transform` can be set to
1603
- ``True`` to try to improve training performance. Default: ``False`` .
1604
- support_binary (bool): Whether to support run .pyc or .so in graph mode. If want to support run .so or .pyc
1605
- in graph mode, coulde set 'support_binary' to be ``True`` , and run once .py file. It would save the source
1606
- of the interfaces would be compiled by MindSpore to the interfaces definition .py file that should be
1607
- guaranteed to be writable. Then compile the .py file to the .pyc or .so file, and could run in Graph mode.
1608
- Currently, this config option only support stand_alone.
1609
- memory_optimize_level (str): The memory optimize level.
1610
- On Ascend hardware platform, default: ``O1``, on other hardware platforms, default: ``O0``.
1611
- The value must be in ['O0', 'O1'].
1612
-
1613
- - O0: priority performance option, disable SOMAS (Safe Optimized Memory Allocation Solver)
1614
- and some other memory optimizations.
1615
- - O1: priority memory option, enable SOMAS and some other memory optimizations.
1616
-
1617
- This parameter will be deprecated and will be removed in future versions. Please use the
1618
- api :func:`mindspore.runtime.set_memory` instead.
1619
-
1620
- memory_offload (str): Whether to enable the memory offload function. When it is enabled, the idle data will be
1621
- temporarily copied to the host side in the case of insufficient device memory. The value must be in the
1622
- range of ['ON', 'OFF'], and the default value is ``'OFF'`` .
1623
-
1624
- - ON: Enable the memory Offload function. On Ascend hardware platform, this parameter does not take effect
1625
- when the graph compilation level is not 'O0'; This parameter does not take effect when
1626
- memory_optimize_level is set 'O1'.
1627
- - OFF: Turn off the memory Offload function.
1628
-
1629
- This parameter is deprecated and will be removed in future versions. Please use the `device` parameter
1630
- of `mindspore.Parameter` instead.
1631
-
1632
- ascend_config (dict): Set the parameters specific to Ascend hardware platform. It is not set by default.
1633
- The default value of `precision_mode`, `jit_compile` and
1634
- `atomic_clean_policy` are experimental parameters, may change in the future.
1635
-
1636
- - precision_mode (str): Mixed precision mode setting, and the default value of inference network
1637
- is ``force_fp16`` . The value range is as follows:
1638
-
1639
- - force_fp16: When the operator supports both float16 and float32, select float16 directly.
1640
- - allow_fp32_to_fp16: For cube operators, use the float16. For vector operators,
1641
- prefer to keep the origin dtype, if the operator in model can support float32,
1642
- it will keep original dtype, otherwise it will reduce to float16.
1643
- - allow_mix_precision: Automatic mixing precision, facing the whole network operator, according
1644
- to the built-in optimization strategy, automatically reduces the precision of some operators
1645
- to float16 or bfloat16.
1646
- - must_keep_origin_dtype: Keep the accuracy of the original drawing.
1647
- - force_fp32: When the input of the matrix calculation operator is float16 and the output supports
1648
- float16 and float32, output is forced to float32.
1649
- - allow_fp32_to_bf16: For cube operators, use the bfloat16. For vector operators,
1650
- prefer to keep the origin dtype, if the operator in model can support float32,
1651
- it will keep original dtype, otherwise it will reduce to bfloat16.
1652
- - allow_mix_precision_fp16: Automatic mixing precision, facing the whole network operator, automatically
1653
- reduces the precision of some operators to float16 according to the built-in optimization strategy.
1654
- - allow_mix_precision_bf16: Automatic mixing precision, facing the whole network operator, according to
1655
- the built-in optimization strategy, automatically reduces the precision of some operators to bfloat16.
1656
-
1657
- This parameter will be deprecated and will be removed in future versions. Please use the
1658
- api :func:`mindspore.device_context.ascend.op_precision.precision_mode` instead.
1497
+ ascend_config (dict): Set the parameters specific to Ascend hardware platform.
1659
1498
 
1660
- - jit_compile (bool): Whether to select online compilation. When set to 'True', online compilation is
1661
- prioritized. When set to 'False', compiled operator binary files are prioritized to improve compilation
1662
- performance. The default settings are online compilation for static shape, and compiled operator binary
1663
- files for dynamic shape.
1664
- This parameter will be deprecated and will be removed in future versions. Please use the
1665
- api :func:`mindspore.device_context.ascend.op_tuning.op_compile` instead.
1666
- - atomic_clean_policy (int): The policy for cleaning memory occupied by atomic operators in the network.
1667
- Default: ``1`` .
1668
-
1669
- - 0: The memory occupied by all atomic operators in the network is cleaned centrally.
1670
- - 1: Memory is not cleaned centrally and each atomic operator in the network is cleaned separately.
1671
- When the memory of the network exceeds the limit, you may try this cleaning policy, but it may cause
1672
- performance loss.
1673
- - matmul_allow_hf32 (bool): Whether to convert FP32 to HF32 for Matmul operators. Default value: ``False``.
1674
- This is an experimental prototype that is subject to change and/or deletion.
1675
- For detailed information, please refer to `Ascend community <https://www.hiascend.com/>`_ .
1676
- This parameter will be deprecated and will be removed in future versions. Please use the
1499
+ - precision_mode (str): Mixed precision mode setting. Default ``"force_fp16"`` .
1500
+ This parameter will be deprecated and removed in future versions. Please use the
1501
+ api :func:`mindspore.device_context.ascend.op_precision.precision_mode` instead.
1502
+ - jit_compile (bool): Whether to select online compilation. This parameter will be deprecated and removed
1503
+ in future versions. Please use the api :func:`mindspore.device_context.ascend.op_tuning.op_compile`
1504
+ instead.
1505
+ - matmul_allow_hf32 (bool): Whether to convert FP32 to HF32 for Matmul operators. Default ``False``.
1506
+ This parameter will be deprecated and removed in future versions. Please use the
1677
1507
  api :func:`mindspore.device_context.ascend.op_precision.matmul_allow_hf32` instead.
1678
- - conv_allow_hf32 (bool): Whether to convert FP32 to HF32 for Conv operators. Default value: ``True``.
1679
- This is an experimental prototype that is subject to change and/or deletion.
1680
- For detailed information, please refer to `Ascend community <https://www.hiascend.com/>`_ .
1681
- This parameter will be deprecated and will be removed in future versions. Please use the
1508
+ - conv_allow_hf32 (bool): Whether to convert FP32 to HF32 for Conv operators. Default ``True``.
1509
+ This parameter will be deprecated and removed in future versions. Please use the
1682
1510
  api :func:`mindspore.device_context.ascend.op_precision.conv_allow_hf32` instead.
1683
- - exception_dump (str): Enable exception dump for Ascend operators, providing the input and output data for
1684
- failing Ascend operators. The value can be ``"0"`` , ``"1"`` and ``"2"``. For ``"0"`` , exception dump is
1685
- turned off; for ``"1"``, all inputs and outputs will be dumped for AICore exception operators;
1686
- for ``"2"``, inputs will be dumped for AICore exception operators, reducing the saved information
1687
- but improving performance. Default: ``"2"`` .
1688
- - op_precision_mode (str): Path to config file of op precision mode. For detailed information, please refer
1689
- to `Ascend community <https://www.hiascend.com/>`_ .
1690
- This parameter will be deprecated and will be removed in future versions. Please use the
1511
+ - op_precision_mode (str): Path to config file of op precision mode.
1512
+ This parameter will be deprecated and removed in future versions. Please use the
1691
1513
  api :func:`mindspore.device_context.ascend.op_precision.op_precision_mode` instead.
1692
- - op_debug_option (str): Enable debugging options for Ascend operators, default not enabled.
1693
- The value currently only supports being set to ``"oom"``.
1694
-
1695
- - ``"oom"``: When there is a memory out of bounds during the execution of an operator,
1696
- AscendCL will return an error code of ``EZ9999``.
1697
-
1698
- This parameter will be deprecated and will be removed in future versions. Please use the
1514
+ - op_debug_option (str): Enable debugging options for Ascend operators.
1515
+ This parameter will be deprecated and removed in future versions. Please use the
1699
1516
  api :func:`mindspore.device_context.ascend.op_debug.debug_option` instead.
1700
-
1701
- - ge_options (dict): Set options for CANN. The options are divided into two categories: global and session.
1702
- This is an experimental prototype that is subject to change and/or deletion.
1703
- For detailed information, please refer to `Ascend community <https://www.hiascend.com/document/detail/zh/canncommercial/80RC3/apiref/ascendgraphapi/atlasgeapi_07_0146.html>`_ .
1704
- The configuration options in `ge_options` may be duplicated with the options in `ascend_config`. If the
1705
- same configuration options are set in both `ascend_config` and `ge_options`, the one set in `ge_options`
1706
- shall prevail.
1707
-
1708
- - global (dict): Set global options.
1709
- - session (dict): Set session options.
1710
-
1711
- - parallel_speed_up_json_path(Union[str, None]): The path to the parallel speed up json file, configuration
1712
- can refer to `parallel_speed_up.json
1713
- <https://gitee.com/mindspore/mindspore/blob/master/config/parallel_speed_up.json>`_ .
1714
- If its value is None or '', it does not take effect. Default None.
1715
-
1716
- - recompute_comm_overlap (bool): Enable overlap between recompute ops and communication ops if True.
1717
- Default: False.
1718
- - matmul_grad_comm_overlap (bool): Enable overlap between dw matmul and
1719
- tensor parallel communication ops if True. Default: False.
1720
- - recompute_allgather_overlap_fagrad (bool): Enable overlap between duplicated allgather by recomputing
1721
- in sequence parallel and flashattentionscoregrad ops if True. Default: False.
1722
- - enable_task_opt (bool): Enable communication fusion to optimize the number of communication operator
1723
- tasks if True.
1724
- Default: False.
1725
- - enable_grad_comm_opt (bool): Enable overlap between dx ops and data parallel communication ops if True.
1726
- Currently, do not support
1727
- `O2 <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.JitConfig.html>`_
1728
- Default: False.
1729
- - enable_opt_shard_comm_opt (bool): Enable overlap between forward ops
1730
- and optimizer parallel allgather communication if True. Currently, do not support
1731
- `O2 <https://www.mindspore.cn/docs/en/master/api_python/mindspore/mindspore.JitConfig.html>`_
1732
- Default: False.
1733
- - compute_communicate_fusion_level (int): Enable the fusion between compute and communicate.
1734
- Default: ``0``. Note: This function must be used with Ascend Training Solution 24.0.RC2 or later.
1735
-
1736
- - 0: Disable fusion.
1737
-
1738
- - 1: Apply fusion to forward nodes.
1739
-
1740
- - 2: Apply fusion to backward nodes.
1741
-
1742
- - 3: Apply fusion to all nodes.
1743
- - dataset_broadcast_opt_level (int): Optimize the scenario that the dataset repeated reading. Only
1744
- support O0/O1 jit level. It doesn't work in O2 mode. Default: ``0``.
1745
-
1746
- - 0: Disable this optimize.
1747
-
1748
- - 1: Optimize dataset reader between pipeline stage.
1749
-
1750
- - 2: Optimize dataset reader within pipeline stage.
1751
-
1752
- - 3: Optimize dataset reader with all scenes.
1753
- - bias_add_comm_swap (bool): Enable node execution order swap communication operators and add operators
1754
- if ``True``. Only 1-dimension bias node is supported. Default: ``False``.
1755
- - enable_allreduce_slice_to_reducescatter (bool): Enable allreduce optimization. In the scenario where
1756
- the batchmatmul model introduces allreduce in parallel, if the subsequent nodes are stridedslice
1757
- operator with model parallel, allreduce will be optimized as reducescatter according to the identified
1758
- patterns. Typical used in MoE module with groupwise alltoall. Default: ``False``.
1759
- - enable_interleave_split_concat_branch (bool): Enable communication computation parallel optimization
1760
- for branches formed by split and concat operators with ``enable_interleave`` attribute. It is typical
1761
- used in MoE parallel scenario. After splitting the input data, each slice of data is processed by the
1762
- MoE module, and then the branch results are concatenated. When the optimization is enable,
1763
- communication and computation will be executed in parallel between branches. Default: ``False``.
1764
- - enable_interleave_parallel_branch (bool): Enable communication computation parallel optimization
1765
- for parallel branches with ``parallel_branch`` attribute in branches merge node. It is typical
1766
- used in MoE parallel scenario with routed and shared expert. When the optimization is enable,
1767
- communication and computation will be executed in parallel between branches. Default: ``False``.
1517
+ - ge_options (dict): Set options for CANN. This parameter will be deprecated and removed in future versions.
1518
+ Please use the related parameter of :func:`mindspore.jit` instead.
1519
+ - atomic_clean_policy (int): The policy for cleaning memory occupied by atomic operators in the network.
1520
+ Default ``1`` represents that memory is not cleaned centrally, ``0`` represents that memory is cleaned
1521
+ centrally. This parameter will be deprecated and removed in future versions. Please
1522
+ use the related parameter of :func:`mindspore.jit` instead.
1523
+ - exception_dump (str): Enable Ascend operator exception dump. Default ``"2"`` . This parameter has been
1524
+ deprecated and removed. Please use the api
1525
+ :func:`mindspore.device_context.ascend.op_debug.aclinit_config` instead.
1768
1526
  - host_scheduling_max_threshold(int): The max threshold to control whether the dynamic shape process is
1769
- used when run the static graph, the default value is 0. When the number of operations in the static graph
1770
- is less than the max threshold, this graph will be executed in dynamic shape process. In large model
1771
- scenarios, this approach can save stream resources. If the number of operations in the static graph is
1772
- greater than the maximum threshold, this graph will be executed in original static process.
1773
-
1774
- jit_syntax_level (int): Set JIT syntax level for graph compiling, triggered by GRAPH_MODE and @jit decorator.
1775
- The value must be ``STRICT`` or ``LAX`` . Default: ``LAX`` . All levels support all backends.
1776
-
1777
- - ``STRICT`` : Only basic syntax is supported, and execution performance is optimal. Can be used for MindIR
1778
- load and export.
1779
- - ``LAX`` : Compatible with all Python syntax as much as possible. However, execution performance may be
1780
- affected and not optimal. Cannot be used for MindIR load and export due to some syntax that may not be
1781
- able to be exported.
1782
-
1783
- debug_level (int): Set config for debugging. Default value: ``RELEASE``.
1784
-
1785
- - ``RELEASE``: Used for normally running, and some debug information will be discard to get a better
1786
- compiling performance.
1787
- - ``DEBUG``: Used for debugging when errors occur, more information will be record in compiling process.
1788
-
1789
- This parameter will be deprecated and removed in a future version.
1527
+ used when run the static graph. Default ``0`` . This parameter will be deprecated and removed in future
1528
+ versions. Please use the related parameter of :func:`mindspore.jit` instead.
1529
+ - parallel_speed_up_json_path(Union[str, None]): The path to the parallel speed up json file.
1530
+ This parameter will be deprecated and removed in future versions. Please use the
1531
+ api :func:`mindspore.parallel.auto_parallel.AutoParallel.transformer_opt` instead.
1532
+ - hccl_watchdog (bool): Enable a thread to monitor the failure of collective communication.
1533
+ Default ``True`` .
1790
1534
  gpu_config (dict): Set the parameters specific to gpu hardware platform. It is not set by default.
1791
- Currently, only setting `conv_fprop_algo` and `conv_dgrad_algo` and `conv_wgrad_algo` and `conv_allow_tf32`
1792
- and `matmul_allow_tf32` are supported on GPU hardware platform.
1793
-
1794
- - conv_fprop_algo (str): Specifies convolution forward algorithm and the default value is 'normal',
1795
- The value range is as follows:
1796
-
1797
- - normal: Use the heuristic search algorithm.
1798
- - performance: Use the trial search algorithm.
1799
- - implicit_gemm: This algorithm expresses the convolution as a matrix product without actually explicitly
1800
- forming the matrix that holds the input tensor data.
1801
- - implicit_precomp_gemm: This algorithm expresses convolution as a matrix product without actually
1802
- explicitly forming the matrix that holds the input tensor data, but still needs some memory workspace to
1803
- precompute some indices in order to facilitate the implicit construction of the matrix that holds the
1804
- input tensor data.
1805
- - gemm: This algorithm expresses the convolution as an explicit matrix product. A significant memory
1806
- workspace is needed to store the matrix that holds the input tensor data.
1807
- - direct: This algorithm expresses the convolution as a direct convolution (for example, without
1808
- implicitly or explicitly doing a matrix multiplication).
1809
- - fft: This algorithm uses the Fast-Fourier Transform approach to compute the convolution. A significant
1810
- memory workspace is needed to store intermediate results.
1811
- - fft_tiling: This algorithm uses the Fast-Fourier Transform approach but splits the inputs into tiles.
1812
- A significant memory workspace is needed to store intermediate results but less than fft algorithm for
1813
- large size images.
1814
- - winograd: This algorithm uses the Winograd Transform approach to compute the convolution. A reasonably
1815
- sized workspace is needed to store intermediate results.
1816
- - winograd_nonfused: This algorithm uses the Winograd Transform approach to compute the convolution. A
1817
- significant workspace may be needed to store intermediate results.
1818
-
1819
- This parameter will be deprecated and will be removed in future versions. Please use the
1820
- api :func:`mindspore.device_context.gpu.op_tuning.conv_fprop_algo` instead.
1821
1535
 
1822
- - conv_dgrad_algo (str): Specifies convolution data grad algorithm and the default value is 'normal',
1823
- The value range is as follows:
1824
-
1825
- - normal: Use the heuristic search algorithm.
1826
- - performance: Use the trial search algorithm.
1827
- - algo_0: This algorithm expresses the convolution as a sum of matrix products without actually explicitly
1828
- forming the matrix that holds the input tensor data. The sum is done using the atomic add operation,
1829
- thus the results are non-deterministic.
1830
- - algo_1: This algorithm expresses the convolution as a matrix product without actually explicitly forming
1831
- the matrix that holds the input tensor data. The results are deterministic.
1832
- - fft: This algorithm uses a Fast-Fourier Transform approach to compute the convolution. A significant
1833
- memory workspace is needed to store intermediate results. The results are deterministic.
1834
- - fft_tiling: This algorithm uses the Fast-Fourier Transform approach but splits the inputs into tiles.
1835
- A significant memory workspace is needed to store intermediate results but less than fft for large size
1836
- images. The results are deterministic.
1837
- - winograd: This algorithm uses the Winograd Transform approach to compute the convolution. A reasonably
1838
- sized workspace is needed to store intermediate results. The results are deterministic.
1839
- - winograd_nonfused: This algorithm uses the Winograd Transform approach to compute the convolution.
1840
- A significant workspace may be needed to store intermediate results. The results are deterministic.
1841
-
1842
- This parameter will be deprecated and will be removed in future versions. Please use the
1536
+ - conv_fprop_algo (str): Specifies convolution forward algorithm. Default ``"normal"`` .
1537
+ This parameter will be deprecated and removed in future versions. Please use the
1538
+ api :func:`mindspore.device_context.gpu.op_tuning.conv_fprop_algo` instead.
1539
+ - conv_dgrad_algo (str): Specifies convolution data grad algorithm. Default ``"normal"`` .
1540
+ This parameter will be deprecated and removed in future versions. Please use the
1843
1541
  api :func:`mindspore.device_context.gpu.op_tuning.conv_dgrad_algo` instead.
1844
-
1845
- - conv_wgrad_algo (str): Specifies convolution filter grad algorithm and the default value is 'normal',
1846
- The value range is as follows:
1847
-
1848
- - normal: Use the heuristic search algorithm.
1849
- - performance: Use the trial search algorithm.
1850
- - algo_0: This algorithm expresses the convolution as a sum of matrix products without actually explicitly
1851
- forming the matrix that holds the input tensor data. The sum is done using the atomic add operation,
1852
- thus the results are non-deterministic.
1853
- - algo_1: This algorithm expresses the convolution as a matrix product without actually explicitly forming
1854
- the matrix that holds the input tensor data. The results are deterministic.
1855
- - fft: This algorithm uses a Fast-Fourier Transform approach to compute the convolution. A significant
1856
- memory workspace is needed to store intermediate results. The results are deterministic.
1857
- - algo_3: This algorithm is similar to algo_0 but uses some small workspace to precompute some indices.
1858
- The results are also non-deterministic.
1859
- - winograd_nonfused: This algorithm uses the Winograd Transform approach to compute the convolution.
1860
- A significant workspace may be needed to store intermediate results. The results are deterministic.
1861
- - fft_tiling: This algorithm uses the Fast-Fourier Transform approach but splits the inputs into tiles.
1862
- A significant memory workspace is needed to store intermediate results but less than fft for large size
1863
- images. The results are deterministic.
1864
-
1865
- This parameter will be deprecated and will be removed in future versions. Please use the
1542
+ - conv_wgrad_algo (str): Specifies convolution filter grad algorithm. Default ``"normal"`` .
1543
+ This parameter will be deprecated and removed in future versions. Please use the
1866
1544
  api :func:`mindspore.device_context.gpu.op_tuning.conv_wgrad_algo` instead.
1867
-
1868
- - conv_allow_tf32 (bool): The flag below controls to allow Tensor core TF32 computation on CUDNN and the
1869
- default value is ``True``.
1870
- This parameter will be deprecated and will be removed in future versions. Please use the
1545
+ - conv_allow_tf32 (bool): Controls to allow Tensor core TF32 computation on CUDNN.
1546
+ Default ``True``.
1547
+ This parameter will be deprecated and removed in future versions. Please use the
1871
1548
  api :func:`mindspore.device_context.gpu.op_precision.conv_allow_tf32` instead.
1872
- - matmul_allow_tf32 (bool): The flag below controls to allow Tensor core TF32 computation on CUBLAS and the
1873
- default value is ``False``.
1874
- This parameter will be deprecated and will be removed in future versions. Please use the
1549
+ - matmul_allow_tf32 (bool): Controls to allow Tensor core TF32 computation on CUBLAS.
1550
+ Default ``False``.
1551
+ This parameter will be deprecated and removed in future versions. Please use the
1875
1552
  api :func:`mindspore.device_context.gpu.op_precision.matmul_allow_tf32` instead.
1876
-
1877
- jit_config (dict): Set the global jit config for compile, take effect in network defined in Cell or jit
1878
- decorators. It is not set by default.
1879
- The setting in context is the global jit config, while JitConfig is the local network's jit config.
1880
- When both exist simultaneously, the global jit config will not overwrite the local network's jit config.
1881
-
1882
- - jit_level (str): Used to control the compilation optimization level. Default: ``""`` , The framework
1883
- automatically selects the execution method based on product, Atlas training product is O2, and all other
1884
- products are O0. In addition, The option of the dynamic shape must be O0 or O1, O2 is not supported.
1885
- The value range is as follows:
1886
-
1887
- - ``"O0"``: Except for optimizations that may affect functionality, all other optimizations are turned
1888
- off, adopt KernelByKernel execution mode.
1889
- - ``"O1"``: Using commonly used optimizations and automatic operator fusion optimizations,
1890
- adopt KernelByKernel execution mode. This optimization level is experimental and is being improved.
1891
- - ``"O2"``: Ultimate performance optimization, adopt Sink execution mode.
1892
-
1893
- - infer_boost (str): Used to control the infer mode. Default: ``"off"`` . The value range is as follows:
1894
-
1895
- - ``"on"``: Enable infer mode, get better infer performance.
1896
- - ``"off"``: Disable infer mode, use forward to infer, performance is not good.
1897
-
1898
- exec_order (str): Set the sorting method for operator execution in GRAPH_MODE Currently, only two sorting
1899
- methods are supported: bfs and dfs, and the default method is bfs.
1900
-
1901
- - ``"bfs"``: The default sorting method, breadth priority, good communication masking, relatively good
1902
- performance.
1903
- - ``"dfs"``: An optional sorting method, depth-first sorting. The performance is relatively worse than that
1904
- of bfs execution order, but it occupies less memory. It is recommended to try dfs in scenarios where other
1905
- execution orders run out of memory (OOM).
1906
-
1907
- Raises:
1908
- ValueError: If input key is not an attribute in context.
1553
+ print_file_path (str): This parameter will be deprecated and removed in future versions.
1554
+ env_config_path (str): This parameter will be deprecated and removed in future versions.
1555
+ debug_level (int): This parameter will be deprecated and removed in future versions.
1556
+ reserve_class_name_in_scope (bool): This parameter will be deprecated and removed in future versions.
1557
+ check_bprop (bool): This parameter will be deprecated and removed in future versions.
1558
+ enable_reduce_precision (bool): This parameter will be deprecated and removed in a future versions.
1559
+ grad_for_scalar (bool): This parameter will be deprecated and removed in future versions.
1560
+ support_binary (bool): Whether to support run .pyc or .so in graph mode.
1909
1561
 
1910
1562
  Examples:
1911
1563
  >>> import mindspore as ms
@@ -2015,7 +1667,9 @@ def set_context(**kwargs):
2015
1667
  def get_context(attr_key):
2016
1668
 
2017
1669
  """
2018
- Get context attribute value according to the input key.
1670
+ Get context attribute value according to the input key, this api will be deprecated and removed in future versions,
1671
+ please use :func:`mindspore.get_current_device` instead.
1672
+
2019
1673
  If some attributes are not set, they will be automatically obtained.
2020
1674
 
2021
1675
  Args:
@@ -2092,7 +1746,7 @@ class ParallelMode:
2092
1746
  @args_type_check(enable_ps=bool)
2093
1747
  def set_ps_context(**kwargs):
2094
1748
  """
2095
- Set parameter server training mode context.
1749
+ Set parameter server training mode context, this api will be deprecated and removed in future versions.
2096
1750
 
2097
1751
  Note:
2098
1752
  Parameter server mode is only supported in graph mode.
@@ -2113,7 +1767,7 @@ def set_ps_context(**kwargs):
2113
1767
  enable_ps (bool): Whether to enable parameter server training mode.
2114
1768
  Only after enable_ps is set True, the environment variables will be effective.
2115
1769
  Default: ``False`` .
2116
- config_file_path (string): Configuration file path used by recovery, parameter server training mode only
1770
+ config_file_path (str): Configuration file path used by recovery, parameter server training mode only
2117
1771
  supports Server disaster recovery currently. Default: ``''`` .
2118
1772
  scheduler_manage_port (int): Scheduler manage port used to scale out/in. Default: ``11202`` .
2119
1773
  enable_ssl (bool): Set PS SSL mode enabled or disabled. Default: ``False`` .
@@ -2132,19 +1786,21 @@ def set_ps_context(**kwargs):
2132
1786
 
2133
1787
  def get_ps_context(attr_key):
2134
1788
  """
2135
- Get parameter server training mode context attribute value according to the key.
1789
+ Get parameter server training mode context attribute value according to the key, this api will be deprecated and
1790
+ removed in future versions.
2136
1791
 
2137
1792
  Args:
2138
1793
  attr_key (str): The key of the attribute:
2139
1794
 
2140
- - enable_ps (bool): Whether to enable parameter server training mode. Default: ``False`` .
2141
- - config_file_path (string): Configuration file path used by recovery, parameter server training mode only
1795
+ - enable_ps (bool, optional): Whether to enable parameter server training mode. Default: ``False`` .
1796
+ - config_file_path (str, optional): Configuration file path used by recovery,
1797
+ parameter server training mode only
2142
1798
  supports Server disaster recovery currently. Default: ``''`` .
2143
- - scheduler_manage_port (int): Scheduler manage port used to scale out/in. Default: ``11202`` .
2144
- - enable_ssl (bool): Set PS SSL mode enabled or disabled. Default: ``False`` .
2145
- - client_password (str): Password to decrypt the secret key stored in the client certificate.
1799
+ - scheduler_manage_port (int, optional): Scheduler manage port used to scale out/in. Default: ``11202`` .
1800
+ - enable_ssl (bool, optional): Set PS SSL mode enabled or disabled. Default: ``False`` .
1801
+ - client_password (str, optional): Password to decrypt the secret key stored in the client certificate.
2146
1802
  Default: ``''`` .
2147
- - server_password (str): Password to decrypt the secret key stored in the server certificate.
1803
+ - server_password (str, optional): Password to decrypt the secret key stored in the server certificate.
2148
1804
  Default: ``''`` .
2149
1805
 
2150
1806
  Returns:
@@ -2162,7 +1818,8 @@ def get_ps_context(attr_key):
2162
1818
 
2163
1819
  def reset_ps_context():
2164
1820
  """
2165
- Reset parameter server training mode context attributes to the default values.
1821
+ Reset parameter server training mode context attributes to the default values, this api will be deprecated and
1822
+ removed in future versions.
2166
1823
 
2167
1824
  Meaning of each field and its default value refer to :func:`mindspore.set_ps_context`.
2168
1825