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
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2024 Huawei Technologies Co., Ltd
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
#ifndef _PROFILING_UTIL_H_
|
|
18
|
-
#define _PROFILING_UTIL_H_
|
|
19
|
-
|
|
20
|
-
#include <string>
|
|
21
|
-
#include <vector>
|
|
22
|
-
#include <map>
|
|
23
|
-
#include "include/types.h"
|
|
24
|
-
|
|
25
|
-
namespace mindspore {
|
|
26
|
-
namespace internal {
|
|
27
|
-
// rts_msprof
|
|
28
|
-
#if defined(__cplusplus)
|
|
29
|
-
extern "C" {
|
|
30
|
-
#endif
|
|
31
|
-
#if (defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER))
|
|
32
|
-
#define MSVP_PROF_API __declspec(dllexport)
|
|
33
|
-
#else
|
|
34
|
-
#define MSVP_PROF_API __attribute__((visibility("default")))
|
|
35
|
-
#endif
|
|
36
|
-
#define MSPROF_REPORT_DATA_MAGIC_NUM 0x5A5AU
|
|
37
|
-
#define MSPROF_TASK_TIME_L0 0x00000800ULL // mean PROF_TASK_TIME
|
|
38
|
-
#define MSPROF_EVENT_FLAG 0xFFFFFFFFFFFFFFFFULL
|
|
39
|
-
typedef void *VOID_PTR;
|
|
40
|
-
typedef int32_t (*ProfCommandHandle)(uint32_t type, VOID_PTR data, uint32_t len);
|
|
41
|
-
typedef int32_t (*MsprofReportHandle)(uint32_t moduleId, uint32_t type, VOID_PTR data, uint32_t len);
|
|
42
|
-
typedef int32_t (*MsprofCtrlHandle)(uint32_t type, VOID_PTR data, uint32_t len);
|
|
43
|
-
typedef int32_t (*MsprofSetDeviceHandle)(VOID_PTR data, uint32_t len);
|
|
44
|
-
typedef int32_t (*AicpuStartFunc)();
|
|
45
|
-
|
|
46
|
-
/* Msprof report level */
|
|
47
|
-
#define MSPROF_REPORT_PYTORCH_LEVEL 30000U
|
|
48
|
-
#define MSPROF_REPORT_PTA_LEVEL 25000U
|
|
49
|
-
#define MSPROF_REPORT_ACL_LEVEL 20000U
|
|
50
|
-
#define MSPROF_REPORT_MODEL_LEVEL 15000U
|
|
51
|
-
#define MSPROF_REPORT_NODE_LEVEL 10000U
|
|
52
|
-
#define MSPROF_REPORT_AICPU_LEVEL 6000U
|
|
53
|
-
#define MSPROF_REPORT_HCCL_NODE_LEVEL 5500U
|
|
54
|
-
#define MSPROF_REPORT_RUNTIME_LEVEL 5000U
|
|
55
|
-
|
|
56
|
-
/* Msprof report type of acl(20000) level(acl), offset: 0x000000 */
|
|
57
|
-
#define MSPROF_REPORT_ACL_OP_BASE_TYPE 0x010000U
|
|
58
|
-
#define MSPROF_REPORT_ACL_MODEL_BASE_TYPE 0x020000U
|
|
59
|
-
#define MSPROF_REPORT_ACL_RUNTIME_BASE_TYPE 0x030000U
|
|
60
|
-
#define MSPROF_REPORT_ACL_OTHERS_BASE_TYPE 0x040000U
|
|
61
|
-
|
|
62
|
-
/* Msprof report type of acl(20000) level(host api), offset: 0x050000 */
|
|
63
|
-
#define MSPROF_REPORT_ACL_NN_BASE_TYPE 0x050000U
|
|
64
|
-
#define MSPROF_REPORT_ACL_ASCENDC_TYPE 0x060000U
|
|
65
|
-
#define MSPROF_REPORT_ACL_HOST_HCCL_BASE_TYPE 0x070000U
|
|
66
|
-
#define MSPROF_REPORT_ACL_DVPP_BASE_TYPE 0x090000U
|
|
67
|
-
#define MSPROF_REPORT_ACL_GRAPH_BASE_TYPE 0x0A0000U
|
|
68
|
-
|
|
69
|
-
/* Msprof report type of model(15000) level, offset: 0x000000 */
|
|
70
|
-
#define MSPROF_REPORT_MODEL_GRAPH_ID_MAP_TYPE 0U /* type info: graph_id_map */
|
|
71
|
-
#define MSPROF_REPORT_MODEL_EXECUTE_TYPE 1U /* type info: execute */
|
|
72
|
-
#define MSPROF_REPORT_MODEL_LOAD_TYPE 2U /* type info: load */
|
|
73
|
-
#define MSPROF_REPORT_MODEL_INPUT_COPY_TYPE 3U /* type info: IntputCopy */
|
|
74
|
-
#define MSPROF_REPORT_MODEL_OUTPUT_COPY_TYPE 4U /* type info: OutputCopy */
|
|
75
|
-
#define MSPROF_REPORT_MODEL_LOGIC_STREAM_TYPE 7U /* type info: logic_stream_info */
|
|
76
|
-
#define MSPROF_REPORT_MODEL_EXEOM_TYPE 8U /* type info: exeom */
|
|
77
|
-
#define MSPROF_REPORT_MODEL_UDF_BASE_TYPE 0x010000U /* type info: udf_info */
|
|
78
|
-
#define MSPROF_REPORT_MODEL_AICPU_BASE_TYPE 0x020000U /* type info: aicpu */
|
|
79
|
-
|
|
80
|
-
/* Msprof report type of node(10000) level, offset: 0x000000 */
|
|
81
|
-
#define MSPROF_REPORT_NODE_BASIC_INFO_TYPE 0U /* type info: node_basic_info */
|
|
82
|
-
#define MSPROF_REPORT_NODE_TENSOR_INFO_TYPE 1U /* type info: tensor_info */
|
|
83
|
-
#define MSPROF_REPORT_NODE_FUSION_OP_INFO_TYPE 2U /* type info: funsion_op_info */
|
|
84
|
-
#define MSPROF_REPORT_NODE_CONTEXT_ID_INFO_TYPE 4U /* type info: context_id_info */
|
|
85
|
-
#define MSPROF_REPORT_NODE_LAUNCH_TYPE 5U /* type info: launch */
|
|
86
|
-
#define MSPROF_REPORT_NODE_TASK_MEMORY_TYPE 6U /* type info: task_memory_info */
|
|
87
|
-
#define MSPROF_REPORT_NODE_HOST_OP_EXEC_TYPE 8U /* type info: op exec */
|
|
88
|
-
#define MSPROF_REPORT_NODE_ATTR_INFO_TYPE 9U /* type info: node_attr_info */
|
|
89
|
-
|
|
90
|
-
#define MSPROF_GE_TENSOR_DATA_RESERVE_BYTES 8
|
|
91
|
-
#define MSPROF_GE_TENSOR_DATA_SHAPE_LEN 8
|
|
92
|
-
#define MSPROF_GE_TENSOR_DATA_NUM 5
|
|
93
|
-
|
|
94
|
-
enum MsprofErrorCode {
|
|
95
|
-
MSPROF_ERROR_NONE = 0,
|
|
96
|
-
MSPROF_ERROR_MEM_NOT_ENOUGH,
|
|
97
|
-
MSPROF_ERROR_GET_ENV,
|
|
98
|
-
MSPROF_ERROR_CONFIG_INVALID,
|
|
99
|
-
MSPROF_ERROR_ACL_JSON_OFF,
|
|
100
|
-
MSPROF_ERROR,
|
|
101
|
-
MSPROF_ERROR_UNINITIALIZE,
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
enum MsprofGeTensorType {
|
|
105
|
-
MSPROF_GE_TENSOR_TYPE_INPUT = 0,
|
|
106
|
-
MSPROF_GE_TENSOR_TYPE_OUTPUT,
|
|
107
|
-
};
|
|
108
|
-
const uint32_t MSPROF_DIFFERENCE = 200;
|
|
109
|
-
|
|
110
|
-
#pragma pack(1)
|
|
111
|
-
struct MsprofNodeBasicInfo {
|
|
112
|
-
uint64_t opName;
|
|
113
|
-
uint32_t taskType;
|
|
114
|
-
uint64_t opType;
|
|
115
|
-
uint32_t blockDim;
|
|
116
|
-
uint32_t opFlag;
|
|
117
|
-
};
|
|
118
|
-
struct MsrofTensorData {
|
|
119
|
-
uint32_t tensorType;
|
|
120
|
-
uint32_t format;
|
|
121
|
-
uint32_t dataType;
|
|
122
|
-
uint32_t shape[MSPROF_GE_TENSOR_DATA_SHAPE_LEN];
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
struct MsprofTensorInfo {
|
|
126
|
-
uint64_t opName;
|
|
127
|
-
uint32_t tensorNum;
|
|
128
|
-
struct MsrofTensorData tensorData[MSPROF_GE_TENSOR_DATA_NUM];
|
|
129
|
-
};
|
|
130
|
-
#pragma pack()
|
|
131
|
-
|
|
132
|
-
struct MsprofApi { // for MsprofReportApi
|
|
133
|
-
#ifdef __cplusplus
|
|
134
|
-
uint16_t magicNumber = MSPROF_REPORT_DATA_MAGIC_NUM;
|
|
135
|
-
#else
|
|
136
|
-
uint16_t magicNumber;
|
|
137
|
-
#endif
|
|
138
|
-
uint16_t level;
|
|
139
|
-
uint32_t type;
|
|
140
|
-
uint32_t threadId;
|
|
141
|
-
uint32_t reserve;
|
|
142
|
-
uint64_t beginTime;
|
|
143
|
-
uint64_t endTime;
|
|
144
|
-
uint64_t itemId;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
struct MsprofEvent { // for MsprofReportEvent
|
|
148
|
-
#ifdef __cplusplus
|
|
149
|
-
uint16_t magicNumber = MSPROF_REPORT_DATA_MAGIC_NUM;
|
|
150
|
-
#else
|
|
151
|
-
uint16_t magicNumber;
|
|
152
|
-
#endif
|
|
153
|
-
uint16_t level;
|
|
154
|
-
uint32_t type;
|
|
155
|
-
uint32_t threadId;
|
|
156
|
-
uint32_t requestId; // 0xFFFF means single event
|
|
157
|
-
uint64_t timeStamp;
|
|
158
|
-
#ifdef __cplusplus
|
|
159
|
-
uint64_t eventFlag = MSPROF_EVENT_FLAG;
|
|
160
|
-
#else
|
|
161
|
-
uint64_t eventFlag;
|
|
162
|
-
#endif
|
|
163
|
-
uint64_t itemId;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
struct MsprofRuntimeTrack { // for MsprofReportCompactInfo buffer data
|
|
167
|
-
uint16_t deviceId;
|
|
168
|
-
uint16_t streamId;
|
|
169
|
-
uint32_t taskId;
|
|
170
|
-
uint64_t taskType; // task message hash id
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
#define MSPROF_COMPACT_INFO_DATA_LENGTH (40)
|
|
174
|
-
struct MsprofCompactInfo { // for MsprofReportCompactInfo buffer data
|
|
175
|
-
#ifdef __cplusplus
|
|
176
|
-
uint16_t magicNumber = MSPROF_REPORT_DATA_MAGIC_NUM;
|
|
177
|
-
#else
|
|
178
|
-
uint16_t magicNumber;
|
|
179
|
-
#endif
|
|
180
|
-
uint16_t level;
|
|
181
|
-
uint32_t type;
|
|
182
|
-
uint32_t threadId;
|
|
183
|
-
uint32_t dataLen;
|
|
184
|
-
uint64_t timeStamp;
|
|
185
|
-
union {
|
|
186
|
-
uint8_t info[MSPROF_COMPACT_INFO_DATA_LENGTH];
|
|
187
|
-
struct MsprofRuntimeTrack runtimeTrack;
|
|
188
|
-
struct MsprofNodeBasicInfo nodeBasicInfo;
|
|
189
|
-
} data;
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
#define MSPROF_ADDTIONAL_INFO_DATA_LENGTH (232)
|
|
193
|
-
struct MsprofAdditionalInfo { // for MsprofReportAdditionalInfo buffer data
|
|
194
|
-
#ifdef __cplusplus
|
|
195
|
-
uint16_t magicNumber = MSPROF_REPORT_DATA_MAGIC_NUM;
|
|
196
|
-
#else
|
|
197
|
-
uint16_t magicNumber;
|
|
198
|
-
#endif
|
|
199
|
-
uint16_t level;
|
|
200
|
-
uint32_t type;
|
|
201
|
-
uint32_t threadId;
|
|
202
|
-
uint32_t dataLen;
|
|
203
|
-
uint64_t timeStamp;
|
|
204
|
-
uint8_t data[MSPROF_ADDTIONAL_INFO_DATA_LENGTH];
|
|
205
|
-
};
|
|
206
|
-
#if defined(__cplusplus)
|
|
207
|
-
}
|
|
208
|
-
#endif
|
|
209
|
-
|
|
210
|
-
struct TensorInfoWrapper {
|
|
211
|
-
MsprofAdditionalInfo tensor_info;
|
|
212
|
-
uint64_t tensor_num;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
struct ProfNodeAdditionInfo {
|
|
216
|
-
MsprofCompactInfo node_basic_info;
|
|
217
|
-
std::vector<TensorInfoWrapper> tensor_info_wrappers;
|
|
218
|
-
MsprofApi api;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
// format
|
|
222
|
-
constexpr auto kOpFormat_DEFAULT = "DefaultFormat";
|
|
223
|
-
constexpr auto kOpFormat_ChannelFirst = "ChannelFirst";
|
|
224
|
-
constexpr auto kOpFormat_ChannelLast = "ChannelLast";
|
|
225
|
-
constexpr auto kOpFormat_NC1KHKWHWC0 = "NC1KHKWHWC0";
|
|
226
|
-
constexpr auto kOpFormat_ND = "ND";
|
|
227
|
-
constexpr auto kOpFormat_NCHW = "NCHW";
|
|
228
|
-
constexpr auto kOpFormat_NHWC = "NHWC";
|
|
229
|
-
constexpr auto kOpFormat_HWCN = "HWCN";
|
|
230
|
-
constexpr auto kOpFormat_CHWN = "CHWN";
|
|
231
|
-
constexpr auto kOpFormat_NC1HWC0 = "NC1HWC0";
|
|
232
|
-
constexpr auto kOpFormat_FRAC_Z = "FRACTAL_Z";
|
|
233
|
-
constexpr auto kOpFormat_FRACTAL_Z = "FRACTAL_Z";
|
|
234
|
-
constexpr auto kOpFormat_FRAC_NZ = "FRACTAL_NZ";
|
|
235
|
-
constexpr auto kOpFormat_C1HWNCoC0 = "C1HWNCoC0";
|
|
236
|
-
constexpr auto kOpFormat_NC1HWC0_C04 = "NC1HWC0_C04";
|
|
237
|
-
constexpr auto kOpFormat_FRACTAL_Z_C04 = "FRACTAL_Z_C04";
|
|
238
|
-
constexpr auto kOpFormat_NDHWC = "NDHWC";
|
|
239
|
-
constexpr auto kOpFormat_NCDHW = "NCDHW";
|
|
240
|
-
constexpr auto kOpFormat_DHWNC = "DHWNC";
|
|
241
|
-
constexpr auto kOpFormat_DHWCN = "DHWCN";
|
|
242
|
-
constexpr auto kOpFormat_NDC1HWC0 = "NDC1HWC0";
|
|
243
|
-
constexpr auto kOpFormat_FRACTAL_Z_3D = "FRACTAL_Z_3D";
|
|
244
|
-
constexpr auto kOpFormat_FRACTAL_ZN_LSTM = "FRACTAL_ZN_LSTM";
|
|
245
|
-
constexpr auto kOpFormat_FRACTAL_ZN_RNN = "FRACTAL_ZN_RNN";
|
|
246
|
-
constexpr auto kOpFormat_ND_RNN_BIAS = "ND_RNN_BIAS";
|
|
247
|
-
|
|
248
|
-
// 0 means unknown format
|
|
249
|
-
static std::map<std::string, uint32_t> OpFormat2Index{{kOpFormat_DEFAULT, 1},
|
|
250
|
-
{kOpFormat_NC1KHKWHWC0, 2},
|
|
251
|
-
{kOpFormat_ND, 3},
|
|
252
|
-
{kOpFormat_NCHW, 4},
|
|
253
|
-
{kOpFormat_NHWC, 5},
|
|
254
|
-
{kOpFormat_HWCN, 6},
|
|
255
|
-
{kOpFormat_NC1HWC0, 7},
|
|
256
|
-
{kOpFormat_FRAC_Z, 8},
|
|
257
|
-
{kOpFormat_C1HWNCoC0, 9},
|
|
258
|
-
{kOpFormat_FRAC_NZ, 10},
|
|
259
|
-
{kOpFormat_NC1HWC0_C04, 11},
|
|
260
|
-
{kOpFormat_FRACTAL_Z_C04, 12},
|
|
261
|
-
{kOpFormat_NDHWC, 13},
|
|
262
|
-
{kOpFormat_FRACTAL_ZN_LSTM, 14},
|
|
263
|
-
{kOpFormat_FRACTAL_ZN_RNN, 15},
|
|
264
|
-
{kOpFormat_ND_RNN_BIAS, 16},
|
|
265
|
-
{kOpFormat_NDC1HWC0, 17},
|
|
266
|
-
{kOpFormat_NCDHW, 18},
|
|
267
|
-
{kOpFormat_FRACTAL_Z_3D, 19},
|
|
268
|
-
{kOpFormat_DHWNC, 20},
|
|
269
|
-
{kOpFormat_DHWCN, 21}};
|
|
270
|
-
|
|
271
|
-
static const std::string UNKNOWN_STR = "UNKNOWN_";
|
|
272
|
-
static const std::map<int, std::string> MAP_FORMAT_TO_STRING_V2 = {
|
|
273
|
-
{TensorFormat::TENSOR_FORMAT_NCHW, "NCHW"},
|
|
274
|
-
{TensorFormat::TENSOR_FORMAT_NHWC, "NHWC"},
|
|
275
|
-
{TensorFormat::TENSOR_FORMAT_ND, "ND"},
|
|
276
|
-
{TensorFormat::TENSOR_FORMAT_NC1HWC0, "NC1HWC0"},
|
|
277
|
-
{TensorFormat::TENSOR_FORMAT_FRACTAL_Z, "FRACTAL_Z"},
|
|
278
|
-
{TensorFormat::TENSOR_FORMAT_NC1HWC0_C04, "NC1HWC0_C04"},
|
|
279
|
-
{TensorFormat::TENSOR_FORMAT_HWCN, "HWCN"},
|
|
280
|
-
{TensorFormat::TENSOR_FORMAT_NDHWC, "NDHWC"},
|
|
281
|
-
{TensorFormat::TENSOR_FORMAT_FRACTAL_NZ, "FRACTAL_NZ"},
|
|
282
|
-
{TensorFormat::TENSOR_FORMAT_NCDHW, "NCDHW"},
|
|
283
|
-
{TensorFormat::TENSOR_FORMAT_NDC1HWC0, "NDC1HWC0"},
|
|
284
|
-
{TensorFormat::TENSOR_FORMAT_FRACTAL_Z_3D, "FRACTAL_Z_3D"},
|
|
285
|
-
};
|
|
286
|
-
const std::string &GetStrWithFormatV2(const int &format);
|
|
287
|
-
|
|
288
|
-
static const int UNKNOWN_DTYPE = 0;
|
|
289
|
-
enum TensorDtypeMs : int {
|
|
290
|
-
kTypeUnknown = 0,
|
|
291
|
-
kObjectTypeString = 12,
|
|
292
|
-
kObjectTypeList = 13,
|
|
293
|
-
kObjectTypeTuple = 14,
|
|
294
|
-
kObjectTypeTensorType = 17,
|
|
295
|
-
kNumberTypeBegin = 29,
|
|
296
|
-
kNumberTypeBool = 30,
|
|
297
|
-
kNumberTypeInt8 = 32,
|
|
298
|
-
kNumberTypeInt16 = 33,
|
|
299
|
-
kNumberTypeInt32 = 34,
|
|
300
|
-
kNumberTypeInt64 = 35,
|
|
301
|
-
kNumberTypeUInt8 = 37,
|
|
302
|
-
kNumberTypeUInt16 = 38,
|
|
303
|
-
kNumberTypeUInt32 = 39,
|
|
304
|
-
kNumberTypeUInt64 = 40,
|
|
305
|
-
kNumberTypeFloat16 = 42,
|
|
306
|
-
kNumberTypeFloat32 = 43,
|
|
307
|
-
kNumberTypeFloat64 = 44,
|
|
308
|
-
kNumberTypeBFloat16 = 45,
|
|
309
|
-
kNumberTypeComplex64 = 48,
|
|
310
|
-
kNumberTypeComplex128 = 49,
|
|
311
|
-
};
|
|
312
|
-
static const std::map<int, int> MAP_DTYPE_TO_MSDTYPE = {
|
|
313
|
-
{TensorDType::TENSOR_DTYPE_UNDEFINED, kTypeUnknown},
|
|
314
|
-
{TensorDType::TENSOR_DTYPE_FLOAT, kNumberTypeFloat32},
|
|
315
|
-
{TensorDType::TENSOR_DTYPE_FLOAT16, kNumberTypeFloat16},
|
|
316
|
-
{TensorDType::TENSOR_DTYPE_INT8, kNumberTypeInt8},
|
|
317
|
-
{TensorDType::TENSOR_DTYPE_INT32, kNumberTypeInt32},
|
|
318
|
-
{TensorDType::TENSOR_DTYPE_UINT8, kNumberTypeUInt8},
|
|
319
|
-
{TensorDType::TENSOR_DTYPE_INT16, kNumberTypeInt16},
|
|
320
|
-
{TensorDType::TENSOR_DTYPE_UINT16, kNumberTypeUInt16},
|
|
321
|
-
{TensorDType::TENSOR_DTYPE_UINT32, kNumberTypeUInt32},
|
|
322
|
-
{TensorDType::TENSOR_DTYPE_INT64, kNumberTypeInt64},
|
|
323
|
-
{TensorDType::TENSOR_DTYPE_UINT64, kNumberTypeUInt64},
|
|
324
|
-
{TensorDType::TENSOR_DTYPE_DOUBLE, kNumberTypeFloat64},
|
|
325
|
-
{TensorDType::TENSOR_DTYPE_BOOL, kNumberTypeBool},
|
|
326
|
-
{TensorDType::TENSOR_DTYPE_STRING, kObjectTypeString},
|
|
327
|
-
{TensorDType::TENSOR_DTYPE_COMPLEX64, kNumberTypeComplex64},
|
|
328
|
-
{TensorDType::TENSOR_DTYPE_COMPLEX128, kNumberTypeComplex128},
|
|
329
|
-
{TensorDType::TENSOR_DTYPE_BF16, kNumberTypeBFloat16},
|
|
330
|
-
};
|
|
331
|
-
const int &GetMsDtype(const int &dtype);
|
|
332
|
-
|
|
333
|
-
struct NodeInfo {
|
|
334
|
-
// dataCnodeName NodeFullnameScope
|
|
335
|
-
const char *op_name;
|
|
336
|
-
const char *op_fullname;
|
|
337
|
-
// 使用的核数
|
|
338
|
-
uint32_t block_dim;
|
|
339
|
-
uint64_t input_size{0};
|
|
340
|
-
uint64_t output_size{0};
|
|
341
|
-
std::vector<std::vector<int64_t>> shapes;
|
|
342
|
-
std::vector<std::string> data_formats;
|
|
343
|
-
std::vector<uint32_t> data_types;
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
class MsProfHelper {
|
|
347
|
-
public:
|
|
348
|
-
MsProfHelper(const NodeInfo &info) : info_(info){};
|
|
349
|
-
~MsProfHelper() = default;
|
|
350
|
-
|
|
351
|
-
void InitReportNode();
|
|
352
|
-
void ReportTask();
|
|
353
|
-
|
|
354
|
-
private:
|
|
355
|
-
void InitProfTensorData(const size_t index, const uint64_t offset_idx, MsprofTensorInfo *tensor_info);
|
|
356
|
-
void BuildSingleTensorInfo(const uint64_t opName_hash_id, const size_t index, const uint32_t tensor_num,
|
|
357
|
-
TensorInfoWrapper *tensor_info_wrapper);
|
|
358
|
-
|
|
359
|
-
ProfNodeAdditionInfo addition_info_;
|
|
360
|
-
NodeInfo info_;
|
|
361
|
-
};
|
|
362
|
-
} // namespace internal
|
|
363
|
-
} // namespace mindspore
|
|
364
|
-
#endif // _PROFILING_UTIL_H_
|
mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/utils/log/log_utils.h
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-2024 Huawei Technologies Co., Ltd
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
#ifndef MS_KERNELS_INTERNAL_KERNEL_UTILS_LOG_LOG_UTILS_H_
|
|
17
|
-
#define MS_KERNELS_INTERNAL_KERNEL_UTILS_LOG_LOG_UTILS_H_
|
|
18
|
-
#include <iostream>
|
|
19
|
-
#include <map>
|
|
20
|
-
#include "include/op_param.h"
|
|
21
|
-
#include "utils/utils.h"
|
|
22
|
-
|
|
23
|
-
namespace mindspore::internal {
|
|
24
|
-
static std::ostream &operator<<(std::ostream &os, const OpParam ¶m) {
|
|
25
|
-
os << "[" << OpIdToString(param.opId) << "]";
|
|
26
|
-
os << ", in dtypes: ";
|
|
27
|
-
for (size_t i = 0; i < param.in_dtypes_.size(); i++) {
|
|
28
|
-
os << " " << param.in_dtypes_[i];
|
|
29
|
-
}
|
|
30
|
-
os << "; out dtypes: ";
|
|
31
|
-
for (size_t i = 0; i < param.out_dtypes_.size(); i++) {
|
|
32
|
-
os << " " << param.out_dtypes_[i];
|
|
33
|
-
}
|
|
34
|
-
return os;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static std::ostream &operator<<(std::ostream &os, const DtypesParam ¶m) {
|
|
38
|
-
os << "[" << OpIdToString(param.op_id_) << "]";
|
|
39
|
-
os << ", in dtypes: ";
|
|
40
|
-
for (size_t i = 0; i < param.in_dtypes_.size(); i++) {
|
|
41
|
-
os << " " << param.in_dtypes_[i];
|
|
42
|
-
}
|
|
43
|
-
os << "; out dtypes: ";
|
|
44
|
-
for (size_t i = 0; i < param.out_dtypes_.size(); i++) {
|
|
45
|
-
os << " " << param.out_dtypes_[i];
|
|
46
|
-
}
|
|
47
|
-
return os;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
static std::ostream &operator<<(
|
|
51
|
-
std::ostream &os,
|
|
52
|
-
const std::vector<std::pair<std::vector<TensorDType>, std::vector<TensorDType>>> &support_dtype_list) {
|
|
53
|
-
for (auto dtyp : support_dtype_list) {
|
|
54
|
-
auto ins = dtyp.first;
|
|
55
|
-
auto outs = dtyp.second;
|
|
56
|
-
os << "(";
|
|
57
|
-
for (size_t i = 0; i < ins.size(); i++) {
|
|
58
|
-
os << ins[i] << " ";
|
|
59
|
-
}
|
|
60
|
-
os << ",";
|
|
61
|
-
for (size_t i = 0; i < outs.size(); i++) {
|
|
62
|
-
os << outs[i] << " ";
|
|
63
|
-
}
|
|
64
|
-
os << ")";
|
|
65
|
-
}
|
|
66
|
-
return os;
|
|
67
|
-
}
|
|
68
|
-
} // namespace mindspore::internal
|
|
69
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_UTILS_LOG_LOG_UTILS_H_
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2024 Huawei Technologies Co., Ltd
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
#ifndef MS_KERNELS_INTERNAL_KERNEL_UTILS_KERNEL_CREATOR_H_
|
|
18
|
-
#define MS_KERNELS_INTERNAL_KERNEL_UTILS_KERNEL_CREATOR_H_
|
|
19
|
-
#include "internal_kernel.h"
|
|
20
|
-
#include "utils/log/log.h"
|
|
21
|
-
namespace mindspore {
|
|
22
|
-
namespace internal {
|
|
23
|
-
template <class T>
|
|
24
|
-
InternalKernelImplPtr InternalKernelCreator(const OpParamPtr ¶m) {
|
|
25
|
-
if (param == nullptr) {
|
|
26
|
-
MSOP_LOG(ERROR) << "Op param nullptr in kernel creator!";
|
|
27
|
-
return nullptr;
|
|
28
|
-
}
|
|
29
|
-
MSOP_LOG(DEBUG) << "Create " << *param;
|
|
30
|
-
auto kernel = std::make_shared<T>(param);
|
|
31
|
-
if (kernel != nullptr && kernel->IsSupported()) {
|
|
32
|
-
return kernel;
|
|
33
|
-
}
|
|
34
|
-
MSOP_LOG(INFO) << "Internal kernel unsupport: id:" << *param;
|
|
35
|
-
return nullptr;
|
|
36
|
-
}
|
|
37
|
-
} // namespace internal
|
|
38
|
-
} // namespace mindspore
|
|
39
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_UTILS_KERNEL_CREATOR_H_
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2024 Huawei Technologies Co., Ltd
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
#ifndef MS_KERNELS_INTERNAL_KERNEL_UTILS_KERNEL_REGISTER_H_
|
|
17
|
-
#define MS_KERNELS_INTERNAL_KERNEL_UTILS_KERNEL_REGISTER_H_
|
|
18
|
-
#include <stdio.h>
|
|
19
|
-
#include <stdlib.h>
|
|
20
|
-
#include <stdarg.h>
|
|
21
|
-
#include <map>
|
|
22
|
-
#include <atomic>
|
|
23
|
-
#include "utils/register/kernel_creator.h"
|
|
24
|
-
#include "asdops/types.h"
|
|
25
|
-
namespace mindspore {
|
|
26
|
-
namespace internal {
|
|
27
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_BF16;
|
|
28
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_BOOL;
|
|
29
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_DOUBLE;
|
|
30
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_FLOAT;
|
|
31
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_FLOAT16;
|
|
32
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_INT16;
|
|
33
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_INT32;
|
|
34
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_INT64;
|
|
35
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_INT8;
|
|
36
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_UINT16;
|
|
37
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_UINT32;
|
|
38
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_UINT64;
|
|
39
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_UINT8;
|
|
40
|
-
using AsdOps::TensorDType::TENSOR_DTYPE_UNDEFINED;
|
|
41
|
-
typedef InternalKernelImplPtr (*KernelCreator)(const OpParamPtr ¶m);
|
|
42
|
-
class InternalKernelRegistry {
|
|
43
|
-
public:
|
|
44
|
-
InternalKernelRegistry() = default;
|
|
45
|
-
virtual ~InternalKernelRegistry() = default;
|
|
46
|
-
|
|
47
|
-
static InternalKernelRegistry *GetInstance();
|
|
48
|
-
void RegKernel(int op_id, KernelCreator creator);
|
|
49
|
-
InternalKernelImplPtr GetKernel(const OpParamPtr ¶m);
|
|
50
|
-
void SetDtypes(int op_id, std::vector<TensorDType> in_types, std::vector<TensorDType> out_types);
|
|
51
|
-
void SetMutable(int op_id, bool input, bool output);
|
|
52
|
-
void SetAsdDtypes(int op_id, std::vector<TensorDType> in_types, std::vector<TensorDType> out_types);
|
|
53
|
-
bool IsDtypeSupported(const DtypesParamPtr ¶m);
|
|
54
|
-
|
|
55
|
-
private:
|
|
56
|
-
void PrintOpRegistryInfo(int op_id);
|
|
57
|
-
bool IsAsdSupported(int op_id, std::vector<int64_t> &in_dtypes, std::vector<int64_t> &out_types);
|
|
58
|
-
bool IsInternalSupported(int op_id, std::vector<int64_t> &in_dtypes, std::vector<int64_t> &out_types);
|
|
59
|
-
std::vector<int> mutable_input_list_;
|
|
60
|
-
std::vector<int> mutable_output_list_;
|
|
61
|
-
std::map<int, KernelCreator> creator_list_;
|
|
62
|
-
std::map<int, std::vector<std::pair<std::vector<TensorDType>, std::vector<TensorDType>>>> op_dtypes_;
|
|
63
|
-
std::map<int, std::vector<std::pair<std::vector<TensorDType>, std::vector<TensorDType>>>> asd_op_dtypes_;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
#define MUTABLE_NUM 13579
|
|
67
|
-
void CheckMutable(bool &input_mutable, bool &output_mutable, int remain_in, int remain_total);
|
|
68
|
-
|
|
69
|
-
class InternalKernelRegister {
|
|
70
|
-
public:
|
|
71
|
-
InternalKernelRegister(const int op_id, KernelCreator creator) {
|
|
72
|
-
InternalKernelRegistry::GetInstance()->RegKernel(op_id, creator);
|
|
73
|
-
}
|
|
74
|
-
InternalKernelRegister(int op_id, int outcnt, TensorDType dt1, TensorDType dt2, TensorDType dt3);
|
|
75
|
-
InternalKernelRegister(int op_id, TensorDType dt1, TensorDType dt2, TensorDType dt3, TensorDType dt4);
|
|
76
|
-
InternalKernelRegister(int op_id, TensorDType main_dtype, int remain_in, int remain_total, ...);
|
|
77
|
-
InternalKernelRegister(int op_id, TensorDType dtype1, TensorDType dtype2);
|
|
78
|
-
InternalKernelRegister(int op_id, TensorDType dtype1, TensorDType dtype2, TensorDType dtype3);
|
|
79
|
-
~InternalKernelRegister() = default;
|
|
80
|
-
};
|
|
81
|
-
#define REG_KERNEL(op_id, creator) static InternalKernelRegister g_##op_id##kernel_reg(op_id, creator);
|
|
82
|
-
#define REG_KERNEL_DTYPES(op_id, incnt, outcnt, dtype, ...) \
|
|
83
|
-
static InternalKernelRegister g_##op_id##_##incnt##_##outcnt##_##dtype(op_id, dtype, (incnt - 1), \
|
|
84
|
-
(incnt + outcnt - 1), ##__VA_ARGS__);
|
|
85
|
-
#define REG_ROPE_DTYPES(op_id, incnt, outcnt, in_dt1, in_dt2, in_dt3, in_dt4) \
|
|
86
|
-
static InternalKernelRegister g_##op_id##_##incnt##_##outcnt##_##in_dt1##in_dt2(op_id, in_dt1, in_dt2, in_dt3, \
|
|
87
|
-
in_dt4);
|
|
88
|
-
#define REG_KERNE_BINARY_DTYPES(op_id, dt1, dt2) \
|
|
89
|
-
static InternalKernelRegister g_##op_id##_##dt1##_##dt2(op_id, dt1, dt2);
|
|
90
|
-
#define REG_RMS_NORM_DTYPES(op_id, incnt, outcnt, in_dt1, in_dt2, out_dt1, out_dt2) \
|
|
91
|
-
static InternalKernelRegister g_##op_id##_##incnt##_##outcnt##_##in_dt1##out_dt2(op_id, in_dt1, out_dt2);
|
|
92
|
-
#define REG_ADD_RMS_NORM_DTYPES(op_id, incnt, outcnt, in_dt1, in_dt2, in_dt3, out_dt1, out_dt2, out_dt3) \
|
|
93
|
-
static InternalKernelRegister g_##op_id##_##incnt##_##outcnt##_##in_dt1##in_dt3(op_id, in_dt1, in_dt3);
|
|
94
|
-
#define REG_MATMUL_BIASADD_DTYPES(op_id, incnt, outcnt, in_dt1, in_dt2, in_dt3, out_dt1, ...) \
|
|
95
|
-
static InternalKernelRegister g_##op_id##_##incnt##_##outcnt##_##in_dt1##in_dt3##out_dt1(op_id, outcnt, in_dt1, in_dt3, out_dt1);
|
|
96
|
-
|
|
97
|
-
class AsdOpInternalKernelRegister {
|
|
98
|
-
public:
|
|
99
|
-
AsdOpInternalKernelRegister(int op_id, TensorDType main_dtype, int remain_in, int remain_total, ...);
|
|
100
|
-
AsdOpInternalKernelRegister(int op_id, TensorDType dtype1);
|
|
101
|
-
AsdOpInternalKernelRegister(int op_id, TensorDType dtype1, TensorDType dtype2, TensorDType dtype3);
|
|
102
|
-
~AsdOpInternalKernelRegister() = default;
|
|
103
|
-
};
|
|
104
|
-
#define REG_ASD_KERNEL_DTYPES(op_id, incnt, outcnt, dtype, ...) \
|
|
105
|
-
static AsdOpInternalKernelRegister g_asd_##op_id##_##incnt##_##outcnt##_##dtype( \
|
|
106
|
-
op_id, dtype, (incnt - 1), (incnt + outcnt - 1), ##__VA_ARGS__);
|
|
107
|
-
#define REG_ASD_RMS_NORM_KERNEL_DTYPES(op_id, incnt, outcnt, dt1) \
|
|
108
|
-
static AsdOpInternalKernelRegister g_asd_##op_id##_##dt1(op_id, dt1);
|
|
109
|
-
#define REG_ASD_GATHER_KERNEL_DTYPES(op_id, incnt, outcnt, dt1, dt2, dt3) \
|
|
110
|
-
static AsdOpInternalKernelRegister g_asd_##op_id##incnt##outcnt##dt1##dt2##dt3(op_id, dt1, dt2, dt3);
|
|
111
|
-
bool InternalKernelEnableByEnv(const int op_id);
|
|
112
|
-
} // namespace internal
|
|
113
|
-
} // namespace mindspore
|
|
114
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_UTILS_KERNEL_REGISTER_H_
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2024 Huawei Technologies Co., Ltd
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
#ifndef MS_KERNELS_INTERNAL_SRC_UTILS_UTILS_H_
|
|
18
|
-
#define MS_KERNELS_INTERNAL_SRC_UTILS_UTILS_H_
|
|
19
|
-
|
|
20
|
-
#include <iostream>
|
|
21
|
-
#include <map>
|
|
22
|
-
#include <set>
|
|
23
|
-
#include "include/op_param.h"
|
|
24
|
-
|
|
25
|
-
namespace mindspore::internal {
|
|
26
|
-
inline void SplitString(const std::string &str, char delim, std::set<std::string> &output_list) {
|
|
27
|
-
std::stringstream ss(str);
|
|
28
|
-
std::string item;
|
|
29
|
-
std::vector<std::string> elems;
|
|
30
|
-
while (std::getline(ss, item, delim)) {
|
|
31
|
-
if (!item.empty()) {
|
|
32
|
-
output_list.emplace(item);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
template <typename T>
|
|
38
|
-
static std::ostream &operator<<(std::ostream &os, const std::vector<T> &v) {
|
|
39
|
-
os << "[size " << v.size() << "]";
|
|
40
|
-
os << "[data";
|
|
41
|
-
for (size_t i = 0; i < v.size(); i++) {
|
|
42
|
-
os << " " << v[i];
|
|
43
|
-
}
|
|
44
|
-
os << "]";
|
|
45
|
-
return os;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
inline std::string OpIdToString(int id) {
|
|
49
|
-
std::map<int, std::string> op_id_string = {
|
|
50
|
-
{OpId::MatMul, "MatMul"},
|
|
51
|
-
{OpId::ReshapeAndCache, "ReshapeAndCache"},
|
|
52
|
-
{OpId::Slice, "Slice"},
|
|
53
|
-
{OpId::Gather, "Gather"},
|
|
54
|
-
{OpId::ApplyRotaryPosEmb, "ApplyRotaryPosEmb"},
|
|
55
|
-
{OpId::Add, "Add"},
|
|
56
|
-
{OpId::Sub, "Sub"},
|
|
57
|
-
{OpId::Exp, "Exp"},
|
|
58
|
-
{OpId::FlashAttentionScore, "FlashAttentionScore"},
|
|
59
|
-
{OpId::PagedAttention, "PagedAttention"},
|
|
60
|
-
{OpId::Cast, "Cast"},
|
|
61
|
-
{OpId::Gelu, "Gelu"},
|
|
62
|
-
{OpId::Transpose, "Transpose"},
|
|
63
|
-
{OpId::Equal, "Equal"},
|
|
64
|
-
{OpId::NotEqual, "NotEqual"},
|
|
65
|
-
{OpId::LogicalNot, "LogicalNot"},
|
|
66
|
-
{OpId::Less, "Less"},
|
|
67
|
-
{OpId::LessEqual, "LessEqual"},
|
|
68
|
-
{OpId::Greater, "Greater"},
|
|
69
|
-
{OpId::GreaterEqual, "GreaterEqual"},
|
|
70
|
-
{OpId::Mul, "Mul"},
|
|
71
|
-
{OpId::RealDiv, "RealDiv"},
|
|
72
|
-
{OpId::LayerNorm, "LayerNorm"},
|
|
73
|
-
{OpId::AddLayerNorm, "AddLayerNorm"},
|
|
74
|
-
{OpId::RmsNorm, "RmsNorm"},
|
|
75
|
-
{OpId::AddRmsNorm, "AddRmsNorm"},
|
|
76
|
-
{OpId::Softmax, "Softmax"},
|
|
77
|
-
{OpId::Split, "Split"},
|
|
78
|
-
{OpId::Swish, "Swish"},
|
|
79
|
-
{OpId::SwiGLU, "SwiGLU"},
|
|
80
|
-
{OpId::Concat, "Concat"},
|
|
81
|
-
{OpId::MatmulQkv, "MatmulQkv"},
|
|
82
|
-
{OpId::MaskedFill, "MaskedFill"},
|
|
83
|
-
{OpId::BroadcastTo, "BroadcastTo"},
|
|
84
|
-
{OpId::ReduceSum, "ReduceSum"},
|
|
85
|
-
{OpId::TopK, "TopK"},
|
|
86
|
-
{OpId::Tile, "Tile"},
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
auto iter = op_id_string.find(id);
|
|
90
|
-
if (iter != op_id_string.end()) {
|
|
91
|
-
return iter->second;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
std::string err_info = "Op not defined! index: " + std::to_string(id);
|
|
95
|
-
return err_info;
|
|
96
|
-
}
|
|
97
|
-
} // namespace mindspore::internal
|
|
98
|
-
#endif // MS_KERNELS_INTERNAL_SRC_UTILS_UTILS_H_
|