mindspore 2.6.0__cp311-cp311-win_amd64.whl → 2.7.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.
- mindspore/.commit_id +1 -1
- mindspore/Microsoft.VisualStudio.Telemetry.dll +0 -0
- mindspore/Newtonsoft.Json.dll +0 -0
- mindspore/__init__.py +2 -2
- mindspore/_c_dataengine.cp311-win_amd64.pyd +0 -0
- mindspore/_c_expression.cp311-win_amd64.pyd +0 -0
- mindspore/_c_mindrecord.cp311-win_amd64.pyd +0 -0
- mindspore/_checkparam.py +42 -11
- mindspore/_extends/builtin_operations.py +3 -3
- mindspore/{_deprecated → _extends/optimize}/__init__.py +9 -3
- mindspore/_extends/optimize/cell_utils.py +96 -0
- mindspore/_extends/parallel_compile/akg_compiler/custom.py +1109 -0
- mindspore/_extends/parallel_compile/akg_compiler/gen_custom_op_files.py +1 -1
- mindspore/_extends/parse/__init__.py +3 -3
- mindspore/_extends/parse/compile_config.py +44 -22
- mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +1 -2
- mindspore/_extends/parse/parser.py +64 -83
- mindspore/_extends/parse/resources.py +39 -0
- mindspore/_extends/parse/standard_method.py +47 -14
- mindspore/_extends/parse/trope.py +8 -1
- mindspore/_extends/pijit/__init__.py +1 -2
- mindspore/_extends/pijit/pijit_func_white_list.py +2 -5
- mindspore/amp.py +4 -22
- 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/adasum.py +1 -1
- mindspore/boost/boost_cell_wrapper.py +4 -4
- mindspore/c1.dll +0 -0
- mindspore/c1xx.dll +0 -0
- mindspore/c2.dll +0 -0
- mindspore/common/__init__.py +43 -12
- mindspore/common/_grad_function.py +2 -1
- mindspore/common/_pijit_context.py +28 -7
- mindspore/common/_stub_tensor.py +1 -209
- mindspore/common/_tensor_cpp_method.py +1 -1
- mindspore/common/_tensor_docs.py +177 -52
- mindspore/common/_utils.py +9 -1
- mindspore/common/api.py +338 -208
- mindspore/common/dtype.py +108 -57
- mindspore/common/dump.py +11 -16
- mindspore/common/dynamic_shape/__init__.py +0 -0
- mindspore/common/{auto_dynamic_shape.py → dynamic_shape/auto_dynamic_shape.py} +17 -23
- mindspore/common/dynamic_shape/enable_dynamic.py +197 -0
- mindspore/common/file_system.py +59 -9
- mindspore/common/generator.py +2 -3
- mindspore/common/hook_handle.py +33 -5
- mindspore/common/jit_config.py +1 -1
- mindspore/common/jit_trace.py +84 -105
- mindspore/common/np_dtype.py +3 -3
- mindspore/common/parameter.py +27 -29
- mindspore/common/recompute.py +5 -7
- mindspore/common/sparse_tensor.py +0 -3
- mindspore/common/symbol.py +0 -1
- mindspore/common/tensor.py +84 -133
- mindspore/communication/_comm_helper.py +46 -4
- mindspore/communication/management.py +79 -7
- mindspore/context.py +47 -38
- mindspore/dataset/__init__.py +1 -1
- mindspore/dataset/audio/transforms.py +1 -1
- mindspore/dataset/core/config.py +38 -4
- mindspore/dataset/engine/datasets.py +350 -322
- mindspore/dataset/engine/datasets_user_defined.py +69 -23
- mindspore/dataset/engine/iterators.py +2 -2
- mindspore/dataset/engine/obs/config_loader.py +2 -2
- mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +8 -0
- mindspore/dataset/transforms/c_transforms.py +2 -2
- mindspore/dataset/transforms/py_transforms.py +7 -3
- mindspore/dataset/transforms/transforms.py +10 -6
- mindspore/dataset/vision/__init__.py +1 -1
- mindspore/dataset/vision/py_transforms.py +8 -8
- mindspore/dataset/vision/transforms.py +17 -5
- mindspore/dataset/vision/utils.py +632 -21
- mindspore/dataset/vision/validators.py +1 -0
- mindspore/device_context/ascend/device.py +1 -1
- mindspore/device_context/ascend/op_tuning.py +35 -1
- mindspore/device_context/gpu/__init__.py +2 -2
- mindspore/device_context/gpu/device.py +1 -1
- mindspore/device_context/gpu/op_precision.py +4 -2
- mindspore/device_context/gpu/op_tuning.py +6 -3
- mindspore/device_manager.py +16 -9
- mindspore/dnnl.dll +0 -0
- mindspore/dpcmi.dll +0 -0
- mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +5 -4
- mindspore/experimental/llm_boost/atb/boost_base.py +2 -3
- mindspore/experimental/optim/adadelta.py +13 -20
- mindspore/experimental/optim/adagrad.py +15 -22
- mindspore/experimental/optim/adam.py +17 -24
- mindspore/experimental/optim/adamax.py +14 -22
- mindspore/experimental/optim/adamw.py +28 -34
- mindspore/experimental/optim/asgd.py +15 -25
- mindspore/experimental/optim/lr_scheduler.py +27 -45
- mindspore/experimental/optim/nadam.py +14 -24
- mindspore/experimental/optim/optimizer.py +13 -23
- mindspore/experimental/optim/radam.py +18 -24
- mindspore/experimental/optim/rmsprop.py +14 -25
- mindspore/experimental/optim/rprop.py +15 -26
- mindspore/experimental/optim/sgd.py +9 -19
- mindspore/hal/__init__.py +4 -4
- mindspore/hal/contiguous_tensors_handle.py +2 -2
- mindspore/hal/memory.py +1 -0
- mindspore/include/api/cell.h +65 -5
- mindspore/include/api/cfg.h +24 -7
- mindspore/include/api/context.h +1 -0
- mindspore/include/api/delegate.h +10 -2
- mindspore/include/api/dual_abi_helper.h +100 -19
- mindspore/include/api/graph.h +14 -1
- mindspore/include/api/kernel.h +16 -3
- mindspore/include/api/kernel_api.h +9 -1
- mindspore/include/api/metrics/accuracy.h +9 -0
- mindspore/include/api/model.h +8 -1
- mindspore/include/api/model_group.h +4 -0
- mindspore/include/api/model_parallel_runner.h +2 -0
- mindspore/include/api/status.h +48 -10
- mindspore/include/api/types.h +8 -3
- mindspore/include/c_api/model_c.h +0 -58
- mindspore/include/c_api/tensor_c.h +0 -26
- mindspore/include/dataset/constants.h +9 -0
- mindspore/include/dataset/vision_ascend.h +1 -1
- mindspore/jpeg62.dll +0 -0
- mindspore/mindrecord/tools/cifar10.py +61 -11
- mindspore/mindrecord/tools/cifar10_to_mr.py +5 -0
- 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_cpu_res_manager.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_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 +4 -44
- mindspore/mint/distributed/__init__.py +5 -0
- mindspore/mint/distributed/distributed.py +425 -19
- mindspore/mint/nn/__init__.py +1 -1
- mindspore/mint/nn/functional.py +53 -6
- mindspore/mint/nn/layer/_functions.py +163 -294
- mindspore/mint/nn/layer/activation.py +8 -6
- mindspore/mint/nn/layer/conv.py +125 -101
- mindspore/mint/nn/layer/normalization.py +11 -25
- mindspore/mint/optim/adam.py +19 -18
- mindspore/mint/optim/adamw.py +14 -8
- mindspore/mint/optim/sgd.py +5 -5
- 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/cell.py +488 -620
- mindspore/nn/grad/cell_grad.py +11 -12
- mindspore/nn/layer/activation.py +36 -36
- mindspore/nn/layer/basic.py +74 -77
- mindspore/nn/layer/channel_shuffle.py +4 -4
- mindspore/nn/layer/combined.py +4 -2
- mindspore/nn/layer/conv.py +86 -85
- mindspore/nn/layer/dense.py +9 -7
- mindspore/nn/layer/embedding.py +50 -52
- mindspore/nn/layer/image.py +38 -40
- mindspore/nn/layer/math.py +111 -112
- mindspore/nn/layer/normalization.py +56 -44
- mindspore/nn/layer/pooling.py +58 -63
- mindspore/nn/layer/rnn_cells.py +33 -33
- mindspore/nn/layer/rnns.py +56 -56
- mindspore/nn/layer/thor_layer.py +74 -73
- mindspore/nn/layer/transformer.py +11 -1
- mindspore/nn/learning_rate_schedule.py +20 -20
- mindspore/nn/loss/loss.py +79 -81
- mindspore/nn/optim/adam.py +2 -4
- mindspore/nn/optim/adasum.py +2 -2
- mindspore/nn/optim/lamb.py +1 -3
- mindspore/nn/optim/optimizer.py +1 -1
- mindspore/nn/optim/tft_wrapper.py +2 -3
- mindspore/nn/optim/thor.py +2 -2
- mindspore/nn/probability/distribution/_utils/utils.py +2 -2
- mindspore/nn/probability/distribution/exponential.py +2 -1
- mindspore/nn/probability/distribution/poisson.py +2 -1
- mindspore/nn/sparse/sparse.py +3 -3
- mindspore/nn/wrap/cell_wrapper.py +73 -42
- mindspore/nn/wrap/grad_reducer.py +37 -52
- mindspore/nn/wrap/loss_scale.py +72 -74
- mindspore/numpy/array_creations.py +7 -7
- mindspore/numpy/fft.py +1 -1
- mindspore/numpy/math_ops.py +1 -1
- mindspore/numpy/utils_const.py +1 -1
- mindspore/opencv_core452.dll +0 -0
- mindspore/opencv_imgcodecs452.dll +0 -0
- mindspore/opencv_imgproc452.dll +0 -0
- mindspore/ops/_grad_experimental/grad_comm_ops.py +51 -13
- mindspore/ops/_grad_experimental/grad_debug_ops.py +14 -0
- mindspore/ops/_grad_experimental/grad_inner_ops.py +0 -9
- mindspore/ops/_op_impl/cpu/__init__.py +1 -0
- mindspore/{experimental/es/__init__.py → ops/_op_impl/cpu/joinedstr_op.py} +12 -6
- mindspore/ops/_vmap/vmap_array_ops.py +6 -13
- mindspore/ops/_vmap/vmap_nn_ops.py +8 -16
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +29 -10
- mindspore/ops/auto_generate/gen_extend_func.py +5 -55
- mindspore/ops/auto_generate/gen_ops_def.py +753 -273
- mindspore/ops/auto_generate/gen_ops_prim.py +1687 -958
- mindspore/ops/auto_generate/pyboost_inner_prim.py +31 -1
- mindspore/ops/composite/__init__.py +10 -0
- mindspore/ops/composite/base.py +9 -5
- mindspore/ops/composite/multitype_ops/__init__.py +12 -1
- mindspore/ops/composite/multitype_ops/_compile_utils.py +132 -108
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -1
- mindspore/ops/composite/multitype_ops/add_impl.py +70 -2
- mindspore/ops/composite/multitype_ops/div_impl.py +49 -0
- mindspore/ops/composite/multitype_ops/floordiv_impl.py +29 -0
- mindspore/ops/composite/multitype_ops/getitem_impl.py +11 -0
- mindspore/ops/composite/multitype_ops/mod_impl.py +5 -3
- mindspore/ops/composite/multitype_ops/mul_impl.py +49 -0
- mindspore/ops/composite/multitype_ops/setitem_impl.py +57 -0
- mindspore/ops/composite/multitype_ops/sub_impl.py +34 -0
- mindspore/ops/composite/multitype_ops/zeros_like_impl.py +14 -0
- mindspore/ops/function/__init__.py +4 -1
- mindspore/ops/function/_add_attr_func.py +11 -6
- mindspore/ops/function/array_func.py +17 -100
- mindspore/ops/function/debug_func.py +8 -5
- mindspore/ops/function/grad/grad_func.py +5 -13
- mindspore/ops/function/math_func.py +65 -399
- mindspore/ops/function/nn_func.py +44 -61
- mindspore/ops/function/other_func.py +4 -1
- mindspore/ops/function/random_func.py +31 -4
- mindspore/ops/functional.py +2 -3
- mindspore/ops/functional_overload.py +486 -18
- mindspore/ops/op_info_register.py +21 -0
- mindspore/ops/operations/__init__.py +5 -2
- mindspore/ops/operations/_custom_ops_utils.py +675 -8
- mindspore/ops/operations/_inner_ops.py +14 -18
- mindspore/ops/operations/_sequence_ops.py +1 -1
- mindspore/ops/operations/array_ops.py +4 -50
- mindspore/ops/operations/comm_ops.py +186 -41
- mindspore/ops/operations/custom_ops.py +244 -175
- mindspore/ops/operations/debug_ops.py +55 -4
- mindspore/ops/operations/image_ops.py +13 -13
- mindspore/ops/operations/manually_defined/ops_def.py +27 -28
- mindspore/ops/operations/math_ops.py +8 -9
- mindspore/ops/operations/nn_ops.py +6 -7
- mindspore/ops/primitive.py +9 -20
- mindspore/ops/tensor_method.py +52 -11
- mindspore/ops_generate/api/cpp_create_prim_instance_helper_generator.py +1 -1
- mindspore/ops_generate/api/functional_map_cpp_generator.py +10 -9
- mindspore/ops_generate/api/functions_cc_generator.py +58 -10
- mindspore/ops_generate/api/tensor_func_reg_cpp_generator.py +1 -1
- mindspore/ops_generate/common/base_generator.py +14 -0
- mindspore/ops_generate/common/gen_constants.py +7 -2
- mindspore/ops_generate/common/gen_utils.py +0 -19
- mindspore/ops_generate/common/op_proto.py +11 -4
- mindspore/ops_generate/common/template.py +88 -11
- mindspore/ops_generate/gen_ops.py +1 -1
- mindspore/ops_generate/op_def/lite_ops_cpp_generator.py +4 -4
- mindspore/ops_generate/op_def/ops_name_h_generator.py +0 -3
- mindspore/ops_generate/op_def/ops_primitive_h_generator.py +0 -4
- mindspore/ops_generate/op_def_py/op_prim_py_generator.py +5 -2
- mindspore/ops_generate/pyboost/auto_grad_impl_cc_generator.py +49 -8
- mindspore/ops_generate/pyboost/auto_grad_reg_cc_generator.py +2 -2
- mindspore/ops_generate/pyboost/gen_pyboost_func.py +31 -16
- mindspore/ops_generate/pyboost/op_template_parser.py +98 -72
- mindspore/ops_generate/pyboost/pyboost_functions_cpp_generator.py +70 -273
- mindspore/ops_generate/pyboost/pyboost_functions_h_generator.py +14 -6
- mindspore/ops_generate/pyboost/pyboost_functions_impl_cpp_generator.py +316 -0
- mindspore/ops_generate/pyboost/pyboost_functions_py_generator.py +1 -1
- mindspore/ops_generate/pyboost/pyboost_grad_function_cpp_generator.py +5 -3
- mindspore/ops_generate/pyboost/pyboost_inner_prim_generator.py +1 -1
- mindspore/ops_generate/pyboost/pyboost_internal_functions_cpp_generator.py +76 -0
- mindspore/ops_generate/pyboost/pyboost_internal_functions_h_generator.py +76 -0
- mindspore/ops_generate/pyboost/pyboost_internal_kernel_info_adapter_generator.py +125 -0
- mindspore/ops_generate/pyboost/pyboost_native_grad_functions_generator.py +4 -3
- mindspore/ops_generate/pyboost/pyboost_op_cpp_code_generator.py +348 -61
- mindspore/ops_generate/pyboost/pyboost_overload_functions_cpp_generator.py +1 -1
- mindspore/ops_generate/pyboost/pyboost_utils.py +118 -9
- mindspore/ops_generate/tensor_py_cc_generator.py +1 -24
- mindspore/parallel/_auto_parallel_context.py +9 -17
- mindspore/parallel/_cell_wrapper.py +106 -40
- mindspore/parallel/_parallel_serialization.py +4 -3
- mindspore/parallel/_ps_context.py +4 -6
- mindspore/parallel/_tensor.py +167 -12
- mindspore/parallel/_transformer/moe.py +1 -1
- mindspore/parallel/_transformer/transformer.py +17 -12
- mindspore/parallel/_utils.py +5 -11
- mindspore/parallel/auto_parallel.py +33 -12
- mindspore/parallel/checkpoint_convert.py +3 -3
- mindspore/parallel/checkpoint_transform.py +5 -1
- mindspore/parallel/cluster/process_entity/_api.py +88 -49
- mindspore/parallel/cluster/process_entity/_utils.py +95 -7
- mindspore/parallel/cluster/run.py +48 -7
- mindspore/parallel/function/__init__.py +8 -1
- mindspore/parallel/function/reshard_func.py +7 -6
- mindspore/parallel/nn/__init__.py +15 -2
- mindspore/parallel/nn/parallel_cell_wrapper.py +50 -14
- mindspore/parallel/nn/parallel_grad_reducer.py +7 -14
- mindspore/parallel/shard.py +9 -23
- mindspore/parallel/transform_safetensors.py +468 -174
- mindspore/pgodb140.dll +0 -0
- mindspore/pgort140.dll +0 -0
- mindspore/profiler/__init__.py +2 -1
- mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +7 -7
- mindspore/profiler/analysis/parser/timeline_assembly_factory/base_timeline_assembler.py +3 -0
- mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +3 -0
- mindspore/profiler/analysis/parser/timeline_creator/cpu_op_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_creator/msprof_timeline_creator.py +4 -4
- mindspore/profiler/analysis/parser/timeline_creator/scope_layer_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +4 -1
- mindspore/profiler/analysis/parser/timeline_event/timeline_event_pool.py +2 -1
- mindspore/profiler/analysis/task_manager.py +1 -1
- mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +5 -1
- mindspore/profiler/analysis/viewer/ascend_integrate_viewer.py +2 -1
- mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +10 -9
- mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +43 -23
- mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +3 -2
- mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +9 -5
- mindspore/profiler/analysis/viewer/ms_operator_details_viewer.py +132 -0
- mindspore/profiler/common/constant.py +16 -0
- mindspore/profiler/common/msprof_cmd_tool.py +2 -2
- mindspore/profiler/common/path_manager.py +9 -0
- mindspore/profiler/common/profiler_context.py +50 -29
- mindspore/profiler/common/profiler_info.py +0 -16
- mindspore/profiler/common/profiler_meta_data.py +1 -0
- mindspore/profiler/common/profiler_op_analyse.py +239 -0
- mindspore/profiler/common/profiler_output_path.py +23 -8
- mindspore/profiler/common/profiler_parameters.py +128 -35
- mindspore/profiler/dynamic_profile/__init__.py +0 -0
- mindspore/profiler/dynamic_profile/dynamic_monitor_proxy.py +39 -0
- mindspore/profiler/dynamic_profile/dynamic_profiler_config_context.py +666 -0
- mindspore/profiler/dynamic_profile/dynamic_profiler_utils.py +62 -0
- mindspore/profiler/dynamic_profiler.py +374 -338
- mindspore/profiler/envprofiler.py +42 -12
- mindspore/profiler/experimental_config.py +112 -7
- mindspore/profiler/mstx.py +33 -12
- mindspore/profiler/platform/__init__.py +2 -3
- mindspore/profiler/platform/cpu_profiler.py +10 -4
- mindspore/profiler/platform/npu_profiler.py +30 -20
- mindspore/profiler/profiler.py +218 -154
- mindspore/profiler/profiler_action_controller.py +65 -77
- mindspore/profiler/profiler_interface.py +2 -2
- mindspore/profiler/schedule.py +10 -4
- mindspore/rewrite/common/config.py +1 -0
- mindspore/rewrite/common/namer.py +1 -0
- mindspore/rewrite/common/namespace.py +1 -0
- mindspore/rewrite/node/node.py +31 -11
- mindspore/rewrite/parsers/assign_parser.py +1 -1
- mindspore/rewrite/symbol_tree/symbol_tree.py +2 -2
- mindspore/run_check/_check_version.py +7 -10
- mindspore/runtime/__init__.py +8 -6
- mindspore/runtime/event.py +10 -4
- mindspore/runtime/executor.py +87 -45
- mindspore/runtime/memory.py +22 -30
- mindspore/runtime/thread_bind_core.py +299 -165
- mindspore/safeguard/rewrite_obfuscation.py +12 -13
- mindspore/swresample-4.dll +0 -0
- mindspore/swscale-6.dll +0 -0
- mindspore/tbbmalloc.dll +0 -0
- mindspore/tinyxml2.dll +0 -0
- mindspore/train/_utils.py +9 -5
- mindspore/train/amp.py +43 -23
- mindspore/train/callback/__init__.py +5 -5
- mindspore/train/callback/_callback.py +2 -1
- mindspore/train/callback/_checkpoint.py +4 -14
- mindspore/train/callback/_flops_collector.py +11 -7
- mindspore/train/callback/_landscape.py +0 -1
- mindspore/train/callback/_train_fault_tolerance.py +72 -18
- mindspore/train/data_sink.py +15 -6
- mindspore/train/dataset_helper.py +14 -5
- mindspore/train/model.py +49 -47
- mindspore/train/serialization.py +168 -126
- mindspore/train/summary/summary_record.py +13 -2
- mindspore/train/train_thor/model_thor.py +2 -2
- mindspore/turbojpeg.dll +0 -0
- mindspore/utils/__init__.py +3 -2
- mindspore/utils/dryrun.py +0 -6
- mindspore/utils/runtime_execution_order_check.py +162 -78
- mindspore/utils/sdc_detect.py +68 -0
- mindspore/utils/utils.py +14 -17
- mindspore/vcmeta.dll +0 -0
- mindspore/vcruntime140.dll +0 -0
- mindspore/vcruntime140_1.dll +0 -0
- mindspore/version.py +1 -1
- {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/METADATA +5 -4
- {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/RECORD +400 -439
- mindspore/_deprecated/jit.py +0 -198
- mindspore/_extends/remote/kernel_build_server_ascend.py +0 -75
- mindspore/communication/_hccl_management.py +0 -297
- mindspore/experimental/es/embedding_service.py +0 -891
- mindspore/experimental/es/embedding_service_layer.py +0 -581
- mindspore/profiler/common/validator/__init__.py +0 -14
- mindspore/profiler/common/validator/validate_path.py +0 -84
- mindspore/profiler/parser/__init__.py +0 -14
- mindspore/profiler/parser/aicpu_data_parser.py +0 -272
- mindspore/profiler/parser/ascend_analysis/__init__.py +0 -14
- mindspore/profiler/parser/ascend_analysis/constant.py +0 -71
- mindspore/profiler/parser/ascend_analysis/file_manager.py +0 -180
- mindspore/profiler/parser/ascend_analysis/function_event.py +0 -185
- mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +0 -136
- mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +0 -131
- mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +0 -104
- mindspore/profiler/parser/ascend_analysis/path_manager.py +0 -313
- mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +0 -123
- mindspore/profiler/parser/ascend_analysis/tlv_decoder.py +0 -86
- mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +0 -75
- mindspore/profiler/parser/ascend_cluster_generator.py +0 -116
- mindspore/profiler/parser/ascend_communicate_generator.py +0 -314
- mindspore/profiler/parser/ascend_flops_generator.py +0 -116
- mindspore/profiler/parser/ascend_fpbp_generator.py +0 -82
- mindspore/profiler/parser/ascend_hccl_generator.py +0 -271
- mindspore/profiler/parser/ascend_integrate_generator.py +0 -42
- mindspore/profiler/parser/ascend_memory_generator.py +0 -185
- mindspore/profiler/parser/ascend_msprof_exporter.py +0 -282
- mindspore/profiler/parser/ascend_msprof_generator.py +0 -187
- mindspore/profiler/parser/ascend_op_generator.py +0 -334
- mindspore/profiler/parser/ascend_steptrace_generator.py +0 -94
- mindspore/profiler/parser/ascend_timeline_generator.py +0 -545
- mindspore/profiler/parser/base_timeline_generator.py +0 -483
- mindspore/profiler/parser/container.py +0 -229
- mindspore/profiler/parser/cpu_gpu_timeline_generator.py +0 -697
- mindspore/profiler/parser/flops_parser.py +0 -531
- mindspore/profiler/parser/framework_enum.py +0 -111
- mindspore/profiler/parser/framework_parser.py +0 -464
- mindspore/profiler/parser/framework_struct.py +0 -61
- mindspore/profiler/parser/gpu_analysis/__init__.py +0 -14
- mindspore/profiler/parser/gpu_analysis/function_event.py +0 -44
- mindspore/profiler/parser/gpu_analysis/fwk_file_parser.py +0 -89
- mindspore/profiler/parser/gpu_analysis/profiler_info_parser.py +0 -72
- mindspore/profiler/parser/hccl_parser.py +0 -573
- mindspore/profiler/parser/hwts_log_parser.py +0 -122
- mindspore/profiler/parser/integrator.py +0 -526
- mindspore/profiler/parser/memory_usage_parser.py +0 -277
- mindspore/profiler/parser/minddata_analyzer.py +0 -800
- mindspore/profiler/parser/minddata_parser.py +0 -186
- mindspore/profiler/parser/minddata_pipeline_parser.py +0 -299
- mindspore/profiler/parser/op_intermediate_parser.py +0 -149
- mindspore/profiler/parser/optime_parser.py +0 -250
- mindspore/profiler/parser/profiler_info.py +0 -213
- mindspore/profiler/parser/step_trace_parser.py +0 -666
- mindspore/utils/hooks.py +0 -81
- /mindspore/common/{_auto_dynamic.py → dynamic_shape/_auto_dynamic.py} +0 -0
- {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/WHEEL +0 -0
- {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/entry_points.txt +0 -0
- {mindspore-2.6.0.dist-info → mindspore-2.7.0.dist-info}/top_level.txt +0 -0
|
@@ -16,12 +16,15 @@
|
|
|
16
16
|
import os
|
|
17
17
|
import json
|
|
18
18
|
from mindspore import log as logger
|
|
19
|
-
from mindspore.profiler.profiler import
|
|
19
|
+
from mindspore.profiler.profiler import Profile
|
|
20
|
+
from mindspore.profiler.experimental_config import _ExperimentalConfig
|
|
21
|
+
from mindspore.profiler import tensorboard_trace_handler
|
|
20
22
|
from mindspore.profiler.common.constant import (
|
|
21
23
|
ProfilerLevel,
|
|
22
24
|
AicoreMetrics,
|
|
23
25
|
ProfilerActivity,
|
|
24
26
|
ExportType,
|
|
27
|
+
HostSystem
|
|
25
28
|
)
|
|
26
29
|
from mindspore.profiler.common.profiler_parameters import ProfilerParameters
|
|
27
30
|
|
|
@@ -46,8 +49,31 @@ class EnvProfiler:
|
|
|
46
49
|
|
|
47
50
|
params = cls._convert_options_to_profiler_params(options)
|
|
48
51
|
logger.info(f"params: {params}")
|
|
49
|
-
if params["
|
|
50
|
-
|
|
52
|
+
if params["start"]:
|
|
53
|
+
experimental_config = _ExperimentalConfig(profiler_level=params.get("profiler_level"),
|
|
54
|
+
aic_metrics=params.get("aic_metrics"),
|
|
55
|
+
l2_cache=params.get("l2_cache"),
|
|
56
|
+
mstx=params.get("mstx"),
|
|
57
|
+
data_simplification=params.get("data_simplification"),
|
|
58
|
+
export_type=params.get("export_type"),
|
|
59
|
+
mstx_domain_include=params.get("mstx_domain_include"),
|
|
60
|
+
mstx_domain_exclude=params.get("mstx_domain_exclude"),
|
|
61
|
+
sys_io=params.get("sys_io"),
|
|
62
|
+
sys_interconnection=params.get("sys_interconnection"),
|
|
63
|
+
host_sys=params.get("host_sys"))
|
|
64
|
+
cls.profiler = Profile(activities=params.get("activities"),
|
|
65
|
+
with_stack=params.get("with_stack"),
|
|
66
|
+
profile_memory=params.get("profile_memory"),
|
|
67
|
+
data_process=params.get("data_process"),
|
|
68
|
+
parallel_strategy=params.get("parallel_strategy"),
|
|
69
|
+
start_profile=params.get("start_profile"),
|
|
70
|
+
hbm_ddr=params.get("hbm_ddr"),
|
|
71
|
+
pcie=params.get("pcie"),
|
|
72
|
+
sync_enable=params.get("sync_enable"),
|
|
73
|
+
record_shapes=params.get("record_shapes"),
|
|
74
|
+
on_trace_ready=tensorboard_trace_handler(params.get("output_path")),
|
|
75
|
+
experimental_config=experimental_config)
|
|
76
|
+
cls.profiler.start()
|
|
51
77
|
logger.info("Profiler init success.")
|
|
52
78
|
|
|
53
79
|
def analyse(self):
|
|
@@ -58,7 +84,7 @@ class EnvProfiler:
|
|
|
58
84
|
if not self.profiler:
|
|
59
85
|
logger.info("Profiler is not initialized, skip analyse.")
|
|
60
86
|
return
|
|
61
|
-
self.profiler.
|
|
87
|
+
self.profiler.stop()
|
|
62
88
|
logger.info("analyse end")
|
|
63
89
|
|
|
64
90
|
@classmethod
|
|
@@ -100,13 +126,17 @@ class EnvProfiler:
|
|
|
100
126
|
params["output_path"] = options["output_path"]
|
|
101
127
|
|
|
102
128
|
# if start is not set, default is False
|
|
103
|
-
params["
|
|
129
|
+
params["start"] = options.get("start", False)
|
|
104
130
|
|
|
105
131
|
for param, (_, default_value) in ProfilerParameters.PARAMS.items():
|
|
106
132
|
if param in options and param not in cls.NOT_SUPPORTED_PARAMS:
|
|
107
133
|
if param == "activities" and isinstance(options[param], list):
|
|
108
|
-
params[param] = cls.
|
|
109
|
-
options[param], default_value
|
|
134
|
+
params[param] = cls._convert_enums_to_list(
|
|
135
|
+
options[param], default_value, ProfilerActivity
|
|
136
|
+
)
|
|
137
|
+
elif param == "host_sys" and isinstance(options[param], list):
|
|
138
|
+
params[param] = cls._convert_enums_to_list(
|
|
139
|
+
options[param], default_value, HostSystem
|
|
110
140
|
)
|
|
111
141
|
elif param == "aic_metrics":
|
|
112
142
|
params[param] = cls._convert_option_to_enum_value(
|
|
@@ -125,15 +155,15 @@ class EnvProfiler:
|
|
|
125
155
|
return params
|
|
126
156
|
|
|
127
157
|
@classmethod
|
|
128
|
-
def
|
|
158
|
+
def _convert_enums_to_list(cls, values, default_value, enum_class):
|
|
129
159
|
"""
|
|
130
|
-
Convert the
|
|
160
|
+
Convert the enums to the list.
|
|
131
161
|
"""
|
|
132
162
|
res = []
|
|
133
|
-
for
|
|
163
|
+
for value in values:
|
|
134
164
|
res.append(
|
|
135
165
|
cls._convert_option_to_enum_value(
|
|
136
|
-
|
|
166
|
+
enum_class, value, default_value
|
|
137
167
|
)
|
|
138
168
|
)
|
|
139
169
|
# remove duplicate
|
|
@@ -146,7 +176,7 @@ class EnvProfiler:
|
|
|
146
176
|
"""
|
|
147
177
|
res = []
|
|
148
178
|
for export_type in export_types:
|
|
149
|
-
if export_type
|
|
179
|
+
if export_type not in ("text", "db"):
|
|
150
180
|
logger.warning(
|
|
151
181
|
f"The value '{export_type}' of parameter '{ExportType.__name__}' is invalid, "
|
|
152
182
|
f"use default value '{default_value}' instead."
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
# ============================================================================
|
|
15
15
|
"""Experimental config file."""
|
|
16
16
|
|
|
17
|
-
from mindspore.profiler.common.constant import ProfilerLevel, AicoreMetrics
|
|
18
|
-
|
|
19
17
|
__all__ = ["_ExperimentalConfig"]
|
|
20
18
|
|
|
19
|
+
from mindspore.profiler.common.constant import ProfilerLevel, AicoreMetrics
|
|
20
|
+
|
|
21
21
|
|
|
22
22
|
class _ExperimentalConfig:
|
|
23
23
|
r"""
|
|
@@ -58,8 +58,8 @@ class _ExperimentalConfig:
|
|
|
58
58
|
- AicoreMetrics.MemoryAccess: Statistics on storage access bandwidth and storage capacity of main
|
|
59
59
|
storage and l2 cache etc.
|
|
60
60
|
l2_cache (bool, optional): (Ascend only) Whether to collect l2 cache data, collect when True.
|
|
61
|
-
Default: ``False`` . The l2_cache.csv file is generated in the ASCEND_PROFILER_OUTPUT folder.In
|
|
62
|
-
only
|
|
61
|
+
Default: ``False`` . The l2_cache.csv file is generated in the ASCEND_PROFILER_OUTPUT folder. In GE backend,
|
|
62
|
+
only support :class:`mindspore.profiler.schedule` configuration wait and skip_first parameter is 0.
|
|
63
63
|
mstx (bool, optional): (Ascend only) Whether to collect light weight profiling data, collect when True.
|
|
64
64
|
Default: ``False`` .
|
|
65
65
|
data_simplification (bool, optional): (Ascend only) Whether to remove FRAMEWORK data and other redundant data.
|
|
@@ -71,6 +71,53 @@ class _ExperimentalConfig:
|
|
|
71
71
|
|
|
72
72
|
- ExportType.Text: Export text type data.
|
|
73
73
|
- ExportType.Db: Export db type data.
|
|
74
|
+
mstx_domain_include (list, optional): (Ascend only) Set the set of enabled domain names when the mstx switch
|
|
75
|
+
is turned on. The name must be of str type. Default value: ``[]``, indicating that this parameter
|
|
76
|
+
is not used to control the domain. This parameter is mutually exclusive with the mstx_domain_exclude
|
|
77
|
+
parameter and cannot be set. simultaneously. If both are set, only the mstx_domain_include parameter
|
|
78
|
+
takes effect.
|
|
79
|
+
mstx_domain_exclude (list, optional): (Ascend only) Set the set of domain names that are not enabled when the
|
|
80
|
+
mstx switch is turned on. The name must be of str type. Default value: ``[]``, indicating that this
|
|
81
|
+
parameter is not used to control the domain.
|
|
82
|
+
sys_io (bool, optional): (Ascend only) Whether to collect NIC and RoCE data. Default: ``False``.
|
|
83
|
+
sys_interconnection (bool, optional): (Ascend only) Whether to collect system interconnection data, including
|
|
84
|
+
HCCS data, PCIe data, and Stars Chip Trans. Default: ``False``.
|
|
85
|
+
host_sys (list, optional): Collect the data of system call classes on the host side.
|
|
86
|
+
Default: ``[]``, indicating that system class data on the host side is not collected.
|
|
87
|
+
You need to set `start_profile` of :class:`mindspore.profiler.profile` to ``False``.When collecting DISK or
|
|
88
|
+
OSRT data, it is necessary to install the iotop, perf, and ltrace third-party tools in advance.
|
|
89
|
+
For detailed steps, please refer to `Installing Third-party Tools
|
|
90
|
+
<https://www.hiascend.com/document/detail/zh/mindstudio/80RC1/T&ITools/Profiling/atlasprofiling_16_0136.
|
|
91
|
+
html>`_ .
|
|
92
|
+
After the third-party tool is successfully installed, user permissions need to be configured.
|
|
93
|
+
For detailed steps, please refer to `Configure User Permissions
|
|
94
|
+
<https://www.hiascend.com/document/detail/zh/mindstudio/80RC1/T&ITools/Profiling/atlasprofiling_16_0137.
|
|
95
|
+
html>`_ .
|
|
96
|
+
Note that in step 3 of configuring user permissions, the content in the msprof_data_collection.sh
|
|
97
|
+
script needs to be replaced with `msprof_data_collection.sh
|
|
98
|
+
<https://gitee.com/mindspore/mindspore/blob/master/docs/api/api_python/mindspore/script/
|
|
99
|
+
msprof_data_collection.sh>`_.
|
|
100
|
+
|
|
101
|
+
Final deliverables by `MindStudio Insight
|
|
102
|
+
<https://www.hiascend.com/developer/download/community/result?module=pt+sto+cann>`_
|
|
103
|
+
tool visualizes the analysis results.
|
|
104
|
+
For detailed analysis, please refer to `host-side CPU data analysis
|
|
105
|
+
<https://www.hiascend.com/document/detail/zh/mindstudio/80RC1/T&ITools/Profiling/
|
|
106
|
+
atlasprofiling_16_0106.html>`_, `host-side MEM data analysis
|
|
107
|
+
<https://www.hiascend.com/document/detail/zh/mindstudio/80RC1/T&ITools/Profiling/
|
|
108
|
+
atlasprofiling_16_0107.html>`_, `host-side DISK data analysis
|
|
109
|
+
<https://www.hiascend.com/document/detail/zh/mindstudio/80RC1/T&ITools/Profiling/
|
|
110
|
+
atlasprofiling_16_0108.html>`_, `host-side NETWORK data analysis
|
|
111
|
+
<https://www.hiascend.com/document/detail/zh/mindstudio/80RC1/T&ITools/Profiling/
|
|
112
|
+
atlasprofiling_16_0109.html>`_, `host-side OSRT data analysis
|
|
113
|
+
<https://www.hiascend.com/document/detail/zh/mindstudio/80RC1/T&ITools/Profiling/
|
|
114
|
+
atlasprofiling_16_0110.html>`_.
|
|
115
|
+
|
|
116
|
+
- HostSystem.CPU: Collect the CPU utilization at the process level.
|
|
117
|
+
- HostSystem.MEM: Collect the memory utilization at the process level.
|
|
118
|
+
- HostSystem.DISK: Collect the disk I/O utilization at the process level.
|
|
119
|
+
- HostSystem.NETWORK: Collect the network I/O utilization at the system level.
|
|
120
|
+
- HostSystem.OSRT: Collect system call stack data at the system level.
|
|
74
121
|
|
|
75
122
|
Raises:
|
|
76
123
|
RuntimeError: When the version of CANN does not match the version of MindSpore,
|
|
@@ -121,8 +168,8 @@ class _ExperimentalConfig:
|
|
|
121
168
|
... net = Net()
|
|
122
169
|
... # Note that the Profiler should be initialized before model.train
|
|
123
170
|
... with mindspore.profiler.profile(activities=[ProfilerActivity.CPU, ProfilerActivity.NPU],
|
|
124
|
-
... schedule=mindspore.profiler.schedule(wait=
|
|
125
|
-
... repeat=1, skip_first=
|
|
171
|
+
... schedule=mindspore.profiler.schedule(wait=0, warmup=0, active=1,
|
|
172
|
+
... repeat=1, skip_first=0),
|
|
126
173
|
... on_trace_ready=mindspore.profiler.tensorboard_trace_handler("./data"),
|
|
127
174
|
... profile_memory=False,
|
|
128
175
|
... experimental_config=experimental_config) as prof:
|
|
@@ -139,38 +186,76 @@ class _ExperimentalConfig:
|
|
|
139
186
|
l2_cache: bool = False,
|
|
140
187
|
mstx: bool = False,
|
|
141
188
|
data_simplification: bool = True,
|
|
142
|
-
export_type: list = None
|
|
189
|
+
export_type: list = None,
|
|
190
|
+
mstx_domain_include: list = None,
|
|
191
|
+
mstx_domain_exclude: list = None,
|
|
192
|
+
sys_io: bool = False,
|
|
193
|
+
sys_interconnection: bool = False,
|
|
194
|
+
host_sys: list = None
|
|
195
|
+
):
|
|
143
196
|
self._profiler_level = profiler_level
|
|
144
197
|
self._aic_metrics = aic_metrics
|
|
145
198
|
self._l2_cache = l2_cache
|
|
146
199
|
self._mstx = mstx
|
|
147
200
|
self._data_simplification = data_simplification
|
|
148
201
|
self._export_type = export_type
|
|
202
|
+
self._mstx_domain_include = mstx_domain_include
|
|
203
|
+
self._mstx_domain_exclude = mstx_domain_exclude
|
|
204
|
+
self._sys_io = sys_io
|
|
205
|
+
self._sys_interconnection = sys_interconnection
|
|
206
|
+
self._host_sys = host_sys
|
|
149
207
|
|
|
150
208
|
@property
|
|
151
209
|
def profiler_level(self) -> ProfilerLevel:
|
|
210
|
+
"""Get profiler_level."""
|
|
152
211
|
return self._profiler_level
|
|
153
212
|
|
|
154
213
|
@property
|
|
155
214
|
def aic_metrics(self) -> AicoreMetrics:
|
|
215
|
+
"""Get aic_metrics."""
|
|
156
216
|
return self._aic_metrics
|
|
157
217
|
|
|
158
218
|
@property
|
|
159
219
|
def l2_cache(self) -> bool:
|
|
220
|
+
"""Get l2_cache."""
|
|
160
221
|
return self._l2_cache
|
|
161
222
|
|
|
162
223
|
@property
|
|
163
224
|
def mstx(self) -> bool:
|
|
225
|
+
"""Get mstx."""
|
|
164
226
|
return self._mstx
|
|
165
227
|
|
|
166
228
|
@property
|
|
167
229
|
def data_simplification(self) -> bool:
|
|
230
|
+
"""Get data_simplification."""
|
|
168
231
|
return self._data_simplification
|
|
169
232
|
|
|
170
233
|
@property
|
|
171
234
|
def export_type(self) -> list:
|
|
235
|
+
"""Get export_type."""
|
|
172
236
|
return self._export_type
|
|
173
237
|
|
|
238
|
+
@property
|
|
239
|
+
def mstx_domain_include(self) -> list:
|
|
240
|
+
return self._mstx_domain_include
|
|
241
|
+
|
|
242
|
+
@property
|
|
243
|
+
def mstx_domain_exclude(self) -> list:
|
|
244
|
+
return self._mstx_domain_exclude
|
|
245
|
+
|
|
246
|
+
@property
|
|
247
|
+
def sys_io(self) -> bool:
|
|
248
|
+
return self._sys_io
|
|
249
|
+
|
|
250
|
+
@property
|
|
251
|
+
def sys_interconnection(self) -> bool:
|
|
252
|
+
return self._sys_interconnection
|
|
253
|
+
|
|
254
|
+
@property
|
|
255
|
+
def host_sys(self) -> list:
|
|
256
|
+
"""Get host_sys."""
|
|
257
|
+
return self._host_sys
|
|
258
|
+
|
|
174
259
|
# Setters
|
|
175
260
|
@profiler_level.setter
|
|
176
261
|
def profiler_level(self, value: ProfilerLevel):
|
|
@@ -195,3 +280,23 @@ class _ExperimentalConfig:
|
|
|
195
280
|
@export_type.setter
|
|
196
281
|
def export_type(self, value: list):
|
|
197
282
|
self._export_type = value
|
|
283
|
+
|
|
284
|
+
@mstx_domain_include.setter
|
|
285
|
+
def mstx_domain_include(self, value: list):
|
|
286
|
+
self._mstx_domain_include = value
|
|
287
|
+
|
|
288
|
+
@mstx_domain_exclude.setter
|
|
289
|
+
def mstx_domain_exclude(self, value: list):
|
|
290
|
+
self._mstx_domain_exclude = value
|
|
291
|
+
|
|
292
|
+
@sys_io.setter
|
|
293
|
+
def sys_io(self, value: bool):
|
|
294
|
+
self._sys_io = value
|
|
295
|
+
|
|
296
|
+
@sys_interconnection.setter
|
|
297
|
+
def sys_interconnection(self, value: bool):
|
|
298
|
+
self._sys_interconnection = value
|
|
299
|
+
|
|
300
|
+
@host_sys.setter
|
|
301
|
+
def host_sys(self, value: list):
|
|
302
|
+
self._host_sys = value
|
mindspore/profiler/mstx.py
CHANGED
|
@@ -39,7 +39,7 @@ class Mstx:
|
|
|
39
39
|
)
|
|
40
40
|
|
|
41
41
|
@staticmethod
|
|
42
|
-
def mark(message: str, stream: mindspore.runtime.Stream = None) -> None:
|
|
42
|
+
def mark(message: str, stream: mindspore.runtime.Stream = None, domain: str = "default") -> None:
|
|
43
43
|
"""Add a marker point in profiling.
|
|
44
44
|
|
|
45
45
|
Args:
|
|
@@ -47,6 +47,7 @@ class Mstx:
|
|
|
47
47
|
stream (:class:`~.runtime.Stream`, optional): NPU stream for async execution, expected type:
|
|
48
48
|
mindspore.runtime.Stream. Default: ``None``, which means only marking on host side without
|
|
49
49
|
marking on device stream.
|
|
50
|
+
domain (str, optional): Domain name. Default: ``default``.
|
|
50
51
|
|
|
51
52
|
Examples:
|
|
52
53
|
>>> import numpy as np
|
|
@@ -77,6 +78,7 @@ class Mstx:
|
|
|
77
78
|
... model = ms.train.Model(net, loss, optimizer)
|
|
78
79
|
... # Add marker before training
|
|
79
80
|
... mstx.mark("train start", stream)
|
|
81
|
+
... mstx.mark("train start", stream, "domain_name")
|
|
80
82
|
... model.train(1, data)
|
|
81
83
|
... # Add marker after training
|
|
82
84
|
... mstx.mark("train end", stream)
|
|
@@ -112,19 +114,24 @@ class Mstx:
|
|
|
112
114
|
if not message or not isinstance(message, str):
|
|
113
115
|
logging.warning("Invalid message for mstx.mark func. Please input valid message string.")
|
|
114
116
|
return
|
|
117
|
+
if not isinstance(domain, str) or domain == "":
|
|
118
|
+
logging.warning(
|
|
119
|
+
"Invalid domain name for mstx.mark func. Please input str and can not be empty."
|
|
120
|
+
)
|
|
121
|
+
return
|
|
115
122
|
if stream:
|
|
116
123
|
if isinstance(stream, Stream):
|
|
117
124
|
device_stream = stream.device_stream()
|
|
118
|
-
Mstx.NPU_PROFILER.mstx_mark(message, device_stream)
|
|
125
|
+
Mstx.NPU_PROFILER.mstx_mark(message, device_stream, domain)
|
|
119
126
|
else:
|
|
120
127
|
logging.warning(
|
|
121
128
|
f"Invalid stream for mstx.mark func. Expected mindspore.runtime.Stream but got {type(stream)}.",
|
|
122
129
|
)
|
|
123
130
|
else:
|
|
124
|
-
Mstx.NPU_PROFILER.mstx_mark(message)
|
|
131
|
+
Mstx.NPU_PROFILER.mstx_mark(message, None, domain)
|
|
125
132
|
|
|
126
133
|
@staticmethod
|
|
127
|
-
def range_start(message: str, stream: mindspore.runtime.Stream = None) -> int:
|
|
134
|
+
def range_start(message: str, stream: mindspore.runtime.Stream = None, domain: str = "default") -> int:
|
|
128
135
|
"""Start a profiling range.
|
|
129
136
|
|
|
130
137
|
Args:
|
|
@@ -132,6 +139,7 @@ class Mstx:
|
|
|
132
139
|
stream (:class:`~.runtime.Stream`, optional): NPU stream for async execution, expected type:
|
|
133
140
|
mindspore.runtime.Stream. Default: ``None``, which means only starting mstx range on
|
|
134
141
|
host side without starting on device stream.
|
|
142
|
+
domain (str, optional): Domain name. Default: ``default``.
|
|
135
143
|
|
|
136
144
|
Returns:
|
|
137
145
|
int, range ID for range_end.
|
|
@@ -165,9 +173,11 @@ class Mstx:
|
|
|
165
173
|
... model = ms.train.Model(net, loss, optimizer)
|
|
166
174
|
... # Start profiling range
|
|
167
175
|
... range_id = mstx.range_start("training process", stream)
|
|
176
|
+
... range_id2 = mstx.range_start("training process", stream, "domain_name")
|
|
168
177
|
... model.train(1, data)
|
|
169
178
|
... # End profiling range
|
|
170
179
|
... mstx.range_end(range_id)
|
|
180
|
+
... mstx.range_end(range_id2, "domain_name")
|
|
171
181
|
>>>
|
|
172
182
|
>>> if __name__ == '__main__':
|
|
173
183
|
... # Note: mstx only supports Ascend device and cannot be used in mindspore.nn.Cell.construct
|
|
@@ -201,10 +211,15 @@ class Mstx:
|
|
|
201
211
|
logging.warning("Invalid message for mstx.range_start func. Please input valid message string.")
|
|
202
212
|
return 0
|
|
203
213
|
# pylint: disable=no-else-return
|
|
214
|
+
if not isinstance(domain, str) or domain == "":
|
|
215
|
+
logging.warning(
|
|
216
|
+
"Invalid domain name for mstx.range_start func. Please input str and can not be empty."
|
|
217
|
+
)
|
|
218
|
+
return 0
|
|
204
219
|
if stream:
|
|
205
220
|
if isinstance(stream, Stream):
|
|
206
221
|
device_stream = stream.device_stream()
|
|
207
|
-
return Mstx.NPU_PROFILER.mstx_range_start(message, device_stream)
|
|
222
|
+
return Mstx.NPU_PROFILER.mstx_range_start(message, device_stream, domain)
|
|
208
223
|
else:
|
|
209
224
|
logging.warning(
|
|
210
225
|
f"Invalid stream for mstx.range_start func. "
|
|
@@ -212,20 +227,21 @@ class Mstx:
|
|
|
212
227
|
)
|
|
213
228
|
return 0
|
|
214
229
|
else:
|
|
215
|
-
return Mstx.NPU_PROFILER.mstx_range_start(message)
|
|
230
|
+
return Mstx.NPU_PROFILER.mstx_range_start(message, None, domain)
|
|
216
231
|
|
|
217
232
|
@staticmethod
|
|
218
|
-
def range_end(range_id: int) -> None:
|
|
233
|
+
def range_end(range_id: int, domain: str = "default") -> None:
|
|
219
234
|
"""End a profiling range.
|
|
220
235
|
|
|
221
236
|
Args:
|
|
222
237
|
range_id (int): Range ID from range_start.
|
|
238
|
+
domain (str, optional): Domain name. Default: ``default``.
|
|
223
239
|
|
|
224
240
|
Examples:
|
|
225
241
|
>>> # Please refer to the example in range_start
|
|
226
|
-
>>> # range_id = mstx.range_start("training process", stream)
|
|
242
|
+
>>> # range_id = mstx.range_start("training process", stream, "domain_name")
|
|
227
243
|
>>> # model.train(1, data)
|
|
228
|
-
>>> # mstx.range_end(range_id)
|
|
244
|
+
>>> # mstx.range_end(range_id, "domain_name")
|
|
229
245
|
"""
|
|
230
246
|
if not Mstx.enable or range_id == 0:
|
|
231
247
|
return
|
|
@@ -234,9 +250,14 @@ class Mstx:
|
|
|
234
250
|
if not Mstx.NPU_PROFILER:
|
|
235
251
|
logging.warning("Invalid npu profiler for mstx, please check.")
|
|
236
252
|
return
|
|
237
|
-
if not isinstance(range_id, int):
|
|
253
|
+
if not isinstance(range_id, int) or range_id < 0:
|
|
254
|
+
logging.warning(
|
|
255
|
+
"Invalid range_id for mstx.range_end func. Please input return value from mstx.range_start."
|
|
256
|
+
)
|
|
257
|
+
return
|
|
258
|
+
if not isinstance(domain, str) or domain == "":
|
|
238
259
|
logging.warning(
|
|
239
|
-
"Invalid
|
|
260
|
+
"Invalid domain name for mstx.range_end func. Please input str and can not be empty."
|
|
240
261
|
)
|
|
241
262
|
return
|
|
242
|
-
Mstx.NPU_PROFILER.mstx_range_end(range_id)
|
|
263
|
+
Mstx.NPU_PROFILER.mstx_range_end(range_id, domain)
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
# ============================================================================
|
|
15
15
|
"""Platform profiler"""
|
|
16
|
+
__all__ = ["CpuProfiler", "GpuProfiler", "NpuProfiler"]
|
|
17
|
+
|
|
16
18
|
from .cpu_profiler import CpuProfiler
|
|
17
19
|
from .gpu_profiler import GpuProfiler
|
|
18
20
|
from .npu_profiler import NpuProfiler
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__all__ = ["CpuProfiler", "GpuProfiler", "NpuProfiler"]
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
import mindspore._c_expression as c_expression
|
|
17
17
|
|
|
18
18
|
from mindspore.profiler.common.registry import PROFILERS
|
|
19
|
-
from mindspore.profiler.common.constant import DeviceTarget, ProfilerActivity
|
|
19
|
+
from mindspore.profiler.common.constant import DeviceTarget, ProfilerActivity, AnalysisMode
|
|
20
20
|
from mindspore.profiler.common.util import print_msg_with_pid
|
|
21
21
|
from mindspore.profiler.common.profiler_context import ProfilerContext
|
|
22
22
|
from mindspore.profiler.common.profiler_path_manager import ProfilerPathManager
|
|
23
|
+
from mindspore.profiler.common.process_pool import MultiProcessPool
|
|
23
24
|
from mindspore.profiler.platform.base_profiler import BaseProfiler
|
|
24
25
|
from mindspore.profiler.analysis.time_converter import TimeConverter
|
|
25
26
|
from mindspore.profiler.analysis.task_manager import TaskManager
|
|
@@ -68,7 +69,7 @@ class CpuProfiler(BaseProfiler):
|
|
|
68
69
|
if ProfilerContext().device_target_set != {DeviceTarget.CPU.value}:
|
|
69
70
|
return
|
|
70
71
|
self._logger.info("CpuProfiler analyse.")
|
|
71
|
-
CPUProfilerAnalysis.online_analyse()
|
|
72
|
+
CPUProfilerAnalysis.online_analyse(**kwargs)
|
|
72
73
|
|
|
73
74
|
def finalize(self) -> None:
|
|
74
75
|
"""Finalize profiling data."""
|
|
@@ -81,12 +82,17 @@ class CPUProfilerAnalysis:
|
|
|
81
82
|
"""
|
|
82
83
|
|
|
83
84
|
@classmethod
|
|
84
|
-
def online_analyse(cls):
|
|
85
|
+
def online_analyse(cls, async_mode: bool = False):
|
|
85
86
|
"""
|
|
86
87
|
Online analysis for CPU
|
|
87
88
|
"""
|
|
88
89
|
cls._pre_analyse_online()
|
|
89
|
-
|
|
90
|
+
if async_mode:
|
|
91
|
+
ProfilerContext().mode = AnalysisMode.ASYNC_MODE.value
|
|
92
|
+
MultiProcessPool().add_async_job(cls._run_tasks, **ProfilerContext().to_dict())
|
|
93
|
+
else:
|
|
94
|
+
ProfilerContext().mode = AnalysisMode.SYNC_MODE.value
|
|
95
|
+
cls._run_tasks(**ProfilerContext().to_dict())
|
|
90
96
|
|
|
91
97
|
@classmethod
|
|
92
98
|
def _pre_analyse_online(cls):
|
|
@@ -18,7 +18,6 @@ import glob
|
|
|
18
18
|
import json
|
|
19
19
|
from typing import List, Optional
|
|
20
20
|
|
|
21
|
-
from mindspore import context
|
|
22
21
|
from mindspore import log as logger
|
|
23
22
|
import mindspore._c_dataengine as cde
|
|
24
23
|
import mindspore._c_expression as c_expression
|
|
@@ -55,6 +54,7 @@ from mindspore.profiler.analysis.viewer.ms_minddata_viewer import (
|
|
|
55
54
|
MindDataPipelineRawViewer,
|
|
56
55
|
MindDataPiplineSummaryViewer,
|
|
57
56
|
)
|
|
57
|
+
from mindspore.profiler.analysis.viewer.ms_operator_details_viewer import MsOperatorDetailsViewer
|
|
58
58
|
from mindspore.profiler.common.util import print_msg_with_pid
|
|
59
59
|
from mindspore.profiler.common.log import ProfilerLogger
|
|
60
60
|
from mindspore.profiler.mstx import Mstx
|
|
@@ -86,11 +86,6 @@ class NpuProfiler(BaseProfiler):
|
|
|
86
86
|
|
|
87
87
|
# record original profiler params
|
|
88
88
|
self._prof_info.profiler_parameters = self._prof_ctx.original_params
|
|
89
|
-
self._prof_info.ms_profiler_info = {
|
|
90
|
-
"context_mode": context.get_context("mode"),
|
|
91
|
-
"rank_id": self._prof_ctx.rank_id,
|
|
92
|
-
"device_id": self._prof_ctx.device_id,
|
|
93
|
-
}
|
|
94
89
|
|
|
95
90
|
# initialize minddata profiler
|
|
96
91
|
if self._prof_ctx.data_process:
|
|
@@ -136,13 +131,27 @@ class NpuProfiler(BaseProfiler):
|
|
|
136
131
|
self._md_profiler.stop()
|
|
137
132
|
self._md_profiler.save(self._prof_ctx.framework_path)
|
|
138
133
|
|
|
134
|
+
if ProfilerActivity.NPU in self._prof_ctx.activities:
|
|
135
|
+
prof_dir = glob.glob(os.path.join(self._prof_ctx.ascend_ms_dir, "PROF_*"))
|
|
136
|
+
if not prof_dir:
|
|
137
|
+
logger.error(f"No PROF_* directory found in {self._prof_ctx.ascend_ms_dir}")
|
|
138
|
+
return
|
|
139
|
+
|
|
140
|
+
self._prof_ctx.msprof_profile_path = prof_dir[0]
|
|
141
|
+
self._prof_ctx.device_id = self._prof_ctx.msprof_profile_device_path.split("_")[-1]
|
|
142
|
+
|
|
143
|
+
self._prof_info.ms_profiler_info = {
|
|
144
|
+
"rank_id": self._prof_ctx.rank_id,
|
|
145
|
+
"device_id": self._prof_ctx.device_id,
|
|
146
|
+
}
|
|
147
|
+
|
|
139
148
|
self._prof_info.save(self._prof_ctx.ascend_ms_dir, self._prof_ctx.rank_id)
|
|
140
149
|
|
|
141
150
|
def analyse(self, **kwargs) -> None:
|
|
142
151
|
"""Analyse the profiling data."""
|
|
143
152
|
self._logger.info("NpuProfiler analyse.")
|
|
144
153
|
|
|
145
|
-
NPUProfilerAnalysis.online_analyse()
|
|
154
|
+
NPUProfilerAnalysis.online_analyse(async_mode=kwargs.get('async_mode'))
|
|
146
155
|
|
|
147
156
|
def finalize(self) -> None:
|
|
148
157
|
"""Finalize profiling data."""
|
|
@@ -189,12 +198,6 @@ class NPUProfilerAnalysis:
|
|
|
189
198
|
"""
|
|
190
199
|
prof_ctx = ProfilerContext()
|
|
191
200
|
if ProfilerActivity.NPU in prof_ctx.activities:
|
|
192
|
-
prof_dir = glob.glob(os.path.join(prof_ctx.ascend_ms_dir, "PROF_*"))
|
|
193
|
-
if not prof_dir:
|
|
194
|
-
logger.error(f"No PROF_* directory found in {prof_ctx.ascend_ms_dir}")
|
|
195
|
-
return
|
|
196
|
-
|
|
197
|
-
prof_ctx.msprof_profile_path = prof_dir[0]
|
|
198
201
|
ProfilerPathManager().clean_analysis_cache()
|
|
199
202
|
ProfilerPathManager().create_output_path()
|
|
200
203
|
ProfilerInfo().load_time_parameters(
|
|
@@ -224,7 +227,6 @@ class NPUProfilerAnalysis:
|
|
|
224
227
|
prof_ctx.set_params()
|
|
225
228
|
prof_ctx.load_offline_profiler_params(prof_info.profiler_parameters)
|
|
226
229
|
prof_ctx.jit_level = prof_info.jit_level
|
|
227
|
-
prof_ctx.context_mode = prof_info.context_mode
|
|
228
230
|
|
|
229
231
|
if ProfilerActivity.NPU in prof_ctx.activities:
|
|
230
232
|
prof_dir = glob.glob(os.path.join(ascend_ms_dir, "PROF_*"))
|
|
@@ -274,18 +276,20 @@ class NPUProfilerAnalysis:
|
|
|
274
276
|
task_mgr = TaskManager()
|
|
275
277
|
activities = kwargs.get("activities", [])
|
|
276
278
|
export_type = kwargs.get("export_type", [])
|
|
279
|
+
record_shapes = kwargs.get("record_shapes", False)
|
|
277
280
|
enable_data_process = kwargs.get("data_process", False)
|
|
278
281
|
|
|
279
282
|
# CANN flow parser
|
|
280
283
|
cann_flow_parsers = []
|
|
281
284
|
|
|
282
285
|
if export_type == [ExportType.Db.value]:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
if ProfilerActivity.NPU.value in activities:
|
|
287
|
+
cann_flow_parsers.append(
|
|
288
|
+
AscendMsprofParser(**kwargs)
|
|
289
|
+
)
|
|
290
|
+
task_mgr.create_flow(
|
|
291
|
+
*cann_flow_parsers, flow_name="cann_flow", show_process=True
|
|
292
|
+
)
|
|
289
293
|
return task_mgr
|
|
290
294
|
|
|
291
295
|
if ProfilerActivity.NPU.value in activities:
|
|
@@ -301,6 +305,12 @@ class NPUProfilerAnalysis:
|
|
|
301
305
|
MsDatasetViewer(**kwargs).save
|
|
302
306
|
)
|
|
303
307
|
)
|
|
308
|
+
if record_shapes:
|
|
309
|
+
cann_flow_parsers.append(
|
|
310
|
+
FrameworkCannRelationParser(**kwargs).register_post_hook(
|
|
311
|
+
MsOperatorDetailsViewer(**kwargs).save
|
|
312
|
+
)
|
|
313
|
+
)
|
|
304
314
|
|
|
305
315
|
if ProfilerActivity.NPU.value in activities:
|
|
306
316
|
cann_flow_parsers.append(
|