mindspore 2.5.0__cp39-cp39-win_amd64.whl → 2.6.0rc1__cp39-cp39-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.
- mindspore/.commit_id +1 -1
- mindspore/Microsoft.VisualStudio.Telemetry.dll +0 -0
- mindspore/Newtonsoft.Json.dll +0 -0
- mindspore/__init__.py +6 -4
- mindspore/_c_dataengine.cp39-win_amd64.pyd +0 -0
- mindspore/_c_expression.cp39-win_amd64.pyd +0 -0
- mindspore/_c_mindrecord.cp39-win_amd64.pyd +0 -0
- mindspore/_check_jit_forbidden_api.py +3 -0
- mindspore/_checkparam.py +3 -33
- mindspore/_deprecated/__init__.py +17 -0
- mindspore/_deprecated/jit.py +198 -0
- mindspore/_extends/builtin_operations.py +1 -1
- mindspore/_extends/parse/__init__.py +6 -7
- mindspore/_extends/parse/compile_config.py +19 -0
- mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +22 -3
- mindspore/_extends/parse/jit_fallback_modules/__init__.py +0 -0
- mindspore/_extends/parse/jit_fallback_modules/check_utils.py +123 -0
- mindspore/_extends/parse/jit_fallback_modules/third_party_modules.py +50 -0
- mindspore/_extends/parse/parser.py +24 -193
- mindspore/_extends/parse/resources.py +1 -5
- mindspore/_extends/parse/standard_method.py +97 -74
- mindspore/_extends/pijit/__init__.py +2 -2
- mindspore/_extends/pijit/pijit_func_white_list.py +16 -11
- mindspore/_extends/pijit/tensor_func_list.py +27 -0
- mindspore/_extends/utils.py +1 -1
- mindspore/amp.py +4 -4
- mindspore/atlprov.dll +0 -0
- mindspore/avcodec-59.dll +0 -0
- mindspore/avdevice-59.dll +0 -0
- mindspore/avfilter-8.dll +0 -0
- mindspore/avformat-59.dll +0 -0
- mindspore/avutil-57.dll +0 -0
- mindspore/boost/__init__.py +2 -2
- mindspore/boost/base.py +3 -7
- mindspore/boost/boost_cell_wrapper.py +2 -2
- mindspore/c1.dll +0 -0
- mindspore/c1xx.dll +0 -0
- mindspore/c2.dll +0 -0
- mindspore/common/__init__.py +4 -3
- mindspore/common/_grad_function.py +56 -0
- mindspore/common/_pijit_context.py +14 -5
- mindspore/common/_register_for_tensor.py +1 -1
- mindspore/common/_stub_tensor.py +5 -10
- mindspore/common/_tensor_cpp_method.py +1 -1
- mindspore/common/_tensor_docs.py +1915 -3287
- mindspore/common/api.py +341 -354
- mindspore/common/auto_dynamic_shape.py +41 -44
- mindspore/common/dtype.py +5 -2
- mindspore/common/dump.py +7 -5
- mindspore/common/file_system.py +3 -0
- mindspore/common/hook_handle.py +5 -3
- mindspore/common/initializer.py +10 -6
- mindspore/common/jit_begin_end.py +94 -0
- mindspore/common/jit_config.py +6 -1
- mindspore/common/jit_context.py +76 -0
- mindspore/common/jit_trace.py +378 -0
- mindspore/common/lazy_inline.py +2 -2
- mindspore/common/mutable.py +5 -4
- mindspore/common/parameter.py +106 -39
- mindspore/common/seed.py +2 -2
- mindspore/common/sparse_tensor.py +23 -17
- mindspore/common/tensor.py +297 -714
- mindspore/communication/__init__.py +7 -5
- mindspore/communication/_comm_helper.py +47 -2
- mindspore/communication/comm_func.py +70 -53
- mindspore/communication/management.py +83 -17
- mindspore/context.py +214 -560
- mindspore/dataset/__init__.py +44 -20
- mindspore/dataset/audio/__init__.py +2 -8
- mindspore/dataset/audio/transforms.py +3 -17
- mindspore/dataset/core/config.py +3 -3
- mindspore/dataset/engine/cache_client.py +1 -1
- mindspore/dataset/engine/datasets.py +102 -120
- mindspore/dataset/engine/datasets_audio.py +22 -22
- mindspore/dataset/engine/datasets_standard_format.py +43 -24
- mindspore/dataset/engine/datasets_text.py +78 -85
- mindspore/dataset/engine/datasets_user_defined.py +108 -76
- mindspore/dataset/engine/datasets_vision.py +111 -108
- mindspore/dataset/engine/iterators.py +5 -3
- mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +1 -1
- mindspore/dataset/engine/samplers.py +279 -57
- mindspore/dataset/engine/serializer_deserializer.py +2 -1
- mindspore/dataset/engine/validators.py +10 -0
- mindspore/dataset/text/__init__.py +7 -6
- mindspore/dataset/text/transforms.py +6 -5
- mindspore/dataset/text/utils.py +3 -3
- mindspore/dataset/transforms/__init__.py +0 -9
- mindspore/dataset/transforms/transforms.py +3 -3
- mindspore/dataset/utils/browse_dataset.py +1 -1
- mindspore/dataset/vision/__init__.py +2 -9
- mindspore/dataset/vision/transforms.py +202 -158
- mindspore/dataset/vision/utils.py +7 -5
- mindspore/device_context/ascend/op_debug.py +60 -1
- mindspore/device_context/ascend/op_tuning.py +0 -4
- mindspore/device_manager.py +39 -3
- mindspore/dnnl.dll +0 -0
- mindspore/dpcmi.dll +0 -0
- mindspore/experimental/es/embedding_service.py +35 -27
- mindspore/experimental/map_parameter.py +4 -4
- mindspore/experimental/optim/adadelta.py +22 -26
- mindspore/experimental/optim/adagrad.py +4 -4
- mindspore/experimental/optim/adam.py +4 -0
- mindspore/experimental/optim/adamax.py +4 -4
- mindspore/experimental/optim/adamw.py +4 -0
- mindspore/experimental/optim/asgd.py +1 -1
- mindspore/experimental/optim/lr_scheduler.py +40 -22
- mindspore/experimental/optim/radam.py +5 -5
- mindspore/experimental/optim/rprop.py +1 -1
- mindspore/experimental/optim/sgd.py +1 -1
- mindspore/hal/contiguous_tensors_handle.py +6 -10
- mindspore/hal/device.py +55 -81
- mindspore/hal/event.py +38 -55
- mindspore/hal/memory.py +93 -144
- mindspore/hal/stream.py +81 -125
- mindspore/include/dataset/constants.h +7 -4
- mindspore/include/dataset/execute.h +2 -2
- mindspore/jpeg62.dll +0 -0
- mindspore/log.py +40 -2
- mindspore/mindrecord/__init__.py +20 -7
- mindspore/mindspore_backend_common.dll +0 -0
- mindspore/mindspore_backend_manager.dll +0 -0
- mindspore/mindspore_common.dll +0 -0
- mindspore/mindspore_core.dll +0 -0
- mindspore/mindspore_dump.dll +0 -0
- mindspore/mindspore_frontend.dll +0 -0
- mindspore/mindspore_glog.dll +0 -0
- mindspore/mindspore_memory_pool.dll +0 -0
- mindspore/mindspore_ms_backend.dll +0 -0
- mindspore/mindspore_ops.dll +0 -0
- mindspore/{mindspore_backend.dll → mindspore_ops_host.dll} +0 -0
- mindspore/mindspore_ops_kernel_common.dll +0 -0
- mindspore/mindspore_profiler.dll +0 -0
- mindspore/mindspore_pyboost.dll +0 -0
- mindspore/mindspore_pynative.dll +0 -0
- mindspore/mindspore_res_manager.dll +0 -0
- mindspore/mindspore_runtime_pipeline.dll +0 -0
- mindspore/mint/__init__.py +131 -700
- mindspore/mint/distributed/__init__.py +5 -1
- mindspore/mint/distributed/distributed.py +194 -109
- mindspore/mint/linalg/__init__.py +2 -0
- mindspore/mint/nn/__init__.py +280 -18
- mindspore/mint/nn/functional.py +282 -64
- mindspore/mint/nn/layer/__init__.py +4 -0
- mindspore/mint/nn/layer/_functions.py +7 -3
- mindspore/mint/nn/layer/activation.py +120 -13
- mindspore/mint/nn/layer/conv.py +218 -24
- mindspore/mint/nn/layer/normalization.py +15 -16
- mindspore/mint/nn/layer/padding.py +1 -1
- mindspore/mint/nn/layer/pooling.py +66 -1
- mindspore/mint/optim/__init__.py +2 -1
- mindspore/mint/optim/sgd.py +171 -0
- mindspore/msobj140.dll +0 -0
- mindspore/mspdb140.dll +0 -0
- mindspore/mspdbcore.dll +0 -0
- mindspore/mspdbst.dll +0 -0
- mindspore/mspft140.dll +0 -0
- mindspore/msvcdis140.dll +0 -0
- mindspore/msvcp140_1.dll +0 -0
- mindspore/msvcp140_2.dll +0 -0
- mindspore/msvcp140_atomic_wait.dll +0 -0
- mindspore/msvcp140_codecvt_ids.dll +0 -0
- mindspore/nn/__init__.py +4 -1
- mindspore/nn/cell.py +1250 -176
- mindspore/nn/layer/activation.py +23 -21
- mindspore/nn/layer/basic.py +22 -16
- mindspore/nn/layer/container.py +1 -1
- mindspore/nn/layer/conv.py +22 -17
- mindspore/nn/layer/embedding.py +9 -8
- mindspore/nn/layer/normalization.py +48 -42
- mindspore/nn/layer/pooling.py +75 -31
- mindspore/nn/layer/transformer.py +11 -10
- mindspore/nn/learning_rate_schedule.py +4 -2
- mindspore/nn/loss/loss.py +27 -19
- mindspore/nn/optim/ada_grad.py +6 -5
- mindspore/nn/optim/adadelta.py +9 -7
- mindspore/nn/optim/adafactor.py +1 -1
- mindspore/nn/optim/adam.py +16 -12
- mindspore/nn/optim/adamax.py +8 -7
- mindspore/nn/optim/adasum.py +5 -5
- mindspore/nn/optim/asgd.py +1 -1
- mindspore/nn/optim/ftrl.py +11 -9
- mindspore/nn/optim/lamb.py +1 -1
- mindspore/nn/optim/lazyadam.py +12 -10
- mindspore/nn/optim/momentum.py +7 -6
- mindspore/nn/optim/optimizer.py +2 -2
- mindspore/nn/optim/proximal_ada_grad.py +12 -10
- mindspore/nn/optim/rmsprop.py +13 -12
- mindspore/nn/optim/rprop.py +9 -7
- mindspore/nn/optim/sgd.py +9 -6
- mindspore/nn/optim/tft_wrapper.py +5 -2
- mindspore/nn/probability/bijector/bijector.py +17 -11
- mindspore/nn/probability/bijector/gumbel_cdf.py +5 -5
- mindspore/nn/probability/bijector/invert.py +2 -2
- mindspore/nn/probability/bijector/scalar_affine.py +3 -3
- mindspore/nn/probability/bijector/softplus.py +3 -2
- mindspore/nn/probability/distribution/beta.py +3 -3
- mindspore/nn/probability/distribution/categorical.py +1 -1
- mindspore/nn/probability/distribution/cauchy.py +4 -2
- mindspore/nn/probability/distribution/exponential.py +6 -7
- mindspore/nn/probability/distribution/gamma.py +2 -2
- mindspore/nn/probability/distribution/gumbel.py +2 -2
- mindspore/nn/probability/distribution/half_normal.py +5 -3
- mindspore/nn/probability/distribution/logistic.py +5 -3
- mindspore/nn/probability/distribution/poisson.py +1 -1
- mindspore/nn/probability/distribution/uniform.py +5 -3
- mindspore/nn/reinforcement/_tensors_queue.py +1 -1
- mindspore/nn/reinforcement/tensor_array.py +1 -1
- mindspore/nn/wrap/__init__.py +6 -6
- mindspore/nn/wrap/cell_wrapper.py +178 -117
- mindspore/nn/wrap/grad_reducer.py +45 -36
- mindspore/nn/wrap/loss_scale.py +3 -3
- mindspore/numpy/array_creations.py +3 -3
- mindspore/numpy/array_ops.py +1 -1
- mindspore/numpy/math_ops.py +4 -4
- mindspore/numpy/utils.py +1 -2
- mindspore/numpy/utils_const.py +1 -2
- mindspore/opencv_core452.dll +0 -0
- mindspore/opencv_imgcodecs452.dll +0 -0
- mindspore/opencv_imgproc452.dll +0 -0
- mindspore/ops/__init__.py +3 -2
- mindspore/ops/_grad_experimental/grad_comm_ops.py +18 -3
- mindspore/ops/_grad_experimental/grad_debug_ops.py +8 -1
- mindspore/ops/_grad_experimental/taylor_rule.py +29 -0
- mindspore/ops/_register_for_op.py +0 -11
- mindspore/{ops_generate → ops/_utils}/arg_dtype_cast.py +123 -4
- mindspore/{ops_generate → ops/_utils}/arg_handler.py +3 -4
- mindspore/ops/_vmap/vmap_array_ops.py +7 -6
- mindspore/ops/_vmap/vmap_grad_nn_ops.py +2 -1
- mindspore/ops/_vmap/vmap_math_ops.py +4 -7
- mindspore/ops/_vmap/vmap_nn_ops.py +9 -8
- mindspore/ops/auto_generate/__init__.py +4 -3
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +102 -49
- mindspore/ops/auto_generate/gen_extend_func.py +281 -135
- mindspore/ops/auto_generate/gen_ops_def.py +2574 -2326
- mindspore/ops/auto_generate/gen_ops_prim.py +8566 -2755
- mindspore/ops/auto_generate/pyboost_inner_prim.py +106 -76
- mindspore/ops/composite/__init__.py +2 -1
- mindspore/ops/composite/base.py +19 -24
- mindspore/ops/composite/math_ops.py +6 -16
- mindspore/ops/composite/multitype_ops/__init__.py +5 -2
- mindspore/ops/composite/multitype_ops/_compile_utils.py +2 -3
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -2
- mindspore/ops/composite/multitype_ops/add_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/bitwise_and_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/bitwise_or_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/bitwise_xor_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/div_impl.py +6 -4
- mindspore/ops/composite/multitype_ops/equal_impl.py +4 -3
- mindspore/ops/composite/multitype_ops/floordiv_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/getitem_impl.py +3 -2
- mindspore/ops/composite/multitype_ops/greater_equal_impl.py +4 -3
- mindspore/ops/composite/multitype_ops/greater_impl.py +4 -3
- mindspore/ops/composite/multitype_ops/in_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/invert_impl.py +50 -0
- mindspore/ops/composite/multitype_ops/left_shift_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/less_equal_impl.py +4 -3
- mindspore/ops/composite/multitype_ops/less_impl.py +4 -3
- mindspore/ops/composite/multitype_ops/logic_not_impl.py +3 -2
- mindspore/ops/composite/multitype_ops/logical_and_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/logical_or_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/mod_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/mul_impl.py +3 -2
- mindspore/ops/composite/multitype_ops/negative_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/not_equal_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/not_in_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/ones_like_impl.py +18 -0
- mindspore/ops/composite/multitype_ops/pow_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/right_shift_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/setitem_impl.py +2 -1
- mindspore/ops/composite/multitype_ops/sub_impl.py +2 -1
- mindspore/ops/function/__init__.py +28 -2
- mindspore/ops/function/_add_attr_func.py +58 -0
- mindspore/ops/function/array_func.py +1629 -2345
- mindspore/ops/function/clip_func.py +38 -45
- mindspore/ops/function/debug_func.py +36 -44
- mindspore/ops/function/grad/__init__.py +1 -0
- mindspore/ops/function/grad/grad_func.py +104 -71
- mindspore/ops/function/image_func.py +1 -1
- mindspore/ops/function/linalg_func.py +46 -78
- mindspore/ops/function/math_func.py +3035 -3705
- mindspore/ops/function/nn_func.py +676 -241
- mindspore/ops/function/other_func.py +159 -1
- mindspore/ops/function/parameter_func.py +17 -30
- mindspore/ops/function/random_func.py +204 -361
- mindspore/ops/function/reshard_func.py +4 -70
- mindspore/ops/function/sparse_func.py +3 -3
- mindspore/ops/function/sparse_unary_func.py +5 -5
- mindspore/ops/function/spectral_func.py +25 -58
- mindspore/ops/function/vmap_func.py +24 -17
- mindspore/ops/functional.py +6 -4
- mindspore/ops/functional_overload.py +547 -4
- mindspore/ops/op_info_register.py +32 -244
- mindspore/ops/operations/__init__.py +10 -5
- mindspore/ops/operations/_custom_ops_utils.py +247 -0
- mindspore/ops/operations/_grad_ops.py +1 -10
- mindspore/ops/operations/_inner_ops.py +5 -76
- mindspore/ops/operations/_ms_kernel.py +4 -10
- mindspore/ops/operations/_rl_inner_ops.py +1 -1
- mindspore/ops/operations/_scalar_ops.py +3 -2
- mindspore/ops/operations/_sequence_ops.py +1 -1
- mindspore/ops/operations/_tensor_array.py +1 -1
- mindspore/ops/operations/array_ops.py +37 -22
- mindspore/ops/operations/comm_ops.py +150 -107
- mindspore/ops/operations/custom_ops.py +221 -23
- mindspore/ops/operations/debug_ops.py +115 -16
- mindspore/ops/operations/inner_ops.py +1 -1
- mindspore/ops/operations/linalg_ops.py +1 -58
- mindspore/ops/operations/manually_defined/_inner.py +1 -1
- mindspore/ops/operations/manually_defined/ops_def.py +746 -79
- mindspore/ops/operations/math_ops.py +21 -18
- mindspore/ops/operations/nn_ops.py +65 -191
- mindspore/ops/operations/other_ops.py +62 -9
- mindspore/ops/operations/random_ops.py +13 -7
- mindspore/ops/operations/reshard_ops.py +1 -1
- mindspore/ops/operations/sparse_ops.py +2 -2
- mindspore/ops/primitive.py +43 -32
- mindspore/ops/tensor_method.py +232 -13
- mindspore/ops_generate/__init__.py +0 -5
- mindspore/ops_generate/aclnn/__init__.py +0 -0
- mindspore/ops_generate/{aclnn_kernel_register_auto_cc_generator.py → aclnn/aclnn_kernel_register_auto_cc_generator.py} +43 -18
- mindspore/ops_generate/{gen_aclnn_implement.py → aclnn/gen_aclnn_implement.py} +49 -51
- mindspore/ops_generate/api/__init__.py +0 -0
- mindspore/ops_generate/{add_tensor_docs_generator.py → api/add_tensor_docs_generator.py} +9 -7
- mindspore/ops_generate/{cpp_create_prim_instance_helper_generator.py → api/cpp_create_prim_instance_helper_generator.py} +6 -9
- mindspore/ops_generate/{functional_map_cpp_generator.py → api/functional_map_cpp_generator.py} +25 -12
- mindspore/ops_generate/{functional_overload_py_generator.py → api/functional_overload_py_generator.py} +8 -6
- mindspore/ops_generate/{functions_cc_generator.py → api/functions_cc_generator.py} +14 -10
- mindspore/ops_generate/api/gen_api.py +103 -0
- mindspore/ops_generate/{op_api_proto.py → api/op_api_proto.py} +98 -69
- mindspore/ops_generate/{tensor_func_reg_cpp_generator.py → api/tensor_func_reg_cpp_generator.py} +82 -43
- mindspore/ops_generate/common/__init__.py +0 -0
- mindspore/ops_generate/common/gen_constants.py +91 -0
- mindspore/ops_generate/{gen_utils.py → common/gen_utils.py} +72 -19
- mindspore/ops_generate/{op_proto.py → common/op_proto.py} +64 -1
- mindspore/ops_generate/{template.py → common/template.py} +96 -84
- mindspore/ops_generate/gen_ops.py +23 -325
- mindspore/ops_generate/op_def/__init__.py +0 -0
- mindspore/ops_generate/op_def/gen_op_def.py +90 -0
- mindspore/ops_generate/{lite_ops_cpp_generator.py → op_def/lite_ops_cpp_generator.py} +47 -11
- mindspore/ops_generate/{ops_def_cc_generator.py → op_def/ops_def_cc_generator.py} +18 -7
- mindspore/ops_generate/{ops_def_h_generator.py → op_def/ops_def_h_generator.py} +5 -5
- mindspore/ops_generate/{ops_name_h_generator.py → op_def/ops_name_h_generator.py} +30 -15
- mindspore/ops_generate/op_def/ops_primitive_h_generator.py +125 -0
- mindspore/ops_generate/op_def_py/__init__.py +0 -0
- mindspore/ops_generate/op_def_py/gen_op_def_py.py +47 -0
- mindspore/ops_generate/{op_def_py_generator.py → op_def_py/op_def_py_generator.py} +6 -5
- mindspore/ops_generate/{op_prim_py_generator.py → op_def_py/op_prim_py_generator.py} +24 -15
- mindspore/ops_generate/pyboost/__init__.py +0 -0
- mindspore/ops_generate/{auto_grad_impl_cc_generator.py → pyboost/auto_grad_impl_cc_generator.py} +11 -7
- mindspore/ops_generate/{auto_grad_reg_cc_generator.py → pyboost/auto_grad_reg_cc_generator.py} +7 -7
- mindspore/ops_generate/{gen_pyboost_func.py → pyboost/gen_pyboost_func.py} +40 -16
- mindspore/ops_generate/{op_template_parser.py → pyboost/op_template_parser.py} +105 -24
- mindspore/ops_generate/{pyboost_functions_cpp_generator.py → pyboost/pyboost_functions_cpp_generator.py} +55 -18
- mindspore/ops_generate/{pyboost_functions_h_generator.py → pyboost/pyboost_functions_h_generator.py} +42 -10
- mindspore/ops_generate/{pyboost_functions_py_generator.py → pyboost/pyboost_functions_py_generator.py} +6 -6
- mindspore/ops_generate/{pyboost_grad_function_cpp_generator.py → pyboost/pyboost_grad_function_cpp_generator.py} +11 -10
- mindspore/ops_generate/{pyboost_inner_prim_generator.py → pyboost/pyboost_inner_prim_generator.py} +8 -7
- mindspore/ops_generate/{pyboost_native_grad_functions_generator.py → pyboost/pyboost_native_grad_functions_generator.py} +14 -10
- mindspore/ops_generate/{pyboost_op_cpp_code_generator.py → pyboost/pyboost_op_cpp_code_generator.py} +140 -53
- mindspore/ops_generate/{pyboost_overload_functions_cpp_generator.py → pyboost/pyboost_overload_functions_cpp_generator.py} +28 -15
- mindspore/ops_generate/{pyboost_utils.py → pyboost/pyboost_utils.py} +88 -4
- mindspore/ops_generate/resources/__init__.py +0 -0
- mindspore/ops_generate/resources/resource_list.py +30 -0
- mindspore/ops_generate/resources/resource_loader.py +36 -0
- mindspore/ops_generate/resources/resource_manager.py +64 -0
- mindspore/ops_generate/resources/yaml_loader.py +88 -0
- mindspore/ops_generate/tensor_py_cc_generator.py +122 -0
- mindspore/parallel/__init__.py +6 -2
- mindspore/parallel/_auto_parallel_context.py +133 -6
- mindspore/parallel/_cell_wrapper.py +130 -15
- mindspore/parallel/_parallel_serialization.py +95 -4
- mindspore/parallel/_ps_context.py +1 -1
- mindspore/parallel/_recovery_context.py +7 -2
- mindspore/parallel/_tensor.py +142 -18
- mindspore/parallel/_utils.py +198 -25
- mindspore/parallel/algo_parameter_config.py +3 -3
- mindspore/parallel/auto_parallel.py +732 -0
- mindspore/parallel/checkpoint_convert.py +159 -0
- mindspore/parallel/checkpoint_transform.py +656 -37
- mindspore/parallel/cluster/process_entity/_api.py +151 -19
- mindspore/parallel/cluster/run.py +1 -1
- mindspore/parallel/function/__init__.py +24 -0
- mindspore/parallel/function/reshard_func.py +259 -0
- mindspore/parallel/nn/__init__.py +25 -0
- mindspore/parallel/nn/parallel_cell_wrapper.py +263 -0
- mindspore/parallel/nn/parallel_grad_reducer.py +169 -0
- mindspore/parallel/parameter_broadcast.py +24 -13
- mindspore/parallel/shard.py +137 -61
- mindspore/parallel/transform_safetensors.py +287 -95
- mindspore/pgodb140.dll +0 -0
- mindspore/pgort140.dll +0 -0
- mindspore/profiler/__init__.py +9 -5
- mindspore/profiler/analysis/parser/ascend_cann_parser.py +6 -2
- mindspore/profiler/analysis/parser/ms_framework_parser.py +4 -4
- mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +7 -4
- mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +22 -0
- mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +241 -86
- mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +41 -2
- mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +33 -35
- mindspore/profiler/analysis/viewer/ascend_memory_viewer.py +7 -0
- mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +8 -3
- mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +141 -30
- mindspore/profiler/analysis/viewer/ms_dataset_viewer.py +5 -6
- mindspore/profiler/common/ascend_msprof_exporter.py +5 -4
- mindspore/profiler/common/constant.py +12 -0
- mindspore/profiler/common/msprof_cmd_tool.py +42 -23
- mindspore/profiler/common/path_manager.py +24 -0
- mindspore/profiler/common/profiler_context.py +26 -2
- mindspore/profiler/common/profiler_meta_data.py +74 -0
- mindspore/profiler/common/profiler_parameters.py +59 -18
- mindspore/profiler/common/profiler_path_manager.py +66 -7
- mindspore/profiler/dynamic_profiler.py +112 -79
- mindspore/profiler/envprofiler.py +26 -1
- mindspore/profiler/experimental_config.py +197 -0
- mindspore/profiler/mstx.py +57 -14
- mindspore/profiler/platform/npu_profiler.py +33 -7
- mindspore/profiler/profiler.py +541 -45
- mindspore/profiler/profiler_action_controller.py +1 -1
- mindspore/profiler/profiler_interface.py +4 -0
- mindspore/profiler/schedule.py +57 -22
- mindspore/rewrite/api/node.py +15 -13
- mindspore/rewrite/api/symbol_tree.py +1 -1
- mindspore/run_check/_check_version.py +25 -14
- mindspore/run_check/run_check.py +1 -1
- mindspore/runtime/__init__.py +2 -2
- mindspore/runtime/executor.py +40 -11
- mindspore/runtime/memory.py +25 -8
- mindspore/safeguard/rewrite_obfuscation.py +12 -9
- mindspore/swresample-4.dll +0 -0
- mindspore/swscale-6.dll +0 -0
- mindspore/tbbmalloc.dll +0 -0
- mindspore/tinyxml2.dll +0 -0
- mindspore/train/__init__.py +8 -8
- mindspore/train/_utils.py +35 -7
- mindspore/train/amp.py +1 -1
- mindspore/train/callback/__init__.py +2 -2
- mindspore/train/callback/_callback.py +2 -16
- mindspore/train/callback/_checkpoint.py +24 -40
- mindspore/train/callback/_cluster_monitor.py +14 -18
- mindspore/train/callback/_flops_collector.py +2 -3
- mindspore/train/callback/_history.py +7 -4
- mindspore/train/callback/_lambda_callback.py +2 -2
- mindspore/train/callback/_landscape.py +0 -3
- mindspore/train/callback/_loss_monitor.py +2 -1
- mindspore/train/callback/_on_request_exit.py +6 -5
- mindspore/train/callback/_reduce_lr_on_plateau.py +11 -6
- mindspore/train/callback/_summary_collector.py +8 -13
- mindspore/train/callback/_time_monitor.py +2 -1
- mindspore/train/callback/{_tft_register.py → _train_fault_tolerance.py} +179 -103
- mindspore/train/data_sink.py +25 -2
- mindspore/train/dataset_helper.py +4 -5
- mindspore/train/loss_scale_manager.py +8 -7
- mindspore/train/metrics/accuracy.py +3 -3
- mindspore/train/metrics/confusion_matrix.py +9 -9
- mindspore/train/metrics/error.py +3 -3
- mindspore/train/metrics/hausdorff_distance.py +4 -4
- mindspore/train/metrics/mean_surface_distance.py +3 -3
- mindspore/train/metrics/metric.py +0 -12
- mindspore/train/metrics/occlusion_sensitivity.py +4 -2
- mindspore/train/metrics/precision.py +8 -6
- mindspore/train/metrics/recall.py +9 -9
- mindspore/train/metrics/root_mean_square_surface_distance.py +2 -2
- mindspore/train/mind_ir_pb2.py +19 -12
- mindspore/train/model.py +176 -103
- mindspore/train/serialization.py +246 -988
- mindspore/train/summary/_summary_adapter.py +2 -2
- mindspore/train/summary/summary_record.py +1 -1
- mindspore/turbojpeg.dll +0 -0
- mindspore/utils/__init__.py +3 -2
- mindspore/utils/dryrun.py +4 -2
- mindspore/utils/hooks.py +81 -0
- mindspore/utils/utils.py +138 -4
- mindspore/vcmeta.dll +0 -0
- mindspore/vcruntime140.dll +0 -0
- mindspore/vcruntime140_1.dll +0 -0
- mindspore/version.py +1 -1
- {mindspore-2.5.0.dist-info → mindspore-2.6.0rc1.dist-info}/METADATA +2 -1
- {mindspore-2.5.0.dist-info → mindspore-2.6.0rc1.dist-info}/RECORD +483 -438
- mindspore/_install_custom.py +0 -43
- mindspore/common/_register_for_adapter.py +0 -74
- mindspore/ops/auto_generate/gen_arg_dtype_cast.py +0 -252
- mindspore/ops/auto_generate/gen_arg_handler.py +0 -136
- mindspore/ops/operations/_opaque_predicate_registry.py +0 -41
- mindspore/ops_generate/gen_constants.py +0 -190
- mindspore/ops_generate/gen_ops_inner_prim.py +0 -131
- mindspore/ops_generate/ops_primitive_h_generator.py +0 -81
- /mindspore/ops_generate/{base_generator.py → common/base_generator.py} +0 -0
- {mindspore-2.5.0.dist-info → mindspore-2.6.0rc1.dist-info}/WHEEL +0 -0
- {mindspore-2.5.0.dist-info → mindspore-2.6.0rc1.dist-info}/entry_points.txt +0 -0
- {mindspore-2.5.0.dist-info → mindspore-2.6.0rc1.dist-info}/top_level.txt +0 -0
|
@@ -495,7 +495,7 @@ def get_image_num_channels(image):
|
|
|
495
495
|
|
|
496
496
|
Raises:
|
|
497
497
|
RuntimeError: If the dimension of `image` is less than 2.
|
|
498
|
-
TypeError: If `image` is not of type
|
|
498
|
+
TypeError: If `image` is not of type numpy.ndarray or PIL Image.
|
|
499
499
|
|
|
500
500
|
Examples:
|
|
501
501
|
>>> import mindspore.dataset.vision as vision
|
|
@@ -528,7 +528,7 @@ def get_image_size(image):
|
|
|
528
528
|
|
|
529
529
|
Raises:
|
|
530
530
|
RuntimeError: If the dimension of `image` is less than 2.
|
|
531
|
-
TypeError: If `image` is not of type
|
|
531
|
+
TypeError: If `image` is not of type type numpy.ndarray or PIL Image.
|
|
532
532
|
|
|
533
533
|
Examples:
|
|
534
534
|
>>> import mindspore.dataset.vision as vision
|
|
@@ -635,10 +635,12 @@ def read_video(filename, start_pts=0, end_pts=None, pts_unit="pts"):
|
|
|
635
635
|
|
|
636
636
|
Args:
|
|
637
637
|
filename(str): The path to the video file to be read.
|
|
638
|
-
start_pts(Union[float, Fraction, int], optional): The start presentation timestamp of the video.
|
|
639
|
-
|
|
638
|
+
start_pts(Union[float, Fraction, int], optional): The start presentation timestamp of the video.
|
|
639
|
+
Default: ``0``.
|
|
640
|
+
end_pts(Union[float, Fraction, int], optional): The end presentation timestamp of the video.
|
|
641
|
+
Default: ``None``.
|
|
640
642
|
The None is represented by 2147483647.
|
|
641
|
-
pts_unit(str, optional): The unit of the timestamps. It can be any of ["pts", "sec"]. Default: "pts"
|
|
643
|
+
pts_unit(str, optional): The unit of the timestamps. It can be any of ["pts", "sec"]. Default: ``"pts"``.
|
|
642
644
|
|
|
643
645
|
Returns:
|
|
644
646
|
- numpy.ndarray, four dimensions uint8 data for video. The format is [T, H, W, C]. `T` is the number of frames,
|
|
@@ -35,7 +35,7 @@ def execute_timeout(op_timeout):
|
|
|
35
35
|
Args:
|
|
36
36
|
op_timeout (int): Set the maximum duration of executing an operator in seconds.
|
|
37
37
|
If the execution time exceeds this value, system will terminate the task.
|
|
38
|
-
0 means endless wait. The defaults for AI Core and
|
|
38
|
+
0 means endless wait. The defaults for AI Core and AI CPU operators vary on different hardware.
|
|
39
39
|
|
|
40
40
|
Examples:
|
|
41
41
|
>>> import mindspore as ms
|
|
@@ -92,3 +92,62 @@ def debug_option(option_value):
|
|
|
92
92
|
f"to 'oom' currently, but got {option_value}."
|
|
93
93
|
)
|
|
94
94
|
AscendOpDebugConf.get_instance().set_debug_option(option_value)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def aclinit_config(config):
|
|
98
|
+
"""
|
|
99
|
+
Configure the configuration items for the aclInit interface.
|
|
100
|
+
please refer to `Ascend Community document about aclInit.
|
|
101
|
+
<https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/800alpha003/apiref/appdevgapi/aclcppdevg_03_0022.html>`_.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
config(dict): When initializing AscendCL, you can enable or configure the
|
|
105
|
+
following features through this configuration interface.
|
|
106
|
+
|
|
107
|
+
- ``"max_opqueue_num"``: When executing using the single-operator model method, to save memory and balance
|
|
108
|
+
the performance of calls, you can configure the maximum length of the single-operator model mapping
|
|
109
|
+
queue through the max_opqueue_num parameter. If the length reaches the maximum, the system will first
|
|
110
|
+
delete the mapping information that has not been used for a long time and the cached single-operator
|
|
111
|
+
model, and then load the latest mapping information and the corresponding single-operator model.
|
|
112
|
+
If the maximum length of the mapping queue is not configured, the default maximum length is 20,000.
|
|
113
|
+
- ``"err_msg_mode"``: This parameter is used to control the level at which error information is retrieved,
|
|
114
|
+
either by process or by thread. The default level is by process. "0" indicating that error information
|
|
115
|
+
is retrieved by thread.
|
|
116
|
+
"1" is the default value, indicates that error information is retrieved by process.
|
|
117
|
+
- ``"dump"``: This parameter is used to enable exception dump for Ascend operators. The value can be set to
|
|
118
|
+
{"dump_scene": "lite_exception"}, {"dump_scene": "lite_exception:disable"}.
|
|
119
|
+
{"dump_scene": "lite_exception"} indicates that the exception dump is enabled.
|
|
120
|
+
{"dump_scene": "lite_exception:disable"} indicates that the exception dump is disabled.
|
|
121
|
+
{"dump_scene": "lite_exception"} is the default value, indicates that the exception dump is enabled.
|
|
122
|
+
|
|
123
|
+
Examples:
|
|
124
|
+
>>> import mindspore as ms
|
|
125
|
+
>>> ms.set_device("Ascend", 0)
|
|
126
|
+
>>> ms.device_context.ascend.op_debug.aclinit_config({"max_opqueue_num": "20000", "err_msg_mode": "1",
|
|
127
|
+
... "dump": {"dump_scene": "lite_exception"}})
|
|
128
|
+
"""
|
|
129
|
+
aclinit_cfg_modes = {
|
|
130
|
+
"max_opqueue_num": (str,),
|
|
131
|
+
"err_msg_mode": ['0', '1'],
|
|
132
|
+
"dump": [{"dump_scene": "lite_exception"}, {"dump_scene": "lite_exception:disable"}],
|
|
133
|
+
}
|
|
134
|
+
instance = AscendOpDebugConf.get_instance()
|
|
135
|
+
aclinit_cfg_setters = {
|
|
136
|
+
"max_opqueue_num": instance.set_max_opqueue_num,
|
|
137
|
+
"err_msg_mode": instance.set_err_msg_mode,
|
|
138
|
+
"dump": instance.set_lite_exception_dump
|
|
139
|
+
}
|
|
140
|
+
aclinit_cfg_set = tuple(aclinit_cfg_modes.keys())
|
|
141
|
+
for key, value in config.items():
|
|
142
|
+
if key not in aclinit_cfg_set:
|
|
143
|
+
raise ValueError(f"For 'ms.device_context.ascend.op_debug.aclinit_config', the key must be one of "
|
|
144
|
+
f"{aclinit_cfg_set}, but got {key}.")
|
|
145
|
+
supported_modes = aclinit_cfg_modes.get(key)
|
|
146
|
+
if isinstance(supported_modes, list) and value not in supported_modes:
|
|
147
|
+
raise ValueError(f"For 'ms.device_context.ascend.op_debug.aclinit_config', the value of argument {key} "
|
|
148
|
+
f"must be one of {supported_modes}, but got {value}.")
|
|
149
|
+
if isinstance(supported_modes, tuple) and not isinstance(value, supported_modes):
|
|
150
|
+
raise TypeError(f"For 'ms.device_context.ascend.op_debug.aclinit_config', the type of argument {key} "
|
|
151
|
+
f"must be one of {supported_modes}, but got {type(value)}.")
|
|
152
|
+
cfg_setter = aclinit_cfg_setters.get(key)
|
|
153
|
+
cfg_setter(value)
|
|
@@ -61,8 +61,6 @@ def op_compile(value):
|
|
|
61
61
|
def aoe_tune_mode(tune_mode):
|
|
62
62
|
"""
|
|
63
63
|
AOE tuning mode setting, which is not set by default.
|
|
64
|
-
For detailed information, please refer to `Ascend Optimization Enging
|
|
65
|
-
<https://www.mindspore.cn/docs/en/master/model_train/optimize/aoe.html>`_ .
|
|
66
64
|
|
|
67
65
|
Args:
|
|
68
66
|
tune_mode (str): AOE tuning mode setting.
|
|
@@ -97,8 +95,6 @@ def aoe_job_type(config):
|
|
|
97
95
|
Set the parameters specific to Ascend Optimization Engine.It needs to be used in
|
|
98
96
|
conjunction with mindspore.device_context.op_tuning.aoe_tune_mode(tune_mode).
|
|
99
97
|
The framework set to "2" by default.
|
|
100
|
-
For detailed information, please refer to `Ascend Optimization Enging
|
|
101
|
-
<https://www.mindspore.cn/docs/en/master/model_train/optimize/aoe.html>`_ .
|
|
102
98
|
|
|
103
99
|
Args:
|
|
104
100
|
config (str): Choose the tuning type.
|
mindspore/device_manager.py
CHANGED
|
@@ -21,7 +21,24 @@ from mindspore._c_expression import DeviceManagerConf, DeviceContextManager, MSC
|
|
|
21
21
|
from mindspore._checkparam import args_type_check
|
|
22
22
|
from mindspore.parallel._ps_context import _need_reset_device_target_for_ps
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
|
|
25
|
+
__all__ = ['set_device', 'set_deterministic', 'get_current_device']
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DeviceInfo(tuple):
|
|
29
|
+
"""
|
|
30
|
+
DeviceInfo class. Store the current device target and the corresponding device id.
|
|
31
|
+
"""
|
|
32
|
+
def __new__(cls, device_target, device_id):
|
|
33
|
+
return super().__new__(cls, (device_target, device_id))
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def device_target(self):
|
|
37
|
+
return self[0]
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def device_id(self):
|
|
41
|
+
return self[1]
|
|
25
42
|
|
|
26
43
|
|
|
27
44
|
@args_type_check(device_target=str, device_id=int)
|
|
@@ -35,13 +52,13 @@ def set_device(device_target, device_id=None):
|
|
|
35
52
|
|
|
36
53
|
Args:
|
|
37
54
|
device_target (str): The target device to run, only support "Ascend", "GPU", and "CPU".
|
|
38
|
-
device_id (int): ID of the target device, the value must be in [0, device_num_per_host-1]
|
|
55
|
+
device_id (int, optional): ID of the target device, the value must be in [0, device_num_per_host-1],
|
|
56
|
+
where device_num_per_host refers to the total number of devices on the host. Default: ``None`` .
|
|
39
57
|
The frame will set different default behaviours according to the scenario:
|
|
40
58
|
if it is a single-card scenario, the frame will be set to 0.
|
|
41
59
|
In a distributed scenario where msrun is started, the framework will
|
|
42
60
|
automatically negotiate the available device_id values.
|
|
43
61
|
In a distributed scenario with other startup methods, the frame is set to 0.
|
|
44
|
-
"device_num_per_host" refers to the total number of devices on the host.
|
|
45
62
|
|
|
46
63
|
Examples:
|
|
47
64
|
>>> import mindspore as ms
|
|
@@ -79,6 +96,25 @@ def set_device(device_target, device_id=None):
|
|
|
79
96
|
DeviceManagerConf.get_instance().set_device(device_target, device_id, is_default)
|
|
80
97
|
|
|
81
98
|
|
|
99
|
+
def get_current_device():
|
|
100
|
+
"""
|
|
101
|
+
Get device target and device id in the current running environment.
|
|
102
|
+
|
|
103
|
+
Examples:
|
|
104
|
+
>>> import mindspore as ms
|
|
105
|
+
>>> ms.set_device("Ascend", 1)
|
|
106
|
+
>>> ms.get_current_device()
|
|
107
|
+
('Ascend', 1)
|
|
108
|
+
>>> ms.get_current_device().device_target
|
|
109
|
+
'Ascend'
|
|
110
|
+
>>> ms.get_current_device().device_id
|
|
111
|
+
1
|
|
112
|
+
"""
|
|
113
|
+
device_target = DeviceManagerConf.get_instance().get_device_target()
|
|
114
|
+
device_id = DeviceManagerConf.get_instance().get_device_id()
|
|
115
|
+
return DeviceInfo(device_target, device_id)
|
|
116
|
+
|
|
117
|
+
|
|
82
118
|
@args_type_check(deterministic=bool)
|
|
83
119
|
def set_deterministic(deterministic):
|
|
84
120
|
"""
|
mindspore/dnnl.dll
CHANGED
|
Binary file
|
mindspore/dpcmi.dll
CHANGED
|
Binary file
|
|
@@ -125,18 +125,20 @@ class EmbeddingServiceOut:
|
|
|
125
125
|
|
|
126
126
|
class EmbeddingService:
|
|
127
127
|
r"""
|
|
128
|
-
|
|
128
|
+
ES(EmbeddingService) feature can support model training and inference
|
|
129
129
|
for PS embedding and data_parallel embedding, and provide unified embedding management, storage,
|
|
130
130
|
and computing capabilities for training and inference.
|
|
131
131
|
PS embedding refer to tables that vocab_size more than 100,000, and recommended to store them on the
|
|
132
132
|
Parameter Server (PS). Data_parallel embedding refer to tables that vocab_size less than 100,000, and recommended
|
|
133
133
|
to store them on device.
|
|
134
134
|
|
|
135
|
+
Currently, ES feature can only create one instance of EmbeddingService object.
|
|
136
|
+
|
|
135
137
|
.. warning::
|
|
136
138
|
This is an experimental EmbeddingService API that is subject to change.
|
|
137
139
|
|
|
138
140
|
.. note::
|
|
139
|
-
This API needs to call
|
|
141
|
+
This API needs to call :func:`mindspore.communication.init` before,
|
|
140
142
|
and it can take effect after the dynamic networking is completed.
|
|
141
143
|
|
|
142
144
|
Raises:
|
|
@@ -241,24 +243,26 @@ class EmbeddingService:
|
|
|
241
243
|
name (str): The embedding table name.
|
|
242
244
|
init_vocabulary_size (int): The size of embedding table.
|
|
243
245
|
embedding_dim (int): The embedding dim of data in embedding table.
|
|
244
|
-
max_feature_count (int): The count of keys when look up for PS.
|
|
245
|
-
initializer (Initializer): The initialization strategy for the PS embedding,
|
|
246
|
-
|
|
246
|
+
max_feature_count (int, optional): The count of keys when look up for PS. Default: ``None``.
|
|
247
|
+
initializer (Initializer, optional): The initialization strategy for the PS embedding,
|
|
248
|
+
default is ``Uniform(scale=0.01)``.
|
|
249
|
+
embedding_type (str, optional): The embedding type, configurable parameters ["PS", "data_parallel"],
|
|
247
250
|
``"PS"`` means initializing PS embedding, ``"data_parallel"`` means initializing data_parallel
|
|
248
251
|
embedding, and default is ``"PS"``.
|
|
249
|
-
ev_option (EmbeddingVariableOption): Properties of the PS embedding,
|
|
252
|
+
ev_option (EmbeddingVariableOption, optional): Properties of the PS embedding,
|
|
250
253
|
is a EmbeddingVariableOption obj which returned by embedding_variable_option function.
|
|
251
254
|
Default is ``None``.
|
|
252
|
-
multihot_lens (int): The param only use when allow_merge is enabled, and not support now.
|
|
255
|
+
multihot_lens (int, optional): The param only use when `allow_merge` is enabled, and not support now.
|
|
253
256
|
Default is ``None``.
|
|
254
|
-
optimizer (str): The type of optimizer in the train mode for PS embedding,
|
|
257
|
+
optimizer (str, optional): The type of optimizer in the train mode for PS embedding,
|
|
255
258
|
cannot be shared among each PS embedding, and currently only ``"Adam"``, ``"Ftrl"``, ``"SGD"`` and
|
|
256
259
|
``"RMSProp"`` are supported, and default is ``None``.
|
|
257
|
-
allow_merge (bool): Whether to enable merge data_parallel embeddings, currently only be False,
|
|
260
|
+
allow_merge (bool, optional): Whether to enable merge data_parallel embeddings, currently only be False,
|
|
258
261
|
and default is ``False``.
|
|
259
|
-
optimizer_param (float): The "initialize accumulator value" param
|
|
262
|
+
optimizer_param (float, optional): The "initialize accumulator value" param
|
|
263
|
+
of optimizer which configured by user,
|
|
260
264
|
representing the init value of moment accumulator, and default is ``None``.
|
|
261
|
-
mode (str): Run mode, configurable parameters ["train", "predict", "export"],
|
|
265
|
+
mode (str, optional): Run mode, configurable parameters ["train", "predict", "export"],
|
|
262
266
|
``"train"`` means train mode, ``"predict"`` means predict mode, ``"export"`` mean export mode,
|
|
263
267
|
and default is ``"train"``.
|
|
264
268
|
|
|
@@ -345,8 +349,9 @@ class EmbeddingService:
|
|
|
345
349
|
|
|
346
350
|
Args:
|
|
347
351
|
padding_key (int): The value for padding key, must be a genuine and legal hash key.
|
|
348
|
-
mask (bool): Whether to update padding key. If set to false, it will not be updated.
|
|
349
|
-
|
|
352
|
+
mask (bool, optional): Whether to update padding key. If set to false, it will not be updated.
|
|
353
|
+
Default is ``True``.
|
|
354
|
+
mask_zero (bool, optional): Whether to update padding key when key is 0. Default is ``False``.
|
|
350
355
|
|
|
351
356
|
Returns:
|
|
352
357
|
PaddingParamsOption object.
|
|
@@ -368,7 +373,7 @@ class EmbeddingService:
|
|
|
368
373
|
|
|
369
374
|
Args:
|
|
370
375
|
completion_key (int): The value for completion key.
|
|
371
|
-
mask (bool): Whether to update completion key. If set to false, it will not be updated,
|
|
376
|
+
mask (bool, optional): Whether to update completion key. If set to false, it will not be updated,
|
|
372
377
|
and default is ``True``.
|
|
373
378
|
|
|
374
379
|
Returns:
|
|
@@ -396,10 +401,11 @@ class EmbeddingService:
|
|
|
396
401
|
|
|
397
402
|
Args:
|
|
398
403
|
filter_freq (int): The frequency threshold value for feature admission.
|
|
399
|
-
default_key (int): The key that number of occurrences does not reach the threshold,
|
|
400
|
-
return value of
|
|
401
|
-
|
|
402
|
-
|
|
404
|
+
default_key (int, optional): The key that number of occurrences does not reach the threshold,
|
|
405
|
+
return value of `default_key` as the corresponding value when look up embedding,
|
|
406
|
+
and default is ``None``.
|
|
407
|
+
default_value (Union[int, float], optional): The key that number of occurrences does not
|
|
408
|
+
reach the threshold, return default value which length value is embedding dim, and default is ``None``.
|
|
403
409
|
|
|
404
410
|
Returns:
|
|
405
411
|
CounterFilter object.
|
|
@@ -460,16 +466,17 @@ class EmbeddingService:
|
|
|
460
466
|
Set variable option for PS embedding.
|
|
461
467
|
|
|
462
468
|
Args:
|
|
463
|
-
filter_option (CounterFilter): The option of counter filter. Default is ``None``.
|
|
464
|
-
padding_option (PaddingParamsOption): The option of padding key. Default is ``None``.
|
|
465
|
-
evict_option (EvictOption): The option evict. Default is ``None``.
|
|
466
|
-
completion_option (CompletionKeyOption): The option of completion key. Default is ``None``.
|
|
467
|
-
storage_option (None): Reserved option, currently not supported. Default is ``None``.
|
|
468
|
-
feature_freezing_option (None): Reserved option, currently not supported. Default is ``None``.
|
|
469
|
-
communication_option (None): Reserved option, currently not supported. Default is ``None``.
|
|
469
|
+
filter_option (CounterFilter, optional): The option of counter filter. Default is ``None``.
|
|
470
|
+
padding_option (PaddingParamsOption, optional): The option of padding key. Default is ``None``.
|
|
471
|
+
evict_option (EvictOption, optional): The option evict. Default is ``None``.
|
|
472
|
+
completion_option (CompletionKeyOption, optional): The option of completion key. Default is ``None``.
|
|
473
|
+
storage_option (None, optional): Reserved option, currently not supported. Default is ``None``.
|
|
474
|
+
feature_freezing_option (None, optional): Reserved option, currently not supported. Default is ``None``.
|
|
475
|
+
communication_option (None, optional): Reserved option, currently not supported. Default is ``None``.
|
|
470
476
|
|
|
471
477
|
Returns:
|
|
472
|
-
EmbeddingVariableOption object, used as the ev_option parameter for
|
|
478
|
+
EmbeddingVariableOption object, used as the ev_option parameter for
|
|
479
|
+
:func:`mindspore.experimental.es.EmbeddingService.embedding_init` .
|
|
473
480
|
|
|
474
481
|
Raises:
|
|
475
482
|
TypeError: If value of "filter_option" is not None and the type of "filter_option" is not CounterFilter.
|
|
@@ -501,7 +508,8 @@ class EmbeddingService:
|
|
|
501
508
|
|
|
502
509
|
.. note::
|
|
503
510
|
This function can only be executed by rank 0.
|
|
504
|
-
Need to call embedding_variable_option
|
|
511
|
+
Need to call :func:`mindspore.experimental.es.EmbeddingService.embedding_variable_option`
|
|
512
|
+
to set evict_option for each PS embedding before export.
|
|
505
513
|
|
|
506
514
|
Args:
|
|
507
515
|
file_path (str): The path to export embedding ckpt, and the last character cannot be ``"/"``.
|
|
@@ -23,7 +23,7 @@ from copy import copy
|
|
|
23
23
|
import numbers
|
|
24
24
|
import mindspore as ms
|
|
25
25
|
from mindspore.common.parameter import Parameter, _get_unique_parameter_key
|
|
26
|
-
from mindspore._c_expression import
|
|
26
|
+
from mindspore._c_expression import TensorPy as Tensor_
|
|
27
27
|
from mindspore._c_expression import MapTensor_
|
|
28
28
|
from mindspore.ops.operations import _map_tensor_ops
|
|
29
29
|
|
|
@@ -78,12 +78,12 @@ class MapParameter(Parameter):
|
|
|
78
78
|
if value_dtype is not None:
|
|
79
79
|
if isinstance(value_shape, numbers.Number):
|
|
80
80
|
value_shape = (value_shape,)
|
|
81
|
-
data = Tensor_(value_dtype, value_shape)
|
|
81
|
+
data = Tensor_(dtype=value_dtype, shape=value_shape)
|
|
82
82
|
elif value_tensor is not None:
|
|
83
|
-
data = Tensor_(value_tensor.dtype, value_tensor.shape)
|
|
83
|
+
data = Tensor_(dtype=value_tensor.dtype, shape=value_tensor.shape)
|
|
84
84
|
else:
|
|
85
85
|
# default
|
|
86
|
-
data = Tensor_(ms.float32, (1,))
|
|
86
|
+
data = Tensor_(dtype=ms.float32, shape=(1,))
|
|
87
87
|
obj = Tensor_.__new__(cls)
|
|
88
88
|
Tensor_.__init__(obj, data)
|
|
89
89
|
# Compatible attributes with Parameter.
|
|
@@ -37,32 +37,28 @@ class Adadelta(Optimizer):
|
|
|
37
37
|
Implements Adadelta algorithm.
|
|
38
38
|
|
|
39
39
|
.. math::
|
|
40
|
-
\
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
&\textbf{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
&\textbf{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
&\
|
|
54
|
-
|
|
55
|
-
&\
|
|
56
|
-
|
|
57
|
-
&\
|
|
58
|
-
&\
|
|
59
|
-
&\
|
|
60
|
-
&\
|
|
61
|
-
|
|
62
|
-
&\rule{110mm}{0.4pt} \\
|
|
63
|
-
&\bf{Return}: \theta_t \\
|
|
64
|
-
&\rule{110mm}{0.4pt}
|
|
65
|
-
\end{align*}
|
|
40
|
+
\begin{aligned}
|
|
41
|
+
&\rule{180mm}{0.4pt} \\
|
|
42
|
+
&\textbf{input} : \gamma \text{ (lr)}, \: \theta_0 \text{ (params)},
|
|
43
|
+
\: f(\theta) \text{ (objective)}, \: \rho \text{ (decay)},
|
|
44
|
+
\: \lambda \text{ (weight decay)} \\
|
|
45
|
+
&\textbf{initialize} : v_0 \leftarrow 0 \: \text{ (square avg)},
|
|
46
|
+
\: u_0 \leftarrow 0 \: \text{ (accumulate variables)} \\[-1.ex]
|
|
47
|
+
&\rule{180mm}{0.4pt} \\
|
|
48
|
+
&\textbf{for} \: t=1 \: \textbf{to} \: \ldots \: \textbf{do} \\
|
|
49
|
+
&\hspace{5mm}g_t \leftarrow \nabla_{\theta} f_t (\theta_{t-1}) \\
|
|
50
|
+
&\hspace{5mm}if \: \lambda \neq 0 \\
|
|
51
|
+
&\hspace{10mm} g_t \leftarrow g_t + \lambda \theta_{t-1} \\
|
|
52
|
+
&\hspace{5mm} v_t \leftarrow v_{t-1} \rho + g^2_t (1 - \rho) \\
|
|
53
|
+
&\hspace{5mm}\Delta x_t \leftarrow \frac{\sqrt{u_{t-1} +
|
|
54
|
+
\epsilon }}{ \sqrt{v_t + \epsilon} }g_t \hspace{21mm} \\
|
|
55
|
+
&\hspace{5mm} u_t \leftarrow u_{t-1} \rho +
|
|
56
|
+
\Delta x^2_t (1 - \rho) \\
|
|
57
|
+
&\hspace{5mm}\theta_t \leftarrow \theta_{t-1} - \gamma \Delta x_t \\
|
|
58
|
+
&\rule{180mm}{0.4pt} \\[-1.ex]
|
|
59
|
+
&\bf{return} \: \theta_t \\[-1.ex]
|
|
60
|
+
&\rule{180mm}{0.4pt} \\[-1.ex]
|
|
61
|
+
\end{aligned}
|
|
66
62
|
|
|
67
63
|
.. warning::
|
|
68
64
|
This is an experimental optimizer API that is subject to change.
|
|
@@ -38,12 +38,12 @@ class Adagrad(Optimizer):
|
|
|
38
38
|
|
|
39
39
|
.. math::
|
|
40
40
|
\begin{aligned}
|
|
41
|
-
&\rule{
|
|
41
|
+
&\rule{160mm}{0.4pt} \\
|
|
42
42
|
&\textbf{input} : \gamma \text{ (lr)}, \: \theta_0 \text{ (params)}, \: f(\theta)
|
|
43
43
|
\text{ (objective)}, \: \lambda \text{ (weight decay)}, \\
|
|
44
44
|
&\hspace{12mm} \tau \text{ (initial accumulator value)}, \: \eta\text{ (lr decay)}\\
|
|
45
45
|
&\textbf{initialize} : state\_sum_0 \leftarrow 0 \\[-1.ex]
|
|
46
|
-
&\rule{
|
|
46
|
+
&\rule{160mm}{0.4pt} \\
|
|
47
47
|
&\textbf{for} \: t=1 \: \textbf{to} \: \ldots \: \textbf{do} \\
|
|
48
48
|
&\hspace{5mm}g_t \leftarrow \nabla_{\theta} f_t (\theta_{t-1}) \\
|
|
49
49
|
&\hspace{5mm} \tilde{\gamma} \leftarrow \gamma / (1 +(t-1) \eta) \\
|
|
@@ -52,9 +52,9 @@ class Adagrad(Optimizer):
|
|
|
52
52
|
&\hspace{5mm}state\_sum_t \leftarrow state\_sum_{t-1} + g^2_t \\
|
|
53
53
|
&\hspace{5mm}\theta_t \leftarrow
|
|
54
54
|
\theta_{t-1}- \tilde{\gamma} \frac{g_t}{\sqrt{state\_sum_t}+\epsilon} \\
|
|
55
|
-
&\rule{
|
|
55
|
+
&\rule{160mm}{0.4pt} \\[-1.ex]
|
|
56
56
|
&\bf{return} \: \theta_t \\[-1.ex]
|
|
57
|
-
&\rule{
|
|
57
|
+
&\rule{160mm}{0.4pt} \\[-1.ex]
|
|
58
58
|
\end{aligned}
|
|
59
59
|
|
|
60
60
|
.. warning::
|
|
@@ -49,12 +49,14 @@ class Adam(Optimizer):
|
|
|
49
49
|
|
|
50
50
|
.. math::
|
|
51
51
|
\begin{aligned}
|
|
52
|
+
&\rule{180mm}{0.4pt} \\
|
|
52
53
|
&\textbf{input} : \gamma \text{ (lr)}, \beta_1, \beta_2
|
|
53
54
|
\text{ (betas)},\theta_0 \text{ (params)},f(\theta) \text{ (objective)} \\
|
|
54
55
|
&\hspace{13mm} \lambda \text{ (weight decay)}, \: \textit{amsgrad},
|
|
55
56
|
\:\textit{maximize} \\
|
|
56
57
|
&\textbf{initialize} : m_0 \leftarrow 0 \text{ ( first moment)},
|
|
57
58
|
v_0\leftarrow 0 \text{ (second moment)},\: \widehat{v_0}^{max}\leftarrow 0\\[-1.ex]
|
|
59
|
+
&\rule{180mm}{0.4pt} \\
|
|
58
60
|
&\textbf{for} \: t=1 \: \textbf{to} \: \ldots \: \textbf{do} \\
|
|
59
61
|
&\hspace{5mm}\textbf{if} \: \textit{maximize}: \\
|
|
60
62
|
&\hspace{10mm}g_t \leftarrow -\nabla_{\theta} f_t (\theta_{t-1}) \\
|
|
@@ -74,7 +76,9 @@ class Adam(Optimizer):
|
|
|
74
76
|
&\hspace{5mm}\textbf{else} \\
|
|
75
77
|
&\hspace{10mm}\theta_t \leftarrow \theta_{t-1} - \gamma \widehat{m_t}/
|
|
76
78
|
\big(\sqrt{\widehat{v_t}} + \epsilon \big) \\
|
|
79
|
+
&\rule{180mm}{0.4pt} \\[-1.ex]
|
|
77
80
|
&\bf{return} \: \theta_t \\[-1.ex]
|
|
81
|
+
&\rule{180mm}{0.4pt} \\[-1.ex]
|
|
78
82
|
\end{aligned}
|
|
79
83
|
|
|
80
84
|
.. warning::
|
|
@@ -43,14 +43,14 @@ class Adamax(Optimizer):
|
|
|
43
43
|
|
|
44
44
|
.. math::
|
|
45
45
|
\begin{aligned}
|
|
46
|
-
&\rule{
|
|
46
|
+
&\rule{180mm}{0.4pt} \\
|
|
47
47
|
&\textbf{input} : \gamma \text{ (lr)}, \beta_1, \beta_2
|
|
48
48
|
\text{ (betas)},\theta_0 \text{ (params)},f(\theta) \text{ (objective)},
|
|
49
49
|
\: \lambda \text{ (weight decay)}, \\
|
|
50
50
|
&\hspace{13mm} \epsilon \text{ (epsilon)} \\
|
|
51
51
|
&\textbf{initialize} : m_0 \leftarrow 0 \text{ ( first moment)},
|
|
52
52
|
u_0 \leftarrow 0 \text{ ( infinity norm)} \\[-1.ex]
|
|
53
|
-
&\rule{
|
|
53
|
+
&\rule{180mm}{0.4pt} \\
|
|
54
54
|
&\textbf{for} \: t=1 \: \textbf{to} \: \ldots \: \textbf{do} \\
|
|
55
55
|
&\hspace{5mm}g_t \leftarrow \nabla_{\theta} f_t (\theta_{t-1}) \\
|
|
56
56
|
&\hspace{5mm}if \: \lambda \neq 0 \\
|
|
@@ -58,9 +58,9 @@ class Adamax(Optimizer):
|
|
|
58
58
|
&\hspace{5mm}m_t \leftarrow \beta_1 m_{t-1} + (1 - \beta_1) g_t \\
|
|
59
59
|
&\hspace{5mm}u_t \leftarrow \mathrm{max}(\beta_2 u_{t-1}, |g_{t}|+\epsilon) \\
|
|
60
60
|
&\hspace{5mm}\theta_t \leftarrow \theta_{t-1} - \frac{\gamma m_t}{(1-\beta^t_1) u_t} \\
|
|
61
|
-
&\rule{
|
|
61
|
+
&\rule{180mm}{0.4pt} \\[-1.ex]
|
|
62
62
|
&\bf{return} \: \theta_t \\[-1.ex]
|
|
63
|
-
&\rule{
|
|
63
|
+
&\rule{180mm}{0.4pt} \\[-1.ex]
|
|
64
64
|
\end{aligned}
|
|
65
65
|
|
|
66
66
|
.. warning::
|
|
@@ -97,6 +97,7 @@ class AdamW(Optimizer):
|
|
|
97
97
|
|
|
98
98
|
.. math::
|
|
99
99
|
\begin{aligned}
|
|
100
|
+
&\rule{180mm}{0.4pt} \\
|
|
100
101
|
&\textbf{input} : \gamma \text{(lr)}, \: \beta_1, \beta_2
|
|
101
102
|
\text{(betas)}, \: \theta_0 \text{(params)}, \: f(\theta) \text{(objective)},
|
|
102
103
|
\: \epsilon \text{ (epsilon)} \\
|
|
@@ -104,6 +105,7 @@ class AdamW(Optimizer):
|
|
|
104
105
|
\: \textit{maximize} \\
|
|
105
106
|
&\textbf{initialize} : m_0 \leftarrow 0 \text{ (first moment)}, v_0 \leftarrow 0
|
|
106
107
|
\text{ ( second moment)}, \: \widehat{v_0}^{max}\leftarrow 0 \\[-1.ex]
|
|
108
|
+
&\rule{180mm}{0.4pt} \\
|
|
107
109
|
&\textbf{for} \: t=1 \: \textbf{to} \: \ldots \: \textbf{do} \\
|
|
108
110
|
&\hspace{5mm}\textbf{if} \: \textit{maximize}: \\
|
|
109
111
|
&\hspace{10mm}g_t \leftarrow -\nabla_{\theta} f_t (\theta_{t-1}) \\
|
|
@@ -122,7 +124,9 @@ class AdamW(Optimizer):
|
|
|
122
124
|
&\hspace{5mm}\textbf{else} \\
|
|
123
125
|
&\hspace{10mm}\theta_t \leftarrow \theta_t - \gamma \widehat{m_t}/
|
|
124
126
|
\big(\sqrt{\widehat{v_t}} + \epsilon \big) \\
|
|
127
|
+
&\rule{180mm}{0.4pt} \\[-1.ex]
|
|
125
128
|
&\bf{return} \: \theta_t \\[-1.ex]
|
|
129
|
+
&\rule{180mm}{0.4pt} \\[-1.ex]
|
|
126
130
|
\end{aligned}
|
|
127
131
|
|
|
128
132
|
.. warning::
|
|
@@ -124,7 +124,7 @@ class ASGD(Optimizer):
|
|
|
124
124
|
self.assignadd = P.AssignAdd()
|
|
125
125
|
self.op_cast = P.Cast()
|
|
126
126
|
|
|
127
|
-
@jit
|
|
127
|
+
@jit(backend="ms_backend")
|
|
128
128
|
def implementation(self, lambd, alpha, t0, lr, group_id, maximize, gradients, weight_decay):
|
|
129
129
|
"""Extract the common computing part for acceleration"""
|
|
130
130
|
start_id = self.group_start_id[group_id]
|