mindspore 2.3.0__cp39-none-any.whl → 2.3.0rc2__cp39-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mindspore might be problematic. Click here for more details.
- mindspore/.commit_id +1 -1
- mindspore/Third_Party_Open_Source_Software_Notice +0 -1512
- mindspore/__init__.py +1 -2
- mindspore/_c_dataengine.cpython-39-aarch64-linux-gnu.so +0 -0
- mindspore/_c_expression.cpython-39-aarch64-linux-gnu.so +0 -0
- mindspore/_c_mindrecord.cpython-39-aarch64-linux-gnu.so +0 -0
- mindspore/_checkparam.py +25 -5
- mindspore/_extends/graph_kernel/model/graph_parallel.py +1 -1
- mindspore/_extends/parse/__init__.py +2 -2
- mindspore/_extends/parse/compile_config.py +0 -29
- mindspore/_extends/parse/namespace.py +2 -2
- mindspore/_extends/parse/parser.py +5 -21
- mindspore/_extends/parse/resources.py +7 -5
- mindspore/_extends/parse/standard_method.py +59 -40
- mindspore/_mindspore_offline_debug.cpython-39-aarch64-linux-gnu.so +0 -0
- mindspore/amp.py +5 -26
- mindspore/bin/cache_admin +0 -0
- mindspore/bin/cache_server +0 -0
- mindspore/boost/adasum.py +1 -1
- mindspore/boost/base.py +1 -1
- mindspore/boost/boost_cell_wrapper.py +1 -1
- mindspore/boost/grad_freeze.py +2 -2
- mindspore/boost/less_batch_normalization.py +6 -9
- mindspore/common/__init__.py +1 -8
- mindspore/common/_register_for_tensor.py +9 -8
- mindspore/common/api.py +65 -275
- mindspore/common/dtype.py +4 -8
- mindspore/common/dump.py +5 -2
- mindspore/common/jit_config.py +1 -1
- mindspore/common/lazy_inline.py +2 -14
- mindspore/common/parameter.py +15 -14
- mindspore/common/recompute.py +5 -20
- mindspore/common/sparse_tensor.py +6 -21
- mindspore/common/tensor.py +52 -100
- mindspore/communication/__init__.py +11 -6
- mindspore/communication/management.py +94 -92
- mindspore/context.py +18 -180
- mindspore/dataset/engine/datasets.py +46 -69
- mindspore/dataset/engine/datasets_user_defined.py +53 -72
- mindspore/dataset/engine/datasets_vision.py +2 -2
- mindspore/dataset/engine/queue.py +38 -56
- mindspore/dataset/engine/validators.py +5 -11
- mindspore/dataset/vision/__init__.py +5 -5
- mindspore/dataset/vision/c_transforms.py +5 -5
- mindspore/dataset/vision/py_transforms_util.py +1 -1
- mindspore/dataset/vision/transforms.py +46 -591
- mindspore/dataset/vision/utils.py +1 -121
- mindspore/dataset/vision/validators.py +3 -9
- mindspore/hal/__init__.py +1 -7
- mindspore/hal/device.py +1 -1
- mindspore/include/api/model.h +0 -3
- mindspore/include/dataset/vision.h +2 -54
- mindspore/include/mindapi/base/types.h +0 -1
- mindspore/lib/libdnnl.so.2 +0 -0
- mindspore/lib/libmindspore.so +0 -0
- mindspore/lib/libmindspore_backend.so +0 -0
- mindspore/lib/libmindspore_common.so +0 -0
- mindspore/lib/libmindspore_core.so +0 -0
- mindspore/lib/libmindspore_glog.so.0 +0 -0
- mindspore/lib/libmindspore_gpr.so.15 +0 -0
- mindspore/lib/libmindspore_grpc++.so.1 +0 -0
- mindspore/lib/libmindspore_grpc.so.15 +0 -0
- mindspore/lib/libmindspore_shared_lib.so +0 -0
- mindspore/lib/libmpi_adapter.so +0 -0
- mindspore/lib/libmpi_collective.so +0 -0
- mindspore/lib/libnnacl.so +0 -0
- mindspore/lib/libopencv_core.so.4.5 +0 -0
- mindspore/lib/libps_cache.so +0 -0
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/config/ascend310p/aic-ascend310p-ops-info.json +0 -35
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/custom_aicore_ops_impl/kv_cache_mgr.py +0 -2
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/vector_core/tbe/custom_aicore_ops_impl/kv_cache_mgr.py +0 -2
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_cpu_kernels.so +0 -0
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/config/cust_aicpu_kernel.json +0 -72
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_proto/libcust_op_proto.so +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/{aclnn_all_finite.h → aclnn_add_custom.h} +11 -9
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/aclnn_decoder_kv_cache.h +1 -1
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/aclnn_prompt_kv_cache.h +1 -1
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/lib/libcust_opapi.so +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend310p/aic-ascend310p-ops-info.json +12 -184
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend910/aic-ascend910-ops-info.json +15 -7
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend910b/aic-ascend910b-ops-info.json +15 -7
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/add_custom.cpp +81 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/add_custom.py +134 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/decoder_kv_cache.py +31 -77
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/prompt_kv_cache.py +31 -77
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/op_tiling/lib/linux/aarch64/libcust_opmaster_rt2.0.so +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/op_tiling/liboptiling.so +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_proto/inc/op_proto.h +5 -4
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_proto/lib/linux/aarch64/libcust_opsproto_rt2.0.so +0 -0
- mindspore/lib/plugin/ascend/libascend_collective.so +0 -0
- mindspore/lib/plugin/ascend/libdvpp_utils.so +0 -0
- mindspore/lib/plugin/ascend/libhccl_plugin.so +0 -0
- mindspore/lib/plugin/ascend/liblowlatency_collective.so +0 -0
- mindspore/lib/plugin/ascend/libmindspore_cpu_kernels.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/DeviceBin +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/PkgInspect +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/bin/op_man +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/device/ascend910b/bin/ascend910b.bin +286 -275
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_cann_host.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/host/libasdops_host.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/asdops/lib/libasdops_static.a +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/add/add_impl.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/apply_rotary_pos_emb_impl.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/asdop/asd_op_impl.h +0 -3
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/backend_param.h +0 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/cast/cast_tiling.h +45 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/compare/compare_impl.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/flash_attention_score/flash_attention_score_impl.h +4 -8
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/flash_attention_score/flash_attention_score_tiling.h +4 -11
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/flash_attention_score/kernel/flash_attention_score_mix_hwsync.h +0 -18
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/internal_kernel.h +0 -6
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/internal_rtbackend.h +75 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul/kernel/matmul.h +5 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul/matmul_impl.h +3 -18
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/pp_matmul_common_tiling.h +5 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/pp_matmul_info.h +2 -2
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_common/tiling_data.h +3 -36
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_stridedslice/kernel/matmul_stridedslice_fusion.h +2 -2
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/matmul_stridedslice/matmul_stridedslice_fusion_impl.h +4 -22
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/op_param.h +2 -16
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/kernel/paged_attention_mix_hwsync.h +3 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/paged_attention_impl.h +4 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/paged_attention/paged_attention_tiling.h +4 -9
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/attention_param.h +2 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/matmul_ext_param.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/matmul_qkv_param.h +4 -10
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/sub_param.h +12 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/rms_norm/rms_norm_impl.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/sub/sub_impl.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/tune_repo/matmul_table.h +1 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/backend.h +2 -10
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/elewise_utils.h +1 -5
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log.h +0 -1
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_tiling.h +0 -17
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/math.h +7 -2
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libAdd_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libSub_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_layernorm_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libadd_rms_norm_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libapply_rotary_pos_emb_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libcast_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libgelu_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libmatmul_stridedslice_fusion_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libms_kernels_internal.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libnot_equal_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/libreshape_and_cache_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/lib/librms_norm_impl.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bnsd_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bnsd_tri_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bsh_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_bf16_bsh_tri_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bnsd_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bnsd_tri_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bsh_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/flash_attention_score_fp16_bsh_tri_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_bf16_bnsd_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_bf16_bsh_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_fp16_bnsd_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/BSAttention/paged_attention_fp16_bsh_full_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblcal.so +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/lccl/lib/liblccl_wrapper.so +0 -0
- mindspore/lib/plugin/libmindspore_ascend.so.2 +0 -0
- mindspore/mindrecord/filewriter.py +2 -2
- mindspore/mint/__init__.py +40 -720
- mindspore/mint/nn/__init__.py +7 -89
- mindspore/mint/nn/functional.py +16 -165
- mindspore/mint/optim/adamw.py +16 -15
- mindspore/nn/__init__.py +2 -0
- mindspore/nn/cell.py +98 -97
- mindspore/nn/extend/basic.py +2 -2
- mindspore/nn/extend/embedding.py +1 -1
- mindspore/nn/extend/layer/normalization.py +5 -7
- mindspore/nn/generator.py +297 -0
- mindspore/nn/layer/activation.py +3 -4
- mindspore/nn/layer/basic.py +16 -79
- mindspore/nn/layer/conv.py +8 -17
- mindspore/nn/layer/embedding.py +4 -1
- mindspore/nn/layer/math.py +1 -1
- mindspore/nn/layer/normalization.py +1 -1
- mindspore/nn/layer/pooling.py +0 -5
- mindspore/nn/layer/rnn_cells.py +2 -2
- mindspore/nn/loss/loss.py +19 -19
- mindspore/nn/optim/adasum.py +1 -1
- mindspore/nn/optim/sgd.py +2 -3
- mindspore/nn/probability/distribution/exponential.py +1 -1
- mindspore/nn/probability/distribution/geometric.py +1 -1
- mindspore/nn/probability/distribution/logistic.py +1 -1
- mindspore/nn/wrap/cell_wrapper.py +1 -25
- mindspore/nn/wrap/loss_scale.py +1 -24
- mindspore/numpy/array_ops.py +1 -5
- mindspore/numpy/dtypes.py +3 -3
- mindspore/numpy/math_ops.py +8 -8
- mindspore/ops/__init__.py +1 -1
- mindspore/ops/_grad_experimental/grad_comm_ops.py +16 -75
- mindspore/ops/_vmap/vmap_array_ops.py +0 -27
- mindspore/ops/_vmap/vmap_math_ops.py +1 -29
- mindspore/ops/_vmap/vmap_nn_ops.py +18 -19
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +8 -34
- mindspore/ops/auto_generate/gen_arg_dtype_cast.py +9 -2
- mindspore/ops/auto_generate/gen_arg_handler.py +0 -26
- mindspore/ops/auto_generate/gen_extend_func.py +27 -603
- mindspore/ops/auto_generate/gen_ops_def.py +203 -993
- mindspore/ops/auto_generate/gen_ops_prim.py +402 -1946
- mindspore/ops/auto_generate/pyboost_inner_prim.py +20 -90
- mindspore/ops/composite/base.py +6 -3
- mindspore/ops/composite/math_ops.py +1 -1
- mindspore/ops/composite/multitype_ops/_compile_utils.py +17 -24
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -1
- mindspore/ops/extend/__init__.py +3 -2
- mindspore/ops/extend/array_func.py +51 -10
- mindspore/ops/extend/nn_func.py +78 -2
- mindspore/ops/function/__init__.py +13 -8
- mindspore/ops/function/array_func.py +179 -455
- mindspore/ops/function/clip_func.py +1 -1
- mindspore/ops/function/grad/grad_func.py +3 -3
- mindspore/ops/function/math_func.py +103 -117
- mindspore/ops/function/nn_func.py +163 -275
- mindspore/ops/function/other_func.py +2 -2
- mindspore/ops/function/random_func.py +69 -202
- mindspore/ops/function/sparse_func.py +4 -4
- mindspore/ops/functional.py +327 -332
- mindspore/ops/operations/__init__.py +3 -13
- mindspore/ops/operations/_grad_ops.py +27 -3
- mindspore/ops/operations/_inner_ops.py +356 -53
- mindspore/ops/operations/_rl_inner_ops.py +2 -2
- mindspore/ops/operations/_tensor_array.py +8 -8
- mindspore/ops/operations/array_ops.py +65 -82
- mindspore/ops/operations/comm_ops.py +93 -784
- mindspore/ops/operations/custom_ops.py +28 -51
- mindspore/ops/operations/debug_ops.py +4 -4
- mindspore/ops/operations/inner_ops.py +2 -2
- mindspore/ops/operations/manually_defined/ops_def.py +4 -304
- mindspore/ops/operations/math_ops.py +50 -3
- mindspore/ops/operations/nn_ops.py +247 -14
- mindspore/ops/operations/other_ops.py +3 -3
- mindspore/ops/operations/random_ops.py +1 -1
- mindspore/ops/operations/sparse_ops.py +1 -1
- mindspore/ops/primitive.py +8 -9
- mindspore/ops/silent_check.py +5 -5
- mindspore/ops_generate/arg_dtype_cast.py +9 -2
- mindspore/ops_generate/arg_handler.py +0 -26
- mindspore/ops_generate/gen_aclnn_implement.py +4 -1
- mindspore/ops_generate/gen_ops.py +4 -26
- mindspore/ops_generate/gen_pyboost_func.py +12 -41
- mindspore/ops_generate/gen_utils.py +0 -21
- mindspore/ops_generate/pyboost_utils.py +2 -7
- mindspore/ops_generate/template.py +0 -1
- mindspore/parallel/_auto_parallel_context.py +1 -21
- mindspore/parallel/_tensor.py +5 -0
- mindspore/parallel/_transformer/transformer.py +1 -1
- mindspore/parallel/_utils.py +1 -15
- mindspore/parallel/algo_parameter_config.py +3 -1
- mindspore/parallel/checkpoint_transform.py +9 -12
- mindspore/parallel/cluster/process_entity/_api.py +29 -28
- mindspore/parallel/cluster/process_entity/_utils.py +3 -13
- mindspore/parallel/cluster/run.py +16 -13
- mindspore/parallel/parameter_broadcast.py +2 -2
- mindspore/parallel/shard.py +17 -31
- mindspore/profiler/__init__.py +2 -3
- mindspore/profiler/common/util.py +2 -107
- mindspore/profiler/envprofiling.py +1 -1
- mindspore/profiler/parser/ascend_analysis/constant.py +21 -8
- mindspore/profiler/parser/ascend_analysis/file_manager.py +0 -82
- mindspore/profiler/parser/ascend_analysis/function_event.py +28 -43
- mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +27 -49
- mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +10 -15
- mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +20 -25
- mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +5 -5
- mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +1 -10
- mindspore/profiler/parser/ascend_hccl_generator.py +1 -4
- mindspore/profiler/parser/ascend_msprof_exporter.py +22 -43
- mindspore/profiler/parser/ascend_timeline_generator.py +5 -7
- mindspore/profiler/parser/minddata_parser.py +3 -72
- mindspore/profiler/profiling.py +59 -176
- mindspore/rewrite/api/node.py +1 -1
- mindspore/rewrite/common/namespace.py +5 -5
- mindspore/rewrite/parsers/assign_parser.py +0 -2
- mindspore/rewrite/parsers/class_def_parser.py +4 -8
- mindspore/run_check/_check_version.py +1 -1
- mindspore/scipy/fft.py +3 -1
- mindspore/scipy/linalg.py +3 -2
- mindspore/scipy/ops.py +3 -5
- mindspore/scipy/optimize/__init__.py +2 -2
- mindspore/train/__init__.py +4 -4
- mindspore/train/anf_ir_pb2.py +2 -8
- mindspore/train/callback/__init__.py +2 -5
- mindspore/train/callback/_backup_and_restore.py +2 -2
- mindspore/train/callback/_checkpoint.py +16 -104
- mindspore/train/callback/_landscape.py +1 -1
- mindspore/train/callback/_time_monitor.py +1 -1
- mindspore/train/data_sink.py +4 -5
- mindspore/train/dataset_helper.py +20 -45
- mindspore/train/model.py +38 -266
- mindspore/train/serialization.py +105 -256
- mindspore/train/summary/_summary_adapter.py +1 -1
- mindspore/version.py +1 -1
- {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/METADATA +2 -2
- {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/RECORD +303 -420
- mindspore/_extends/pijit/__init__.py +0 -23
- mindspore/_extends/pijit/pijit_func_white_list.py +0 -343
- mindspore/common/file_system.py +0 -48
- mindspore/common/generator.py +0 -260
- mindspore/common/no_inline.py +0 -54
- mindspore/common/np_dtype.py +0 -25
- mindspore/communication/comm_func.py +0 -1140
- mindspore/hal/memory.py +0 -326
- mindspore/lib/libavcodec.so.59 +0 -0
- mindspore/lib/libavdevice.so.59 +0 -0
- mindspore/lib/libavfilter.so.8 +0 -0
- mindspore/lib/libavformat.so.59 +0 -0
- mindspore/lib/libavutil.so.57 +0 -0
- mindspore/lib/libmindspore_np_dtype.so +0 -0
- mindspore/lib/libswresample.so.4 +0 -0
- mindspore/lib/libswscale.so.6 +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/all_finite.cpp +0 -326
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/all_finite.py +0 -180
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_576ceaeef5870c451cab59af55ea46ad.json +0 -58
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_576ceaeef5870c451cab59af55ea46ad.o +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_86a73ff6e28d734c96bb8d3054f7dd18.json +0 -58
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_86a73ff6e28d734c96bb8d3054f7dd18.o +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_f55e0ebaad1f2f572e43677336992fa0.json +0 -58
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/ascend910b/all_finite/AllFinite_f55e0ebaad1f2f572e43677336992fa0.o +0 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/config/ascend910b/all_finite.json +0 -109
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/kernel/config/ascend910b/binary_info_config.json +0 -38
- mindspore/lib/plugin/ascend/custom_compiler/OWNERS +0 -12
- mindspore/lib/plugin/ascend/custom_compiler/setup.py +0 -255
- mindspore/lib/plugin/ascend/custom_compiler/start.sh +0 -26
- mindspore/lib/plugin/ascend/custom_compiler/template.json +0 -40
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/acme.h +0 -24
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/acme_op.h +0 -69
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/base_type.h +0 -133
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/op_creator.h +0 -32
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/op_param.h +0 -35
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/include/tiling_info.h +0 -60
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/kernel_register.h +0 -37
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/platform/platform_configs.h +0 -89
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/core/platform/rt_funcs.h +0 -135
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/add_op.h +0 -34
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_backoff_base.h +0 -62
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_elewise_op.h +0 -33
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_ops.h +0 -88
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/asd_pa_op.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/cast_op.h +0 -52
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/ops/host_src/matmul_op.h +0 -95
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/utils/asd_utils.h +0 -84
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/acme/src/utils/comm_utils.h +0 -61
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/apply_rotary_pos_emb/kernel/apply_rotary_pos_emb_fp32.h +0 -224
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/and_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/div_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/elewise_binary_impl.h +0 -48
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/elewise_binary_tiling.h +0 -25
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/and_kernel.h +0 -46
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/div_kernel.h +0 -46
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/elewise_binary_base.h +0 -260
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/elewise_binary_kernel.h +0 -35
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/max_kernel.h +0 -66
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/min_kernel.h +0 -66
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/mul_kernel.h +0 -66
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/kernel/or_kernel.h +0 -46
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/max_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/min_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/mul_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/or_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/abs_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/elewise_unary_impl.h +0 -47
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/elewise_unary_tiling.h +0 -24
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/exp_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/abs_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/elewise_unary_base.h +0 -148
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/elewise_unary_kernel.h +0 -31
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/exp_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/ln_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/not_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/reciprocal_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/relu_kernel.h +0 -55
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/rsqrt_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/kernel/sqrt_kernel.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/ln_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/not_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/reciprocal_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/relu_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/rsqrt_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_unary/sqrt_impl.h +0 -29
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/grouped_matmul_impl.h +0 -45
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/grouped_matmul_tiling.h +0 -187
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/kernel/grouped_matmul.h +0 -245
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/kernel/grouped_matmul_interface.h +0 -24
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/kernel/grouped_matmul_utils.h +0 -111
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/grouped_matmul/tiling_data.h +0 -54
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/compare_param.h +0 -31
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/elewise_param.h +0 -41
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/param/grouped_matmul_param.h +0 -40
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/profiling_util.h +0 -364
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_utils.h +0 -69
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/register/kernel_creator.h +0 -39
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/register/kernel_registry.h +0 -114
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/utils.h +0 -98
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix.json +0 -19
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix_mix_aic_0.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MatMulPostFusionMixTactic/matmul_postfusion_mix_mix_aiv_0.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix.json +0 -19
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix_mix_aic_0.o +0 -0
- mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/op_kernels/ascend910b/MultiMatMulPostFusionMixTactic/multi_matmul_postfusion_mix_mix_aiv_0.o +0 -0
- mindspore/mint/linalg/__init__.py +0 -22
- mindspore/nn/layer/embedding_service.py +0 -531
- mindspore/nn/layer/embedding_service_layer.py +0 -393
- mindspore/ops/function/reshard_func.py +0 -102
- mindspore/ops/operations/_infer_ops.py +0 -19
- mindspore/ops/operations/reshard_ops.py +0 -53
- mindspore/profiler/common/process_pool.py +0 -41
- mindspore/profiler/common/singleton.py +0 -28
- mindspore/profiler/parser/ascend_integrate_generator.py +0 -42
- mindspore/profiler/parser/ascend_memory_generator.py +0 -185
- mindspore/train/callback/_cluster_monitor.py +0 -201
- mindspore/train/callback/_flops_collector.py +0 -238
- mindspore/train/callback/_mindio_ttp.py +0 -443
- {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/WHEEL +0 -0
- {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/entry_points.txt +0 -0
- {mindspore-2.3.0.dist-info → mindspore-2.3.0rc2.dist-info}/top_level.txt +0 -0
mindspore/profiler/profiling.py
CHANGED
|
@@ -34,13 +34,11 @@ from mindspore.context import get_auto_parallel_context
|
|
|
34
34
|
from mindspore.communication.management import GlobalComm, get_rank, get_group_size, get_local_rank
|
|
35
35
|
import mindspore._c_expression as c_expression
|
|
36
36
|
import mindspore._c_dataengine as cde
|
|
37
|
-
from mindspore._c_expression import _framework_profiler_enable_mi
|
|
38
37
|
from mindspore.profiler.common.exceptions.exceptions import ProfilerFileNotFoundException, \
|
|
39
38
|
ProfilerIOException, ProfilerException, ProfilerRawFileException, ProfilerParamTypeErrorException
|
|
40
39
|
from mindspore.profiler.common.exceptions.exceptions import ProfilerPathErrorException
|
|
41
40
|
from mindspore.profiler.common.exceptions.exceptions import ProfilerDirNotFoundException
|
|
42
|
-
from mindspore.profiler.common.util import get_file_path
|
|
43
|
-
from mindspore.profiler.common.process_pool import MultiProcessPool
|
|
41
|
+
from mindspore.profiler.common.util import get_file_path
|
|
44
42
|
from mindspore.profiler.common.validator.validate_path import validate_and_normalize_path
|
|
45
43
|
from mindspore.profiler.parser.framework_parser import GpuFrameWorkParser, DynamicFrameWorkParser
|
|
46
44
|
from mindspore.profiler.parser.integrator import Integrator, DeviceTarget
|
|
@@ -65,8 +63,6 @@ from mindspore.profiler.parser.ascend_flops_generator import AscendFlopsGenerato
|
|
|
65
63
|
from mindspore.profiler.parser.ascend_cluster_generator import AscendClusterGenerator
|
|
66
64
|
from mindspore.profiler.parser.ascend_hccl_generator import AscendHCCLGenerator
|
|
67
65
|
from mindspore.profiler.parser.ascend_communicate_generator import AscendCommunicationGenerator
|
|
68
|
-
from mindspore.profiler.parser.ascend_memory_generator import AscendMemoryGenerator
|
|
69
|
-
from mindspore.profiler.parser.ascend_integrate_generator import AscendIntegrateGenerator
|
|
70
66
|
|
|
71
67
|
INIT_OP_NAME = 'Default/InitDataSetQueue'
|
|
72
68
|
|
|
@@ -89,12 +85,6 @@ class ModelTraingMode(Enum):
|
|
|
89
85
|
UNKNOWN = 3
|
|
90
86
|
|
|
91
87
|
|
|
92
|
-
class ProfilerLevel(Enum):
|
|
93
|
-
Level0 = "Level0"
|
|
94
|
-
Level1 = "Level1"
|
|
95
|
-
Level2 = "Level2"
|
|
96
|
-
|
|
97
|
-
|
|
98
88
|
class DeviceSupportParam(Enum):
|
|
99
89
|
"""The device target enum."""
|
|
100
90
|
CPU = ['start', 'start_profile', 'output_path', 'timeline_limit', 'profile_framework', 'op_time']
|
|
@@ -105,21 +95,16 @@ class DeviceSupportParam(Enum):
|
|
|
105
95
|
ASCEND = [
|
|
106
96
|
'start', 'start_profile', 'output_path', 'data_process', 'timeline_limit', 'profile_memory',
|
|
107
97
|
'parallel_strategy', 'profile_communication', 'aicore_metrics', 'l2_cache', 'hbm_ddr', 'pcie', 'op_time',
|
|
108
|
-
'ascend_job_id', 'profile_framework'
|
|
98
|
+
'ascend_job_id', 'profile_framework'
|
|
109
99
|
]
|
|
110
100
|
|
|
111
101
|
|
|
112
102
|
ALWAYS_VALID_PARAM = [
|
|
113
103
|
'start', 'start_profile', 'output_path', 'data_process', 'parallel_strategy', 'l2_cache',
|
|
114
|
-
'hbm_ddr', 'pcie', 'ascend_job_id', 'op_time', 'profile_framework'
|
|
104
|
+
'hbm_ddr', 'pcie', 'ascend_job_id', 'op_time', 'profile_framework'
|
|
115
105
|
]
|
|
116
106
|
|
|
117
107
|
|
|
118
|
-
ANALYSIS_ASYNC_MODE = 'async'
|
|
119
|
-
ANALYSIS_SYNC_MODE = 'sync'
|
|
120
|
-
DEFAULT_MODEL_ID = 4294967295
|
|
121
|
-
|
|
122
|
-
|
|
123
108
|
def _environment_check():
|
|
124
109
|
if c_expression.security.enable_security():
|
|
125
110
|
raise RuntimeError("Profiler is not supported when MindSpore is compiled with \'-s on\'.")
|
|
@@ -313,8 +298,9 @@ def _ascend_graph_msprof_generator(mindstudio_profiler_output, model_iteration_d
|
|
|
313
298
|
flag = msprof_exporter.export(model_iteration_dict)
|
|
314
299
|
ProfilerInfo.set_export_end_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
315
300
|
return flag
|
|
316
|
-
|
|
317
|
-
|
|
301
|
+
|
|
302
|
+
except ProfilerException as err:
|
|
303
|
+
logger.warning(err.message)
|
|
318
304
|
return False
|
|
319
305
|
|
|
320
306
|
|
|
@@ -330,6 +316,7 @@ def _ascend_graph_msprof_analyse(mindstudio_profiler_output):
|
|
|
330
316
|
msprof_analyser = AscendMsprofDataGenerator(mindstudio_profiler_output)
|
|
331
317
|
res = msprof_analyser.parse()
|
|
332
318
|
return res
|
|
319
|
+
|
|
333
320
|
except ProfilerException as err:
|
|
334
321
|
logger.warning(err.message)
|
|
335
322
|
finally:
|
|
@@ -349,14 +336,6 @@ class Profiler:
|
|
|
349
336
|
|
|
350
337
|
Args:
|
|
351
338
|
output_path (str, optional): Output data path. Default: ``"./data"`` .
|
|
352
|
-
profiler_level (ProfilerLevel, optional): (Ascend only) The level of profiling. Default: ``None``.
|
|
353
|
-
|
|
354
|
-
- Profiler.Level0: Leanest level of profiling data collection, collects information about the elapsed
|
|
355
|
-
time of the computational operators on the NPU and communication large operator information.
|
|
356
|
-
- Profiler.Level1: Collect more CANN layer AscendCL data and AICore performance metrics and communication
|
|
357
|
-
mini operator information based on Level0.
|
|
358
|
-
- Profiler.Level2: Collect GE and Runtime information in CANN layer on top of Level1
|
|
359
|
-
|
|
360
339
|
op_time (bool, optional): (Ascend/GPU) Whether to collect operators performance data. Default value: ``True``.
|
|
361
340
|
profile_communication (bool, optional): (Ascend only) Whether to collect communication performance data in
|
|
362
341
|
a multi devices training,collect when True. Setting this parameter has no effect during single card
|
|
@@ -368,7 +347,7 @@ class Profiler:
|
|
|
368
347
|
start_profile (bool, optional): The start_profile parameter controls whether to enable or disable performance
|
|
369
348
|
data collection based on conditions. Default: ``True`` .
|
|
370
349
|
aicore_metrics (int, optional): (Ascend only) Types of AICORE performance data collected, when using this
|
|
371
|
-
parameter, `op_time` must be set to ``True`` , and the value must be in [-1, 0, 1, 2, 3, 4, 5
|
|
350
|
+
parameter, `op_time` must be set to ``True`` , and the value must be in [-1, 0, 1, 2, 3, 4, 5],
|
|
372
351
|
Default: ``0`` , the data items contained in each metric are as follows:
|
|
373
352
|
|
|
374
353
|
- -1: Does not collect AICORE data.
|
|
@@ -408,12 +387,6 @@ class Profiler:
|
|
|
408
387
|
- "time": Only record host timestamp.
|
|
409
388
|
- "memory": Only record host memory usage.
|
|
410
389
|
- None: Not record host information.
|
|
411
|
-
data_simplification (bool, optional): (Ascend only) Whether to remove FRAMEWORK data and other redundant data.
|
|
412
|
-
If set to True, only the delivery of profiler and the original performance data in the PROF_XXX
|
|
413
|
-
directory are retained to save disk space.
|
|
414
|
-
Default value: ``True`` .
|
|
415
|
-
host_stack (bool, optional): (Ascend) Whether to collect frame host call stack data.
|
|
416
|
-
Default value: ``True`` .
|
|
417
390
|
|
|
418
391
|
Raises:
|
|
419
392
|
RuntimeError: When the version of CANN does not match the version of MindSpore,
|
|
@@ -475,7 +448,7 @@ class Profiler:
|
|
|
475
448
|
|
|
476
449
|
def __init__(self, **kwargs):
|
|
477
450
|
if os.getenv("PROFILING_MODE"):
|
|
478
|
-
raise RuntimeError("Profiling is already enabled by
|
|
451
|
+
raise RuntimeError("Profiling is already enabled by env.")
|
|
479
452
|
|
|
480
453
|
self._dev_id = None
|
|
481
454
|
self._cpu_profiler = None
|
|
@@ -495,7 +468,6 @@ class Profiler:
|
|
|
495
468
|
self._timeline_size_limit_byte = 500 * 1024 * 1024 # 500MB
|
|
496
469
|
self._parallel_strategy = True
|
|
497
470
|
self._model_iteration_dict = None
|
|
498
|
-
self._analyse_mode = ANALYSIS_SYNC_MODE
|
|
499
471
|
_environment_check()
|
|
500
472
|
# default aicore_metrics type is ArithmeticUtilization
|
|
501
473
|
self._aicore_metrics_id = 0
|
|
@@ -514,11 +486,8 @@ class Profiler:
|
|
|
514
486
|
self._dynamic_status = False
|
|
515
487
|
self._profile_framework = "all"
|
|
516
488
|
self._msprof_enable = os.getenv("PROFILER_SAMPLECONFIG")
|
|
517
|
-
self.profiler_level = None
|
|
518
489
|
self._pretty_json = False
|
|
519
490
|
self._analyse_only = kwargs.get("analyse_only", False)
|
|
520
|
-
self._data_simplification = kwargs.get("data_simplification", True)
|
|
521
|
-
self._host_stack = True
|
|
522
491
|
if self._msprof_enable:
|
|
523
492
|
return
|
|
524
493
|
self._start_time = int(time.time() * 1e6) # us
|
|
@@ -578,15 +547,18 @@ class Profiler:
|
|
|
578
547
|
Returns:
|
|
579
548
|
str, job start time.
|
|
580
549
|
"""
|
|
550
|
+
AscendMsprofExporter.check_msprof_env()
|
|
551
|
+
script_path = AscendMsprofExporter.get_msprof_info_path()
|
|
552
|
+
if not script_path:
|
|
553
|
+
logger.warning("Can`t find get_msprof_info.py path, use single-export mode instead.")
|
|
554
|
+
return None
|
|
555
|
+
|
|
556
|
+
logger.info("get_msprof_info.py path is : %s", script_path)
|
|
557
|
+
host_dir = os.path.join(prof_dir, 'host')
|
|
558
|
+
cmd = ['python',
|
|
559
|
+
script_path,
|
|
560
|
+
'-dir', host_dir]
|
|
581
561
|
try:
|
|
582
|
-
AscendMsprofExporter.check_msprof_env()
|
|
583
|
-
script_path = AscendMsprofExporter.get_msprof_info_path()
|
|
584
|
-
if not script_path:
|
|
585
|
-
logger.warning("Can`t find get_msprof_info.py path, use single-export mode instead.")
|
|
586
|
-
return None
|
|
587
|
-
logger.info("get_msprof_info.py path is : %s", script_path)
|
|
588
|
-
host_dir = os.path.join(prof_dir, 'host')
|
|
589
|
-
cmd = ['python', script_path, '-dir', host_dir]
|
|
590
562
|
outs, _ = AscendMsprofExporter.run_cmd(cmd)
|
|
591
563
|
if not outs:
|
|
592
564
|
logger.warning('Can`t find the msprof info result')
|
|
@@ -598,7 +570,7 @@ class Profiler:
|
|
|
598
570
|
if jor_start_time is not None:
|
|
599
571
|
return float(jor_start_time.strip())
|
|
600
572
|
return None
|
|
601
|
-
except (RuntimeError, JSONDecodeError, AttributeError
|
|
573
|
+
except (RuntimeError, JSONDecodeError, AttributeError) as err:
|
|
602
574
|
logger.warning('Get the drvVersion error, use single-export mode instead. detail : %s', err)
|
|
603
575
|
return None
|
|
604
576
|
|
|
@@ -730,7 +702,7 @@ class Profiler:
|
|
|
730
702
|
return message
|
|
731
703
|
return op_info
|
|
732
704
|
|
|
733
|
-
def analyse(self, offline_path=None, pretty=False, step_list=None
|
|
705
|
+
def analyse(self, offline_path=None, pretty=False, step_list=None):
|
|
734
706
|
"""
|
|
735
707
|
Collect and analyze training performance data, support calls during and after training. The example shows above.
|
|
736
708
|
|
|
@@ -741,38 +713,19 @@ class Profiler:
|
|
|
741
713
|
pretty (bool, optional): Whether to pretty json files. Default: ``False``.
|
|
742
714
|
step_list (list, optional): A list of steps that need to be analyzed. Default: ``None``.
|
|
743
715
|
By default, all steps will be analyzed.
|
|
744
|
-
mode (str, optional): Analysis mode, it must be one of ["sync", "async"]. Default: ``sync``.
|
|
745
|
-
|
|
746
|
-
- sync: analyse data in current process, it will block the current process.
|
|
747
|
-
- async: analyse data in subprocess, it will not the current process.Since the parsing process
|
|
748
|
-
will take up extra CPU resources, please enable this mode according to the actual resource situation.
|
|
749
|
-
|
|
750
716
|
"""
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
raise ProfilerParamTypeErrorException("The elements of the parameter step_list must be integers.")
|
|
764
|
-
step_list.sort()
|
|
765
|
-
if step_list[-1] - step_list[0] != len(step_list) - 1:
|
|
766
|
-
err_msg = "The elements of the parameter step_list must be continuous integers."
|
|
767
|
-
raise ProfilerParamTypeErrorException(err_msg)
|
|
768
|
-
model_iteration_dict[DEFAULT_MODEL_ID] = step_list
|
|
769
|
-
if offline_path is not None and not isinstance(offline_path, str):
|
|
770
|
-
raise ProfilerParamTypeErrorException("For analyse, the type of parameter offline_path must be str.")
|
|
771
|
-
self._analyse(offline_path=offline_path, model_iteration_dict=model_iteration_dict, mode=mode)
|
|
772
|
-
except (ProfilerException, RuntimeError, OSError, TypeError, NameError) as err:
|
|
773
|
-
logger.error("Profiler analyse failed: %s", str(err))
|
|
774
|
-
|
|
775
|
-
def _analyse(self, offline_path=None, model_iteration_dict=None, mode=ANALYSIS_SYNC_MODE):
|
|
717
|
+
if isinstance(pretty, bool):
|
|
718
|
+
self._pretty_json = pretty
|
|
719
|
+
model_iteration_dict = {}
|
|
720
|
+
if step_list is not None and not isinstance(step_list, list):
|
|
721
|
+
raise ProfilerParamTypeErrorException("Parameter step_list must be a list.")
|
|
722
|
+
if step_list:
|
|
723
|
+
if not isinstance(step_list[0], int):
|
|
724
|
+
raise ProfilerParamTypeErrorException("The elements of the parameter step_list must be integers.")
|
|
725
|
+
model_iteration_dict.setdefault(4294967295, []).append(step_list[0])
|
|
726
|
+
self._analyse(offline_path=offline_path, model_iteration_dict=model_iteration_dict)
|
|
727
|
+
|
|
728
|
+
def _analyse(self, offline_path=None, model_iteration_dict=None):
|
|
776
729
|
"""
|
|
777
730
|
Collect and analyze training performance data, support calls during and after training. The example shows above.
|
|
778
731
|
|
|
@@ -781,17 +734,15 @@ class Profiler:
|
|
|
781
734
|
Offline mode isused in abnormal exit scenario. This parameter should be set to ``None``
|
|
782
735
|
for online mode. Default: ``None``.
|
|
783
736
|
model_iteration_dict: Dictionary with model id as the key and iteration id as the value, Default: ``None``.
|
|
784
|
-
mode (str, optional): Analysis mode. Whether to analyse data in subprocess. Default: ``sync``.
|
|
785
|
-
By default, analyse data in current process.
|
|
786
737
|
"""
|
|
787
738
|
self._model_iteration_dict = model_iteration_dict
|
|
788
739
|
self._init_profiler_info()
|
|
789
740
|
self._is_support_step_info_collect()
|
|
790
|
-
self._analyse_mode = mode
|
|
791
741
|
parallel_mode = get_auto_parallel_context("parallel_mode")
|
|
792
742
|
stage_num = get_auto_parallel_context("pipeline_stages")
|
|
793
743
|
|
|
794
744
|
ProfilerInfo.set_parallel_info(parallel_mode, stage_num)
|
|
745
|
+
ProfilerInfo.set_heterogeneous(self._is_heterogeneous)
|
|
795
746
|
if offline_path:
|
|
796
747
|
ProfilerInfo.set_analyse_start_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
797
748
|
self._ascend_graph_analyse(offline_path=offline_path)
|
|
@@ -812,8 +763,6 @@ class Profiler:
|
|
|
812
763
|
cpu_op_file = glob.glob(os.path.join(self._output_path, 'cpu_op_type_info_*'))
|
|
813
764
|
if self._device_target and self._device_target != DeviceTarget.CPU.value and cpu_op_file:
|
|
814
765
|
self._is_heterogeneous = True
|
|
815
|
-
|
|
816
|
-
ProfilerInfo.set_heterogeneous(self._is_heterogeneous)
|
|
817
766
|
ProfilerInfo.set_analyse_start_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
818
767
|
if self._device_target and self._device_target == DeviceTarget.CPU.value:
|
|
819
768
|
self._cpu_analyse()
|
|
@@ -878,8 +827,6 @@ class Profiler:
|
|
|
878
827
|
self._cpu_profiler.step_profiling_enable(True)
|
|
879
828
|
if self._op_time:
|
|
880
829
|
self._cpu_profiler.enable_op_time()
|
|
881
|
-
if self._profile_memory:
|
|
882
|
-
self._cpu_profiler.enable_profile_memory()
|
|
883
830
|
|
|
884
831
|
if self._device_target and self._device_target == DeviceTarget.GPU.value:
|
|
885
832
|
if self._data_process:
|
|
@@ -894,9 +841,8 @@ class Profiler:
|
|
|
894
841
|
self._md_profiler.start()
|
|
895
842
|
self._ascend_graph_start()
|
|
896
843
|
ProfilerInfo.set_profiling_start_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
897
|
-
ProfilerInfo.set_system_cnt(c_expression.get_clock_syscnt())
|
|
898
844
|
ProfilerInfo.set_system_time(int(c_expression.get_clock_time() * 1e3)) # cast us to ns
|
|
899
|
-
|
|
845
|
+
ProfilerInfo.set_system_cnt(c_expression.get_clock_syscnt())
|
|
900
846
|
|
|
901
847
|
def stop(self):
|
|
902
848
|
"""
|
|
@@ -1099,9 +1045,7 @@ class Profiler:
|
|
|
1099
1045
|
"pcie": self._pcie,
|
|
1100
1046
|
"parallel_strategy": self.ENABLE_STATUS if self._parallel_strategy else self.DISABLE_STATUS,
|
|
1101
1047
|
"op_time": self.ENABLE_STATUS if self._op_time else self.DISABLE_STATUS,
|
|
1102
|
-
"profile_framework": self._profile_framework
|
|
1103
|
-
"profiler_level": self.profiler_level.value if self.profiler_level else self.DISABLE_STATUS,
|
|
1104
|
-
"host_stack": "on" if self._host_stack else "off"
|
|
1048
|
+
"profile_framework": self._profile_framework
|
|
1105
1049
|
}
|
|
1106
1050
|
|
|
1107
1051
|
return profiling_options
|
|
@@ -1151,7 +1095,7 @@ class Profiler:
|
|
|
1151
1095
|
|
|
1152
1096
|
if self._aicore_metrics_id not in AICORE_METRICS_DICT:
|
|
1153
1097
|
logger.warning(f"For '{self.__class__.__name__}', the parameter aicore_metrics must be in "
|
|
1154
|
-
f"[-1, 0, 1, 2, 3, 4, 5
|
|
1098
|
+
f"[-1, 0, 1, 2, 3, 4, 5], but got {self._aicore_metrics_id}, it will be set to 0.")
|
|
1155
1099
|
self._aicore_metrics_id = 0
|
|
1156
1100
|
|
|
1157
1101
|
l2_cache_enable = kwargs.pop("l2_cache", False)
|
|
@@ -1181,22 +1125,6 @@ class Profiler:
|
|
|
1181
1125
|
f"but got type {type(self._parallel_strategy)}, it will be set to True.")
|
|
1182
1126
|
self._parallel_strategy = True
|
|
1183
1127
|
|
|
1184
|
-
self.profiler_level = kwargs.pop("profiler_level", None)
|
|
1185
|
-
if self.profiler_level and not isinstance(self.profiler_level, ProfilerLevel):
|
|
1186
|
-
logger.warning(f"For '{self.__class__.__name__}', the parameter profiler_level must be one of "
|
|
1187
|
-
f"[ProfilerLevel.Level0, ProfilerLevel.Level1, ProfilerLevel.Level2], but got type "
|
|
1188
|
-
f"{type(self.profiler_level)}, it will be set to ProfilerLevel.Level0.")
|
|
1189
|
-
self.profiler_level = ProfilerLevel.Level0
|
|
1190
|
-
elif self.profiler_level == ProfilerLevel.Level0:
|
|
1191
|
-
self._data_process = False
|
|
1192
|
-
self._aicore_metrics_id = -1
|
|
1193
|
-
logger.warning(f"For '{self.__class__.__name__}', when profiler_level set Level0, data_process will be set "
|
|
1194
|
-
f"to False and aicore_metrics set to -1.")
|
|
1195
|
-
elif self.profiler_level == ProfilerLevel.Level1:
|
|
1196
|
-
self._data_process = False
|
|
1197
|
-
logger.warning(f"For '{self.__class__.__name__}', when profiler_level set Level1, data_process will be set "
|
|
1198
|
-
f"to False.")
|
|
1199
|
-
|
|
1200
1128
|
def _ascend_analyse(self):
|
|
1201
1129
|
"""Collect and analyse ascend performance data."""
|
|
1202
1130
|
self._rank_size = 1
|
|
@@ -1213,15 +1141,18 @@ class Profiler:
|
|
|
1213
1141
|
self.stop()
|
|
1214
1142
|
else:
|
|
1215
1143
|
logger.info("No need to stop profiler because profiler has been stopped.")
|
|
1216
|
-
self._ascend_profiler.finalize()
|
|
1217
1144
|
# export op data before analyse
|
|
1218
1145
|
self._ascend_graph_analyse()
|
|
1219
1146
|
|
|
1220
|
-
def _minddata_analyse(self):
|
|
1147
|
+
def _minddata_analyse(self, source_path):
|
|
1221
1148
|
"""Analyse mindadata for ascend graph model."""
|
|
1222
1149
|
if not self._data_process:
|
|
1223
1150
|
return
|
|
1224
1151
|
store_id = self._rank_id if self._device_target == DeviceTarget.ASCEND.value else self._dev_id
|
|
1152
|
+
# Parsing minddata AICPU profiling
|
|
1153
|
+
if self._device_target == DeviceTarget.ASCEND.value:
|
|
1154
|
+
logger.info("Profiling: analyzing the minddata AICPU data.")
|
|
1155
|
+
MinddataParser.execute(source_path, self._output_path, store_id)
|
|
1225
1156
|
|
|
1226
1157
|
# parse minddata pipeline operator and queue
|
|
1227
1158
|
try:
|
|
@@ -1241,16 +1172,6 @@ class Profiler:
|
|
|
1241
1172
|
finally:
|
|
1242
1173
|
pass
|
|
1243
1174
|
|
|
1244
|
-
def _minddata_aicpu_analyse(self, source_path, job_id):
|
|
1245
|
-
"""Analyse minddata aicpu after ascend."""
|
|
1246
|
-
if not self._data_process:
|
|
1247
|
-
return
|
|
1248
|
-
store_id = self._rank_id if self._device_target == DeviceTarget.ASCEND.value else self._dev_id
|
|
1249
|
-
# Parsing minddata AICPU profiling
|
|
1250
|
-
if self._device_target == DeviceTarget.ASCEND.value:
|
|
1251
|
-
logger.info("Profiling: analyzing the minddata AICPU data.")
|
|
1252
|
-
MinddataParser.execute(source_path, self._output_path, job_id, store_id)
|
|
1253
|
-
|
|
1254
1175
|
def _ascend_fpbp_analyse(self, op_summary, steptrace):
|
|
1255
1176
|
"""
|
|
1256
1177
|
Ascned graph model op analyse.
|
|
@@ -1305,8 +1226,8 @@ class Profiler:
|
|
|
1305
1226
|
op_analyser.parse()
|
|
1306
1227
|
op_analyser.write(op_intermediate_detail_path, op_intermediate_type_path,
|
|
1307
1228
|
aicpu_intermediate_detail_path, framework_raw_path, output_timeline_data_path)
|
|
1308
|
-
except
|
|
1309
|
-
logger.warning(
|
|
1229
|
+
except ProfilerException as err:
|
|
1230
|
+
logger.warning(err.message)
|
|
1310
1231
|
finally:
|
|
1311
1232
|
pass
|
|
1312
1233
|
|
|
@@ -1333,12 +1254,12 @@ class Profiler:
|
|
|
1333
1254
|
try:
|
|
1334
1255
|
logger.info("Profiling: analyzing the timeline data")
|
|
1335
1256
|
timeline_analyser = AscendTimelineGenerator(self._output_path, source_path, mindstudio_profiler_output,
|
|
1336
|
-
self._rank_id, self._rank_size, context.get_context('mode')
|
|
1337
|
-
self._model_iteration_dict.get(DEFAULT_MODEL_ID))
|
|
1257
|
+
self._rank_id, self._rank_size, context.get_context('mode'))
|
|
1338
1258
|
timeline_analyser.parse_cluster_data(op_summary, steptrace)
|
|
1339
1259
|
timeline_analyser.parse_timeline_data(pretty=self._pretty_json)
|
|
1340
1260
|
timeline_analyser.write_timeline_display()
|
|
1341
1261
|
timeline_analyser.write_timeline_summary()
|
|
1262
|
+
|
|
1342
1263
|
except (ProfilerIOException, ProfilerFileNotFoundException, RuntimeError) as err:
|
|
1343
1264
|
logger.warning('Fail to write timeline data: %s', err)
|
|
1344
1265
|
finally:
|
|
@@ -1376,8 +1297,8 @@ class Profiler:
|
|
|
1376
1297
|
flops_analyser.parse()
|
|
1377
1298
|
flops_analyser.write(flops_path, flops_summary_path)
|
|
1378
1299
|
|
|
1379
|
-
except
|
|
1380
|
-
logger.warning(
|
|
1300
|
+
except ProfilerException as err:
|
|
1301
|
+
logger.warning(err.message)
|
|
1381
1302
|
finally:
|
|
1382
1303
|
pass
|
|
1383
1304
|
|
|
@@ -1418,23 +1339,8 @@ class Profiler:
|
|
|
1418
1339
|
target_timeline_path = os.path.join(ascend_profiler_output_path, f"trace_view.json")
|
|
1419
1340
|
shutil.copy(source_timeline_path, target_timeline_path)
|
|
1420
1341
|
|
|
1421
|
-
src_op_mem_file = os.path.join(self._output_path, f"operator_memory_{dev_id}.csv")
|
|
1422
|
-
if os.path.exists(src_op_mem_file):
|
|
1423
|
-
dst_op_mem_file = os.path.join(ascend_profiler_output_path, f"operator_memory.csv")
|
|
1424
|
-
shutil.copy(src_op_mem_file, dst_op_mem_file)
|
|
1425
|
-
|
|
1426
|
-
ms_output_path = os.path.abspath(
|
|
1427
|
-
os.path.join(source_path, os.path.pardir, 'mindstudio_profiler_output'))
|
|
1428
|
-
static_op_mem_path = os.path.join(ms_output_path, f"static_op_mem_*.csv")
|
|
1429
|
-
src_static_op_mem_path = glob.glob(static_op_mem_path)
|
|
1430
|
-
if src_static_op_mem_path:
|
|
1431
|
-
dst_static_op_mem_file = os.path.join(ascend_profiler_output_path, f"static_op_mem.csv")
|
|
1432
|
-
shutil.copy(src_static_op_mem_path[0], dst_static_op_mem_file)
|
|
1433
|
-
|
|
1434
1342
|
self._ascend_graph_cluster_analyse(source_path, ascend_profiler_output_path)
|
|
1435
1343
|
self._ascend_graph_communicate_analyse(source_path, ascend_profiler_output_path)
|
|
1436
|
-
AscendIntegrateGenerator(source_path, ascend_profiler_output_path).parse()
|
|
1437
|
-
AscendMemoryGenerator(self._output_path, self._rank_id, source_path, ascend_profiler_output_path).parse()
|
|
1438
1344
|
|
|
1439
1345
|
def _ascend_graph_cluster_analyse(self, source_path, ascend_profiler_output_path):
|
|
1440
1346
|
"""Analyse step trace time info"""
|
|
@@ -1526,7 +1432,7 @@ class Profiler:
|
|
|
1526
1432
|
return []
|
|
1527
1433
|
kernel_map = {}
|
|
1528
1434
|
for kernel in kernels:
|
|
1529
|
-
key = kernel.name if kernel.
|
|
1435
|
+
key = kernel.name if kernel.is_comm_op else (kernel.name, str(kernel.ts))
|
|
1530
1436
|
kernel_map[key] = kernel.parent
|
|
1531
1437
|
launch_ops = [None] * len(op_summary)
|
|
1532
1438
|
for index, summary in enumerate(op_summary):
|
|
@@ -1542,13 +1448,10 @@ class Profiler:
|
|
|
1542
1448
|
return launch_ops
|
|
1543
1449
|
|
|
1544
1450
|
def _ascend_graph_analyse(self, offline_path=None):
|
|
1545
|
-
if offline_path or self._analyse_mode == ANALYSIS_SYNC_MODE:
|
|
1546
|
-
self._ascend_graph_analyse_inner(offline_path)
|
|
1547
|
-
else:
|
|
1548
|
-
MultiProcessPool().add_async_job(self._ascend_graph_analyse_inner)
|
|
1549
|
-
|
|
1550
|
-
def _ascend_graph_analyse_inner(self, offline_path=None):
|
|
1551
1451
|
"""Ascend graph mode analyse."""
|
|
1452
|
+
if not offline_path:
|
|
1453
|
+
self._ascend_profiler.finalize()
|
|
1454
|
+
|
|
1552
1455
|
job_id = self._get_profiling_job_id(offline_path)
|
|
1553
1456
|
if not job_id:
|
|
1554
1457
|
return
|
|
@@ -1556,10 +1459,10 @@ class Profiler:
|
|
|
1556
1459
|
|
|
1557
1460
|
self._check_output_path(output_path=self._output_path)
|
|
1558
1461
|
source_path = os.path.join(self._output_path, job_id)
|
|
1559
|
-
self._minddata_analyse()
|
|
1462
|
+
self._minddata_analyse(source_path)
|
|
1560
1463
|
if self._op_time:
|
|
1561
|
-
mindstudio_profiler_output = os.path.abspath(
|
|
1562
|
-
|
|
1464
|
+
mindstudio_profiler_output = os.path.abspath(os.path.join(source_path, os.path.pardir,
|
|
1465
|
+
'mindstudio_profiler_output'))
|
|
1563
1466
|
flag = _ascend_graph_msprof_generator(mindstudio_profiler_output, self._model_iteration_dict)
|
|
1564
1467
|
if not flag:
|
|
1565
1468
|
logger.warning('Current driver package not support all export mode, use single export mode, '
|
|
@@ -1586,12 +1489,7 @@ class Profiler:
|
|
|
1586
1489
|
self._ascend_ms_analyze(mindstudio_profiler_output)
|
|
1587
1490
|
self._ascend_graph_hccl_analyse(mindstudio_profiler_output, steptrace)
|
|
1588
1491
|
self._ascend_graph_msadvisor_analyse(job_id)
|
|
1589
|
-
self._minddata_aicpu_analyse(self._output_path, job_id)
|
|
1590
1492
|
ProfilerInfo.set_graph_ids(graph_ids)
|
|
1591
|
-
try:
|
|
1592
|
-
ProfilerPathManager.simplify_data(self._output_path, self._data_simplification)
|
|
1593
|
-
except RuntimeError as err:
|
|
1594
|
-
logger.error('Profilier simplify data failed, %s', str(err))
|
|
1595
1493
|
|
|
1596
1494
|
def _ascend_graph_start(self):
|
|
1597
1495
|
"""Ascend graph mode start profiling."""
|
|
@@ -1620,7 +1518,7 @@ class Profiler:
|
|
|
1620
1518
|
else:
|
|
1621
1519
|
logger.info("No need to stop profiler because profiler has been stopped.")
|
|
1622
1520
|
|
|
1623
|
-
self._minddata_analyse()
|
|
1521
|
+
self._minddata_analyse(self._output_path)
|
|
1624
1522
|
|
|
1625
1523
|
try:
|
|
1626
1524
|
self._analyse_step_relation_info()
|
|
@@ -1990,21 +1888,6 @@ class Profiler:
|
|
|
1990
1888
|
logger.warning(f"For '{self.__class__.__name__}', the parameter profile_framework must be one of ['memory',"
|
|
1991
1889
|
f" 'time', 'all', None], but got {self._profile_framework}, it will be set to 'all'.")
|
|
1992
1890
|
self._profile_framework = "all"
|
|
1993
|
-
if not isinstance(self._data_simplification, bool):
|
|
1994
|
-
logger.warning(f"For '{self.__class__.__name__}', the parameter data_simplification must be bool, "
|
|
1995
|
-
f"but got type {type(self._data_simplification)}, it will be set to True.")
|
|
1996
|
-
self._data_simplification = True
|
|
1997
|
-
|
|
1998
|
-
if not isinstance(self._data_simplification, bool):
|
|
1999
|
-
logger.warning(f"For '{self.__class__.__name__}', the parameter data_simplification must be bool, "
|
|
2000
|
-
f"but got type {type(self._data_simplification)}, it will be set to True.")
|
|
2001
|
-
self._data_simplification = True
|
|
2002
|
-
|
|
2003
|
-
self._host_stack = kwargs.pop("host_stack", True)
|
|
2004
|
-
if not isinstance(self._host_stack, bool):
|
|
2005
|
-
logger.warning(f"For '{self.__class__.__name__}', the parameter host_stack must be bool, but got "
|
|
2006
|
-
f"type {type(self._host_stack)}, it will be set to True.")
|
|
2007
|
-
self._host_stack = True
|
|
2008
1891
|
|
|
2009
1892
|
def _host_info_analyse(self):
|
|
2010
1893
|
"""
|
|
@@ -2014,7 +1897,7 @@ class Profiler:
|
|
|
2014
1897
|
host_dir = os.path.join(self._output_path, 'host_info')
|
|
2015
1898
|
host_dir = validate_and_normalize_path(host_dir)
|
|
2016
1899
|
if not os.path.exists(host_dir):
|
|
2017
|
-
logger.
|
|
1900
|
+
logger.error("Host info directory: %s not exist.", host_dir)
|
|
2018
1901
|
return
|
|
2019
1902
|
csv_file_name = 'host_info_' + str(self._rank_id) + '.csv'
|
|
2020
1903
|
json_file_name = 'timeline_' + str(self._rank_id) + '.json'
|
|
@@ -2035,7 +1918,7 @@ def _offline_parse(offline_path):
|
|
|
2035
1918
|
host_dir = os.path.join(offline_path, 'profiler', 'host_info')
|
|
2036
1919
|
host_dir = validate_and_normalize_path(host_dir)
|
|
2037
1920
|
if not os.path.exists(host_dir):
|
|
2038
|
-
logger.
|
|
1921
|
+
logger.error("Host info directory: %s not exist.", host_dir)
|
|
2039
1922
|
return
|
|
2040
1923
|
files = os.listdir(host_dir)
|
|
2041
1924
|
for file in files:
|
mindspore/rewrite/api/node.py
CHANGED
|
@@ -142,7 +142,7 @@ class Node:
|
|
|
142
142
|
Examples:
|
|
143
143
|
>>> from mindspore.rewrite import SymbolTree, ScopedValue
|
|
144
144
|
>>> import mindspore.nn as nn
|
|
145
|
-
>>>
|
|
145
|
+
>>> import mindspore.ops as ops
|
|
146
146
|
>>> # Define the network structure of LeNet5. Refer to
|
|
147
147
|
>>> # https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
|
|
148
148
|
>>> net = LeNet5()
|
|
@@ -17,14 +17,14 @@ import os
|
|
|
17
17
|
import sys
|
|
18
18
|
import inspect
|
|
19
19
|
import types
|
|
20
|
-
from mindspore._extends.parse.namespace import
|
|
20
|
+
from mindspore._extends.parse.namespace import CellNamespace
|
|
21
21
|
from mindspore.nn import CellList, SequentialCell
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
_ms_common_ns =
|
|
25
|
-
_ms_nn_ns =
|
|
26
|
-
_ms_ops_ns =
|
|
27
|
-
_ms_functional_ns =
|
|
24
|
+
_ms_common_ns = CellNamespace('mindspore.common')
|
|
25
|
+
_ms_nn_ns = CellNamespace('mindspore.nn')
|
|
26
|
+
_ms_ops_ns = CellNamespace('mindspore.ops.operations')
|
|
27
|
+
_ms_functional_ns = CellNamespace('mindspore.ops.functional')
|
|
28
28
|
|
|
29
29
|
# Elements in _subtree_black_list will not be converted to symbol tree.
|
|
30
30
|
# Only str and types are stored in _subtree_black_list.
|
|
@@ -664,8 +664,6 @@ class AssignParser(Parser):
|
|
|
664
664
|
if method_object is not None:
|
|
665
665
|
if inspect.ismethod(method_object):
|
|
666
666
|
self.process_class_method(func_scope_name, func_name, method_object)
|
|
667
|
-
elif isinstance(inspect.getattr_static(self.stree.get_origin_network(), func_name), staticmethod):
|
|
668
|
-
self.insert_callfunction_node(func_scope_name, func_name, None, None, False)
|
|
669
667
|
else:
|
|
670
668
|
self.process_function(func_scope_name, func_name, method_object, False)
|
|
671
669
|
return
|
|
@@ -20,7 +20,7 @@ import sys
|
|
|
20
20
|
from textwrap import dedent
|
|
21
21
|
from mindspore import log as logger
|
|
22
22
|
from mindspore.nn import Cell
|
|
23
|
-
from mindspore._extends.parse.namespace import
|
|
23
|
+
from mindspore._extends.parse.namespace import CellNamespace
|
|
24
24
|
from . import Parser, ParserRegister, reg_parser
|
|
25
25
|
from ..node import NodeManager
|
|
26
26
|
from ..symbol_tree import SymbolTree
|
|
@@ -47,7 +47,7 @@ class ClassDefParser(Parser):
|
|
|
47
47
|
def __init__(self):
|
|
48
48
|
"""Constructor"""
|
|
49
49
|
super(ClassDefParser, self).__init__()
|
|
50
|
-
self._cell_namespace =
|
|
50
|
+
self._cell_namespace = CellNamespace('mindspore.nn')
|
|
51
51
|
|
|
52
52
|
@staticmethod
|
|
53
53
|
def _save_imports(stree):
|
|
@@ -114,14 +114,10 @@ class ClassDefParser(Parser):
|
|
|
114
114
|
if key.startswith('__'):
|
|
115
115
|
# ignore inner functions
|
|
116
116
|
continue
|
|
117
|
-
|
|
118
|
-
if not is_staticmethod and callable(value) and key in function_defs:
|
|
117
|
+
if callable(value) and key in function_defs:
|
|
119
118
|
# ignore functions defined by self
|
|
120
119
|
continue
|
|
121
|
-
|
|
122
|
-
assign_code = f"self.{key} = obj.__class__.{key}"
|
|
123
|
-
else:
|
|
124
|
-
assign_code = f"self.__class__.{key} = obj.__class__.{key}"
|
|
120
|
+
assign_code = f"self.__class__.{key} = obj.__class__.{key}"
|
|
125
121
|
assign_ast = ast.parse(assign_code).body[0]
|
|
126
122
|
init_func_ast.body.append(assign_ast)
|
|
127
123
|
|
|
@@ -259,7 +259,7 @@ class AscendEnvChecker(EnvChecker):
|
|
|
259
259
|
|
|
260
260
|
def __init__(self, library_path):
|
|
261
261
|
self.library_path = library_path
|
|
262
|
-
self.version = ["7.2"
|
|
262
|
+
self.version = ["7.2"]
|
|
263
263
|
atlas_nnae_version = "/usr/local/Ascend/nnae/latest/compiler/version.info"
|
|
264
264
|
atlas_toolkit_version = "/usr/local/Ascend/ascend-toolkit/latest/compiler/version.info"
|
|
265
265
|
hisi_fwk_version = "/usr/local/Ascend/latest/compiler/version.info"
|
mindspore/scipy/fft.py
CHANGED
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
"""fft operations, the function docs are adapted from Scipy API."""
|
|
16
16
|
from __future__ import absolute_import
|
|
17
17
|
from __future__ import division
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
from mindspore.ops.auto_generate import DCT
|
|
20
20
|
from mindspore.ops._primitive_cache import _get_cache_prim
|
|
21
21
|
from mindspore.scipy.utils import _raise_value_error
|
|
22
22
|
|
|
23
|
+
__all__ = ['dct', 'idct']
|
|
24
|
+
|
|
23
25
|
|
|
24
26
|
def dct(x, type=2, n=None, axis=-1, norm=None):
|
|
25
27
|
"""
|
mindspore/scipy/linalg.py
CHANGED
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
# ============================================================================
|
|
15
15
|
"""Linear algebra submodule"""
|
|
16
16
|
from __future__ import absolute_import
|
|
17
|
-
__all__ = ['block_diag', 'inv', 'cho_factor', 'cholesky',
|
|
18
|
-
'cho_solve', 'eigh', 'lu_factor', 'lu', 'solve_triangular']
|
|
19
17
|
from .ops import LU, SolveTriangular
|
|
20
18
|
from .utils import _nd_transpose, _value_check, _type_check, _dtype_check, _mstype_check, _square_check, _solve_check
|
|
21
19
|
from .utils_const import _raise_value_error
|
|
@@ -27,6 +25,9 @@ from ..ops.operations.linalg_ops import Eigh
|
|
|
27
25
|
from ..ops import functional as F
|
|
28
26
|
from ..ops import operations as P
|
|
29
27
|
|
|
28
|
+
__all__ = ['block_diag', 'inv', 'cho_factor', 'cholesky',
|
|
29
|
+
'cho_solve', 'eigh', 'lu_factor', 'lu', 'solve_triangular']
|
|
30
|
+
|
|
30
31
|
|
|
31
32
|
def solve_triangular(a, b, trans=0, lower=False, unit_diagonal=False, overwrite_b=False, debug=None, check_finite=True):
|
|
32
33
|
"""
|