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/parallel/shard.py
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
# ============================================================================
|
|
15
|
-
"""shard"""
|
|
15
|
+
"""pynative shard"""
|
|
16
16
|
|
|
17
17
|
import copy
|
|
18
18
|
import mindspore as ms
|
|
@@ -33,9 +33,6 @@ class Layout():
|
|
|
33
33
|
Args:
|
|
34
34
|
device_matrix (tuple): Describe the shape of devices arrangement, its element type is int.
|
|
35
35
|
alias_name (tuple): The alias name for each axis of device_matrix, its length shoits element type is string.
|
|
36
|
-
When using "interleaved_parallel" as an alias name, the tensor would be split into multiple
|
|
37
|
-
copies on the corresponding partition dimension on a single card. The corresponding value
|
|
38
|
-
of "interleaved_parallel" in device_matrix must be 2.
|
|
39
36
|
|
|
40
37
|
Raises:
|
|
41
38
|
TypeError: `device_matrix` is not a tuple type.
|
|
@@ -53,9 +50,6 @@ class Layout():
|
|
|
53
50
|
>>> layout0 = layout("dp", "mp")
|
|
54
51
|
>>> print(layout0.to_dict())
|
|
55
52
|
{"device_matrix": (2, 2, 2), "tensor_map": (2, 0)}
|
|
56
|
-
>>> # Total device num is 4, but split the tensor in local device into two copies.
|
|
57
|
-
>>> layout = Layout((2, 2, 2), ("dp", "sp", "interleaved_parallel"))
|
|
58
|
-
>>> layout1 = layout(("dp", "interleaved_parallel"), "sp")
|
|
59
53
|
"""
|
|
60
54
|
|
|
61
55
|
def __init__(self, device_matrix, alias_name):
|
|
@@ -77,13 +71,6 @@ class Layout():
|
|
|
77
71
|
raise ValueError(f"The element of alias_name can not set 'None', because 'None' means no sharding.")
|
|
78
72
|
if len(set(alias_name)) != len(alias_name):
|
|
79
73
|
raise ValueError(f'Each element of alias_name {alias_name} should be different')
|
|
80
|
-
inter_key = "interleaved_parallel"
|
|
81
|
-
if inter_key in alias_name and alias_name.index(inter_key) != len(alias_name) - 1:
|
|
82
|
-
raise ValueError(f"When alias_name {alias_name} contains keyword 'interleaved_parallel',"
|
|
83
|
-
f" it should be at the last dim of alias_name, which means the virtual sharding.")
|
|
84
|
-
if inter_key in alias_name and device_matrix[alias_name.index(inter_key)] != 2:
|
|
85
|
-
raise ValueError(f"When alias_name {alias_name} contains keyword 'interleaved_parallel',"
|
|
86
|
-
f" the corresponding dim of device_matrix should be 2.")
|
|
87
74
|
self._device_shape = device_matrix
|
|
88
75
|
self._alias_name = alias_name
|
|
89
76
|
self._tensor_map = None
|
|
@@ -125,9 +112,7 @@ class Layout():
|
|
|
125
112
|
raise ValueError("The device_shape of layout is None")
|
|
126
113
|
if self._tensor_map is None:
|
|
127
114
|
raise ValueError("The tensor_map of layout is None")
|
|
128
|
-
|
|
129
|
-
return {"device_matrix": self._device_shape, "tensor_map": self._tensor_map,
|
|
130
|
-
"interleaved_parallel": interleaved_parallel}
|
|
115
|
+
return {"device_matrix": self._device_shape, "tensor_map": self._tensor_map}
|
|
131
116
|
|
|
132
117
|
|
|
133
118
|
|
|
@@ -146,17 +131,16 @@ class Shard(Shard_):
|
|
|
146
131
|
self.level = None
|
|
147
132
|
|
|
148
133
|
def __call__(self, fn, in_strategy, out_strategy=None, parameter_plan=None, device="Ascend", level=0):
|
|
149
|
-
|
|
150
|
-
|
|
134
|
+
if ms.context.get_context("mode") != ms.context.PYNATIVE_MODE or \
|
|
135
|
+
ms.context.get_auto_parallel_context("parallel_mode") not in ["auto_parallel"]:
|
|
151
136
|
raise AssertionError(
|
|
152
|
-
f"Cell shard only supports auto parallel
|
|
137
|
+
f"Cell shard only supports auto parallel under PyNative mode.")
|
|
153
138
|
if ms.context.get_context("device_target") not in ["Ascend", "GPU"]:
|
|
154
139
|
raise AssertionError(
|
|
155
140
|
f"'Shard' now only supports 'Ascend' and 'GPU'")
|
|
156
|
-
if
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
f"'parallel_mode' is 'auto_parallel.'")
|
|
141
|
+
if ms.context.get_auto_parallel_context("search_mode") != "sharding_propagation":
|
|
142
|
+
raise AssertionError(
|
|
143
|
+
f"'search_mode' must be 'sharding_propagation' for 'Shard'")
|
|
160
144
|
if not isinstance(in_strategy, tuple):
|
|
161
145
|
raise TypeError(
|
|
162
146
|
f"For 'Shard', the 'in_strategy' should be a tuple, but got {type(in_strategy).__name__}")
|
|
@@ -269,9 +253,8 @@ class Shard(Shard_):
|
|
|
269
253
|
def shard(fn, in_strategy, out_strategy=None, parameter_plan=None, device="Ascend", level=0):
|
|
270
254
|
"""
|
|
271
255
|
Defining the input and output layouts of this cell and the parallel strategies of remaining ops will be
|
|
272
|
-
generated by sharding propagation. In PyNative mode, use this method
|
|
273
|
-
|
|
274
|
-
strategy for others will be set by sharding propagation.
|
|
256
|
+
generated by sharding propagation. In PyNative mode, use this method
|
|
257
|
+
to specify a Cell for distributed execution in graph mode.
|
|
275
258
|
in_strategy and out_strategy define the input and output layout respectively.
|
|
276
259
|
in_strategy/out_strategy should be a tuple, each element of which corresponds to the desired layout of
|
|
277
260
|
this input/output, and None represents data_parallel,
|
|
@@ -279,8 +262,9 @@ def shard(fn, in_strategy, out_strategy=None, parameter_plan=None, device="Ascen
|
|
|
279
262
|
The parallel strategies of remaining operators are derived from the strategy specified by the input and output.
|
|
280
263
|
|
|
281
264
|
Note:
|
|
282
|
-
|
|
283
|
-
|
|
265
|
+
You need to set the execution mode to PyNative mode,
|
|
266
|
+
set the parallel mode in `set_auto_parallel_context` (parallel_mode) to "auto_parallel"
|
|
267
|
+
and the search mode (search_mode) to "sharding_propagation".
|
|
284
268
|
If the input contain Parameter, its strategy should be set in `in_strategy`.
|
|
285
269
|
|
|
286
270
|
Args:
|
|
@@ -310,7 +294,9 @@ def shard(fn, in_strategy, out_strategy=None, parameter_plan=None, device="Ascen
|
|
|
310
294
|
Function, return the function that will be executed under auto parallel process.
|
|
311
295
|
|
|
312
296
|
Raises:
|
|
313
|
-
AssertionError: If
|
|
297
|
+
AssertionError: If execute mode is not PYNATIVE_MODE.
|
|
298
|
+
AssertionError: If parallel mode is not "auto_parallel".
|
|
299
|
+
AssertionError: If search_mode it not "sharding_propagation".
|
|
314
300
|
AssertionError: If device_target it not "Ascend" or "GPU".
|
|
315
301
|
TypeError: If `in_strategy` is not a tuple.
|
|
316
302
|
TypeError: If `out_strategy` is not a tuple or None.
|
|
@@ -342,7 +328,7 @@ def shard(fn, in_strategy, out_strategy=None, parameter_plan=None, device="Ascen
|
|
|
342
328
|
|
|
343
329
|
Tutorial Examples:
|
|
344
330
|
- `Functional Operator Sharding
|
|
345
|
-
<https://www.mindspore.cn/tutorials/experts/en/master/parallel/
|
|
331
|
+
<https://www.mindspore.cn/tutorials/experts/en/master/parallel/pynative_shard_function_parallel.html>`_
|
|
346
332
|
"""
|
|
347
333
|
if not isinstance(fn, (ms.nn.Cell)):
|
|
348
334
|
logger.warning("'fn' is not a mindspore.nn.Cell, and its definition cannot involve Parameter; "
|
mindspore/profiler/__init__.py
CHANGED
|
@@ -20,8 +20,7 @@ Users can visualize the results using the MindInsight tool.
|
|
|
20
20
|
Now, Profiler supports AICORE operator, AICPU operator, HostCPU operator, memory,
|
|
21
21
|
correspondence, cluster, etc data analysis.
|
|
22
22
|
"""
|
|
23
|
-
__all__ = ["Profiler", "EnvProfiler", "ProfilerLevel"]
|
|
24
|
-
|
|
25
23
|
from mindspore.profiler.profiling import Profiler
|
|
26
24
|
from mindspore.profiler.envprofiling import EnvProfiler
|
|
27
|
-
|
|
25
|
+
|
|
26
|
+
__all__ = ["Profiler", "EnvProfiler"]
|
|
@@ -21,7 +21,6 @@ import os
|
|
|
21
21
|
|
|
22
22
|
# one sys count takes 10 ns, 1 ms has 100000 system count
|
|
23
23
|
import re
|
|
24
|
-
import shutil
|
|
25
24
|
import stat
|
|
26
25
|
|
|
27
26
|
from mindspore import log as logger
|
|
@@ -321,11 +320,11 @@ def combine_stream_task_id(stream_id, task_id):
|
|
|
321
320
|
|
|
322
321
|
|
|
323
322
|
def get_newest_file(file_list):
|
|
324
|
-
|
|
323
|
+
'''
|
|
325
324
|
Find the newest files
|
|
326
325
|
:param file_list:
|
|
327
326
|
:return:
|
|
328
|
-
|
|
327
|
+
'''
|
|
329
328
|
newest_file_list = []
|
|
330
329
|
newest_timestamp = '0'
|
|
331
330
|
for file_path in file_list:
|
|
@@ -338,107 +337,3 @@ def get_newest_file(file_list):
|
|
|
338
337
|
|
|
339
338
|
newest_file_list.sort()
|
|
340
339
|
return newest_file_list
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
class ProfilerPathManager:
|
|
344
|
-
"""A path manager to manage profiler path"""
|
|
345
|
-
|
|
346
|
-
FRAMEWORK_DIR = "FRAMEWORK"
|
|
347
|
-
INVALID_VALUE = -1
|
|
348
|
-
|
|
349
|
-
@classmethod
|
|
350
|
-
def get_fwk_path(cls, profiler_path: str) -> str:
|
|
351
|
-
"""Get FRAMEWORK directory path"""
|
|
352
|
-
fwk_path = os.path.join(profiler_path, cls.FRAMEWORK_DIR)
|
|
353
|
-
if os.path.isdir(fwk_path):
|
|
354
|
-
return fwk_path
|
|
355
|
-
return ""
|
|
356
|
-
|
|
357
|
-
@classmethod
|
|
358
|
-
def get_cann_path(cls, profiler_path: str) -> str:
|
|
359
|
-
"""Get CANN Prof directory path"""
|
|
360
|
-
sub_dirs = os.listdir(os.path.realpath(profiler_path))
|
|
361
|
-
for sub_dir in sub_dirs:
|
|
362
|
-
sub_path = os.path.join(profiler_path, sub_dir)
|
|
363
|
-
if os.path.isdir(sub_path) and re.match(r"^PROF_\d+_\d+_[0-9a-zA-Z]+", sub_dir):
|
|
364
|
-
return sub_path
|
|
365
|
-
return ""
|
|
366
|
-
|
|
367
|
-
@classmethod
|
|
368
|
-
def get_host_path(cls, cann_path: str) -> str:
|
|
369
|
-
"""Get CANN Prof host directory path"""
|
|
370
|
-
host_path = os.path.join(cann_path, 'host')
|
|
371
|
-
if os.path.exists(host_path):
|
|
372
|
-
return host_path
|
|
373
|
-
return ""
|
|
374
|
-
|
|
375
|
-
@classmethod
|
|
376
|
-
def get_device_path(cls, cann_path: str) -> str:
|
|
377
|
-
"""Get CANN Prof device directory path"""
|
|
378
|
-
sub_dirs = os.listdir(os.path.realpath(cann_path))
|
|
379
|
-
for sub_dir in sub_dirs:
|
|
380
|
-
sub_path = os.path.join(cann_path, sub_dir)
|
|
381
|
-
if os.path.isdir(sub_path) and re.match(r"^device_\d", sub_dir):
|
|
382
|
-
return sub_path
|
|
383
|
-
return ""
|
|
384
|
-
|
|
385
|
-
@classmethod
|
|
386
|
-
def remove_path_safety(cls, path: str):
|
|
387
|
-
"""Remove directory"""
|
|
388
|
-
msg = f"Failed to remove path: {path}"
|
|
389
|
-
if os.path.islink(path):
|
|
390
|
-
raise RuntimeError(msg)
|
|
391
|
-
if not os.path.exists(path):
|
|
392
|
-
return
|
|
393
|
-
try:
|
|
394
|
-
shutil.rmtree(path)
|
|
395
|
-
except FileNotFoundError:
|
|
396
|
-
return
|
|
397
|
-
except Exception as err:
|
|
398
|
-
raise RuntimeError(msg) from err
|
|
399
|
-
|
|
400
|
-
@classmethod
|
|
401
|
-
def remove_file_safety(cls, file: str):
|
|
402
|
-
"""Remove file"""
|
|
403
|
-
msg = f"Failed to remove file: {file}"
|
|
404
|
-
if os.path.islink(file):
|
|
405
|
-
raise RuntimeError(msg)
|
|
406
|
-
if not os.path.exists(file):
|
|
407
|
-
return
|
|
408
|
-
try:
|
|
409
|
-
os.remove(file)
|
|
410
|
-
except FileExistsError:
|
|
411
|
-
return
|
|
412
|
-
except Exception as err:
|
|
413
|
-
raise RuntimeError(msg) from err
|
|
414
|
-
|
|
415
|
-
@classmethod
|
|
416
|
-
def simplify_data(cls, profiler_path: str, simplify_flag: bool):
|
|
417
|
-
"""Profiler simplify temporary data"""
|
|
418
|
-
cann_path = cls.get_cann_path(profiler_path)
|
|
419
|
-
device_path = cls.get_device_path(cann_path)
|
|
420
|
-
host_path = cls.get_host_path(cann_path)
|
|
421
|
-
rm_dirs = ['sqlite', 'summary', 'timeline'] if simplify_flag else ['sqlite']
|
|
422
|
-
for rm_dir in rm_dirs:
|
|
423
|
-
if device_path:
|
|
424
|
-
target_path = os.path.join(device_path, rm_dir)
|
|
425
|
-
cls.remove_path_safety(target_path)
|
|
426
|
-
if host_path:
|
|
427
|
-
target_path = os.path.join(host_path, rm_dir)
|
|
428
|
-
cls.remove_path_safety(target_path)
|
|
429
|
-
if simplify_flag:
|
|
430
|
-
fwk_path = cls.get_fwk_path(profiler_path)
|
|
431
|
-
cls.remove_path_safety(fwk_path)
|
|
432
|
-
if not cann_path:
|
|
433
|
-
return
|
|
434
|
-
cann_rm_dirs = ['analyze', 'mindstudio_profiler_log', 'mindstudio_profiler_output']
|
|
435
|
-
for cann_rm_dir in cann_rm_dirs:
|
|
436
|
-
target_path = os.path.join(cann_path, cann_rm_dir)
|
|
437
|
-
cls.remove_path_safety(target_path)
|
|
438
|
-
log_patten = r'msprof_anlysis_\d+\.log$'
|
|
439
|
-
for cann_file in os.listdir(cann_path):
|
|
440
|
-
file_path = os.path.join(cann_path, cann_file)
|
|
441
|
-
if not os.path.isfile(file_path):
|
|
442
|
-
continue
|
|
443
|
-
if re.match(log_patten, cann_file):
|
|
444
|
-
cls.remove_file_safety(file_path)
|
|
@@ -160,7 +160,7 @@ def parse_ascend_args(options):
|
|
|
160
160
|
if options.get("aicore_metrics") not in AICORE_METRICS_DICT:
|
|
161
161
|
logger.warning(
|
|
162
162
|
"The 'aicore_metrics' parameter of the environment variable MS_PROFILE_OPTIONS must be in "
|
|
163
|
-
f"[-1, 0, 1, 2, 3, 4, 5
|
|
163
|
+
f"[-1, 0, 1, 2, 3, 4, 5], but got {options.get('aicore_metrics')}, it will be set to 0.")
|
|
164
164
|
options["aicore_metrics"] = 0
|
|
165
165
|
if not isinstance(options.get("l2_cache"), bool):
|
|
166
166
|
logger.warning(
|
|
@@ -17,22 +17,26 @@
|
|
|
17
17
|
|
|
18
18
|
class Constant:
|
|
19
19
|
"""Constant values"""
|
|
20
|
+
INVALID_VALUE = -1
|
|
21
|
+
NULL_VALUE = 0
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
META_EVENT = 'M'
|
|
25
|
-
COMPLETE_EVENT = 'X'
|
|
26
|
-
FLOW_OP = "flow"
|
|
27
|
-
INVALID_FLOW_ID = 18446744073709551615
|
|
23
|
+
# dir name
|
|
24
|
+
FRAMEWORK_DIR = "FRAMEWORK"
|
|
25
|
+
OUTPUT_DIR = "ASCEND_PROFILER_OUTPUT"
|
|
28
26
|
|
|
29
27
|
# file authority
|
|
28
|
+
FILE_AUTHORITY = 0o640
|
|
29
|
+
DIR_AUTHORITY = 0o700
|
|
30
30
|
MAX_FILE_SIZE = 1024 * 1024 * 1024 * 10
|
|
31
31
|
MAX_CSV_SIZE = 1024 * 1024 * 1024 * 5
|
|
32
|
+
MAX_PATH_LENGTH = 4096
|
|
33
|
+
MAX_WORKER_NAME_LENGTH = 226
|
|
34
|
+
MAX_FILE_NAME_LENGTH = 255
|
|
35
|
+
PROF_WARN_SIZE = 1024 * 1024 * 1024
|
|
32
36
|
|
|
33
37
|
# tlv constant struct
|
|
34
38
|
FIX_SIZE_BYTES = "fix_size_bytes"
|
|
35
|
-
NS_TO_US =
|
|
39
|
+
NS_TO_US = 1000
|
|
36
40
|
|
|
37
41
|
# field name
|
|
38
42
|
SEQUENCE_UNMBER = "Sequence number"
|
|
@@ -51,3 +55,12 @@ class Constant:
|
|
|
51
55
|
PROCESS_SORT = "process_sort_index"
|
|
52
56
|
THREAD_NAME = "thread_name"
|
|
53
57
|
THREAD_SORT = "thread_sort_index"
|
|
58
|
+
FLOW_START_PH = "s"
|
|
59
|
+
FLOW_END_PH = "f"
|
|
60
|
+
|
|
61
|
+
ACL_OP_EXE_NAME = ("AscendCL@aclopCompileAndExecute".lower(), "AscendCL@aclopCompileAndExecuteV2".lower())
|
|
62
|
+
AI_CORE = "AI_CORE"
|
|
63
|
+
|
|
64
|
+
# profiler begin info
|
|
65
|
+
CANN_BEGIN_TIME = "collectionTimeBegin"
|
|
66
|
+
CANN_BEGIN_MONOTONIC = "clockMonotonicRaw"
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
# ============================================================================
|
|
15
15
|
"""Profiler file manager"""
|
|
16
|
-
import csv
|
|
17
16
|
import json
|
|
18
17
|
import os.path
|
|
19
18
|
from typing import List
|
|
@@ -76,84 +75,3 @@ class FileManager:
|
|
|
76
75
|
flags = os.O_WRONLY | os.O_CREAT
|
|
77
76
|
with os.fdopen(os.open(file_path, flags, cls.DATA_FILE_AUTHORITY), 'w') as fp:
|
|
78
77
|
json.dump(json_data, fp, ensure_ascii=False)
|
|
79
|
-
|
|
80
|
-
@classmethod
|
|
81
|
-
def read_csv_file(cls, file_path: str) -> list:
|
|
82
|
-
"""Read csv file and return list"""
|
|
83
|
-
if not os.path.isfile(file_path):
|
|
84
|
-
return []
|
|
85
|
-
file_size = os.path.getsize(file_path)
|
|
86
|
-
if file_size <= 0:
|
|
87
|
-
return []
|
|
88
|
-
if file_size > Constant.MAX_CSV_SIZE:
|
|
89
|
-
msg = f"The file size exceeds the preset value, please check the file: {file_path}"
|
|
90
|
-
logger.warning(msg)
|
|
91
|
-
return []
|
|
92
|
-
result_data = []
|
|
93
|
-
try:
|
|
94
|
-
with open(file_path, newline="") as csv_file:
|
|
95
|
-
reader = csv.reader(csv_file)
|
|
96
|
-
for row in reader:
|
|
97
|
-
result_data.append(row)
|
|
98
|
-
except Exception as err:
|
|
99
|
-
raise RuntimeError(f"Failed to read the file: {file_path}") from err
|
|
100
|
-
return result_data
|
|
101
|
-
|
|
102
|
-
@classmethod
|
|
103
|
-
def create_csv_file(cls, file_path: str, data: list, headers: list = None) -> None:
|
|
104
|
-
"""Create csv file and write the data"""
|
|
105
|
-
if not data:
|
|
106
|
-
return
|
|
107
|
-
try:
|
|
108
|
-
with os.fdopen(os.open(file_path, os.O_WRONLY | os.O_CREAT, 0o600),
|
|
109
|
-
'w', newline="") as file:
|
|
110
|
-
writer = csv.writer(file)
|
|
111
|
-
if headers:
|
|
112
|
-
writer.writerow(headers)
|
|
113
|
-
writer.writerows(data)
|
|
114
|
-
except Exception as err:
|
|
115
|
-
raise RuntimeError(f"Can't create file: {file_path}") from err
|
|
116
|
-
|
|
117
|
-
@classmethod
|
|
118
|
-
def combine_csv_file(cls, source_file_list: list, target_file_path: str, header_map: dict = None):
|
|
119
|
-
"""Merge multiple CSV files into one"""
|
|
120
|
-
headers, all_data = [], []
|
|
121
|
-
for source_file in source_file_list:
|
|
122
|
-
data = cls.read_csv_file(source_file)
|
|
123
|
-
if len(data) > 1:
|
|
124
|
-
headers = data[0]
|
|
125
|
-
all_data.extend(data[1:])
|
|
126
|
-
if all_data:
|
|
127
|
-
if isinstance(header_map, dict):
|
|
128
|
-
headers = [header_map.get(header, header) for header in headers]
|
|
129
|
-
FileManager.create_csv_file(target_file_path, all_data, headers)
|
|
130
|
-
|
|
131
|
-
@classmethod
|
|
132
|
-
def get_csv_file_list_by_start_name(cls, source_path: str, start_name: str):
|
|
133
|
-
"""Get all the csv files that match the name"""
|
|
134
|
-
file_list = []
|
|
135
|
-
for file_name in os.listdir(source_path):
|
|
136
|
-
if file_name.startswith(start_name) and file_name.endswith(".csv"):
|
|
137
|
-
file_list.append(os.path.join(source_path, file_name))
|
|
138
|
-
return file_list
|
|
139
|
-
|
|
140
|
-
@classmethod
|
|
141
|
-
def read_txt_file(cls, file_path: str) -> list:
|
|
142
|
-
"""Read txt file and return list"""
|
|
143
|
-
if not os.path.isfile(file_path):
|
|
144
|
-
return []
|
|
145
|
-
file_size = os.path.getsize(file_path)
|
|
146
|
-
if file_size <= 0:
|
|
147
|
-
return []
|
|
148
|
-
if file_size > Constant.MAX_FILE_SIZE:
|
|
149
|
-
msg = f"The file size exceeds the preset value, please check the file: {file_path}"
|
|
150
|
-
logger.warning(msg)
|
|
151
|
-
return []
|
|
152
|
-
result_data = []
|
|
153
|
-
try:
|
|
154
|
-
with open(file_path, "r") as file:
|
|
155
|
-
for line in file.readlines():
|
|
156
|
-
result_data.append(line.strip().split(","))
|
|
157
|
-
except Exception as err:
|
|
158
|
-
raise RuntimeError(f"Failed to read the file: {file_path}") from err
|
|
159
|
-
return result_data
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
# ============================================================================
|
|
15
15
|
"""Function event data struct."""
|
|
16
|
-
from typing import Dict, Optional
|
|
16
|
+
from typing import Dict, Optional, List
|
|
17
17
|
from enum import Enum
|
|
18
18
|
from decimal import Decimal
|
|
19
19
|
import struct
|
|
@@ -26,6 +26,10 @@ from mindspore.profiler.parser.ascend_analysis.profiler_info_parser import Profi
|
|
|
26
26
|
class BaseEvent(ABC):
|
|
27
27
|
"""Base class of CANNEvent and MindSporeOpEvent"""
|
|
28
28
|
|
|
29
|
+
HOST_TO_DEVICE = "HostToDevice"
|
|
30
|
+
START_FLOW = "s"
|
|
31
|
+
END_FLOW = "f"
|
|
32
|
+
|
|
29
33
|
def __init__(self, data: Dict):
|
|
30
34
|
if not isinstance(data, dict):
|
|
31
35
|
raise TypeError("Input data must be dict.")
|
|
@@ -39,6 +43,7 @@ class BaseEvent(ABC):
|
|
|
39
43
|
self.dur: float = 0.0
|
|
40
44
|
self.args: Dict = {}
|
|
41
45
|
self.parent: Optional[BaseEvent] = None
|
|
46
|
+
self.children: List[BaseEvent] = []
|
|
42
47
|
self._init_params()
|
|
43
48
|
|
|
44
49
|
@abstractmethod
|
|
@@ -50,6 +55,15 @@ class BaseEvent(ABC):
|
|
|
50
55
|
class CANNEvent(BaseEvent):
|
|
51
56
|
"""Function event collected on the CANN side"""
|
|
52
57
|
|
|
58
|
+
def __init__(self, data: Dict):
|
|
59
|
+
self.unique_id = ""
|
|
60
|
+
self.is_ai_core = False
|
|
61
|
+
super().__init__(data)
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def is_comm_op(self):
|
|
65
|
+
return self.name.startswith("hcom_")
|
|
66
|
+
|
|
53
67
|
def _init_params(self):
|
|
54
68
|
"""Initialize the attribute value of CANNEvent."""
|
|
55
69
|
self.ts = Decimal(str(self._orig_data.get("ts", 0)))
|
|
@@ -60,54 +74,25 @@ class CANNEvent(BaseEvent):
|
|
|
60
74
|
self.name = self._orig_data.get("name", "")
|
|
61
75
|
self.id = self._orig_data.get("id", 0)
|
|
62
76
|
self.args = self._orig_data.get("args", {})
|
|
63
|
-
self.
|
|
64
|
-
self.
|
|
77
|
+
self.unique_id = f"{self.pid}-{self.tid}-{str(self.ts)}"
|
|
78
|
+
self.is_ai_core = self.args.get("Task Type") == Constant.AI_CORE
|
|
65
79
|
|
|
66
80
|
def is_flow_start_event(self) -> bool:
|
|
67
81
|
"""Determine whether the event is flow start event or not."""
|
|
68
|
-
return self._orig_data.get("cat") ==
|
|
69
|
-
|
|
82
|
+
return self._orig_data.get("cat") == self.HOST_TO_DEVICE and \
|
|
83
|
+
self._orig_data.get("ph") == self.START_FLOW
|
|
70
84
|
|
|
71
85
|
def is_flow_end_event(self) -> bool:
|
|
72
86
|
"""Determine whether the event is flow end event or not."""
|
|
73
|
-
return self._orig_data.get("cat") ==
|
|
74
|
-
|
|
87
|
+
return self._orig_data.get("cat") == self.HOST_TO_DEVICE and \
|
|
88
|
+
self._orig_data.get("ph") == self.END_FLOW
|
|
75
89
|
|
|
76
90
|
def is_x_event(self) -> bool:
|
|
77
91
|
"""Determine whether the event x event or not."""
|
|
78
92
|
return self._orig_data.get("ph") == "X"
|
|
79
93
|
|
|
80
|
-
def to_json(self):
|
|
81
|
-
"""Cast to trace event."""
|
|
82
|
-
if self.ph == Constant.META_EVENT:
|
|
83
|
-
res = {'name': self.name, 'pid': self.pid, 'tid': self.tid,
|
|
84
|
-
'args': self.args, 'ph': self.ph}
|
|
85
|
-
if self.cat:
|
|
86
|
-
res.update({'cat': self.cat})
|
|
87
|
-
return res
|
|
88
|
-
|
|
89
|
-
if self.ph == Constant.COMPLETE_EVENT:
|
|
90
|
-
if self.parent is not None:
|
|
91
|
-
self.args.update({'mindspore_op': self.parent.name})
|
|
92
|
-
res = {'name': self.name, 'pid': self.pid, 'tid': self.tid,
|
|
93
|
-
'ts': str(self.ts), 'dur': self.dur, 'args': self.args, 'ph': self.ph}
|
|
94
|
-
if self.cat:
|
|
95
|
-
res.update({'cat': self.cat})
|
|
96
|
-
return res
|
|
97
|
-
|
|
98
|
-
if self.ph == Constant.START_FLOW:
|
|
99
|
-
return {"ph": self.ph, "name": self.name, "id": self.id, "pid": self.pid,
|
|
100
|
-
"tid": self.tid, "ts": str(self.ts), "cat": self.cat}
|
|
101
|
-
|
|
102
|
-
if self.ph == Constant.END_FLOW:
|
|
103
|
-
return {"ph": self.ph, "name": self.name, "id": self.id, "pid": self.pid,
|
|
104
|
-
"tid": self.tid, "ts": str(self.ts), "cat": self.cat, 'bp': "e"}
|
|
105
|
-
return {'name': self.name, 'pid': self.pid, 'tid': self.tid,
|
|
106
|
-
'ts': str(self.ts), 'args': self.args, 'ph': self.ph}
|
|
107
|
-
|
|
108
94
|
|
|
109
95
|
class MindSporeOpEnum(Enum):
|
|
110
|
-
"""MindSporeOp index enum"""
|
|
111
96
|
START_NS = 0
|
|
112
97
|
END_NS = 1
|
|
113
98
|
SEQUENCE_UNMBER = 2
|
|
@@ -115,9 +100,7 @@ class MindSporeOpEnum(Enum):
|
|
|
115
100
|
START_THREAD_ID = 4
|
|
116
101
|
END_THREAD_ID = 5
|
|
117
102
|
FORWORD_THREAD_ID = 6
|
|
118
|
-
|
|
119
|
-
STEP_ID = 8
|
|
120
|
-
IS_ASYNC = 9
|
|
103
|
+
IS_ASYNC = 7
|
|
121
104
|
|
|
122
105
|
|
|
123
106
|
class MindSporeOpEvent(BaseEvent):
|
|
@@ -131,7 +114,11 @@ class MindSporeOpEvent(BaseEvent):
|
|
|
131
114
|
Constant.OP_NAME: 3, Constant.INPUT_SHAPES: 5, Constant.INPUT_DTYPES: 4,
|
|
132
115
|
Constant.CALL_STACK: 6, Constant.MODULE_HIERARCHY: 7, Constant.FLOPS: 8
|
|
133
116
|
}
|
|
134
|
-
_fix_data_format = "<
|
|
117
|
+
_fix_data_format = "<3q4Q?"
|
|
118
|
+
|
|
119
|
+
def __init__(self, data: Dict):
|
|
120
|
+
self.is_mindspore_op = True
|
|
121
|
+
super().__init__(data)
|
|
135
122
|
|
|
136
123
|
def _init_params(self):
|
|
137
124
|
"""Initialize the attribute value of MindSporeOpEvent."""
|
|
@@ -142,8 +129,6 @@ class MindSporeOpEvent(BaseEvent):
|
|
|
142
129
|
self.ts = ProfilerInfoParser.get_local_time(fix_size_data[MindSporeOpEnum.START_NS.value])
|
|
143
130
|
self.end_us = ProfilerInfoParser.get_local_time(fix_size_data[MindSporeOpEnum.END_NS.value])
|
|
144
131
|
self.dur = self.end_us - self.ts
|
|
145
|
-
self.flow_id = int(fix_size_data[MindSporeOpEnum.FLOW_ID.value])
|
|
146
|
-
self.step = int(fix_size_data[MindSporeOpEnum.STEP_ID.value])
|
|
147
132
|
self.args = self.__get_args(fix_size_data)
|
|
148
133
|
|
|
149
134
|
def __get_args(self, fix_size_data) -> Dict:
|
|
@@ -155,7 +140,7 @@ class MindSporeOpEvent(BaseEvent):
|
|
|
155
140
|
if type_name == Constant.OP_NAME or type_id not in self._orig_data.keys():
|
|
156
141
|
continue
|
|
157
142
|
if type_name in set([Constant.INPUT_SHAPES, Constant.INPUT_DTYPES, Constant.CALL_STACK]):
|
|
158
|
-
args[type_name] = self._orig_data.get(type_id).replace("
|
|
143
|
+
args[type_name] = self._orig_data.get(type_id).replace(";", ";\r\n")
|
|
159
144
|
else:
|
|
160
145
|
args[type_name] = self._orig_data.get(type_id)
|
|
161
146
|
return args
|