mindspore 2.4.10__cp39-cp39-win_amd64.whl → 2.5.0__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 +8 -3
- 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/_checkparam.py +0 -5
- mindspore/_extends/parallel_compile/akg_compiler/gen_custom_op_files.py +1 -1
- mindspore/_extends/parse/compile_config.py +64 -0
- mindspore/_extends/parse/deprecated/__init__.py +0 -0
- mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +375 -0
- mindspore/_extends/parse/parser.py +23 -5
- mindspore/_extends/parse/standard_method.py +123 -27
- mindspore/_extends/pijit/pijit_func_white_list.py +1 -1
- mindspore/amp.py +7 -1
- 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/boost_cell_wrapper.py +136 -41
- mindspore/c1.dll +0 -0
- mindspore/c1xx.dll +0 -0
- mindspore/c2.dll +0 -0
- mindspore/common/__init__.py +3 -1
- mindspore/common/_register_for_tensor.py +0 -1
- mindspore/common/_stub_tensor.py +25 -4
- mindspore/common/_tensor_cpp_method.py +17 -0
- mindspore/common/_tensor_docs.py +6132 -0
- mindspore/common/api.py +98 -21
- mindspore/common/dtype.py +34 -34
- mindspore/common/dump.py +2 -1
- mindspore/common/file_system.py +8 -3
- mindspore/common/generator.py +2 -0
- mindspore/common/hook_handle.py +3 -1
- mindspore/common/initializer.py +3 -4
- mindspore/common/lazy_inline.py +8 -2
- mindspore/common/mindir_util.py +10 -2
- mindspore/common/parameter.py +31 -15
- mindspore/common/tensor.py +713 -1337
- mindspore/communication/__init__.py +1 -1
- mindspore/communication/_comm_helper.py +5 -0
- mindspore/communication/comm_func.py +215 -173
- mindspore/communication/management.py +23 -20
- mindspore/context.py +285 -191
- mindspore/dataset/__init__.py +23 -19
- mindspore/dataset/callback/ds_callback.py +2 -1
- mindspore/dataset/core/config.py +84 -3
- mindspore/dataset/engine/cache_admin.py +3 -3
- mindspore/dataset/engine/cache_client.py +5 -4
- mindspore/dataset/engine/datasets.py +192 -149
- mindspore/dataset/engine/datasets_audio.py +14 -0
- mindspore/dataset/engine/datasets_standard_format.py +11 -11
- mindspore/dataset/engine/datasets_text.py +38 -1
- mindspore/dataset/engine/datasets_user_defined.py +100 -66
- mindspore/dataset/engine/datasets_vision.py +81 -8
- mindspore/dataset/engine/iterators.py +281 -63
- mindspore/dataset/engine/obs/util.py +8 -0
- mindspore/dataset/engine/queue.py +40 -0
- mindspore/dataset/engine/samplers.py +26 -2
- mindspore/dataset/engine/serializer_deserializer.py +1 -1
- mindspore/dataset/engine/validators.py +43 -11
- mindspore/dataset/transforms/py_transforms_util.py +17 -0
- mindspore/dataset/transforms/transforms.py +29 -12
- mindspore/dataset/vision/validators.py +1 -2
- mindspore/device_context/__init__.py +21 -0
- mindspore/device_context/ascend/__init__.py +25 -0
- mindspore/device_context/ascend/device.py +72 -0
- mindspore/device_context/ascend/op_debug.py +94 -0
- mindspore/device_context/ascend/op_precision.py +193 -0
- mindspore/device_context/ascend/op_tuning.py +127 -0
- mindspore/device_context/cpu/__init__.py +25 -0
- mindspore/device_context/cpu/device.py +62 -0
- mindspore/device_context/cpu/op_tuning.py +43 -0
- mindspore/device_context/gpu/__init__.py +21 -0
- mindspore/device_context/gpu/device.py +70 -0
- mindspore/device_context/gpu/op_precision.py +67 -0
- mindspore/device_context/gpu/op_tuning.py +175 -0
- mindspore/device_manager.py +134 -0
- mindspore/dnnl.dll +0 -0
- mindspore/dpcmi.dll +0 -0
- mindspore/experimental/llm_boost/__init__.py +1 -0
- mindspore/experimental/llm_boost/ascend_native/__init__.py +22 -0
- mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +211 -0
- mindspore/experimental/llm_boost/ascend_native/llm_boost.py +52 -0
- mindspore/experimental/llm_boost/atb/boost_base.py +2 -3
- mindspore/experimental/llm_boost/atb/llama_boost.py +6 -1
- mindspore/experimental/llm_boost/register.py +1 -0
- mindspore/experimental/optim/adadelta.py +26 -22
- mindspore/experimental/optim/adam.py +3 -0
- mindspore/experimental/optim/lr_scheduler.py +33 -24
- mindspore/experimental/optim/radam.py +33 -30
- mindspore/hal/device.py +28 -0
- mindspore/hal/event.py +17 -0
- mindspore/hal/memory.py +94 -3
- mindspore/hal/stream.py +91 -6
- mindspore/include/api/context.h +0 -1
- mindspore/jpeg62.dll +0 -0
- mindspore/log.py +12 -0
- mindspore/mindrecord/__init__.py +1 -1
- mindspore/mindrecord/config.py +17 -316
- mindspore/mindrecord/filereader.py +1 -9
- mindspore/mindrecord/filewriter.py +5 -15
- mindspore/mindrecord/mindpage.py +1 -9
- mindspore/mindspore_backend.dll +0 -0
- mindspore/mindspore_common.dll +0 -0
- mindspore/mindspore_core.dll +0 -0
- mindspore/mindspore_glog.dll +0 -0
- mindspore/mindspore_ops.dll +0 -0
- mindspore/mint/__init__.py +824 -218
- mindspore/mint/distributed/__init__.py +66 -4
- mindspore/mint/distributed/distributed.py +2594 -44
- mindspore/mint/linalg/__init__.py +6 -0
- mindspore/mint/nn/__init__.py +473 -14
- mindspore/mint/nn/functional.py +486 -11
- mindspore/mint/nn/layer/__init__.py +17 -4
- mindspore/mint/nn/layer/_functions.py +330 -0
- mindspore/mint/nn/layer/activation.py +169 -1
- mindspore/mint/nn/layer/basic.py +123 -0
- mindspore/mint/nn/layer/conv.py +727 -0
- mindspore/mint/nn/layer/normalization.py +215 -19
- mindspore/mint/nn/layer/padding.py +797 -0
- mindspore/mint/nn/layer/pooling.py +170 -0
- mindspore/mint/optim/__init__.py +2 -1
- mindspore/mint/optim/adam.py +223 -0
- mindspore/mint/optim/adamw.py +26 -19
- mindspore/mint/special/__init__.py +2 -1
- 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/multiprocessing/__init__.py +5 -0
- mindspore/nn/cell.py +126 -19
- mindspore/nn/dynamic_lr.py +2 -1
- mindspore/nn/layer/activation.py +6 -6
- mindspore/nn/layer/basic.py +35 -25
- mindspore/nn/layer/channel_shuffle.py +3 -3
- mindspore/nn/layer/embedding.py +3 -3
- mindspore/nn/layer/normalization.py +8 -7
- mindspore/nn/layer/padding.py +4 -3
- mindspore/nn/layer/pooling.py +47 -13
- mindspore/nn/layer/rnn_cells.py +1 -1
- mindspore/nn/layer/rnns.py +2 -1
- mindspore/nn/layer/timedistributed.py +5 -5
- mindspore/nn/layer/transformer.py +48 -26
- mindspore/nn/learning_rate_schedule.py +5 -3
- mindspore/nn/loss/loss.py +31 -36
- mindspore/nn/optim/ada_grad.py +1 -0
- mindspore/nn/optim/adadelta.py +2 -2
- mindspore/nn/optim/adam.py +1 -1
- mindspore/nn/optim/lars.py +1 -4
- mindspore/nn/optim/optimizer.py +1 -1
- mindspore/nn/optim/rprop.py +2 -2
- mindspore/nn/optim/thor.py +2 -1
- mindspore/nn/utils/init.py +13 -11
- mindspore/nn/wrap/cell_wrapper.py +4 -6
- mindspore/nn/wrap/loss_scale.py +3 -4
- mindspore/numpy/array_creations.py +60 -62
- mindspore/numpy/array_ops.py +148 -143
- mindspore/numpy/logic_ops.py +41 -42
- mindspore/numpy/math_ops.py +361 -359
- mindspore/numpy/utils.py +16 -16
- mindspore/numpy/utils_const.py +4 -4
- mindspore/opencv_core452.dll +0 -0
- mindspore/opencv_imgcodecs452.dll +0 -0
- mindspore/opencv_imgproc452.dll +0 -0
- mindspore/ops/__init__.py +2 -1
- mindspore/ops/_grad_experimental/grad_comm_ops.py +94 -13
- mindspore/ops/_grad_experimental/grad_debug_ops.py +6 -1
- mindspore/ops/_grad_experimental/grad_inner_ops.py +9 -0
- mindspore/ops/_grad_experimental/grad_math_ops.py +2 -1
- mindspore/ops/_op_impl/cpu/__init__.py +1 -0
- mindspore/ops/_op_impl/cpu/raise_op.py +28 -0
- mindspore/ops/_vmap/vmap_array_ops.py +20 -19
- mindspore/ops/_vmap/vmap_base.py +0 -2
- mindspore/ops/_vmap/vmap_grad_nn_ops.py +19 -13
- mindspore/ops/_vmap/vmap_math_ops.py +11 -9
- mindspore/ops/_vmap/vmap_nn_ops.py +20 -34
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +149 -12
- mindspore/ops/auto_generate/gen_arg_handler.py +0 -61
- mindspore/ops/auto_generate/gen_extend_func.py +554 -60
- mindspore/ops/auto_generate/gen_ops_def.py +1621 -115
- mindspore/ops/auto_generate/gen_ops_prim.py +8024 -3409
- mindspore/ops/auto_generate/pyboost_inner_prim.py +183 -79
- mindspore/ops/composite/base.py +1 -1
- mindspore/ops/composite/multitype_ops/_compile_utils.py +229 -30
- mindspore/ops/composite/multitype_ops/pow_impl.py +0 -29
- mindspore/ops/function/__init__.py +12 -0
- mindspore/ops/function/array_func.py +561 -159
- mindspore/ops/function/clip_func.py +64 -0
- mindspore/ops/function/debug_func.py +28 -20
- mindspore/ops/function/image_func.py +1 -1
- mindspore/ops/function/linalg_func.py +5 -4
- mindspore/ops/function/math_func.py +1659 -290
- mindspore/ops/function/nn_func.py +988 -317
- mindspore/ops/function/parameter_func.py +3 -56
- mindspore/ops/function/random_func.py +243 -33
- mindspore/ops/function/sparse_unary_func.py +1 -1
- mindspore/ops/functional.py +18 -5
- mindspore/ops/functional_overload.py +897 -0
- mindspore/ops/operations/__init__.py +3 -2
- mindspore/ops/operations/_embedding_cache_ops.py +4 -4
- mindspore/ops/operations/_grad_ops.py +2 -34
- mindspore/ops/operations/_infer_ops.py +2 -1
- mindspore/ops/operations/_inner_ops.py +38 -8
- mindspore/ops/operations/array_ops.py +45 -303
- mindspore/ops/operations/comm_ops.py +19 -16
- mindspore/ops/operations/custom_ops.py +11 -55
- mindspore/ops/operations/debug_ops.py +42 -47
- mindspore/ops/operations/inner_ops.py +6 -4
- mindspore/ops/operations/linalg_ops.py +3 -2
- mindspore/ops/operations/manually_defined/ops_def.py +185 -104
- mindspore/ops/operations/math_ops.py +11 -216
- mindspore/ops/operations/nn_ops.py +146 -308
- mindspore/ops/primitive.py +23 -21
- mindspore/ops/tensor_method.py +1669 -0
- mindspore/ops_generate/aclnn_kernel_register_auto_cc_generator.py +110 -0
- mindspore/ops_generate/add_tensor_docs_generator.py +54 -0
- mindspore/ops_generate/arg_handler.py +0 -61
- mindspore/ops_generate/auto_grad_impl_cc_generator.py +135 -0
- mindspore/ops_generate/auto_grad_reg_cc_generator.py +93 -0
- mindspore/ops_generate/base_generator.py +11 -0
- mindspore/ops_generate/cpp_create_prim_instance_helper_generator.py +108 -0
- mindspore/ops_generate/functional_map_cpp_generator.py +491 -0
- mindspore/ops_generate/functional_overload_py_generator.py +110 -0
- mindspore/ops_generate/functions_cc_generator.py +233 -0
- mindspore/ops_generate/gen_aclnn_implement.py +110 -114
- mindspore/ops_generate/gen_constants.py +157 -3
- mindspore/ops_generate/gen_ops.py +245 -990
- mindspore/ops_generate/gen_pyboost_func.py +97 -998
- mindspore/ops_generate/gen_utils.py +119 -33
- mindspore/ops_generate/lite_ops_cpp_generator.py +155 -0
- mindspore/ops_generate/op_api_proto.py +206 -0
- mindspore/ops_generate/op_def_py_generator.py +131 -0
- mindspore/ops_generate/op_prim_py_generator.py +480 -0
- mindspore/ops_generate/op_proto.py +373 -108
- mindspore/ops_generate/op_template_parser.py +436 -0
- mindspore/ops_generate/ops_def_cc_generator.py +288 -0
- mindspore/ops_generate/ops_def_h_generator.py +74 -0
- mindspore/ops_generate/ops_name_h_generator.py +68 -0
- mindspore/ops_generate/ops_primitive_h_generator.py +81 -0
- mindspore/ops_generate/pyboost_functions_cpp_generator.py +370 -0
- mindspore/ops_generate/pyboost_functions_h_generator.py +68 -0
- mindspore/ops_generate/pyboost_functions_py_generator.py +148 -0
- mindspore/ops_generate/pyboost_grad_function_cpp_generator.py +154 -0
- mindspore/ops_generate/pyboost_inner_prim_generator.py +131 -0
- mindspore/ops_generate/pyboost_native_grad_functions_generator.py +268 -0
- mindspore/ops_generate/pyboost_op_cpp_code_generator.py +851 -0
- mindspore/ops_generate/pyboost_overload_functions_cpp_generator.py +344 -0
- mindspore/ops_generate/pyboost_utils.py +92 -33
- mindspore/ops_generate/template.py +294 -44
- mindspore/ops_generate/tensor_func_reg_cpp_generator.py +422 -0
- mindspore/parallel/__init__.py +3 -3
- mindspore/parallel/_auto_parallel_context.py +24 -33
- mindspore/parallel/_parallel_serialization.py +13 -2
- mindspore/parallel/_utils.py +4 -1
- mindspore/parallel/algo_parameter_config.py +1 -1
- mindspore/parallel/checkpoint_transform.py +44 -0
- mindspore/parallel/cluster/process_entity/_api.py +131 -37
- mindspore/parallel/cluster/process_entity/_utils.py +41 -6
- mindspore/parallel/cluster/run.py +20 -3
- mindspore/parallel/parameter_broadcast.py +1 -1
- mindspore/parallel/shard.py +3 -0
- mindspore/parallel/transform_safetensors.py +119 -253
- mindspore/pgodb140.dll +0 -0
- mindspore/pgort140.dll +0 -0
- mindspore/profiler/__init__.py +17 -4
- mindspore/profiler/analysis/__init__.py +0 -0
- mindspore/profiler/analysis/parser/__init__.py +0 -0
- mindspore/profiler/analysis/parser/ascend_cann_parser.py +166 -0
- mindspore/profiler/analysis/parser/base_parser.py +158 -0
- mindspore/profiler/analysis/parser/framework_cann_relation_parser.py +45 -0
- mindspore/profiler/analysis/parser/ms_framework_parser.py +142 -0
- mindspore/profiler/analysis/parser/ms_minddata_parser.py +145 -0
- mindspore/profiler/analysis/parser/timeline_assembly_factory/__init__.py +0 -0
- mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +261 -0
- mindspore/profiler/analysis/parser/timeline_assembly_factory/base_timeline_assembler.py +40 -0
- mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +84 -0
- mindspore/profiler/analysis/parser/timeline_creator/__init__.py +0 -0
- mindspore/profiler/analysis/parser/timeline_creator/base_timeline_creator.py +44 -0
- mindspore/profiler/analysis/parser/timeline_creator/cpu_op_timeline_creator.py +90 -0
- mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +76 -0
- mindspore/profiler/analysis/parser/timeline_creator/msprof_timeline_creator.py +103 -0
- mindspore/profiler/analysis/parser/timeline_creator/scope_layer_timeline_creator.py +134 -0
- mindspore/profiler/analysis/parser/timeline_event/__init__.py +0 -0
- mindspore/profiler/analysis/parser/timeline_event/base_event.py +233 -0
- mindspore/profiler/analysis/parser/timeline_event/cpu_op_event.py +47 -0
- mindspore/profiler/analysis/parser/timeline_event/flow_event.py +36 -0
- mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +260 -0
- mindspore/profiler/analysis/parser/timeline_event/msprof_event.py +73 -0
- mindspore/profiler/analysis/parser/timeline_event/scope_layer_event.py +53 -0
- mindspore/profiler/analysis/parser/timeline_event/timeline_event_pool.py +146 -0
- mindspore/profiler/analysis/task_manager.py +131 -0
- mindspore/profiler/analysis/time_converter.py +84 -0
- mindspore/profiler/analysis/viewer/__init__.py +0 -0
- mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +333 -0
- mindspore/profiler/analysis/viewer/ascend_integrate_viewer.py +87 -0
- mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +252 -0
- mindspore/profiler/analysis/viewer/ascend_memory_viewer.py +313 -0
- mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +322 -0
- mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +265 -0
- mindspore/profiler/analysis/viewer/ascend_timeline_viewer.py +58 -0
- mindspore/profiler/analysis/viewer/base_viewer.py +26 -0
- mindspore/profiler/analysis/viewer/ms_dataset_viewer.py +97 -0
- mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +581 -0
- mindspore/profiler/analysis/work_flow.py +73 -0
- mindspore/profiler/common/ascend_msprof_exporter.py +138 -0
- mindspore/profiler/common/command_executor.py +90 -0
- mindspore/profiler/common/constant.py +174 -3
- mindspore/profiler/common/file_manager.py +208 -0
- mindspore/profiler/common/log.py +130 -0
- mindspore/profiler/common/msprof_cmd_tool.py +202 -0
- mindspore/profiler/common/path_manager.py +371 -0
- mindspore/profiler/common/process_bar.py +168 -0
- mindspore/profiler/common/process_pool.py +9 -3
- mindspore/profiler/common/profiler_context.py +476 -0
- mindspore/profiler/common/profiler_info.py +304 -0
- mindspore/profiler/common/profiler_output_path.py +284 -0
- mindspore/profiler/common/profiler_parameters.py +210 -0
- mindspore/profiler/common/profiler_path_manager.py +120 -0
- mindspore/profiler/common/record_function.py +76 -0
- mindspore/profiler/common/tlv_decoder.py +76 -0
- mindspore/profiler/common/util.py +75 -2
- mindspore/profiler/dynamic_profiler.py +270 -37
- mindspore/profiler/envprofiler.py +138 -0
- mindspore/profiler/mstx.py +199 -0
- mindspore/profiler/platform/__init__.py +21 -0
- mindspore/profiler/platform/base_profiler.py +40 -0
- mindspore/profiler/platform/cpu_profiler.py +124 -0
- mindspore/profiler/platform/gpu_profiler.py +74 -0
- mindspore/profiler/platform/npu_profiler.py +309 -0
- mindspore/profiler/profiler.py +580 -93
- mindspore/profiler/profiler_action_controller.py +187 -0
- mindspore/profiler/profiler_interface.py +114 -0
- mindspore/profiler/schedule.py +208 -0
- mindspore/rewrite/api/symbol_tree.py +1 -2
- mindspore/run_check/_check_version.py +2 -6
- mindspore/runtime/__init__.py +37 -0
- mindspore/runtime/device.py +27 -0
- mindspore/runtime/event.py +209 -0
- mindspore/runtime/executor.py +148 -0
- mindspore/runtime/memory.py +392 -0
- mindspore/runtime/stream.py +460 -0
- mindspore/runtime/thread_bind_core.py +401 -0
- 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 +2 -2
- mindspore/train/_utils.py +53 -18
- mindspore/train/amp.py +8 -4
- mindspore/train/callback/_checkpoint.py +32 -18
- mindspore/train/callback/_early_stop.py +1 -1
- mindspore/train/callback/_flops_collector.py +105 -69
- mindspore/train/callback/_history.py +1 -1
- mindspore/train/callback/_summary_collector.py +44 -6
- mindspore/train/callback/_tft_register.py +31 -10
- mindspore/train/dataset_helper.py +11 -11
- mindspore/train/metrics/precision.py +4 -5
- mindspore/train/mind_ir_pb2.py +167 -46
- mindspore/train/model.py +13 -15
- mindspore/train/serialization.py +462 -76
- mindspore/train/summary/summary_record.py +1 -2
- mindspore/train/train_thor/model_thor.py +1 -1
- mindspore/turbojpeg.dll +0 -0
- mindspore/utils/__init__.py +4 -2
- mindspore/utils/dryrun.py +138 -0
- mindspore/utils/runtime_execution_order_check.py +550 -0
- mindspore/vcmeta.dll +0 -0
- mindspore/vcruntime140.dll +0 -0
- mindspore/vcruntime140_1.dll +0 -0
- mindspore/version.py +1 -1
- {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/METADATA +2 -3
- {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/RECORD +385 -261
- {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/entry_points.txt +1 -1
- mindspore/common/_tensor_overload.py +0 -139
- mindspore/mindspore_np_dtype.dll +0 -0
- mindspore/profiler/envprofiling.py +0 -254
- mindspore/profiler/profiling.py +0 -1926
- {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/WHEEL +0 -0
- {mindspore-2.4.10.dist-info → mindspore-2.5.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# Copyright 2024 Huawei Technologies Co., Ltd
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
# ============================================================================
|
|
15
|
+
"""Runtime event class"""
|
|
16
|
+
from mindspore._c_expression import Event as Event_
|
|
17
|
+
from mindspore._c_expression import Stream as Stream_
|
|
18
|
+
from mindspore._c_expression import current_stream as current_stream_
|
|
19
|
+
from mindspore import _checkparam as Validator
|
|
20
|
+
from .device import _is_supported
|
|
21
|
+
|
|
22
|
+
function_event_status = {'Event': False, 'wait': False}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Event(Event_):
|
|
26
|
+
r"""
|
|
27
|
+
Wrapper around a device event.
|
|
28
|
+
|
|
29
|
+
Device events are synchronization markers that can be used to monitor the device’s progress,
|
|
30
|
+
to accurately measure timing, and to synchronize device streams.
|
|
31
|
+
|
|
32
|
+
The underlying device events are lazily initialized when the event is first recorded.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
enable_timing (bool, optional): indicates if the event should measure time (default: ``False``)
|
|
36
|
+
blocking (bool, optional): if ``True``, `wait` will be blocking (default: ``False``)
|
|
37
|
+
|
|
38
|
+
Supported Platforms:
|
|
39
|
+
``Ascend`` ``GPU``
|
|
40
|
+
|
|
41
|
+
Examples:
|
|
42
|
+
>>> import mindspore as ms
|
|
43
|
+
>>> import numpy as np
|
|
44
|
+
>>> from mindspore import Tensor, ops
|
|
45
|
+
>>> ms.set_device("Ascend", 0)
|
|
46
|
+
>>> start = ms.runtime.Event(enable_timing=True)
|
|
47
|
+
>>> end = ms.runtime.Event(enable_timing=True)
|
|
48
|
+
>>> s1 = ms.runtime.Stream()
|
|
49
|
+
>>> s2 = ms.runtime.Stream()
|
|
50
|
+
>>> a = Tensor(np.ones([2, 2]), ms.float32)
|
|
51
|
+
>>> b = Tensor(np.ones([2, 2]), ms.float32)
|
|
52
|
+
>>> c = Tensor(np.ones([2, 2]), ms.float32)
|
|
53
|
+
>>> with ms.runtime.StreamCtx(s1):
|
|
54
|
+
... d = ops.matmul(a, b)
|
|
55
|
+
... start.record()
|
|
56
|
+
>>> c += 2
|
|
57
|
+
>>> end.record()
|
|
58
|
+
>>> with ms.runtime.StreamCtx(s2):
|
|
59
|
+
... start.synchronize()
|
|
60
|
+
... end.synchronize()
|
|
61
|
+
... e = c + d
|
|
62
|
+
>>> ms.runtime.synchronize()
|
|
63
|
+
>>> print(e)
|
|
64
|
+
[[5. 5.]
|
|
65
|
+
[5. 5.]]
|
|
66
|
+
>>> elapsed_time = start.elapsed_time(end)
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
def __init__(self, enable_timing=False, blocking=False):
|
|
70
|
+
if not function_event_status['Event']:
|
|
71
|
+
function_event_status['Event'] = True
|
|
72
|
+
if not _is_supported():
|
|
73
|
+
return
|
|
74
|
+
# pylint: disable=useless-super-delegation
|
|
75
|
+
Validator.check_bool(enable_timing, "enable_timing", "Event")
|
|
76
|
+
Validator.check_bool(blocking, "blocking", "Event")
|
|
77
|
+
super().__init__(enable_timing, blocking)
|
|
78
|
+
|
|
79
|
+
def record(self, stream=None):
|
|
80
|
+
r"""
|
|
81
|
+
Records the event in a given stream.
|
|
82
|
+
|
|
83
|
+
Uses :func:`mindspore.runtime.current_stream()` if no `stream` is specified. The
|
|
84
|
+
stream's device must match the event's device.
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
stream (Stream, optional): a stream to record. If this argument is ``None``,
|
|
88
|
+
current stream will be used. Default value: ``None``.
|
|
89
|
+
|
|
90
|
+
Raises:
|
|
91
|
+
TypeError: If 'stream' is neither a :class:`mindspore.runtime.Stream` nor a ``None``.
|
|
92
|
+
"""
|
|
93
|
+
if stream is None:
|
|
94
|
+
stream = current_stream_()
|
|
95
|
+
if not isinstance(stream, Stream_):
|
|
96
|
+
raise TypeError(
|
|
97
|
+
f"For 'record', the argument 'stream' should be Stream,"
|
|
98
|
+
f" but got {type(stream)}."
|
|
99
|
+
)
|
|
100
|
+
super().record(stream)
|
|
101
|
+
|
|
102
|
+
def wait(self, stream=None):
|
|
103
|
+
r"""
|
|
104
|
+
Makes all future work submitted to the given stream wait for this
|
|
105
|
+
event.
|
|
106
|
+
|
|
107
|
+
Use :func:`mindspore.runtime.current_stream()` if no `stream` is specified.
|
|
108
|
+
|
|
109
|
+
Args:
|
|
110
|
+
stream (Stream, optional): a stream to record. If this argument is ``None``,
|
|
111
|
+
current stream will be used. Default value: ``None``.
|
|
112
|
+
|
|
113
|
+
Raises:
|
|
114
|
+
TypeError: If 'stream' is neither a :class:`mindspore.runtime.Stream` nor a ``None``.
|
|
115
|
+
|
|
116
|
+
Supported Platforms:
|
|
117
|
+
``Ascend`` ``GPU``
|
|
118
|
+
|
|
119
|
+
Examples:
|
|
120
|
+
>>> import mindspore as ms
|
|
121
|
+
>>> import numpy as np
|
|
122
|
+
>>> from mindspore import Tensor, ops
|
|
123
|
+
>>> ms.set_device("Ascend", 0)
|
|
124
|
+
>>> event = ms.runtime.Event()
|
|
125
|
+
>>> s1 = ms.runtime.Stream()
|
|
126
|
+
>>> s2 = ms.runtime.Stream()
|
|
127
|
+
>>> a = Tensor(np.ones([2, 2]), ms.float32)
|
|
128
|
+
>>> b = Tensor(np.ones([2, 2]), ms.float32)
|
|
129
|
+
>>> with ms.runtime.StreamCtx(s1):
|
|
130
|
+
... c = ops.matmul(a, b)
|
|
131
|
+
... event.record()
|
|
132
|
+
>>> event.wait()
|
|
133
|
+
>>> d = c + 2
|
|
134
|
+
>>> ms.runtime.synchronize()
|
|
135
|
+
>>> print(d)
|
|
136
|
+
[[4. 4.]
|
|
137
|
+
[4. 4.]]
|
|
138
|
+
"""
|
|
139
|
+
if not function_event_status['wait']:
|
|
140
|
+
function_event_status['wait'] = True
|
|
141
|
+
if not _is_supported():
|
|
142
|
+
return
|
|
143
|
+
if stream is None:
|
|
144
|
+
stream = current_stream_()
|
|
145
|
+
if not isinstance(stream, Stream_):
|
|
146
|
+
raise TypeError(
|
|
147
|
+
f"For 'wait', the argument 'stream' should be Stream,"
|
|
148
|
+
f" but got {type(stream)}."
|
|
149
|
+
)
|
|
150
|
+
super().wait(stream)
|
|
151
|
+
|
|
152
|
+
def synchronize(self):
|
|
153
|
+
r"""
|
|
154
|
+
Waits for the event to complete.
|
|
155
|
+
|
|
156
|
+
Waits until the completion of all work currently captured in this event.
|
|
157
|
+
This prevents the CPU thread from proceeding until the event completes.
|
|
158
|
+
"""
|
|
159
|
+
# pylint: disable=useless-super-delegation
|
|
160
|
+
super().synchronize()
|
|
161
|
+
|
|
162
|
+
def query(self):
|
|
163
|
+
r"""
|
|
164
|
+
Checks if all work currently captured by event has completed.
|
|
165
|
+
|
|
166
|
+
Returns:
|
|
167
|
+
A boolean indicating if all work currently captured by event has completed.
|
|
168
|
+
|
|
169
|
+
Supported Platforms:
|
|
170
|
+
``Ascend`` ``GPU``
|
|
171
|
+
|
|
172
|
+
Examples:
|
|
173
|
+
>>> import mindspore as ms
|
|
174
|
+
>>> import numpy as np
|
|
175
|
+
>>> from mindspore import Tensor, ops
|
|
176
|
+
>>> ms.set_device("Ascend", 0)
|
|
177
|
+
>>> a = Tensor(np.ones([1024, 2048]), ms.float32)
|
|
178
|
+
>>> b = Tensor(np.ones([2048, 4096]), ms.float32)
|
|
179
|
+
>>> s1 = ms.runtime.Stream()
|
|
180
|
+
>>> with ms.runtime.StreamCtx(s1):
|
|
181
|
+
... c = ops.matmul(a, b)
|
|
182
|
+
... ev = s1.record_event()
|
|
183
|
+
>>> s1.synchronize()
|
|
184
|
+
>>> assert ev.query()
|
|
185
|
+
"""
|
|
186
|
+
# pylint: disable=useless-super-delegation
|
|
187
|
+
return super().query()
|
|
188
|
+
|
|
189
|
+
def elapsed_time(self, end_event):
|
|
190
|
+
r"""
|
|
191
|
+
Returns the time elapsed in milliseconds after the event was
|
|
192
|
+
recorded and before the end_event was recorded.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
end_event (Event): end event.
|
|
196
|
+
|
|
197
|
+
Returns:
|
|
198
|
+
float, the time elapsed in milliseconds.
|
|
199
|
+
|
|
200
|
+
Raises:
|
|
201
|
+
TypeError: If 'end_event' is not a :class:`mindspore.runtime.Event`.
|
|
202
|
+
"""
|
|
203
|
+
# pylint: disable=useless-super-delegation
|
|
204
|
+
if not isinstance(end_event, Event):
|
|
205
|
+
raise TypeError(
|
|
206
|
+
f"For 'elapsed_time', the argument 'end_event' should be Event,"
|
|
207
|
+
f" but got {type(end_event)}."
|
|
208
|
+
)
|
|
209
|
+
return super().elapsed_time(end_event)
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Copyright 2024 Huawei Technologies Co., Ltd
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
# ============================================================================
|
|
15
|
+
|
|
16
|
+
"""Executor manager interfaces."""
|
|
17
|
+
from mindspore._c_expression import RuntimeConf
|
|
18
|
+
from mindspore.runtime.thread_bind_core import _get_cpu_affinity_policy
|
|
19
|
+
from mindspore._checkparam import args_type_check
|
|
20
|
+
from mindspore import _checkparam as Validator
|
|
21
|
+
from mindspore import log as logger
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def launch_blocking():
|
|
26
|
+
"""
|
|
27
|
+
Whether to enable synchronous execution.
|
|
28
|
+
Default: ``False`` . When the value is set to ``False`` , the operator is executed asynchronously on the
|
|
29
|
+
device. When an error occurs in the execution of the operator, the specific error script code location
|
|
30
|
+
cannot be located. When this API is called , the value will be changed to true, the operator is executed
|
|
31
|
+
synchronously on the device. It will reduce the execution performance of the program. At this time, when
|
|
32
|
+
an error occurs in the execution of the operator, the location of the error script code can be located
|
|
33
|
+
according to the call stack of the error.
|
|
34
|
+
|
|
35
|
+
Note:
|
|
36
|
+
- No parameters are required.
|
|
37
|
+
- By default, operations are executed asynchronously.
|
|
38
|
+
- Calling this function enables synchronous execution.
|
|
39
|
+
|
|
40
|
+
Examples:
|
|
41
|
+
>>> import mindspore as ms
|
|
42
|
+
>>> ms.set_device("Ascend", 1)
|
|
43
|
+
>>> ms.runtime.launch_blocking()
|
|
44
|
+
"""
|
|
45
|
+
return RuntimeConf.get_instance().set_launch_blocking()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@args_type_check(threads_num=int)
|
|
49
|
+
def dispatch_threads_num(threads_num):
|
|
50
|
+
"""
|
|
51
|
+
Set the threads number of runtime used.
|
|
52
|
+
|
|
53
|
+
The framework set the runtime number of threads are 5 by default.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
threads_num (int): The threads number of runtime used.
|
|
57
|
+
|
|
58
|
+
Examples:
|
|
59
|
+
>>> import mindspore as ms
|
|
60
|
+
>>> ms.set_device("Ascend", 1)
|
|
61
|
+
>>> ms.runtime.dispatch_threads_num(6)
|
|
62
|
+
"""
|
|
63
|
+
if RuntimeConf.get_instance().is_dispatch_threads_num_configured():
|
|
64
|
+
raise RuntimeError("The 'dispatch_threads_num' can not be set repeatedly.")
|
|
65
|
+
|
|
66
|
+
threads_num = Validator.check_positive_int(threads_num, "threads_num")
|
|
67
|
+
|
|
68
|
+
return RuntimeConf.get_instance().set_dispatch_threads_num(threads_num)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@args_type_check(enable_affinity=bool, affinity_cpu_list=dict)
|
|
72
|
+
def set_cpu_affinity(enable_affinity, affinity_cpu_list=None):
|
|
73
|
+
"""
|
|
74
|
+
Enable thread-level core binding to assign specific CPU cores to MindSpore's main modules (main thread, pynative,
|
|
75
|
+
runtime, minddata), to prevent unstable performance caused by MindSpore's threads seizing CPU.
|
|
76
|
+
|
|
77
|
+
Note:
|
|
78
|
+
- Provides two binding modes: 1. Automatically generates binding policies based on available CPUs, NUMA nodes,
|
|
79
|
+
and device resources in the environment to bind cores at thread level. 2. Thread-level bonding based on
|
|
80
|
+
customized bonding policies passed in by `affinity_cpu_list`.
|
|
81
|
+
|
|
82
|
+
- The automated bind-core policy generation scenario invokes system commands to obtain CPU, NUMA node, and
|
|
83
|
+
device resources on the environment, and some commands cannot be executed successfully due to environment
|
|
84
|
+
differences; the automated bind-core policy generated will vary according to the resources available on the
|
|
85
|
+
environment:
|
|
86
|
+
|
|
87
|
+
1. `cat /sys/fs/cgroup/cpuset/cpuset.cpus`, to obtain the available CPU resources on the environment; if the
|
|
88
|
+
execution of this command fails, the bind-core function will not take effect.
|
|
89
|
+
2. `npu-smi info -m`, get the available NPU resources on the environment; if the execution of this command
|
|
90
|
+
fails, the bind-core policy will be generated only based on the available CPU resources,
|
|
91
|
+
without considering the device affinity.
|
|
92
|
+
3. `npu-smi info -t board -i {NPU_ID} -c {CHIP_ID}`, get NPU details based on the logical ID of the device;
|
|
93
|
+
if the execution of this command fails, the bind-core policy is generated based on the available CPU
|
|
94
|
+
resources only, regardless of device affinity.
|
|
95
|
+
4. `lspci -s {PCIe_No} -vvv`, get the hardware information of the device on the environment; if the execution
|
|
96
|
+
of this command fails, the bind-core policy is generated only based on the available CPU resources,
|
|
97
|
+
without considering the device affinity.
|
|
98
|
+
5. `lscpu`, get information about CPUs and NUMA nodes on the environment; if the execution of this command
|
|
99
|
+
fails, only the available CPU resources are used to generate the bind-core policy, without considering
|
|
100
|
+
the device affinity.
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
enable_affinity (bool): Switches on/off thread-level core binding.
|
|
104
|
+
affinity_cpu_list (dict, optional): Specifies a customized bind-core policy. The key to be passed
|
|
105
|
+
into the dict needs to be in string ``"deviceX"`` format, and the value needs to be in list
|
|
106
|
+
``["cpuidX-cpuidY"]`` format. Default: ``None``, i.e., use the bind-core policy generated automatically
|
|
107
|
+
based on the environment. It is allowed to pass the empty dict ``{}``, in which case the bind-core
|
|
108
|
+
policy generated automatically based on the environment will be used.
|
|
109
|
+
|
|
110
|
+
Raises:
|
|
111
|
+
TypeError: The parameter `enable_affinity` is not a boolean.
|
|
112
|
+
TypeError: The parameter `affinity_cpu_list` is neither a dictionary nor a ``None``.
|
|
113
|
+
ValueError: The key of parameter `affinity_cpu_list` is not a string.
|
|
114
|
+
ValueError: The key of parameter `affinity_cpu_list` is not in ``"deviceX"`` format.
|
|
115
|
+
ValueError: The parameter `affinity_cpu_list` has a value that is not a list.
|
|
116
|
+
ValueError: The element in value of parameter `affinity_cpu_list` is not a string.
|
|
117
|
+
ValueError: The element in value for parameter `affinity_cpu_list` does not match ``["cpuidX-cpuidY"]``.
|
|
118
|
+
RuntimeError: Automatically generated binding policy or customized binding policy scenario where the number
|
|
119
|
+
of CPU cores assigned to each device is less than 7.
|
|
120
|
+
RuntimeError: A custom-specified binding policy scenario where the CPU assigned to a device is not
|
|
121
|
+
available in the environment.
|
|
122
|
+
RuntimeError: The `mindspore.runtime.set_cpu_affinity` API is called repeatedly.
|
|
123
|
+
|
|
124
|
+
Examples:
|
|
125
|
+
>>> import mindspore as ms
|
|
126
|
+
>>> ms.set_device("Ascend", 1)
|
|
127
|
+
>>> ms.runtime.set_cpu_affinity(True)
|
|
128
|
+
>>>
|
|
129
|
+
>>> import mindspore as ms
|
|
130
|
+
>>> ms.set_device("Ascend", 1)
|
|
131
|
+
>>> ms.runtime.set_cpu_affinity(True, {"device0":["0-9"],"device1":["10-15","20-29"],"device2":["35-45"]})
|
|
132
|
+
"""
|
|
133
|
+
if RuntimeConf.get_instance().is_thread_bind_core_configured():
|
|
134
|
+
raise RuntimeError("The 'mindspore.runtime.set_cpu_affinity' cannot be set repeatedly.")
|
|
135
|
+
if enable_affinity:
|
|
136
|
+
module_bind_core_policy, bind_policy_flag = _get_cpu_affinity_policy(affinity_cpu_list)
|
|
137
|
+
if not module_bind_core_policy:
|
|
138
|
+
logger.warning("set_cpu_affinity is not enabled because the environment does not meet the "
|
|
139
|
+
"basic conditions for binding core.")
|
|
140
|
+
RuntimeConf.get_instance().set_thread_bind_core_configured()
|
|
141
|
+
return
|
|
142
|
+
if bind_policy_flag:
|
|
143
|
+
RuntimeConf.get_instance().thread_bind_core_with_policy(module_bind_core_policy)
|
|
144
|
+
else:
|
|
145
|
+
RuntimeConf.get_instance().thread_bind_core(module_bind_core_policy)
|
|
146
|
+
else:
|
|
147
|
+
RuntimeConf.get_instance().set_thread_bind_core_configured()
|
|
148
|
+
return
|