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,260 +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_ASCENDC_ELEWISE_BINARY_BASE_H_
|
|
18
|
-
#define MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_BINARY_BASE_H_
|
|
19
|
-
|
|
20
|
-
#include "kernel_operator.h"
|
|
21
|
-
|
|
22
|
-
using namespace AscendC;
|
|
23
|
-
|
|
24
|
-
template <typename IN_TYPE>
|
|
25
|
-
class ElewiseBaseWide {
|
|
26
|
-
public:
|
|
27
|
-
__aicore__ inline ElewiseBaseWide(){};
|
|
28
|
-
__aicore__ inline void InitBinary(GM_ADDR in1, GM_ADDR in2, GM_ADDR out, GM_ADDR tiling) {
|
|
29
|
-
gm_in1 = reinterpret_cast<__gm__ IN_TYPE *>(in1);
|
|
30
|
-
gm_in2 = reinterpret_cast<__gm__ IN_TYPE *>(in2);
|
|
31
|
-
gm_out = reinterpret_cast<__gm__ IN_TYPE *>(out);
|
|
32
|
-
SetTilingInfo(tiling);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
__aicore__ inline void ProcessBinary() {
|
|
36
|
-
if (broadcast_mode == 0) {
|
|
37
|
-
return BroadcastNone();
|
|
38
|
-
} else if (broadcast_mode == 3) {
|
|
39
|
-
return ScalarLeft();
|
|
40
|
-
} else if (broadcast_mode == 4) {
|
|
41
|
-
return ScalarRight();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
__aicore__ inline void SetBinaryFunc(void (*func)(const LocalTensor<IN_TYPE> &dstLocal,
|
|
45
|
-
const LocalTensor<IN_TYPE> &src0Local,
|
|
46
|
-
const LocalTensor<IN_TYPE> &src1Local, const int &calCount)) {
|
|
47
|
-
elewise_binary_func_ = func;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
private:
|
|
51
|
-
__aicore__ inline void SetTilingInfo(GM_ADDR tiling) {
|
|
52
|
-
core_idx = get_block_idx();
|
|
53
|
-
core_num = get_block_num();
|
|
54
|
-
|
|
55
|
-
avg_block_count = (uint32_t)(*((__gm__ uint32_t *)tiling + 0));
|
|
56
|
-
avg_block_ub_num = (uint32_t)(*((__gm__ uint32_t *)tiling + 1));
|
|
57
|
-
avg_block_ub_tail = (uint32_t)(*((__gm__ uint32_t *)tiling + 2));
|
|
58
|
-
avg_block_ub_loop = (uint32_t)(*((__gm__ uint32_t *)tiling + 3));
|
|
59
|
-
tail_block_count = (uint32_t)(*((__gm__ uint32_t *)tiling + 4));
|
|
60
|
-
tail_block_ub_num = (uint32_t)(*((__gm__ uint32_t *)tiling + 5));
|
|
61
|
-
tail_block_ub_tail = (uint32_t)(*((__gm__ uint32_t *)tiling + 6));
|
|
62
|
-
tail_block_ub_loop = (uint32_t)(*((__gm__ uint32_t *)tiling + 7));
|
|
63
|
-
|
|
64
|
-
buffer_num = (uint32_t)(*((__gm__ uint32_t *)tiling + 8));
|
|
65
|
-
broadcast_mode = (uint32_t)(*((__gm__ uint32_t *)tiling + 10));
|
|
66
|
-
}
|
|
67
|
-
__aicore__ inline void SetUbParam(uint32_t &ub_count, uint32_t &ub_loop, uint32_t &ub_tail) {
|
|
68
|
-
ub_count = avg_block_ub_num;
|
|
69
|
-
ub_loop = avg_block_ub_loop;
|
|
70
|
-
ub_tail = avg_block_ub_tail;
|
|
71
|
-
|
|
72
|
-
if (core_idx == core_num - 1) {
|
|
73
|
-
ub_count = tail_block_ub_num;
|
|
74
|
-
ub_loop = tail_block_ub_loop;
|
|
75
|
-
ub_tail = tail_block_ub_tail;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
__aicore__ inline void InitInOut(uint32_t count) {
|
|
79
|
-
pipe.InitBuffer(in1Que, buffer_num, count * sizeof(IN_TYPE));
|
|
80
|
-
pipe.InitBuffer(in2Que, buffer_num, count * sizeof(IN_TYPE));
|
|
81
|
-
pipe.InitBuffer(outQue, buffer_num, count * sizeof(IN_TYPE));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
__aicore__ inline void CopyOut(uint32_t idx, uint32_t stride, uint32_t count) {
|
|
85
|
-
LocalTensor<IN_TYPE> out = outQue.DeQue<IN_TYPE>();
|
|
86
|
-
DataCopy(outGm[idx * stride], out, count);
|
|
87
|
-
outQue.FreeTensor(out);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
__aicore__ inline void CopyIn1(uint32_t idx, uint32_t stride, uint32_t count) {
|
|
91
|
-
LocalTensor<IN_TYPE> in1 = in1Que.AllocTensor<IN_TYPE>();
|
|
92
|
-
DataCopy(in1, in1Gm[idx * stride], count);
|
|
93
|
-
in1Que.EnQue(in1);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
__aicore__ inline void CopyIn2(uint32_t idx, uint32_t stride, uint32_t count) {
|
|
97
|
-
LocalTensor<IN_TYPE> in2 = in2Que.AllocTensor<IN_TYPE>();
|
|
98
|
-
DataCopy(in2, in2Gm[idx * stride], count);
|
|
99
|
-
in2Que.EnQue(in2);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
__aicore__ inline void BroadcastNone() {
|
|
103
|
-
uint32_t ub_count, ub_loop, ub_tail;
|
|
104
|
-
SetUbParam(ub_count, ub_loop, ub_tail);
|
|
105
|
-
|
|
106
|
-
in1Gm.SetGlobalBuffer(gm_in1 + core_idx * avg_block_count);
|
|
107
|
-
in2Gm.SetGlobalBuffer(gm_in2 + core_idx * avg_block_count);
|
|
108
|
-
outGm.SetGlobalBuffer(gm_out + core_idx * avg_block_count);
|
|
109
|
-
|
|
110
|
-
InitInOut(ub_count);
|
|
111
|
-
|
|
112
|
-
uint32_t loop = 0;
|
|
113
|
-
for (; loop < ub_loop - 1; loop++) {
|
|
114
|
-
CopyIn1(loop, ub_count, ub_count);
|
|
115
|
-
CopyIn2(loop, ub_count, ub_count);
|
|
116
|
-
ComputeNone(ub_count);
|
|
117
|
-
CopyOut(loop, ub_count, ub_count);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/* for ub tail */
|
|
121
|
-
if (ub_tail <= 0) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
CopyIn1(loop, ub_count, ub_count);
|
|
125
|
-
CopyIn2(loop, ub_count, ub_tail);
|
|
126
|
-
ComputeNone(ub_tail);
|
|
127
|
-
CopyOut(loop, ub_count, ub_tail);
|
|
128
|
-
}
|
|
129
|
-
__aicore__ inline void ScalarLeft() {
|
|
130
|
-
uint32_t ub_count, ub_loop, ub_tail;
|
|
131
|
-
SetUbParam(ub_count, ub_loop, ub_tail);
|
|
132
|
-
|
|
133
|
-
in1Gm.SetGlobalBuffer(gm_in1);
|
|
134
|
-
in2Gm.SetGlobalBuffer(gm_in2 + core_idx * avg_block_count);
|
|
135
|
-
outGm.SetGlobalBuffer(gm_out + core_idx * avg_block_count);
|
|
136
|
-
|
|
137
|
-
InitInOut(ub_count);
|
|
138
|
-
|
|
139
|
-
/* input tensor init once */
|
|
140
|
-
LocalTensor<IN_TYPE> scalar_t = in1Que.AllocTensor<IN_TYPE>();
|
|
141
|
-
IN_TYPE scalar_value = in1Gm.GetValue(0);
|
|
142
|
-
Duplicate(scalar_t, scalar_value, ub_count);
|
|
143
|
-
pipe_barrier(PIPE_ALL);
|
|
144
|
-
|
|
145
|
-
uint32_t loop = 0;
|
|
146
|
-
for (; loop < ub_loop - 1; loop++) {
|
|
147
|
-
CopyIn2(loop, ub_count, ub_count);
|
|
148
|
-
ComputeLeft(ub_count, scalar_t);
|
|
149
|
-
CopyOut(loop, ub_count, ub_count);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/* for ub tail */
|
|
153
|
-
if (ub_tail <= 0) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
CopyIn2(loop, ub_count, ub_tail);
|
|
157
|
-
ComputeLeft(ub_tail, scalar_t);
|
|
158
|
-
CopyOut(loop, ub_count, ub_tail);
|
|
159
|
-
|
|
160
|
-
/* free*/
|
|
161
|
-
in1Que.FreeTensor(scalar_t);
|
|
162
|
-
}
|
|
163
|
-
__aicore__ inline void ScalarRight() {
|
|
164
|
-
uint32_t ub_count, ub_loop, ub_tail;
|
|
165
|
-
SetUbParam(ub_count, ub_loop, ub_tail);
|
|
166
|
-
|
|
167
|
-
in1Gm.SetGlobalBuffer(gm_in1 + core_idx * avg_block_count);
|
|
168
|
-
in2Gm.SetGlobalBuffer(gm_in2);
|
|
169
|
-
outGm.SetGlobalBuffer(gm_out + core_idx * avg_block_count);
|
|
170
|
-
|
|
171
|
-
InitInOut(ub_count);
|
|
172
|
-
|
|
173
|
-
/* input tensor init once */
|
|
174
|
-
LocalTensor<IN_TYPE> scalar_t = in2Que.AllocTensor<IN_TYPE>();
|
|
175
|
-
IN_TYPE scalar_value = in2Gm.GetValue(0);
|
|
176
|
-
Duplicate(scalar_t, scalar_value, ub_count);
|
|
177
|
-
pipe_barrier(PIPE_ALL);
|
|
178
|
-
|
|
179
|
-
uint32_t loop = 0;
|
|
180
|
-
for (; loop < ub_loop - 1; loop++) {
|
|
181
|
-
CopyIn1(loop, ub_count, ub_count);
|
|
182
|
-
ComputeRight(ub_count, scalar_t);
|
|
183
|
-
CopyOut(loop, ub_count, ub_count);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/* for ub tail */
|
|
187
|
-
if (ub_tail <= 0) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
CopyIn1(loop, ub_count, ub_tail);
|
|
191
|
-
ComputeRight(ub_tail, scalar_t);
|
|
192
|
-
CopyOut(loop, ub_count, ub_tail);
|
|
193
|
-
|
|
194
|
-
/* free*/
|
|
195
|
-
in2Que.FreeTensor(scalar_t);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
__aicore__ inline void ComputeLeft(uint32_t count, LocalTensor<IN_TYPE> &scalar_t) {
|
|
199
|
-
LocalTensor<IN_TYPE> in2 = in2Que.DeQue<IN_TYPE>();
|
|
200
|
-
LocalTensor<IN_TYPE> out = outQue.AllocTensor<IN_TYPE>();
|
|
201
|
-
elewise_binary_func_(out, scalar_t, in2, count);
|
|
202
|
-
in2Que.FreeTensor(in2);
|
|
203
|
-
pipe_barrier(PIPE_ALL);
|
|
204
|
-
outQue.EnQue(out);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
__aicore__ inline void ComputeRight(uint32_t count, LocalTensor<IN_TYPE> &scalar_t) {
|
|
208
|
-
LocalTensor<IN_TYPE> in1 = in1Que.DeQue<IN_TYPE>();
|
|
209
|
-
LocalTensor<IN_TYPE> out = outQue.AllocTensor<IN_TYPE>();
|
|
210
|
-
elewise_binary_func_(out, in1, scalar_t, count);
|
|
211
|
-
in1Que.FreeTensor(in1);
|
|
212
|
-
pipe_barrier(PIPE_ALL);
|
|
213
|
-
outQue.EnQue(out);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
__aicore__ inline void ComputeNone(uint32_t count) {
|
|
217
|
-
LocalTensor<IN_TYPE> in1 = in1Que.DeQue<IN_TYPE>();
|
|
218
|
-
LocalTensor<IN_TYPE> in2 = in2Que.DeQue<IN_TYPE>();
|
|
219
|
-
LocalTensor<IN_TYPE> out = outQue.AllocTensor<IN_TYPE>();
|
|
220
|
-
elewise_binary_func_(out, in1, in2, count);
|
|
221
|
-
in1Que.FreeTensor(in1);
|
|
222
|
-
in2Que.FreeTensor(in2);
|
|
223
|
-
pipe_barrier(PIPE_ALL);
|
|
224
|
-
outQue.EnQue(out);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
private:
|
|
228
|
-
void (*elewise_binary_func_)(const LocalTensor<IN_TYPE> &dstLocal, const LocalTensor<IN_TYPE> &src0Local,
|
|
229
|
-
const LocalTensor<IN_TYPE> &src1Local, const int &calCount);
|
|
230
|
-
|
|
231
|
-
TPipe pipe;
|
|
232
|
-
TQue<AscendC::QuePosition::VECIN, 1> in1Que;
|
|
233
|
-
TQue<AscendC::QuePosition::VECIN, 1> in2Que;
|
|
234
|
-
TQue<AscendC::QuePosition::VECOUT, 1> outQue;
|
|
235
|
-
|
|
236
|
-
__gm__ IN_TYPE *__restrict__ gm_in1{nullptr};
|
|
237
|
-
__gm__ IN_TYPE *__restrict__ gm_in2{nullptr};
|
|
238
|
-
__gm__ IN_TYPE *__restrict__ gm_out{nullptr};
|
|
239
|
-
|
|
240
|
-
GlobalTensor<IN_TYPE> in1Gm;
|
|
241
|
-
GlobalTensor<IN_TYPE> in2Gm;
|
|
242
|
-
GlobalTensor<IN_TYPE> outGm;
|
|
243
|
-
|
|
244
|
-
uint32_t core_idx{0};
|
|
245
|
-
uint32_t core_num{0};
|
|
246
|
-
uint32_t buffer_num{0};
|
|
247
|
-
uint32_t broadcast_mode{0};
|
|
248
|
-
|
|
249
|
-
uint32_t avg_block_count{0};
|
|
250
|
-
uint32_t avg_block_ub_num{0};
|
|
251
|
-
uint32_t avg_block_ub_tail{0};
|
|
252
|
-
uint32_t avg_block_ub_loop{0};
|
|
253
|
-
|
|
254
|
-
uint32_t tail_block_count{0};
|
|
255
|
-
uint32_t tail_block_ub_num{0};
|
|
256
|
-
uint32_t tail_block_ub_tail{0};
|
|
257
|
-
uint32_t tail_block_ub_loop{0};
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_BINARY_BASE_H_
|
|
@@ -1,35 +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_ASCENDC_ELEWISE_ELEWISE_BINARY_KERNEL_H_
|
|
18
|
-
#define MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_ELEWISE_BINARY_KERNEL_H_
|
|
19
|
-
|
|
20
|
-
void elewise_sub(uint32_t blockDim, void *l2ctrl, void *stream, uint8_t *in1, uint8_t *in2, uint8_t *out,
|
|
21
|
-
uint8_t *tiling, int dtype);
|
|
22
|
-
void elewise_mul(uint32_t blockDim, void *l2ctrl, void *stream, uint8_t *in1, uint8_t *in2, uint8_t *out,
|
|
23
|
-
uint8_t *tiling, int dtype);
|
|
24
|
-
void elewise_div(uint32_t blockDim, void *l2ctrl, void *stream, uint8_t *in1, uint8_t *in2, uint8_t *out,
|
|
25
|
-
uint8_t *tiling, int dtype);
|
|
26
|
-
void elewise_min(uint32_t blockDim, void *l2ctrl, void *stream, uint8_t *in1, uint8_t *in2, uint8_t *out,
|
|
27
|
-
uint8_t *tiling, int dtype);
|
|
28
|
-
void elewise_max(uint32_t blockDim, void *l2ctrl, void *stream, uint8_t *in1, uint8_t *in2, uint8_t *out,
|
|
29
|
-
uint8_t *tiling, int dtype);
|
|
30
|
-
void elewise_and(uint32_t blockDim, void *l2ctrl, void *stream, uint8_t *in1, uint8_t *in2, uint8_t *out,
|
|
31
|
-
uint8_t *tiling, int dtype);
|
|
32
|
-
void elewise_or(uint32_t blockDim, void *l2ctrl, void *stream, uint8_t *in1, uint8_t *in2, uint8_t *out,
|
|
33
|
-
uint8_t *tiling, int dtype);
|
|
34
|
-
|
|
35
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_ELEWISE_BINARY_KERNEL_H_
|
|
@@ -1,66 +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_ASCENDC_ELEWISE_BINARY_MAX_KERNEL_H_
|
|
18
|
-
#define MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_BINARY_MAX_KERNEL_H_
|
|
19
|
-
|
|
20
|
-
#include "elewise_binary_base.h"
|
|
21
|
-
|
|
22
|
-
template <typename T = int16_t>
|
|
23
|
-
class MaxI16 : public ElewiseBaseWide<T> {
|
|
24
|
-
public:
|
|
25
|
-
__aicore__ inline MaxI16() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Max); }
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
template <typename T = int32_t>
|
|
29
|
-
class MaxInt : public ElewiseBaseWide<T> {
|
|
30
|
-
public:
|
|
31
|
-
__aicore__ inline MaxInt() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Max); }
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
template <typename T = half>
|
|
35
|
-
class MaxFp16 : public ElewiseBaseWide<T> {
|
|
36
|
-
public:
|
|
37
|
-
__aicore__ inline MaxFp16() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Max); }
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
template <typename T = float>
|
|
41
|
-
class MaxFp32 : public ElewiseBaseWide<T> {
|
|
42
|
-
public:
|
|
43
|
-
__aicore__ inline MaxFp32() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Max); }
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
extern "C" __global__ __aicore__ void max_device(GM_ADDR x1, GM_ADDR x2, GM_ADDR y, GM_ADDR tiling, int32_t dtype) {
|
|
47
|
-
if (dtype == 3) { // int32
|
|
48
|
-
MaxInt<int32_t> op;
|
|
49
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
50
|
-
op.ProcessBinary();
|
|
51
|
-
} else if (dtype == 1) { // fp16
|
|
52
|
-
MaxFp16<half> op;
|
|
53
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
54
|
-
op.ProcessBinary();
|
|
55
|
-
} else if (dtype == 0) { // fp32
|
|
56
|
-
MaxFp32<float> op;
|
|
57
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
58
|
-
op.ProcessBinary();
|
|
59
|
-
} else if (dtype == 6) { // int16
|
|
60
|
-
MaxI16<int16_t> op;
|
|
61
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
62
|
-
op.ProcessBinary();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_BINARY_MAX_KERNEL_H_
|
|
@@ -1,66 +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_ASCENDC_ELEWISE_BINARY_MIN_KERNEL_H_
|
|
18
|
-
#define MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_BINARY_MIN_KERNEL_H_
|
|
19
|
-
|
|
20
|
-
#include "elewise_binary_base.h"
|
|
21
|
-
|
|
22
|
-
template <typename T = int16_t>
|
|
23
|
-
class MinI16 : public ElewiseBaseWide<T> {
|
|
24
|
-
public:
|
|
25
|
-
__aicore__ inline MinI16() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Min); }
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
template <typename T = int32_t>
|
|
29
|
-
class MinInt : public ElewiseBaseWide<T> {
|
|
30
|
-
public:
|
|
31
|
-
__aicore__ inline MinInt() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Min); }
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
template <typename T = half>
|
|
35
|
-
class MinFp16 : public ElewiseBaseWide<T> {
|
|
36
|
-
public:
|
|
37
|
-
__aicore__ inline MinFp16() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Min); }
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
template <typename T = float>
|
|
41
|
-
class MinFp32 : public ElewiseBaseWide<T> {
|
|
42
|
-
public:
|
|
43
|
-
__aicore__ inline MinFp32() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Min); }
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
extern "C" __global__ __aicore__ void min_device(GM_ADDR x1, GM_ADDR x2, GM_ADDR y, GM_ADDR tiling, int32_t dtype) {
|
|
47
|
-
if (dtype == 3) { // int32
|
|
48
|
-
MinInt<int32_t> op;
|
|
49
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
50
|
-
op.ProcessBinary();
|
|
51
|
-
} else if (dtype == 1) { // fp16
|
|
52
|
-
MinFp16<half> op;
|
|
53
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
54
|
-
op.ProcessBinary();
|
|
55
|
-
} else if (dtype == 0) { // fp32
|
|
56
|
-
MinFp32<float> op;
|
|
57
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
58
|
-
op.ProcessBinary();
|
|
59
|
-
} else if (dtype == 6) { // int16
|
|
60
|
-
MinI16<int16_t> op;
|
|
61
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
62
|
-
op.ProcessBinary();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_BINARY_MIN_KERNEL_H_
|
|
@@ -1,66 +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_ASCENDC_ELEWISE_BINARY_MUL_KERNEL_H_
|
|
18
|
-
#define MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_BINARY_MUL_KERNEL_H_
|
|
19
|
-
|
|
20
|
-
#include "elewise_binary_base.h"
|
|
21
|
-
|
|
22
|
-
template <typename T = int16_t>
|
|
23
|
-
class MulI16 : public ElewiseBaseWide<T> {
|
|
24
|
-
public:
|
|
25
|
-
__aicore__ inline MulI16() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Mul); }
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
template <typename T = int32_t>
|
|
29
|
-
class MulInt : public ElewiseBaseWide<T> {
|
|
30
|
-
public:
|
|
31
|
-
__aicore__ inline MulInt() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Mul); }
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
template <typename T = half>
|
|
35
|
-
class MulFp16 : public ElewiseBaseWide<T> {
|
|
36
|
-
public:
|
|
37
|
-
__aicore__ inline MulFp16() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Mul); }
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
template <typename T = float>
|
|
41
|
-
class MulFp32 : public ElewiseBaseWide<T> {
|
|
42
|
-
public:
|
|
43
|
-
__aicore__ inline MulFp32() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Mul); }
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
extern "C" __global__ __aicore__ void mul_device(GM_ADDR x1, GM_ADDR x2, GM_ADDR y, GM_ADDR tiling, int32_t dtype) {
|
|
47
|
-
if (dtype == 3) { // int32
|
|
48
|
-
MulInt<int32_t> op;
|
|
49
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
50
|
-
op.ProcessBinary();
|
|
51
|
-
} else if (dtype == 1) { // fp16
|
|
52
|
-
MulFp16<half> op;
|
|
53
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
54
|
-
op.ProcessBinary();
|
|
55
|
-
} else if (dtype == 0) { // fp32
|
|
56
|
-
MulFp32<float> op;
|
|
57
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
58
|
-
op.ProcessBinary();
|
|
59
|
-
} else if (dtype == 6) { // int16
|
|
60
|
-
MulI16<int16_t> op;
|
|
61
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
62
|
-
op.ProcessBinary();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_BINARY_MUL_KERNEL_H_
|
|
@@ -1,46 +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_ASCENDC_ELEWISE_BINARY_OR_KERNEL_H_
|
|
18
|
-
#define MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_BINARY_OR_KERNEL_H_
|
|
19
|
-
|
|
20
|
-
#include "elewise_binary_base.h"
|
|
21
|
-
|
|
22
|
-
template <typename T = int16_t>
|
|
23
|
-
class OrI16 : public ElewiseBaseWide<T> {
|
|
24
|
-
public:
|
|
25
|
-
__aicore__ inline OrI16() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Or); }
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
template <typename T = uint16_t>
|
|
29
|
-
class OrU16 : public ElewiseBaseWide<T> {
|
|
30
|
-
public:
|
|
31
|
-
__aicore__ inline OrU16() { ElewiseBaseWide<T>::SetBinaryFunc(AscendC::Or); }
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
extern "C" __global__ __aicore__ void or_device(GM_ADDR x1, GM_ADDR x2, GM_ADDR y, GM_ADDR tiling, int32_t dtype) {
|
|
35
|
-
if (dtype == 6) { // int16
|
|
36
|
-
OrI16<int16_t> op;
|
|
37
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
38
|
-
op.ProcessBinary();
|
|
39
|
-
} else if (dtype == 7) { // uint16
|
|
40
|
-
OrU16<uint16_t> op;
|
|
41
|
-
op.InitBinary(x1, x2, y, tiling);
|
|
42
|
-
op.ProcessBinary();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_ASCENDC_ELEWISE_BINARY_OR_KERNEL_H_
|
mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/max_impl.h
DELETED
|
@@ -1,29 +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_MAX_IMPL_H_
|
|
17
|
-
#define MS_KERNELS_INTERNAL_KERNEL_MAX_IMPL_H_
|
|
18
|
-
#include "elewise_binary_impl.h"
|
|
19
|
-
namespace mindspore {
|
|
20
|
-
namespace internal {
|
|
21
|
-
class MaxImpl : public ElewiseBinaryImpl {
|
|
22
|
-
public:
|
|
23
|
-
MaxImpl(const OpParamPtr ¶m) : ElewiseBinaryImpl(param) {}
|
|
24
|
-
virtual ~MaxImpl() {}
|
|
25
|
-
int Launch() override;
|
|
26
|
-
};
|
|
27
|
-
} // namespace internal
|
|
28
|
-
} // namespace mindspore
|
|
29
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_MAX_IMPL_H_
|
mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/min_impl.h
DELETED
|
@@ -1,29 +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_MIN_IMPL_H_
|
|
17
|
-
#define MS_KERNELS_INTERNAL_KERNEL_MIN_IMPL_H_
|
|
18
|
-
#include "elewise_binary_impl.h"
|
|
19
|
-
namespace mindspore {
|
|
20
|
-
namespace internal {
|
|
21
|
-
class MinImpl : public ElewiseBinaryImpl {
|
|
22
|
-
public:
|
|
23
|
-
MinImpl(const OpParamPtr ¶m) : ElewiseBinaryImpl(param) {}
|
|
24
|
-
virtual ~MinImpl() {}
|
|
25
|
-
int Launch() override;
|
|
26
|
-
};
|
|
27
|
-
} // namespace internal
|
|
28
|
-
} // namespace mindspore
|
|
29
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_MIN_IMPL_H_
|
mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/mul_impl.h
DELETED
|
@@ -1,29 +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_MUL_IMPL_H_
|
|
17
|
-
#define MS_KERNELS_INTERNAL_KERNEL_MUL_IMPL_H_
|
|
18
|
-
#include "elewise_binary_impl.h"
|
|
19
|
-
namespace mindspore {
|
|
20
|
-
namespace internal {
|
|
21
|
-
class MulImpl : public ElewiseBinaryImpl {
|
|
22
|
-
public:
|
|
23
|
-
MulImpl(const OpParamPtr ¶m) : ElewiseBinaryImpl(param) {}
|
|
24
|
-
virtual ~MulImpl() {}
|
|
25
|
-
int Launch() override;
|
|
26
|
-
};
|
|
27
|
-
} // namespace internal
|
|
28
|
-
} // namespace mindspore
|
|
29
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_MUL_IMPL_H_
|
mindspore/lib/plugin/ascend/ms_kernels_internal/internal_kernel/include/elewise_binary/or_impl.h
DELETED
|
@@ -1,29 +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_OR_IMPL_H_
|
|
17
|
-
#define MS_KERNELS_INTERNAL_KERNEL_OR_IMPL_H_
|
|
18
|
-
#include "elewise_binary_impl.h"
|
|
19
|
-
namespace mindspore {
|
|
20
|
-
namespace internal {
|
|
21
|
-
class OrImpl : public ElewiseBinaryImpl {
|
|
22
|
-
public:
|
|
23
|
-
OrImpl(const OpParamPtr ¶m) : ElewiseBinaryImpl(param) {}
|
|
24
|
-
virtual ~OrImpl() {}
|
|
25
|
-
int Launch() override;
|
|
26
|
-
};
|
|
27
|
-
} // namespace internal
|
|
28
|
-
} // namespace mindspore
|
|
29
|
-
#endif // MS_KERNELS_INTERNAL_KERNEL_OR_IMPL_H_
|