mindspore 2.2.11__cp37-cp37m-manylinux1_x86_64.whl → 2.3.0rc1__cp37-cp37m-manylinux1_x86_64.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/__init__.py +5 -4
- mindspore/_akg/akg/composite/build_module.py +155 -11
- mindspore/_akg/akg/config/repository.json +38 -0
- mindspore/_akg/akg/ms/info_version_adapt.py +29 -0
- mindspore/_akg/akg/topi/cpp/impl.py +1 -1
- mindspore/_akg/akg/tvm/_ffi/base.py +1 -1
- mindspore/_akg/akg/tvm/contrib/nvcc.py +4 -1
- mindspore/_akg/akg/utils/ascend_profilier/path_manager.py +2 -1
- mindspore/_akg/akg/utils/composite_op_helper.py +4 -2
- mindspore/_akg/akg/utils/dump_ascend_meta.py +2 -2
- mindspore/_akg/akg/utils/gen_random.py +14 -8
- mindspore/_akg/akg/utils/op_dsl.py +11 -0
- mindspore/_akg/akg/utils/tbe_codegen_utils.py +5 -5
- mindspore/_c_dataengine.cpython-37m-x86_64-linux-gnu.so +0 -0
- mindspore/_c_expression.cpython-37m-x86_64-linux-gnu.so +0 -0
- mindspore/_c_mindrecord.cpython-37m-x86_64-linux-gnu.so +0 -0
- mindspore/_checkparam.py +58 -0
- mindspore/_extends/builtin_operations.py +2 -1
- mindspore/_extends/graph_kernel/model/graph_parallel.py +16 -6
- mindspore/_extends/parallel_compile/akg_compiler/akg_process.py +3 -16
- mindspore/_extends/parallel_compile/akg_compiler/build_tbe_kernel.py +16 -4
- mindspore/_extends/parallel_compile/akg_compiler/compiler.py +1 -0
- mindspore/_extends/parallel_compile/akg_compiler/gen_custom_op_files.py +96 -0
- mindspore/_extends/parallel_compile/akg_compiler/tbe_topi.py +2 -1
- mindspore/_extends/parallel_compile/akg_compiler/util.py +5 -2
- mindspore/_extends/parse/__init__.py +18 -14
- mindspore/_extends/parse/compile_config.py +229 -0
- mindspore/_extends/parse/parser.py +155 -59
- mindspore/_extends/parse/resources.py +40 -7
- mindspore/_extends/parse/standard_method.py +124 -204
- mindspore/_extends/remote/kernel_build_server.py +2 -0
- mindspore/_mindspore_offline_debug.cpython-37m-x86_64-linux-gnu.so +0 -0
- mindspore/_profiler.py +30 -0
- mindspore/amp.py +24 -18
- mindspore/bin/cache_admin +0 -0
- mindspore/bin/cache_server +0 -0
- mindspore/boost/boost_cell_wrapper.py +1 -1
- mindspore/boost/group_loss_scale_manager.py +1 -1
- mindspore/common/__init__.py +3 -1
- mindspore/common/_jit_fallback_utils.py +2 -3
- mindspore/common/_register_for_adapter.py +7 -0
- mindspore/common/_stub_tensor.py +6 -1
- mindspore/common/_utils.py +5 -17
- mindspore/common/api.py +91 -48
- mindspore/common/auto_dynamic_shape.py +27 -14
- mindspore/common/dtype.py +5 -4
- mindspore/common/dump.py +5 -4
- mindspore/common/initializer.py +1 -1
- mindspore/common/jit_config.py +20 -11
- mindspore/common/lazy_inline.py +58 -17
- mindspore/common/mindir_util.py +12 -2
- mindspore/common/mutable.py +79 -14
- mindspore/common/parameter.py +19 -4
- mindspore/common/seed.py +9 -9
- mindspore/common/sparse_tensor.py +251 -18
- mindspore/common/symbol.py +122 -0
- mindspore/common/tensor.py +321 -435
- mindspore/communication/__init__.py +3 -3
- mindspore/communication/_comm_helper.py +5 -0
- mindspore/communication/management.py +56 -38
- mindspore/config/op_info.config +22 -54
- mindspore/context.py +192 -54
- mindspore/dataset/__init__.py +5 -5
- mindspore/dataset/audio/__init__.py +6 -6
- mindspore/dataset/audio/transforms.py +711 -158
- mindspore/dataset/callback/ds_callback.py +2 -2
- mindspore/dataset/engine/cache_client.py +2 -2
- mindspore/dataset/engine/datasets.py +95 -38
- mindspore/dataset/engine/datasets_audio.py +14 -14
- mindspore/dataset/engine/datasets_standard_format.py +33 -3
- mindspore/dataset/engine/datasets_text.py +38 -38
- mindspore/dataset/engine/datasets_user_defined.py +7 -7
- mindspore/dataset/engine/datasets_vision.py +75 -71
- mindspore/dataset/engine/offload.py +5 -7
- mindspore/dataset/engine/validators.py +1 -1
- mindspore/dataset/text/__init__.py +3 -3
- mindspore/dataset/text/transforms.py +408 -121
- mindspore/dataset/text/utils.py +9 -9
- mindspore/dataset/transforms/__init__.py +1 -1
- mindspore/dataset/transforms/transforms.py +261 -76
- mindspore/dataset/utils/browse_dataset.py +9 -9
- mindspore/dataset/vision/__init__.py +3 -3
- mindspore/dataset/vision/c_transforms.py +5 -5
- mindspore/dataset/vision/py_transforms_util.py +2 -2
- mindspore/dataset/vision/transforms.py +2264 -514
- mindspore/dataset/vision/utils.py +40 -9
- mindspore/dataset/vision/validators.py +7 -1
- mindspore/experimental/optim/__init__.py +12 -2
- mindspore/experimental/optim/adadelta.py +161 -0
- mindspore/experimental/optim/adagrad.py +168 -0
- mindspore/experimental/optim/adam.py +35 -34
- mindspore/experimental/optim/adamax.py +170 -0
- mindspore/experimental/optim/adamw.py +40 -16
- mindspore/experimental/optim/asgd.py +153 -0
- mindspore/experimental/optim/lr_scheduler.py +65 -125
- mindspore/experimental/optim/nadam.py +157 -0
- mindspore/experimental/optim/optimizer.py +15 -8
- mindspore/experimental/optim/radam.py +194 -0
- mindspore/experimental/optim/rmsprop.py +154 -0
- mindspore/experimental/optim/rprop.py +164 -0
- mindspore/experimental/optim/sgd.py +28 -19
- mindspore/hal/__init__.py +34 -0
- mindspore/hal/_ascend.py +57 -0
- mindspore/hal/_base.py +57 -0
- mindspore/hal/_cpu.py +56 -0
- mindspore/hal/_gpu.py +57 -0
- mindspore/hal/device.py +356 -0
- mindspore/hal/event.py +179 -0
- mindspore/hal/stream.py +337 -0
- mindspore/include/api/data_type.h +2 -2
- mindspore/include/api/dual_abi_helper.h +16 -3
- mindspore/include/api/model.h +1 -3
- mindspore/include/api/status.h +14 -0
- mindspore/include/c_api/model_c.h +173 -0
- mindspore/include/c_api/ms/base/types.h +1 -0
- mindspore/include/c_api/types_c.h +19 -0
- mindspore/include/dataset/execute.h +1 -3
- mindspore/include/mindapi/base/format.h +125 -23
- mindspore/include/mindapi/base/types.h +7 -0
- 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/libopencv_imgcodecs.so.4.5 +0 -0
- mindspore/lib/libopencv_imgproc.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/ascend910/aic-ascend910-ops-info.json +2044 -154
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/config/ascend910b/aic-ascend910b-ops-info.json +2044 -33
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/custom_aicore_ops_impl/build_tbe_kernel.py +529 -0
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/custom_aicore_ops_impl/compiler.py +56 -0
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/custom_aicore_ops_impl/custom.py +1109 -0
- mindspore/lib/plugin/ascend/custom_aicore_ops/op_impl/ai_core/tbe/custom_aicore_ops_impl/get_file_path.py +36 -0
- 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/ai_core/tbe/custom_aicore_ops_impl/tbe_topi.py +556 -0
- 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 +6365 -1759
- 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_add_custom.h +49 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/aclnn_decoder_kv_cache.h +59 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_api/include/aclnn_prompt_kv_cache.h +59 -0
- 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 +52 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend910/aic-ascend910-ops-info.json +232 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/config/ascend910b/aic-ascend910b-ops-info.json +232 -0
- 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.cpp +192 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/decoder_kv_cache.py +134 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/prompt_kv_cache.cpp +274 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/custom_ascendc_ops_impl/dynamic/prompt_kv_cache.py +134 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_impl/ai_core/tbe/op_tiling/lib/linux/x86_64/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 +39 -0
- mindspore/lib/plugin/ascend/custom_ascendc_ops/op_proto/lib/linux/x86_64/libcust_opsproto_rt2.0.so +0 -0
- mindspore/lib/plugin/ascend/libakg.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/libmindspore_cpu_kernels.so +0 -0
- mindspore/lib/plugin/cpu/libakg.so +0 -0
- mindspore/lib/plugin/gpu/libcuda_ops.so.10 +0 -0
- mindspore/lib/plugin/gpu/libcuda_ops.so.11 +0 -0
- mindspore/lib/plugin/gpu10.1/libakg.so +0 -0
- mindspore/lib/plugin/gpu10.1/libnccl.so.2 +0 -0
- mindspore/lib/plugin/gpu10.1/libnvidia_collective.so +0 -0
- mindspore/lib/plugin/gpu11.1/libakg.so +0 -0
- mindspore/lib/plugin/gpu11.1/libnccl.so.2 +0 -0
- mindspore/lib/plugin/gpu11.1/libnvidia_collective.so +0 -0
- mindspore/lib/plugin/gpu11.6/libakg.so +0 -0
- mindspore/lib/plugin/gpu11.6/libnccl.so.2 +0 -0
- mindspore/lib/plugin/gpu11.6/libnvidia_collective.so +0 -0
- mindspore/lib/plugin/libmindspore_ascend.so.2 +0 -0
- mindspore/lib/plugin/libmindspore_gpu.so.10.1 +0 -0
- mindspore/lib/plugin/libmindspore_gpu.so.11.1 +0 -0
- mindspore/lib/plugin/libmindspore_gpu.so.11.6 +0 -0
- mindspore/mindrecord/__init__.py +5 -1
- mindspore/mindrecord/config.py +809 -0
- mindspore/mindrecord/filereader.py +25 -0
- mindspore/mindrecord/filewriter.py +74 -56
- mindspore/mindrecord/mindpage.py +40 -6
- mindspore/mindrecord/shardutils.py +3 -2
- mindspore/mindrecord/shardwriter.py +7 -0
- mindspore/mindrecord/tools/cifar100_to_mr.py +53 -66
- mindspore/mindrecord/tools/cifar10_to_mr.py +48 -63
- mindspore/mindrecord/tools/csv_to_mr.py +7 -17
- mindspore/mindrecord/tools/imagenet_to_mr.py +3 -8
- mindspore/mindrecord/tools/mnist_to_mr.py +11 -21
- mindspore/mindrecord/tools/tfrecord_to_mr.py +2 -10
- mindspore/multiprocessing/__init__.py +68 -0
- mindspore/nn/cell.py +86 -133
- mindspore/nn/dynamic_lr.py +2 -2
- mindspore/nn/layer/activation.py +80 -91
- mindspore/nn/layer/basic.py +4 -80
- mindspore/nn/layer/channel_shuffle.py +3 -16
- mindspore/nn/layer/container.py +3 -3
- mindspore/nn/layer/conv.py +71 -71
- mindspore/nn/layer/embedding.py +107 -46
- mindspore/nn/layer/image.py +4 -7
- mindspore/nn/layer/normalization.py +46 -38
- mindspore/nn/layer/padding.py +26 -39
- mindspore/nn/layer/pooling.py +13 -9
- mindspore/nn/layer/rnn_cells.py +5 -15
- mindspore/nn/layer/rnns.py +6 -5
- mindspore/nn/layer/thor_layer.py +1 -2
- mindspore/nn/layer/timedistributed.py +1 -1
- mindspore/nn/layer/transformer.py +52 -50
- mindspore/nn/learning_rate_schedule.py +6 -5
- mindspore/nn/loss/loss.py +44 -65
- mindspore/nn/optim/ada_grad.py +6 -4
- mindspore/nn/optim/adadelta.py +3 -1
- mindspore/nn/optim/adafactor.py +1 -1
- mindspore/nn/optim/adam.py +102 -181
- mindspore/nn/optim/adamax.py +4 -2
- mindspore/nn/optim/adasum.py +2 -2
- mindspore/nn/optim/asgd.py +4 -2
- mindspore/nn/optim/ftrl.py +31 -61
- mindspore/nn/optim/lamb.py +5 -3
- mindspore/nn/optim/lars.py +2 -2
- mindspore/nn/optim/lazyadam.py +6 -4
- mindspore/nn/optim/momentum.py +13 -25
- mindspore/nn/optim/optimizer.py +6 -3
- mindspore/nn/optim/proximal_ada_grad.py +4 -2
- mindspore/nn/optim/rmsprop.py +9 -3
- mindspore/nn/optim/rprop.py +4 -2
- mindspore/nn/optim/sgd.py +4 -2
- mindspore/nn/optim/thor.py +2 -2
- mindspore/nn/probability/distribution/_utils/custom_ops.py +2 -2
- mindspore/nn/probability/distribution/beta.py +2 -2
- mindspore/nn/probability/distribution/categorical.py +4 -6
- mindspore/nn/probability/distribution/cauchy.py +2 -2
- mindspore/nn/probability/distribution/exponential.py +1 -1
- mindspore/nn/probability/distribution/gumbel.py +2 -2
- mindspore/nn/probability/distribution/poisson.py +2 -2
- mindspore/nn/probability/distribution/uniform.py +2 -2
- mindspore/nn/reinforcement/_tensors_queue.py +13 -1
- mindspore/nn/wrap/__init__.py +2 -1
- mindspore/nn/wrap/cell_wrapper.py +33 -12
- mindspore/nn/wrap/grad_reducer.py +148 -8
- mindspore/nn/wrap/loss_scale.py +7 -7
- mindspore/numpy/__init__.py +2 -0
- mindspore/numpy/array_creations.py +2 -0
- mindspore/numpy/array_ops.py +1 -5
- mindspore/numpy/fft.py +431 -0
- mindspore/numpy/math_ops.py +53 -59
- mindspore/numpy/utils.py +3 -0
- mindspore/ops/__init__.py +7 -3
- mindspore/ops/_grad_experimental/grad_array_ops.py +4 -160
- mindspore/ops/_grad_experimental/grad_comm_ops.py +14 -18
- mindspore/ops/_grad_experimental/grad_inner_ops.py +8 -0
- mindspore/ops/_grad_experimental/grad_math_ops.py +92 -287
- mindspore/ops/_grad_experimental/grad_nn_ops.py +0 -53
- mindspore/ops/_grad_experimental/grad_quant_ops.py +3 -3
- mindspore/ops/_grad_experimental/grad_sparse.py +1 -1
- mindspore/ops/_grad_experimental/grad_sparse_ops.py +3 -3
- mindspore/ops/_op_impl/__init__.py +0 -1
- mindspore/ops/_op_impl/aicpu/__init__.py +1 -0
- mindspore/ops/_op_impl/aicpu/gamma.py +2 -0
- mindspore/ops/_op_impl/{cpu/concat.py → aicpu/generate_eod_mask.py} +16 -17
- mindspore/ops/_op_impl/aicpu/log_uniform_candidate_sampler.py +1 -3
- mindspore/ops/_op_impl/aicpu/poisson.py +2 -0
- mindspore/ops/_op_impl/cpu/__init__.py +1 -3
- mindspore/ops/_op_impl/cpu/adam.py +2 -2
- mindspore/ops/_op_impl/cpu/adam_weight_decay.py +3 -2
- mindspore/ops/_op_impl/cpu/maximum_grad.py +16 -14
- mindspore/ops/_op_impl/cpu/minimum_grad.py +8 -0
- mindspore/ops/_vmap/vmap_array_ops.py +137 -101
- mindspore/ops/_vmap/vmap_base.py +8 -1
- mindspore/ops/_vmap/vmap_grad_math_ops.py +95 -9
- mindspore/ops/_vmap/vmap_grad_nn_ops.py +102 -56
- mindspore/ops/_vmap/vmap_image_ops.py +70 -13
- mindspore/ops/_vmap/vmap_math_ops.py +74 -49
- mindspore/ops/_vmap/vmap_nn_ops.py +164 -89
- mindspore/ops/_vmap/vmap_other_ops.py +1 -1
- mindspore/ops/auto_generate/__init__.py +31 -0
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +133 -0
- mindspore/ops/auto_generate/gen_arg_dtype_cast.py +248 -0
- mindspore/ops/auto_generate/gen_arg_handler.py +147 -0
- mindspore/ops/auto_generate/gen_extend_func.py +130 -0
- mindspore/ops/auto_generate/gen_ops_def.py +4786 -0
- mindspore/ops/auto_generate/gen_ops_prim.py +8335 -0
- mindspore/ops/auto_generate/pyboost_inner_prim.py +77 -0
- mindspore/ops/composite/__init__.py +5 -2
- mindspore/ops/composite/base.py +118 -17
- mindspore/ops/composite/math_ops.py +9 -48
- mindspore/ops/composite/multitype_ops/_compile_utils.py +166 -601
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +15 -133
- mindspore/ops/composite/multitype_ops/add_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/bitwise_and_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/bitwise_or_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/bitwise_xor_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/div_impl.py +8 -0
- mindspore/ops/composite/multitype_ops/equal_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/floordiv_impl.py +8 -0
- mindspore/ops/composite/multitype_ops/getitem_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/greater_equal_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/greater_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/in_impl.py +8 -2
- mindspore/ops/composite/multitype_ops/left_shift_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/less_equal_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/less_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/logic_not_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/logical_and_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/logical_or_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/mod_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/mul_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/negative_impl.py +9 -3
- mindspore/ops/composite/multitype_ops/not_equal_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/not_in_impl.py +6 -1
- mindspore/ops/composite/multitype_ops/ones_like_impl.py +2 -2
- mindspore/ops/composite/multitype_ops/pow_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/right_shift_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/setitem_impl.py +32 -21
- mindspore/ops/composite/multitype_ops/sub_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/zeros_like_impl.py +6 -3
- mindspore/ops/deprecated.py +14 -3
- mindspore/ops/extend/__init__.py +46 -0
- mindspore/ops/extend/array_func.py +152 -0
- mindspore/ops/extend/math_func.py +76 -0
- mindspore/ops/{_op_impl/tbe/atomic_addr_clean.py → extend/nn_func.py} +5 -15
- mindspore/ops/function/__init__.py +19 -11
- mindspore/ops/function/array_func.py +248 -1436
- mindspore/ops/function/clip_func.py +12 -13
- mindspore/ops/function/debug_func.py +2 -5
- mindspore/ops/function/fft_func.py +31 -0
- mindspore/ops/function/grad/grad_func.py +24 -17
- mindspore/ops/function/image_func.py +27 -21
- mindspore/ops/function/linalg_func.py +30 -53
- mindspore/ops/function/math_func.py +450 -2356
- mindspore/ops/function/nn_func.py +470 -789
- mindspore/ops/function/other_func.py +4 -5
- mindspore/ops/function/parameter_func.py +6 -92
- mindspore/ops/function/random_func.py +24 -80
- mindspore/ops/function/sparse_unary_func.py +11 -18
- mindspore/ops/function/spectral_func.py +1 -1
- mindspore/ops/function/vmap_func.py +15 -14
- mindspore/ops/functional.py +56 -62
- mindspore/ops/op_info_register.py +22 -19
- mindspore/ops/operations/__init__.py +19 -19
- mindspore/ops/operations/_embedding_cache_ops.py +1 -1
- mindspore/ops/operations/_grad_ops.py +20 -723
- mindspore/ops/operations/_inner_ops.py +233 -286
- mindspore/ops/operations/_quant_ops.py +4 -4
- mindspore/ops/operations/_rl_inner_ops.py +1 -1
- mindspore/ops/operations/_scalar_ops.py +5 -480
- mindspore/ops/operations/_sequence_ops.py +4 -34
- mindspore/ops/operations/array_ops.py +100 -2481
- mindspore/ops/operations/comm_ops.py +38 -46
- mindspore/ops/operations/custom_ops.py +9 -9
- mindspore/ops/operations/debug_ops.py +101 -32
- mindspore/ops/operations/image_ops.py +3 -219
- mindspore/ops/operations/inner_ops.py +52 -38
- mindspore/ops/operations/linalg_ops.py +1 -49
- mindspore/{rewrite/ast_transformers → ops/operations/manually_defined}/__init__.py +11 -4
- mindspore/ops/operations/manually_defined/_inner.py +61 -0
- mindspore/ops/operations/manually_defined/ops_def.py +1391 -0
- mindspore/ops/operations/math_ops.py +752 -4588
- mindspore/ops/operations/nn_ops.py +380 -1750
- mindspore/ops/operations/other_ops.py +50 -42
- mindspore/ops/operations/random_ops.py +3 -50
- mindspore/ops/operations/sparse_ops.py +4 -4
- mindspore/ops/primitive.py +196 -96
- mindspore/ops/silent_check.py +162 -0
- mindspore/ops_generate/__init__.py +27 -0
- mindspore/ops_generate/arg_dtype_cast.py +248 -0
- mindspore/ops_generate/arg_handler.py +147 -0
- mindspore/ops_generate/gen_aclnn_implement.py +266 -0
- mindspore/ops_generate/gen_ops.py +1062 -0
- mindspore/ops_generate/gen_ops_inner_prim.py +129 -0
- mindspore/ops_generate/gen_pyboost_func.py +932 -0
- mindspore/ops_generate/gen_utils.py +188 -0
- mindspore/ops_generate/op_proto.py +138 -0
- mindspore/ops_generate/pyboost_utils.py +364 -0
- mindspore/ops_generate/template.py +238 -0
- mindspore/parallel/__init__.py +6 -4
- mindspore/parallel/_auto_parallel_context.py +28 -4
- mindspore/parallel/_cell_wrapper.py +16 -9
- mindspore/parallel/_cost_model_context.py +1 -1
- mindspore/parallel/_dp_allreduce_fusion.py +159 -159
- mindspore/parallel/_parallel_serialization.py +28 -12
- mindspore/parallel/_ps_context.py +1 -1
- mindspore/parallel/_recovery_context.py +1 -1
- mindspore/parallel/_tensor.py +22 -8
- mindspore/parallel/_transformer/__init__.py +1 -1
- mindspore/parallel/_transformer/layers.py +1 -1
- mindspore/parallel/_transformer/loss.py +1 -1
- mindspore/parallel/_transformer/moe.py +1 -1
- mindspore/parallel/_transformer/op_parallel_config.py +1 -1
- mindspore/parallel/_transformer/transformer.py +9 -9
- mindspore/parallel/_utils.py +131 -6
- mindspore/parallel/algo_parameter_config.py +6 -6
- mindspore/parallel/checkpoint_transform.py +156 -26
- mindspore/parallel/cluster/__init__.py +15 -0
- mindspore/parallel/cluster/process_entity/__init__.py +18 -0
- mindspore/parallel/cluster/process_entity/_api.py +345 -0
- mindspore/parallel/cluster/process_entity/_utils.py +116 -0
- mindspore/parallel/cluster/run.py +139 -0
- mindspore/parallel/mpi/__init__.py +1 -1
- mindspore/parallel/mpi/_mpi_config.py +1 -1
- mindspore/parallel/parameter_broadcast.py +152 -0
- mindspore/parallel/shard.py +99 -2
- mindspore/profiler/common/util.py +20 -0
- mindspore/profiler/envprofiling.py +1 -1
- mindspore/{_extends/parallel_compile/tbe_compiler → profiler/parser/ascend_analysis}/__init__.py +1 -1
- mindspore/profiler/parser/ascend_analysis/constant.py +66 -0
- mindspore/profiler/parser/ascend_analysis/file_manager.py +77 -0
- mindspore/profiler/parser/ascend_analysis/function_event.py +146 -0
- mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +108 -0
- mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +80 -0
- mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +52 -0
- mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +104 -0
- mindspore/profiler/parser/ascend_analysis/tlv_decoder.py +86 -0
- mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +59 -0
- mindspore/profiler/parser/ascend_cluster_generator.py +116 -0
- mindspore/profiler/parser/ascend_communicate_generator.py +314 -0
- mindspore/profiler/parser/ascend_flops_generator.py +27 -5
- mindspore/profiler/parser/ascend_fpbp_generator.py +8 -2
- mindspore/profiler/parser/ascend_hccl_generator.py +27 -279
- mindspore/profiler/parser/ascend_msprof_exporter.py +122 -118
- mindspore/profiler/parser/ascend_msprof_generator.py +67 -273
- mindspore/profiler/parser/ascend_op_generator.py +68 -27
- mindspore/profiler/parser/ascend_timeline_generator.py +292 -131
- mindspore/profiler/parser/base_timeline_generator.py +17 -3
- mindspore/profiler/parser/cpu_gpu_timeline_generator.py +2 -1
- mindspore/profiler/parser/framework_parser.py +11 -4
- mindspore/profiler/parser/integrator.py +3 -1
- mindspore/profiler/parser/memory_usage_parser.py +8 -2
- mindspore/profiler/parser/minddata_analyzer.py +8 -2
- mindspore/profiler/parser/minddata_parser.py +1 -1
- mindspore/profiler/parser/msadvisor_analyzer.py +5 -3
- mindspore/profiler/parser/msadvisor_parser.py +10 -4
- mindspore/profiler/parser/profiler_info.py +5 -0
- mindspore/profiler/profiling.py +373 -171
- mindspore/rewrite/__init__.py +2 -13
- mindspore/rewrite/api/node.py +122 -36
- mindspore/rewrite/api/pattern_engine.py +2 -3
- mindspore/rewrite/api/scoped_value.py +16 -15
- mindspore/rewrite/api/symbol_tree.py +46 -30
- mindspore/rewrite/ast_helpers/__init__.py +3 -6
- mindspore/rewrite/ast_helpers/ast_converter.py +143 -0
- mindspore/rewrite/ast_helpers/ast_finder.py +48 -0
- mindspore/rewrite/ast_helpers/ast_flattener.py +268 -0
- mindspore/rewrite/ast_helpers/ast_modifier.py +160 -92
- mindspore/rewrite/common/__init__.py +1 -2
- mindspore/rewrite/common/config.py +24 -0
- mindspore/rewrite/common/{rewrite_elog.py → error_log.py} +39 -39
- mindspore/rewrite/{namer.py → common/namer.py} +63 -18
- mindspore/rewrite/common/namespace.py +118 -0
- mindspore/rewrite/node/__init__.py +5 -5
- mindspore/rewrite/node/call_function.py +23 -7
- mindspore/rewrite/node/cell_container.py +7 -3
- mindspore/rewrite/node/control_flow.py +53 -28
- mindspore/rewrite/node/node.py +212 -196
- mindspore/rewrite/node/node_manager.py +51 -22
- mindspore/rewrite/node/node_topological_manager.py +3 -23
- mindspore/rewrite/parsers/__init__.py +12 -0
- mindspore/rewrite/parsers/arguments_parser.py +8 -9
- mindspore/rewrite/parsers/assign_parser.py +635 -413
- mindspore/rewrite/parsers/attribute_parser.py +3 -4
- mindspore/rewrite/parsers/class_def_parser.py +107 -144
- mindspore/rewrite/parsers/constant_parser.py +5 -5
- mindspore/rewrite/parsers/container_parser.py +4 -6
- mindspore/rewrite/parsers/expr_parser.py +55 -0
- mindspore/rewrite/parsers/for_parser.py +31 -98
- mindspore/rewrite/parsers/function_def_parser.py +13 -5
- mindspore/rewrite/parsers/if_parser.py +28 -10
- mindspore/rewrite/parsers/module_parser.py +8 -182
- mindspore/rewrite/parsers/parser.py +1 -5
- mindspore/rewrite/parsers/parser_register.py +1 -1
- mindspore/rewrite/parsers/return_parser.py +5 -10
- mindspore/rewrite/parsers/while_parser.py +59 -0
- mindspore/rewrite/sparsify/utils.py +1 -1
- mindspore/rewrite/symbol_tree/__init__.py +20 -0
- mindspore/rewrite/{symbol_tree.py → symbol_tree/symbol_tree.py} +704 -185
- mindspore/rewrite/{symbol_tree_builder.py → symbol_tree/symbol_tree_builder.py} +8 -8
- mindspore/rewrite/{symbol_tree_dumper.py → symbol_tree/symbol_tree_dumper.py} +4 -4
- mindspore/run_check/_check_version.py +6 -14
- mindspore/run_check/run_check.py +1 -1
- mindspore/safeguard/rewrite_obfuscation.py +9 -19
- mindspore/scipy/__init__.py +2 -1
- mindspore/scipy/fft.py +133 -0
- mindspore/scipy/linalg.py +140 -55
- mindspore/scipy/ops.py +15 -71
- mindspore/scipy/ops_grad.py +5 -34
- mindspore/scipy/optimize/line_search.py +2 -2
- mindspore/scipy/optimize/minimize.py +1 -1
- mindspore/train/__init__.py +3 -2
- mindspore/train/_utils.py +178 -4
- mindspore/train/amp.py +167 -245
- mindspore/train/callback/_backup_and_restore.py +4 -4
- mindspore/train/callback/_callback.py +4 -4
- mindspore/train/callback/_checkpoint.py +47 -21
- mindspore/train/callback/_early_stop.py +2 -2
- mindspore/train/callback/_landscape.py +15 -10
- mindspore/train/callback/_loss_monitor.py +2 -2
- mindspore/train/callback/_on_request_exit.py +2 -2
- mindspore/train/callback/_reduce_lr_on_plateau.py +2 -2
- mindspore/train/callback/_summary_collector.py +13 -14
- mindspore/train/callback/_time_monitor.py +2 -2
- mindspore/train/data_sink.py +1 -1
- mindspore/train/dataset_helper.py +19 -4
- mindspore/train/loss_scale_manager.py +2 -2
- mindspore/train/metrics/accuracy.py +7 -7
- mindspore/train/metrics/confusion_matrix.py +8 -6
- mindspore/train/metrics/cosine_similarity.py +6 -4
- mindspore/train/metrics/error.py +2 -2
- mindspore/train/metrics/metric.py +3 -3
- mindspore/train/metrics/perplexity.py +2 -1
- mindspore/train/metrics/topk.py +2 -2
- mindspore/train/mind_ir_pb2.py +75 -6
- mindspore/train/model.py +41 -27
- mindspore/train/serialization.py +262 -133
- mindspore/train/summary/_writer_pool.py +1 -1
- mindspore/train/summary/summary_record.py +56 -34
- mindspore/train/train_thor/convert_utils.py +3 -3
- mindspore/version.py +1 -1
- {mindspore-2.2.11.dist-info → mindspore-2.3.0rc1.dist-info}/METADATA +2 -2
- {mindspore-2.2.11.dist-info → mindspore-2.3.0rc1.dist-info}/RECORD +532 -1075
- {mindspore-2.2.11.dist-info → mindspore-2.3.0rc1.dist-info}/entry_points.txt +1 -0
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py +0 -662
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py +0 -377
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_job.py +0 -201
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_job_manager.py +0 -515
- mindspore/config/super_bar_config.json +0 -544
- mindspore/gen_ops.py +0 -273
- mindspore/lib/plugin/ascend/custom_aicpu_ops/op_impl/cpu/aicpu_kernel/impl/libcust_aicpu_kernels.so +0 -0
- mindspore/lib/plugin/ascend/libmindspore_aicpu_kernels.so +0 -0
- mindspore/lib/plugin/libmindspore_ascend.so.1 +0 -0
- mindspore/nn/layer/flash_attention.py +0 -189
- mindspore/ops/_op_impl/cpu/tensor_shape.py +0 -42
- mindspore/ops/_op_impl/tbe/__init__.py +0 -47
- mindspore/ops/_op_impl/tbe/abs.py +0 -38
- mindspore/ops/_op_impl/tbe/abs_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/abs_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/abs_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/accumulate_n_v2.py +0 -41
- mindspore/ops/_op_impl/tbe/accumulate_n_v2_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/acos.py +0 -37
- mindspore/ops/_op_impl/tbe/acos_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/acos_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/acos_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/acosh.py +0 -37
- mindspore/ops/_op_impl/tbe/acosh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/acosh_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/acosh_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/act_ulq_clamp_max_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/act_ulq_clamp_min_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/acts_ulq.py +0 -45
- mindspore/ops/_op_impl/tbe/acts_ulq_input_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/adam_apply_one.py +0 -50
- mindspore/ops/_op_impl/tbe/adam_apply_one_assign.py +0 -53
- mindspore/ops/_op_impl/tbe/adam_apply_one_ds.py +0 -51
- mindspore/ops/_op_impl/tbe/adam_apply_one_with_decay.py +0 -54
- mindspore/ops/_op_impl/tbe/adam_apply_one_with_decay_assign.py +0 -54
- mindspore/ops/_op_impl/tbe/adam_apply_one_with_decay_ds.py +0 -55
- mindspore/ops/_op_impl/tbe/adaptive_max_pool2d.py +0 -37
- mindspore/ops/_op_impl/tbe/add.py +0 -42
- mindspore/ops/_op_impl/tbe/add_ds.py +0 -43
- mindspore/ops/_op_impl/tbe/add_n.py +0 -39
- mindspore/ops/_op_impl/tbe/add_n_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/addcdiv.py +0 -41
- mindspore/ops/_op_impl/tbe/addcdiv_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/addcmul.py +0 -43
- mindspore/ops/_op_impl/tbe/addcmul_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/apply_ada_max.py +0 -68
- mindspore/ops/_op_impl/tbe/apply_ada_max_ds.py +0 -69
- mindspore/ops/_op_impl/tbe/apply_adadelta.py +0 -66
- mindspore/ops/_op_impl/tbe/apply_adadelta_ds.py +0 -67
- mindspore/ops/_op_impl/tbe/apply_adagrad.py +0 -55
- mindspore/ops/_op_impl/tbe/apply_adagrad_d_a.py +0 -67
- mindspore/ops/_op_impl/tbe/apply_adagrad_ds.py +0 -56
- mindspore/ops/_op_impl/tbe/apply_adagrad_v2.py +0 -48
- mindspore/ops/_op_impl/tbe/apply_adagrad_v2_ds.py +0 -49
- mindspore/ops/_op_impl/tbe/apply_adam.py +0 -79
- mindspore/ops/_op_impl/tbe/apply_adam_ds.py +0 -80
- mindspore/ops/_op_impl/tbe/apply_adam_with_amsgrad.py +0 -60
- mindspore/ops/_op_impl/tbe/apply_adam_with_amsgrad_ds.py +0 -61
- mindspore/ops/_op_impl/tbe/apply_add_sign.py +0 -65
- mindspore/ops/_op_impl/tbe/apply_add_sign_ds.py +0 -66
- mindspore/ops/_op_impl/tbe/apply_centered_rms_prop.py +0 -77
- mindspore/ops/_op_impl/tbe/apply_centered_rms_prop_ds.py +0 -78
- mindspore/ops/_op_impl/tbe/apply_ftrl.py +0 -67
- mindspore/ops/_op_impl/tbe/apply_ftrl_ds.py +0 -68
- mindspore/ops/_op_impl/tbe/apply_gradient_descent.py +0 -44
- mindspore/ops/_op_impl/tbe/apply_gradient_descent_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/apply_keras_momentum.py +0 -49
- mindspore/ops/_op_impl/tbe/apply_momentum.py +0 -64
- mindspore/ops/_op_impl/tbe/apply_momentum_ds.py +0 -65
- mindspore/ops/_op_impl/tbe/apply_power_sign.py +0 -65
- mindspore/ops/_op_impl/tbe/apply_power_sign_ds.py +0 -66
- mindspore/ops/_op_impl/tbe/apply_proximal_adagrad.py +0 -57
- mindspore/ops/_op_impl/tbe/apply_proximal_adagrad_ds.py +0 -58
- mindspore/ops/_op_impl/tbe/apply_proximal_gradient_descent.py +0 -54
- mindspore/ops/_op_impl/tbe/apply_proximal_gradient_descent_ds.py +0 -55
- mindspore/ops/_op_impl/tbe/apply_rms_prop.py +0 -52
- mindspore/ops/_op_impl/tbe/approximate_equal.py +0 -39
- mindspore/ops/_op_impl/tbe/approximate_equal_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/arg_max.py +0 -38
- mindspore/ops/_op_impl/tbe/arg_max_with_value.py +0 -38
- mindspore/ops/_op_impl/tbe/arg_max_with_value_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/arg_min.py +0 -38
- mindspore/ops/_op_impl/tbe/arg_min_v2_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/arg_min_with_value.py +0 -38
- mindspore/ops/_op_impl/tbe/arg_min_with_value_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/asin.py +0 -37
- mindspore/ops/_op_impl/tbe/asin_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/asin_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/asin_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/asinh.py +0 -37
- mindspore/ops/_op_impl/tbe/asinh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/asinh_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/asinh_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/assign.py +0 -79
- mindspore/ops/_op_impl/tbe/assign_add.py +0 -59
- mindspore/ops/_op_impl/tbe/assign_add_ds.py +0 -60
- mindspore/ops/_op_impl/tbe/assign_ds.py +0 -80
- mindspore/ops/_op_impl/tbe/assign_sub.py +0 -55
- mindspore/ops/_op_impl/tbe/assign_sub_ds.py +0 -56
- mindspore/ops/_op_impl/tbe/atan.py +0 -37
- mindspore/ops/_op_impl/tbe/atan2.py +0 -38
- mindspore/ops/_op_impl/tbe/atan2_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/atan_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/atan_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/atan_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/atanh.py +0 -37
- mindspore/ops/_op_impl/tbe/atanh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/avg_pool.py +0 -43
- mindspore/ops/_op_impl/tbe/avg_pool_3d.py +0 -44
- mindspore/ops/_op_impl/tbe/avg_pool_3d_grad.py +0 -45
- mindspore/ops/_op_impl/tbe/avg_pool_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/avg_pool_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/avg_pool_grad_vm.py +0 -42
- mindspore/ops/_op_impl/tbe/basic_lstm_cell.py +0 -57
- mindspore/ops/_op_impl/tbe/basic_lstm_cell_c_state_grad.py +0 -50
- mindspore/ops/_op_impl/tbe/basic_lstm_cell_c_state_grad_v2.py +0 -51
- mindspore/ops/_op_impl/tbe/basic_lstm_cell_input_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/basic_lstm_cell_weight_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/batch_matmul.py +0 -42
- mindspore/ops/_op_impl/tbe/batch_matmul_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/batch_matmul_v2.py +0 -47
- mindspore/ops/_op_impl/tbe/batch_to_space.py +0 -38
- mindspore/ops/_op_impl/tbe/batch_to_space_nd.py +0 -38
- mindspore/ops/_op_impl/tbe/batch_to_space_nd_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/batch_to_space_nd_v2.py +0 -41
- mindspore/ops/_op_impl/tbe/batchnorm.py +0 -58
- mindspore/ops/_op_impl/tbe/batchnorm_grad.py +0 -58
- mindspore/ops/_op_impl/tbe/bce_with_logits_loss.py +0 -42
- mindspore/ops/_op_impl/tbe/bessel_i0e.py +0 -37
- mindspore/ops/_op_impl/tbe/bessel_i0e_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/bessel_i1e.py +0 -37
- mindspore/ops/_op_impl/tbe/bessel_i1e_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/bias_add.py +0 -38
- mindspore/ops/_op_impl/tbe/bias_add_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/bias_add_grad.py +0 -53
- mindspore/ops/_op_impl/tbe/binary_cross_entropy.py +0 -39
- mindspore/ops/_op_impl/tbe/binary_cross_entropy_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/binary_cross_entropy_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/binary_cross_entropy_grad_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/bitwise_and.py +0 -39
- mindspore/ops/_op_impl/tbe/bitwise_and_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/bitwise_or.py +0 -39
- mindspore/ops/_op_impl/tbe/bitwise_or_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/bitwise_xor.py +0 -39
- mindspore/ops/_op_impl/tbe/bitwise_xor_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/bn_infer.py +0 -43
- mindspore/ops/_op_impl/tbe/bn_infer_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/bn_infer_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/bn_infer_grad_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/bn_inference.py +0 -50
- mindspore/ops/_op_impl/tbe/bn_training_reduce.py +0 -38
- mindspore/ops/_op_impl/tbe/bn_training_reduce_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/bn_training_reduce_grad.py +0 -46
- mindspore/ops/_op_impl/tbe/bn_training_reduce_grad_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/bn_training_update.py +0 -52
- mindspore/ops/_op_impl/tbe/bn_training_update_ds.py +0 -53
- mindspore/ops/_op_impl/tbe/bn_training_update_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/bn_training_update_grad_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/bn_training_update_v2.py +0 -48
- mindspore/ops/_op_impl/tbe/bn_training_update_v3.py +0 -51
- mindspore/ops/_op_impl/tbe/bounding_box_decode.py +0 -41
- mindspore/ops/_op_impl/tbe/bounding_box_decode_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/bounding_box_encode.py +0 -38
- mindspore/ops/_op_impl/tbe/broadcast_to.py +0 -40
- mindspore/ops/_op_impl/tbe/broadcast_to_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/cast.py +0 -55
- mindspore/ops/_op_impl/tbe/cast_ds.py +0 -58
- mindspore/ops/_op_impl/tbe/cdist.py +0 -38
- mindspore/ops/_op_impl/tbe/cdist_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/ceil.py +0 -37
- mindspore/ops/_op_impl/tbe/ceil_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/celu.py +0 -39
- mindspore/ops/_op_impl/tbe/centralization.py +0 -39
- mindspore/ops/_op_impl/tbe/check_valid.py +0 -38
- mindspore/ops/_op_impl/tbe/check_valid_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/clip_by_norm_no_div_sum.py +0 -41
- mindspore/ops/_op_impl/tbe/clip_by_norm_no_div_sum_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/clip_by_value.py +0 -41
- mindspore/ops/_op_impl/tbe/clip_by_value_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/concat.py +0 -40
- mindspore/ops/_op_impl/tbe/concat_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/confusion_matrix.py +0 -63
- mindspore/ops/_op_impl/tbe/confusion_mul_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/confusion_softmax_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/confusion_transpose_d.py +0 -39
- mindspore/ops/_op_impl/tbe/conv2d.py +0 -47
- mindspore/ops/_op_impl/tbe/conv2d_backprop_filter.py +0 -42
- mindspore/ops/_op_impl/tbe/conv2d_backprop_filter_ds.py +0 -43
- mindspore/ops/_op_impl/tbe/conv2d_backprop_input.py +0 -42
- mindspore/ops/_op_impl/tbe/conv2d_backprop_input_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/conv2d_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/conv2d_transpose.py +0 -48
- mindspore/ops/_op_impl/tbe/conv3d.py +0 -45
- mindspore/ops/_op_impl/tbe/conv3d_backprop_filter.py +0 -42
- mindspore/ops/_op_impl/tbe/conv3d_backprop_input.py +0 -42
- mindspore/ops/_op_impl/tbe/conv3d_transpose.py +0 -47
- mindspore/ops/_op_impl/tbe/conv3d_transpose_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/cos.py +0 -37
- mindspore/ops/_op_impl/tbe/cos_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/cosh.py +0 -37
- mindspore/ops/_op_impl/tbe/cosh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/ctc_loss_v2.py +0 -42
- mindspore/ops/_op_impl/tbe/ctc_loss_v2_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/cum_sum.py +0 -42
- mindspore/ops/_op_impl/tbe/cum_sum_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/cummin.py +0 -41
- mindspore/ops/_op_impl/tbe/cumprod.py +0 -42
- mindspore/ops/_op_impl/tbe/data_format_dim_map.py +0 -38
- mindspore/ops/_op_impl/tbe/data_format_dim_map_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/deformable_offsets.py +0 -45
- mindspore/ops/_op_impl/tbe/deformable_offsets_grad.py +0 -48
- mindspore/ops/_op_impl/tbe/depth_to_space_ds.py +0 -49
- mindspore/ops/_op_impl/tbe/depthwise_conv2d.py +0 -44
- mindspore/ops/_op_impl/tbe/depthwise_conv2d_backprop_filter.py +0 -41
- mindspore/ops/_op_impl/tbe/depthwise_conv2d_backprop_input.py +0 -41
- mindspore/ops/_op_impl/tbe/diag.py +0 -38
- mindspore/ops/_op_impl/tbe/diag_part.py +0 -38
- mindspore/ops/_op_impl/tbe/dilation.py +0 -40
- mindspore/ops/_op_impl/tbe/div.py +0 -41
- mindspore/ops/_op_impl/tbe/div_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/div_no_nan.py +0 -41
- mindspore/ops/_op_impl/tbe/div_no_nan_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/dropout_do_mask.py +0 -38
- mindspore/ops/_op_impl/tbe/dropout_do_mask_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/dropout_do_mask_v3.py +0 -39
- mindspore/ops/_op_impl/tbe/dynamic_atomic_addr_clean.py +0 -34
- mindspore/ops/_op_impl/tbe/dynamic_gru_v2.py +0 -95
- mindspore/ops/_op_impl/tbe/dynamic_rnn.py +0 -82
- mindspore/ops/_op_impl/tbe/elu.py +0 -38
- mindspore/ops/_op_impl/tbe/elu_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/elu_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/elu_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/equal.py +0 -42
- mindspore/ops/_op_impl/tbe/equal_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/erf.py +0 -37
- mindspore/ops/_op_impl/tbe/erf_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/erfc.py +0 -37
- mindspore/ops/_op_impl/tbe/erfc_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/erfinv.py +0 -36
- mindspore/ops/_op_impl/tbe/exp.py +0 -40
- mindspore/ops/_op_impl/tbe/exp_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/expand_dims.py +0 -38
- mindspore/ops/_op_impl/tbe/expm1.py +0 -37
- mindspore/ops/_op_impl/tbe/expm1_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/extract_image_patches.py +0 -41
- mindspore/ops/_op_impl/tbe/extract_volume_patches.py +0 -39
- mindspore/ops/_op_impl/tbe/fake_quant_with_min_max_vars.py +0 -39
- mindspore/ops/_op_impl/tbe/fake_quant_with_min_max_vars_gradient.py +0 -43
- mindspore/ops/_op_impl/tbe/fake_quant_with_min_max_vars_per_channel.py +0 -39
- mindspore/ops/_op_impl/tbe/fake_quant_with_min_max_vars_per_channel_gradient.py +0 -43
- mindspore/ops/_op_impl/tbe/fast_gelu.py +0 -37
- mindspore/ops/_op_impl/tbe/fast_gelu_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/fast_gelu_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/fast_gelu_grad_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/fill.py +0 -56
- mindspore/ops/_op_impl/tbe/fill_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/flatten.py +0 -48
- mindspore/ops/_op_impl/tbe/floor.py +0 -37
- mindspore/ops/_op_impl/tbe/floor_div.py +0 -41
- mindspore/ops/_op_impl/tbe/floor_div_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/floor_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/floor_mod.py +0 -39
- mindspore/ops/_op_impl/tbe/floor_mod_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/fused_dbn_dw.py +0 -52
- mindspore/ops/_op_impl/tbe/fused_mul_add.py +0 -38
- mindspore/ops/_op_impl/tbe/fused_mul_add_n.py +0 -48
- mindspore/ops/_op_impl/tbe/fused_mul_add_n_l2loss.py +0 -53
- mindspore/ops/_op_impl/tbe/fused_mul_apply_momentum.py +0 -57
- mindspore/ops/_op_impl/tbe/fused_mul_apply_momentum_extern.py +0 -67
- mindspore/ops/_op_impl/tbe/gather_nd.py +0 -52
- mindspore/ops/_op_impl/tbe/gather_nd_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/gather_v2.py +0 -56
- mindspore/ops/_op_impl/tbe/gather_v2_ds.py +0 -68
- mindspore/ops/_op_impl/tbe/gelu.py +0 -37
- mindspore/ops/_op_impl/tbe/gelu_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/gelu_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/gelu_grad_ds.py +0 -43
- mindspore/ops/_op_impl/tbe/ger.py +0 -43
- mindspore/ops/_op_impl/tbe/ger_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/greater.py +0 -43
- mindspore/ops/_op_impl/tbe/greater_equal.py +0 -41
- mindspore/ops/_op_impl/tbe/greater_equal_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/gru_v2_hidden_grad.py +0 -51
- mindspore/ops/_op_impl/tbe/gru_v2_hidden_grad_cell.py +0 -52
- mindspore/ops/_op_impl/tbe/hard_swish.py +0 -37
- mindspore/ops/_op_impl/tbe/hard_swish_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/hard_swish_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/hard_swish_grad_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/histogram_fixed_width.py +0 -40
- mindspore/ops/_op_impl/tbe/hshrink.py +0 -33
- mindspore/ops/_op_impl/tbe/hshrink_grad.py +0 -37
- mindspore/ops/_op_impl/tbe/hsigmoid.py +0 -45
- mindspore/ops/_op_impl/tbe/hsigmoid_grad.py +0 -39
- mindspore/ops/_op_impl/tbe/ifmr.py +0 -47
- mindspore/ops/_op_impl/tbe/ifmr_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/im2col.py +0 -42
- mindspore/ops/_op_impl/tbe/in_top_k.py +0 -37
- mindspore/ops/_op_impl/tbe/inplace_add.py +0 -39
- mindspore/ops/_op_impl/tbe/inplace_index_add.py +0 -46
- mindspore/ops/_op_impl/tbe/inplace_sub.py +0 -39
- mindspore/ops/_op_impl/tbe/inplace_update.py +0 -39
- mindspore/ops/_op_impl/tbe/inplace_update_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/inv.py +0 -38
- mindspore/ops/_op_impl/tbe/inv_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/inv_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/inv_grad_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/invert.py +0 -37
- mindspore/ops/_op_impl/tbe/invert_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/iou.py +0 -38
- mindspore/ops/_op_impl/tbe/iou_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/is_close.py +0 -40
- mindspore/ops/_op_impl/tbe/kl_div_loss.py +0 -38
- mindspore/ops/_op_impl/tbe/kl_div_loss_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/kl_div_loss_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/l2_loss.py +0 -36
- mindspore/ops/_op_impl/tbe/l2_loss_ds.py +0 -37
- mindspore/ops/_op_impl/tbe/l2_normalize.py +0 -38
- mindspore/ops/_op_impl/tbe/l2_normalize_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/lamb_apply_optimizer_assign.py +0 -55
- mindspore/ops/_op_impl/tbe/lamb_apply_weight_assign.py +0 -42
- mindspore/ops/_op_impl/tbe/lamb_next_mv.py +0 -59
- mindspore/ops/_op_impl/tbe/lamb_next_mv_with_decay.py +0 -59
- mindspore/ops/_op_impl/tbe/lamb_next_right.py +0 -44
- mindspore/ops/_op_impl/tbe/lamb_update_with_lr.py +0 -48
- mindspore/ops/_op_impl/tbe/lamb_update_with_lr_v2.py +0 -44
- mindspore/ops/_op_impl/tbe/lars_update.py +0 -50
- mindspore/ops/_op_impl/tbe/lars_update_ds.py +0 -51
- mindspore/ops/_op_impl/tbe/layer_norm.py +0 -46
- mindspore/ops/_op_impl/tbe/layer_norm_beta_gamma_backprop.py +0 -44
- mindspore/ops/_op_impl/tbe/layer_norm_beta_gamma_backprop_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/layer_norm_beta_gamma_backprop_v2.py +0 -40
- mindspore/ops/_op_impl/tbe/layer_norm_beta_gamma_backprop_v2_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/layer_norm_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/layer_norm_grad.py +0 -48
- mindspore/ops/_op_impl/tbe/layer_norm_x_backprop.py +0 -43
- mindspore/ops/_op_impl/tbe/layer_norm_x_backprop_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/layer_norm_x_backprop_v2.py +0 -45
- mindspore/ops/_op_impl/tbe/layer_norm_x_backprop_v2_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/lerp.py +0 -38
- mindspore/ops/_op_impl/tbe/less.py +0 -41
- mindspore/ops/_op_impl/tbe/less_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/less_equal.py +0 -41
- mindspore/ops/_op_impl/tbe/less_equal_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/log.py +0 -40
- mindspore/ops/_op_impl/tbe/log1p.py +0 -37
- mindspore/ops/_op_impl/tbe/log1p_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/log_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/logical_and.py +0 -37
- mindspore/ops/_op_impl/tbe/logical_and_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/logical_not.py +0 -36
- mindspore/ops/_op_impl/tbe/logical_not_ds.py +0 -37
- mindspore/ops/_op_impl/tbe/logical_or.py +0 -37
- mindspore/ops/_op_impl/tbe/logical_or_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/logsoftmax.py +0 -37
- mindspore/ops/_op_impl/tbe/logsoftmax_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/logsoftmax_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/logsoftmax_grad_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/lp_norm.py +0 -40
- mindspore/ops/_op_impl/tbe/lp_norm_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/lrn.py +0 -41
- mindspore/ops/_op_impl/tbe/lrn_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/lstm_input_grad.py +0 -51
- mindspore/ops/_op_impl/tbe/masked_fill.py +0 -40
- mindspore/ops/_op_impl/tbe/masked_fill_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/matmul.py +0 -53
- mindspore/ops/_op_impl/tbe/matmul_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/matmul_v2.py +0 -50
- mindspore/ops/_op_impl/tbe/matrix_diag.py +0 -45
- mindspore/ops/_op_impl/tbe/matrix_diag_part.py +0 -45
- mindspore/ops/_op_impl/tbe/matrix_set_diag.py +0 -46
- mindspore/ops/_op_impl/tbe/max_pool.py +0 -39
- mindspore/ops/_op_impl/tbe/max_pool3d.py +0 -44
- mindspore/ops/_op_impl/tbe/max_pool3d_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/max_pool3d_grad_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/max_pool_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/max_pool_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/max_pool_grad_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/max_pool_grad_grad_with_argmax.py +0 -41
- mindspore/ops/_op_impl/tbe/max_pool_grad_with_argmax.py +0 -42
- mindspore/ops/_op_impl/tbe/max_pool_with_argmax.py +0 -40
- mindspore/ops/_op_impl/tbe/maximum.py +0 -39
- mindspore/ops/_op_impl/tbe/maximum_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/maximum_grad.py +0 -46
- mindspore/ops/_op_impl/tbe/maximum_grad_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/mem_set.py +0 -38
- mindspore/ops/_op_impl/tbe/minimum.py +0 -40
- mindspore/ops/_op_impl/tbe/minimum_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/minimum_grad.py +0 -46
- mindspore/ops/_op_impl/tbe/minimum_grad_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/mish.py +0 -37
- mindspore/ops/_op_impl/tbe/mod.py +0 -41
- mindspore/ops/_op_impl/tbe/mod_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/mul.py +0 -37
- mindspore/ops/_op_impl/tbe/mul_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/mul_no_nan.py +0 -39
- mindspore/ops/_op_impl/tbe/mul_no_nan_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/multilabel_margin_loss.py +0 -39
- mindspore/ops/_op_impl/tbe/neg.py +0 -39
- mindspore/ops/_op_impl/tbe/neg_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/new_im2col.py +0 -40
- mindspore/ops/_op_impl/tbe/nll_loss.py +0 -41
- mindspore/ops/_op_impl/tbe/nll_loss_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/nms_with_mask.py +0 -39
- mindspore/ops/_op_impl/tbe/not_equal.py +0 -41
- mindspore/ops/_op_impl/tbe/not_equal_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/npu_alloc_float_status.py +0 -34
- mindspore/ops/_op_impl/tbe/npu_clear_float_status.py +0 -35
- mindspore/ops/_op_impl/tbe/npu_clear_float_status_v2.py +0 -35
- mindspore/ops/_op_impl/tbe/npu_get_float_status.py +0 -35
- mindspore/ops/_op_impl/tbe/npu_get_float_status_v2.py +0 -35
- mindspore/ops/_op_impl/tbe/one_hot.py +0 -48
- mindspore/ops/_op_impl/tbe/one_hot_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/ones_like.py +0 -40
- mindspore/ops/_op_impl/tbe/ones_like_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/p_s_r_o_i_pooling.py +0 -40
- mindspore/ops/_op_impl/tbe/p_s_r_o_i_pooling_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/pack.py +0 -58
- mindspore/ops/_op_impl/tbe/pack_ds.py +0 -59
- mindspore/ops/_op_impl/tbe/pad_d.py +0 -40
- mindspore/ops/_op_impl/tbe/pad_d_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/parallel_concat.py +0 -70
- mindspore/ops/_op_impl/tbe/parallel_resize_bilinear.py +0 -45
- mindspore/ops/_op_impl/tbe/parallel_resize_bilinear_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/pdist.py +0 -36
- mindspore/ops/_op_impl/tbe/pooling.py +0 -46
- mindspore/ops/_op_impl/tbe/population_count.py +0 -38
- mindspore/ops/_op_impl/tbe/pow.py +0 -41
- mindspore/ops/_op_impl/tbe/pow_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/prelu.py +0 -37
- mindspore/ops/_op_impl/tbe/prelu_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/prelu_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/range.py +0 -39
- mindspore/ops/_op_impl/tbe/real_div.py +0 -38
- mindspore/ops/_op_impl/tbe/real_div_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/reciprocal.py +0 -36
- mindspore/ops/_op_impl/tbe/reciprocal_ds.py +0 -37
- mindspore/ops/_op_impl/tbe/reciprocal_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/reciprocal_grad_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/reduce_all.py +0 -38
- mindspore/ops/_op_impl/tbe/reduce_all_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/reduce_any.py +0 -38
- mindspore/ops/_op_impl/tbe/reduce_any_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/reduce_max.py +0 -43
- mindspore/ops/_op_impl/tbe/reduce_max_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/reduce_mean.py +0 -40
- mindspore/ops/_op_impl/tbe/reduce_mean_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/reduce_min.py +0 -41
- mindspore/ops/_op_impl/tbe/reduce_min_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/reduce_prod.py +0 -42
- mindspore/ops/_op_impl/tbe/reduce_prod_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/reduce_std.py +0 -44
- mindspore/ops/_op_impl/tbe/reduce_sum.py +0 -39
- mindspore/ops/_op_impl/tbe/reduce_sum_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/relu.py +0 -39
- mindspore/ops/_op_impl/tbe/relu6.py +0 -38
- mindspore/ops/_op_impl/tbe/relu6_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/relu6_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/relu6_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/relu_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/relu_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/relu_grad_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/relu_grad_v2.py +0 -40
- mindspore/ops/_op_impl/tbe/relu_grad_v2_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/relu_v2.py +0 -40
- mindspore/ops/_op_impl/tbe/relu_v2_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/renorm.py +0 -39
- mindspore/ops/_op_impl/tbe/resize_bilinear.py +0 -40
- mindspore/ops/_op_impl/tbe/resize_bilinear_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/resize_bilinear_v2.py +0 -43
- mindspore/ops/_op_impl/tbe/resize_nearest_neighbor.py +0 -40
- mindspore/ops/_op_impl/tbe/resize_nearest_neighbor_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/resize_nearest_neighbor_grad.py +0 -39
- mindspore/ops/_op_impl/tbe/resize_nearest_neighbor_grad_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/reverse_v2_d.py +0 -37
- mindspore/ops/_op_impl/tbe/rint.py +0 -37
- mindspore/ops/_op_impl/tbe/rint_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/roi_align.py +0 -43
- mindspore/ops/_op_impl/tbe/roi_align_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/roi_align_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/roi_align_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/roll.py +0 -42
- mindspore/ops/_op_impl/tbe/round.py +0 -38
- mindspore/ops/_op_impl/tbe/round_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/rsqrt.py +0 -37
- mindspore/ops/_op_impl/tbe/rsqrt_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/rsqrt_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/rsqrt_grad_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/scatter_add.py +0 -44
- mindspore/ops/_op_impl/tbe/scatter_div.py +0 -46
- mindspore/ops/_op_impl/tbe/scatter_max.py +0 -45
- mindspore/ops/_op_impl/tbe/scatter_min.py +0 -45
- mindspore/ops/_op_impl/tbe/scatter_mul.py +0 -44
- mindspore/ops/_op_impl/tbe/scatter_nd.py +0 -41
- mindspore/ops/_op_impl/tbe/scatter_nd_add.py +0 -45
- mindspore/ops/_op_impl/tbe/scatter_nd_d.py +0 -41
- mindspore/ops/_op_impl/tbe/scatter_nd_ds.py +0 -49
- mindspore/ops/_op_impl/tbe/scatter_nd_sub.py +0 -47
- mindspore/ops/_op_impl/tbe/scatter_nd_sub_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/scatter_nd_update.py +0 -47
- mindspore/ops/_op_impl/tbe/scatter_nd_update_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/scatter_non_aliasing_add.py +0 -39
- mindspore/ops/_op_impl/tbe/scatter_non_aliasing_add_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/scatter_sub.py +0 -47
- mindspore/ops/_op_impl/tbe/scatter_sub_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/scatter_update.py +0 -43
- mindspore/ops/_op_impl/tbe/select.py +0 -38
- mindspore/ops/_op_impl/tbe/select_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/selu.py +0 -39
- mindspore/ops/_op_impl/tbe/selu_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/sgd.py +0 -62
- mindspore/ops/_op_impl/tbe/sigmoid.py +0 -37
- mindspore/ops/_op_impl/tbe/sigmoid_cross_entropy_with_logits.py +0 -41
- mindspore/ops/_op_impl/tbe/sigmoid_cross_entropy_with_logits_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/sigmoid_cross_entropy_with_logits_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/sigmoid_cross_entropy_with_logits_grad_ds.py +0 -43
- mindspore/ops/_op_impl/tbe/sigmoid_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/sigmoid_grad.py +0 -39
- mindspore/ops/_op_impl/tbe/sigmoid_grad_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/sign.py +0 -38
- mindspore/ops/_op_impl/tbe/sign_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/sin.py +0 -37
- mindspore/ops/_op_impl/tbe/sin_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/sinh.py +0 -37
- mindspore/ops/_op_impl/tbe/sinh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/slice.py +0 -58
- mindspore/ops/_op_impl/tbe/smooth_l1_loss.py +0 -45
- mindspore/ops/_op_impl/tbe/smooth_l1_loss_ds.py +0 -46
- mindspore/ops/_op_impl/tbe/smooth_l1_loss_grad.py +0 -46
- mindspore/ops/_op_impl/tbe/smooth_l1_loss_grad_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/soft_margin_loss.py +0 -38
- mindspore/ops/_op_impl/tbe/soft_margin_loss_grad.py +0 -39
- mindspore/ops/_op_impl/tbe/soft_shrink.py +0 -36
- mindspore/ops/_op_impl/tbe/soft_shrink_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/softmax.py +0 -37
- mindspore/ops/_op_impl/tbe/softmax_cross_entropy_with_logits.py +0 -38
- mindspore/ops/_op_impl/tbe/softmax_cross_entropy_with_logits_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/softmax_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/softmax_grad_ext.py +0 -42
- mindspore/ops/_op_impl/tbe/softmax_v2_with_dropout_do_mask_v3.py +0 -39
- mindspore/ops/_op_impl/tbe/softplus.py +0 -37
- mindspore/ops/_op_impl/tbe/softplus_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/softplus_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/softplus_grad_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/softsign.py +0 -37
- mindspore/ops/_op_impl/tbe/softsign_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/sort.py +0 -38
- mindspore/ops/_op_impl/tbe/sort_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/space_to_batch.py +0 -38
- mindspore/ops/_op_impl/tbe/space_to_batch_nd.py +0 -38
- mindspore/ops/_op_impl/tbe/space_to_depth.py +0 -47
- mindspore/ops/_op_impl/tbe/sparse_apply_adadelta.py +0 -56
- mindspore/ops/_op_impl/tbe/sparse_apply_adagrad.py +0 -45
- mindspore/ops/_op_impl/tbe/sparse_apply_adagrad_ds.py +0 -46
- mindspore/ops/_op_impl/tbe/sparse_apply_adagrad_v2.py +0 -46
- mindspore/ops/_op_impl/tbe/sparse_apply_adagrad_v2_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/sparse_apply_ftrl_d.py +0 -53
- mindspore/ops/_op_impl/tbe/sparse_apply_ftrl_d_ds.py +0 -50
- mindspore/ops/_op_impl/tbe/sparse_apply_ftrl_v2.py +0 -50
- mindspore/ops/_op_impl/tbe/sparse_apply_proximal_adagrad.py +0 -66
- mindspore/ops/_op_impl/tbe/sparse_apply_proximal_adagrad_ds.py +0 -67
- mindspore/ops/_op_impl/tbe/sparse_apply_r_m_s_prop.py +0 -57
- mindspore/ops/_op_impl/tbe/sparse_apply_r_m_s_prop_ds.py +0 -58
- mindspore/ops/_op_impl/tbe/sparse_gather_v2.py +0 -56
- mindspore/ops/_op_impl/tbe/sparse_gather_v2_ds.py +0 -58
- mindspore/ops/_op_impl/tbe/split_d.py +0 -38
- mindspore/ops/_op_impl/tbe/split_d_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/split_v.py +0 -39
- mindspore/ops/_op_impl/tbe/splitv.py +0 -39
- mindspore/ops/_op_impl/tbe/sqrt.py +0 -37
- mindspore/ops/_op_impl/tbe/sqrt_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/sqrt_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/sqrt_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/square.py +0 -38
- mindspore/ops/_op_impl/tbe/square_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/square_sum_all.py +0 -40
- mindspore/ops/_op_impl/tbe/square_sum_all_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/square_sum_v1.py +0 -38
- mindspore/ops/_op_impl/tbe/square_sum_v1_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/square_sum_v2.py +0 -39
- mindspore/ops/_op_impl/tbe/squared_difference.py +0 -39
- mindspore/ops/_op_impl/tbe/squared_difference_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/squeeze.py +0 -37
- mindspore/ops/_op_impl/tbe/strided_read.py +0 -38
- mindspore/ops/_op_impl/tbe/strided_slice_d.py +0 -44
- mindspore/ops/_op_impl/tbe/strided_slice_ds.py +0 -71
- mindspore/ops/_op_impl/tbe/strided_slice_grad_d.py +0 -51
- mindspore/ops/_op_impl/tbe/strided_slice_grad_ds.py +0 -57
- mindspore/ops/_op_impl/tbe/strided_write.py +0 -38
- mindspore/ops/_op_impl/tbe/sub.py +0 -39
- mindspore/ops/_op_impl/tbe/sub_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/tan.py +0 -38
- mindspore/ops/_op_impl/tbe/tan_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/tanh.py +0 -37
- mindspore/ops/_op_impl/tbe/tanh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/tanh_grad.py +0 -39
- mindspore/ops/_op_impl/tbe/tanh_grad_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/tensor_move.py +0 -49
- mindspore/ops/_op_impl/tbe/tensor_move_ds.py +0 -50
- mindspore/ops/_op_impl/tbe/tensor_scatter_update.py +0 -41
- mindspore/ops/_op_impl/tbe/tile.py +0 -37
- mindspore/ops/_op_impl/tbe/tile_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/top_k.py +0 -42
- mindspore/ops/_op_impl/tbe/top_k_ds.py +0 -43
- mindspore/ops/_op_impl/tbe/trans_data.py +0 -167
- mindspore/ops/_op_impl/tbe/trans_data_ds.py +0 -180
- mindspore/ops/_op_impl/tbe/trans_data_rnn.py +0 -44
- mindspore/ops/_op_impl/tbe/transpose.py +0 -60
- mindspore/ops/_op_impl/tbe/transpose_d.py +0 -47
- mindspore/ops/_op_impl/tbe/transpose_nod.py +0 -60
- mindspore/ops/_op_impl/tbe/trunc.py +0 -39
- mindspore/ops/_op_impl/tbe/truncate_div.py +0 -41
- mindspore/ops/_op_impl/tbe/truncate_div_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/truncate_mod.py +0 -41
- mindspore/ops/_op_impl/tbe/truncate_mod_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/unpack.py +0 -38
- mindspore/ops/_op_impl/tbe/unpack_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/unsorted_segment_max.py +0 -49
- mindspore/ops/_op_impl/tbe/unsorted_segment_max_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/unsorted_segment_min.py +0 -49
- mindspore/ops/_op_impl/tbe/unsorted_segment_min_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/unsorted_segment_prod.py +0 -49
- mindspore/ops/_op_impl/tbe/unsorted_segment_prod_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/unsorted_segment_sum.py +0 -38
- mindspore/ops/_op_impl/tbe/unsorted_segment_sum_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/wts_arq.py +0 -40
- mindspore/ops/_op_impl/tbe/xdivy.py +0 -38
- mindspore/ops/_op_impl/tbe/xdivy_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/xlogy.py +0 -38
- mindspore/ops/_op_impl/tbe/xlogy_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/zeros_like.py +0 -41
- mindspore/ops/_op_impl/tbe/zeros_like_ds.py +0 -42
- mindspore/ops/_tracefunc.py +0 -241
- mindspore/ops/arg_dtype_cast.py +0 -54
- mindspore/rewrite/api/tree_node_helper.py +0 -60
- mindspore/rewrite/ast_creator_register.py +0 -37
- mindspore/rewrite/ast_helpers/ast_creator.py +0 -115
- mindspore/rewrite/ast_transformers/flatten_recursive_stmt.py +0 -267
- mindspore/rewrite/ast_transformers/remove_return_out_of_if.py +0 -228
- mindspore/rewrite/namespace.py +0 -53
- {mindspore-2.2.11.dist-info → mindspore-2.3.0rc1.dist-info}/WHEEL +0 -0
- {mindspore-2.2.11.dist-info → mindspore-2.3.0rc1.dist-info}/top_level.txt +0 -0
mindspore/profiler/profiling.py
CHANGED
|
@@ -14,13 +14,19 @@
|
|
|
14
14
|
# ============================================================================
|
|
15
15
|
"""Profiling api file."""
|
|
16
16
|
import os
|
|
17
|
+
import re
|
|
18
|
+
import shutil
|
|
17
19
|
import stat
|
|
18
20
|
import time
|
|
19
21
|
import json
|
|
22
|
+
from json import JSONDecodeError
|
|
20
23
|
import glob
|
|
21
24
|
import subprocess
|
|
22
25
|
import csv
|
|
26
|
+
import socket
|
|
23
27
|
from enum import Enum
|
|
28
|
+
from multiprocessing import Process
|
|
29
|
+
from typing import List
|
|
24
30
|
import numpy as np
|
|
25
31
|
|
|
26
32
|
from mindspore import log as logger, context
|
|
@@ -29,13 +35,14 @@ from mindspore.communication.management import GlobalComm, get_rank, get_group_s
|
|
|
29
35
|
import mindspore._c_expression as c_expression
|
|
30
36
|
import mindspore._c_dataengine as cde
|
|
31
37
|
from mindspore.profiler.common.exceptions.exceptions import ProfilerFileNotFoundException, \
|
|
32
|
-
ProfilerIOException, ProfilerException, ProfilerRawFileException
|
|
38
|
+
ProfilerIOException, ProfilerException, ProfilerRawFileException, ProfilerParamTypeErrorException
|
|
33
39
|
from mindspore.profiler.common.exceptions.exceptions import ProfilerPathErrorException
|
|
34
40
|
from mindspore.profiler.common.exceptions.exceptions import ProfilerDirNotFoundException
|
|
35
41
|
from mindspore.profiler.common.util import get_file_path
|
|
36
42
|
from mindspore.profiler.common.validator.validate_path import validate_and_normalize_path
|
|
37
43
|
from mindspore.profiler.parser.framework_parser import GpuFrameWorkParser, DynamicFrameWorkParser
|
|
38
44
|
from mindspore.profiler.parser.integrator import Integrator, DeviceTarget
|
|
45
|
+
from mindspore.profiler.parser.ascend_analysis.function_event import CANNEvent
|
|
39
46
|
from mindspore.profiler.parser.cpu_gpu_timeline_generator import GpuTimelineGenerator, CpuTimelineGenerator
|
|
40
47
|
from mindspore.profiler.parser.ascend_timeline_generator import AscendTimelineGenerator
|
|
41
48
|
from mindspore.profiler.parser.memory_usage_parser import MemoryUsageParser
|
|
@@ -48,12 +55,14 @@ from mindspore.profiler.parser.msadvisor_analyzer import Msadvisor
|
|
|
48
55
|
from mindspore.profiler.parser.profiler_info import ProfilerInfo
|
|
49
56
|
from mindspore.common.api import _pynative_executor
|
|
50
57
|
from mindspore.profiler.parser.ascend_msprof_exporter import AscendMsprofExporter
|
|
51
|
-
from mindspore.profiler.parser.ascend_msprof_generator import AscendMsprofDataGenerator
|
|
58
|
+
from mindspore.profiler.parser.ascend_msprof_generator import AscendMsprofDataGenerator
|
|
52
59
|
from mindspore.profiler.parser.ascend_fpbp_generator import AscendFPBPGenerator
|
|
53
60
|
from mindspore.profiler.parser.ascend_op_generator import AscendOPGenerator
|
|
54
61
|
from mindspore.profiler.parser.ascend_steptrace_generator import AscendStepTraceGenerator
|
|
55
62
|
from mindspore.profiler.parser.ascend_flops_generator import AscendFlopsGenerator
|
|
56
|
-
from mindspore.profiler.parser.
|
|
63
|
+
from mindspore.profiler.parser.ascend_cluster_generator import AscendClusterGenerator
|
|
64
|
+
from mindspore.profiler.parser.ascend_hccl_generator import AscendHCCLGenerator
|
|
65
|
+
from mindspore.profiler.parser.ascend_communicate_generator import AscendCommunicationGenerator
|
|
57
66
|
|
|
58
67
|
INIT_OP_NAME = 'Default/InitDataSetQueue'
|
|
59
68
|
|
|
@@ -64,10 +73,18 @@ AICORE_METRICS_DICT = {
|
|
|
64
73
|
3: "MemoryL0",
|
|
65
74
|
4: "ResourceConflictRatio",
|
|
66
75
|
5: "MemoryUB",
|
|
76
|
+
6: "L2Cache",
|
|
67
77
|
-1: "None"
|
|
68
78
|
}
|
|
69
79
|
|
|
70
80
|
|
|
81
|
+
class ModelTraingMode(Enum):
|
|
82
|
+
PYNATIVE = 0
|
|
83
|
+
GRAPH = 1
|
|
84
|
+
KERNEL_BY_KERNEL = 2
|
|
85
|
+
UNKNOWN = 3
|
|
86
|
+
|
|
87
|
+
|
|
71
88
|
class DeviceSupportParam(Enum):
|
|
72
89
|
"""The device target enum."""
|
|
73
90
|
CPU = ['start', 'start_profile', 'output_path', 'timeline_limit', 'profile_framework', 'op_time']
|
|
@@ -77,14 +94,14 @@ class DeviceSupportParam(Enum):
|
|
|
77
94
|
]
|
|
78
95
|
ASCEND = [
|
|
79
96
|
'start', 'start_profile', 'output_path', 'data_process', 'timeline_limit', 'profile_memory',
|
|
80
|
-
'parallel_strategy', 'profile_communication', 'aicore_metrics', 'l2_cache', '
|
|
81
|
-
'profile_framework'
|
|
97
|
+
'parallel_strategy', 'profile_communication', 'aicore_metrics', 'l2_cache', 'hbm_ddr', 'pcie', 'op_time',
|
|
98
|
+
'ascend_job_id', 'profile_framework'
|
|
82
99
|
]
|
|
83
100
|
|
|
84
101
|
|
|
85
102
|
ALWAYS_VALID_PARAM = [
|
|
86
103
|
'start', 'start_profile', 'output_path', 'data_process', 'parallel_strategy', 'l2_cache',
|
|
87
|
-
'ascend_job_id', 'op_time', 'profile_framework'
|
|
104
|
+
'hbm_ddr', 'pcie', 'ascend_job_id', 'op_time', 'profile_framework'
|
|
88
105
|
]
|
|
89
106
|
|
|
90
107
|
|
|
@@ -273,11 +290,11 @@ def _parse_host_info(input_file, output_timeline_file, output_memory_file, is_de
|
|
|
273
290
|
logger.warning("No valid time_stamp is record in file: %s", input_file)
|
|
274
291
|
|
|
275
292
|
|
|
276
|
-
def _ascend_graph_msprof_generator(
|
|
293
|
+
def _ascend_graph_msprof_generator(mindstudio_profiler_output, model_iteration_dict):
|
|
277
294
|
"""Executing the msprof export mode."""
|
|
278
295
|
try:
|
|
279
296
|
ProfilerInfo.set_export_start_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
280
|
-
msprof_exporter = AscendMsprofExporter(
|
|
297
|
+
msprof_exporter = AscendMsprofExporter(mindstudio_profiler_output)
|
|
281
298
|
flag = msprof_exporter.export(model_iteration_dict)
|
|
282
299
|
ProfilerInfo.set_export_end_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
283
300
|
return flag
|
|
@@ -287,27 +304,24 @@ def _ascend_graph_msprof_generator(source_path, model_iteration_dict):
|
|
|
287
304
|
return False
|
|
288
305
|
|
|
289
306
|
|
|
290
|
-
def _ascend_graph_msprof_analyse(
|
|
307
|
+
def _ascend_graph_msprof_analyse(mindstudio_profiler_output):
|
|
291
308
|
"""
|
|
292
309
|
Ascend graph model msprof data analyse.
|
|
293
310
|
|
|
294
311
|
Returns:
|
|
295
|
-
list[obj]: The list is : df_op_summary, df_op_statistic, df_step_trace
|
|
312
|
+
list[obj]: The list is : df_op_summary, df_op_statistic, df_step_trace, df_step_trace_model
|
|
296
313
|
"""
|
|
297
|
-
|
|
298
|
-
df_op_statistic = []
|
|
299
|
-
df_step_trace = []
|
|
314
|
+
res = ([], [], [], [])
|
|
300
315
|
try:
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
df_op_summary, df_op_statistic, df_step_trace = msprof_analyser.parse()
|
|
316
|
+
msprof_analyser = AscendMsprofDataGenerator(mindstudio_profiler_output)
|
|
317
|
+
res = msprof_analyser.parse()
|
|
318
|
+
return res
|
|
319
|
+
|
|
306
320
|
except ProfilerException as err:
|
|
307
321
|
logger.warning(err.message)
|
|
308
322
|
finally:
|
|
309
323
|
pass
|
|
310
|
-
return
|
|
324
|
+
return res
|
|
311
325
|
|
|
312
326
|
|
|
313
327
|
class Profiler:
|
|
@@ -316,7 +330,7 @@ class Profiler:
|
|
|
316
330
|
MindSpore users can import the mindspore.Profiler, initialize the Profiler object to start profiling,
|
|
317
331
|
and use Profiler.analyse() to stop profiling and analyse the results.
|
|
318
332
|
Users can visualize the results using the `MindSpore Insight
|
|
319
|
-
<https://www.mindspore.cn/mindinsight/docs/en/
|
|
333
|
+
<https://www.mindspore.cn/mindinsight/docs/en/master/index.html>`_ tool.
|
|
320
334
|
Now, Profiler supports AICORE operator, AICPU operator, HostCPU operator, memory,
|
|
321
335
|
correspondence, cluster, etc data analysis.
|
|
322
336
|
|
|
@@ -324,7 +338,7 @@ class Profiler:
|
|
|
324
338
|
output_path (str, optional): Output data path. Default: ``"./data"`` .
|
|
325
339
|
op_time (bool, optional): (Ascend/GPU) Whether to collect operators performance data. Default value: ``True``.
|
|
326
340
|
profile_communication (bool, optional): (Ascend only) Whether to collect communication performance data in
|
|
327
|
-
a multi devices training,collect when True. Setting this parameter has no effect during single
|
|
341
|
+
a multi devices training,collect when True. Setting this parameter has no effect during single card
|
|
328
342
|
training. When using this parameter, `op_time` must be set to ``True`` . Default: ``False`` .
|
|
329
343
|
profile_memory (bool, optional): (Ascend only) Whether to collect tensor memory data, collect when ``True`` .
|
|
330
344
|
When using this parameter, `op_time` must be set to True. Default: ``False`` .
|
|
@@ -344,9 +358,14 @@ class Profiler:
|
|
|
344
358
|
- 3: MemoryL0 contains l0a_read/write_bw, l0b_read/write_bw, l0c_read/write_bw etc.
|
|
345
359
|
- 4: ResourceConflictRatio contains vec_bankgroup/bank/resc_cflt_ratio etc.
|
|
346
360
|
- 5: MemoryUB contains ub_read/write_bw_mte, ub_read/write_bw_vector, ub\_/write_bw_scalar etc.
|
|
361
|
+
- 6: L2Cache contains write_cache_hit, write_cache_miss_allocate, r0_read_cache_hit, r1_read_cache_hit etc.
|
|
347
362
|
|
|
348
363
|
l2_cache (bool, optional): (Ascend only) Whether to collect l2 cache data, collect when True.
|
|
349
364
|
Default: ``False`` .
|
|
365
|
+
hbm_ddr (bool, optional): (Ascend only) Whether to collect HBM/DDR read and write rate data, collect when True.
|
|
366
|
+
Default: ``False`` .
|
|
367
|
+
pcie (bool, optional): (Ascend only) Whether to collect PCIe bandwidth data, collect when True.
|
|
368
|
+
Default: ``False`` .
|
|
350
369
|
sync_enable (bool, optional): (GPU only) Whether the profiler collects operators in a synchronous way.
|
|
351
370
|
Default: ``True`` .
|
|
352
371
|
|
|
@@ -424,8 +443,13 @@ class Profiler:
|
|
|
424
443
|
_has_initialized = False
|
|
425
444
|
_ascend_profiling_options = ""
|
|
426
445
|
_ascend_job_id = ""
|
|
446
|
+
ENABLE_STATUS = "on"
|
|
447
|
+
DISABLE_STATUS = "off"
|
|
427
448
|
|
|
428
449
|
def __init__(self, **kwargs):
|
|
450
|
+
if os.getenv("PROFILING_MODE"):
|
|
451
|
+
raise RuntimeError("Profiling is already enabled by env.")
|
|
452
|
+
|
|
429
453
|
self._dev_id = None
|
|
430
454
|
self._cpu_profiler = None
|
|
431
455
|
self._gpu_profiler = None
|
|
@@ -447,7 +471,9 @@ class Profiler:
|
|
|
447
471
|
_environment_check()
|
|
448
472
|
# default aicore_metrics type is ArithmeticUtilization
|
|
449
473
|
self._aicore_metrics_id = 0
|
|
450
|
-
self._l2_cache =
|
|
474
|
+
self._l2_cache = self.DISABLE_STATUS
|
|
475
|
+
self._hbm_ddr = self.DISABLE_STATUS
|
|
476
|
+
self._pcie = self.DISABLE_STATUS
|
|
451
477
|
self._data_process = True
|
|
452
478
|
self._op_time = True
|
|
453
479
|
self._profile_communication = False
|
|
@@ -460,24 +486,42 @@ class Profiler:
|
|
|
460
486
|
self._dynamic_status = False
|
|
461
487
|
self._profile_framework = "all"
|
|
462
488
|
self._msprof_enable = os.getenv("PROFILER_SAMPLECONFIG")
|
|
489
|
+
self._pretty_json = False
|
|
490
|
+
self._analyse_only = kwargs.get("analyse_only", False)
|
|
463
491
|
if self._msprof_enable:
|
|
464
492
|
return
|
|
465
|
-
self._start_time = int(time.time() *
|
|
493
|
+
self._start_time = int(time.time() * 1e6) # us
|
|
494
|
+
self._monotonic_time = int(time.monotonic() * 1e6) # us
|
|
466
495
|
logger.info("Profiling: start time: %d", self._start_time)
|
|
467
496
|
if kwargs.get("env_enable"):
|
|
468
497
|
self._profiler_init(kwargs)
|
|
469
498
|
return
|
|
470
|
-
if Profiler._has_initialized:
|
|
471
|
-
msg = "Do not init twice in the profiler."
|
|
472
|
-
raise RuntimeError(msg)
|
|
473
499
|
Profiler._has_initialized = True
|
|
474
500
|
# get device_id and device_target
|
|
475
|
-
self.
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
self.
|
|
501
|
+
if self._analyse_only:
|
|
502
|
+
self._device_target = DeviceTarget.ASCEND.value
|
|
503
|
+
self._rank_id = kwargs.get("rank_id", 0)
|
|
504
|
+
else:
|
|
505
|
+
self._get_devid_rankid_and_devtarget()
|
|
506
|
+
self._parser_kwargs(kwargs)
|
|
507
|
+
self._get_output_path(kwargs)
|
|
508
|
+
self._decide_device_target(kwargs)
|
|
509
|
+
if self.start_profile:
|
|
510
|
+
self.start()
|
|
511
|
+
|
|
512
|
+
@staticmethod
|
|
513
|
+
def _get_prof_rank(prof_path: str):
|
|
514
|
+
"""get rank id."""
|
|
515
|
+
sub_dirs = os.listdir(os.path.realpath(prof_path))
|
|
516
|
+
info_json_path = ""
|
|
517
|
+
for sub_dir in sub_dirs:
|
|
518
|
+
if sub_dir.startswith("device_"):
|
|
519
|
+
device_id = sub_dir.split("_")[-1]
|
|
520
|
+
info_json_path = os.path.join(prof_path, sub_dir, f"info.json.{device_id}")
|
|
521
|
+
if not os.path.exists(info_json_path):
|
|
522
|
+
return -1
|
|
523
|
+
rank_id, _ = Profiler._parse_info_json(info_json_path)
|
|
524
|
+
return rank_id
|
|
481
525
|
|
|
482
526
|
@staticmethod
|
|
483
527
|
def _check_output_path(output_path):
|
|
@@ -493,9 +537,9 @@ class Profiler:
|
|
|
493
537
|
return output_path
|
|
494
538
|
|
|
495
539
|
@staticmethod
|
|
496
|
-
def
|
|
540
|
+
def _parse_job_start_time(prof_dir):
|
|
497
541
|
"""
|
|
498
|
-
|
|
542
|
+
Get the start time of the job.
|
|
499
543
|
|
|
500
544
|
Args:
|
|
501
545
|
input_file (str): The file path of the host start log file.
|
|
@@ -503,12 +547,32 @@ class Profiler:
|
|
|
503
547
|
Returns:
|
|
504
548
|
str, job start time.
|
|
505
549
|
"""
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
550
|
+
AscendMsprofExporter.check_msprof_env()
|
|
551
|
+
script_path = AscendMsprofExporter.get_msprof_info_path()
|
|
552
|
+
if not script_path:
|
|
553
|
+
logger.warning("Can`t find get_msprof_info.py path, use single-export mode instead.")
|
|
554
|
+
return None
|
|
555
|
+
|
|
556
|
+
logger.info("get_msprof_info.py path is : %s", script_path)
|
|
557
|
+
host_dir = os.path.join(prof_dir, 'host')
|
|
558
|
+
cmd = ['python',
|
|
559
|
+
script_path,
|
|
560
|
+
'-dir', host_dir]
|
|
561
|
+
try:
|
|
562
|
+
outs, _ = AscendMsprofExporter.run_cmd(cmd)
|
|
563
|
+
if not outs:
|
|
564
|
+
logger.warning('Can`t find the msprof info result')
|
|
565
|
+
return None
|
|
566
|
+
result = json.loads(outs)
|
|
567
|
+
if result.get('status', 1) == 1:
|
|
568
|
+
return None
|
|
569
|
+
jor_start_time = result.get('data', {}).get('collection_info', {}).get('Collection start time', None)
|
|
570
|
+
if jor_start_time is not None:
|
|
571
|
+
return float(jor_start_time.strip())
|
|
572
|
+
return None
|
|
573
|
+
except (RuntimeError, JSONDecodeError, AttributeError) as err:
|
|
574
|
+
logger.warning('Get the drvVersion error, use single-export mode instead. detail : %s', err)
|
|
575
|
+
return None
|
|
512
576
|
|
|
513
577
|
@staticmethod
|
|
514
578
|
def _parse_info_json(info_file):
|
|
@@ -527,8 +591,52 @@ class Profiler:
|
|
|
527
591
|
dev_info = info_dict.get("DeviceInfo", [])
|
|
528
592
|
dev_id = dev_info[0].get("id", -1)
|
|
529
593
|
|
|
594
|
+
if int(rank_id) < 0:
|
|
595
|
+
rank_id = 0
|
|
596
|
+
|
|
530
597
|
return str(rank_id), str(dev_id)
|
|
531
598
|
|
|
599
|
+
@classmethod
|
|
600
|
+
def offline_analyse(cls, path: str, pretty=False, step_list=None):
|
|
601
|
+
"""
|
|
602
|
+
Analyze training performance data offline, which is invoked after performance data collection is completed.
|
|
603
|
+
|
|
604
|
+
Args:
|
|
605
|
+
path (str): The profiling data path which need to be analyzed offline.
|
|
606
|
+
There needs to be a profiler directory in this path.
|
|
607
|
+
pretty (bool, optional): Whether to pretty json files. Default: ``False``.
|
|
608
|
+
step_list (list, optional): A list of steps that need to be analyzed. Default: ``None``.
|
|
609
|
+
By default, all steps will be analyzed.
|
|
610
|
+
|
|
611
|
+
Examples:
|
|
612
|
+
>>> from mindspore import Profiler
|
|
613
|
+
>>> Profiler.offline_analyse("./profiling_path")
|
|
614
|
+
"""
|
|
615
|
+
profiler_path = os.path.join(path, "profiler")
|
|
616
|
+
if not os.path.exists(profiler_path):
|
|
617
|
+
raise ProfilerPathErrorException(f'There must be a profiler folder in the data path: {path}.')
|
|
618
|
+
|
|
619
|
+
rank_set = set()
|
|
620
|
+
sub_dirs = os.listdir(os.path.realpath(profiler_path))
|
|
621
|
+
for sub_dir in sub_dirs:
|
|
622
|
+
sub_path = os.path.join(profiler_path, sub_dir)
|
|
623
|
+
if os.path.isdir(sub_path) and re.match(r"^PROF_\d+_\d+_[a-zA-Z0-9]+", sub_dir):
|
|
624
|
+
rank = cls._get_prof_rank(sub_path)
|
|
625
|
+
rank_set.add(rank)
|
|
626
|
+
if not rank_set:
|
|
627
|
+
return
|
|
628
|
+
|
|
629
|
+
process_list = []
|
|
630
|
+
for rank_id in rank_set:
|
|
631
|
+
profiler = cls(analyse_only=True, rank_id=rank_id)
|
|
632
|
+
process = Process(target=profiler.analyse,
|
|
633
|
+
args=(path, pretty, step_list))
|
|
634
|
+
process.start()
|
|
635
|
+
process_list.append(process)
|
|
636
|
+
|
|
637
|
+
for process in process_list:
|
|
638
|
+
process.join()
|
|
639
|
+
|
|
532
640
|
def op_analyse(self, op_name, device_id=None):
|
|
533
641
|
"""
|
|
534
642
|
Profiler users can use this interface to obtain operator performance data.
|
|
@@ -554,12 +662,12 @@ class Profiler:
|
|
|
554
662
|
>>> # Profiler init.
|
|
555
663
|
>>> profiler = Profiler()
|
|
556
664
|
>>> # Train Model or eval Model, taking LeNet5 as an example.
|
|
557
|
-
>>> # Refer to https://gitee.com/mindspore/docs/blob/r2.
|
|
665
|
+
>>> # Refer to https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/lenet.py
|
|
558
666
|
>>> net = LeNet5()
|
|
559
667
|
>>> optimizer = nn.Momentum(net.trainable_params(), learning_rate=0.1, momentum=0.9)
|
|
560
668
|
>>> loss = nn.SoftmaxCrossEntropyWithLogits(sparse=True)
|
|
561
669
|
>>> # Create the dataset taking MNIST as an example.
|
|
562
|
-
>>> # Refer to https://gitee.com/mindspore/docs/blob/r2.
|
|
670
|
+
>>> # Refer to https://gitee.com/mindspore/docs/blob/r2.3.q1/docs/mindspore/code/mnist.py
|
|
563
671
|
>>> dataloader = create_dataset()
|
|
564
672
|
>>> model = Model(net, loss, optimizer)
|
|
565
673
|
>>> model.train(5, dataloader, dataset_sink_mode=False)
|
|
@@ -594,16 +702,28 @@ class Profiler:
|
|
|
594
702
|
return message
|
|
595
703
|
return op_info
|
|
596
704
|
|
|
597
|
-
def analyse(self, offline_path=None):
|
|
705
|
+
def analyse(self, offline_path=None, pretty=False, step_list=None):
|
|
598
706
|
"""
|
|
599
707
|
Collect and analyze training performance data, support calls during and after training. The example shows above.
|
|
600
708
|
|
|
601
709
|
Args:
|
|
602
|
-
offline_path (Union[str, None], optional): The data path which need to be
|
|
710
|
+
offline_path (Union[str, None], optional): The data path which need to be analyzed with offline mode.
|
|
603
711
|
Offline mode isused in abnormal exit scenario. This parameter should be set to ``None``
|
|
604
712
|
for online mode. Default: ``None``.
|
|
713
|
+
pretty (bool, optional): Whether to pretty json files. Default: ``False``.
|
|
714
|
+
step_list (list, optional): A list of steps that need to be analyzed. Default: ``None``.
|
|
715
|
+
By default, all steps will be analyzed.
|
|
605
716
|
"""
|
|
606
|
-
|
|
717
|
+
if isinstance(pretty, bool):
|
|
718
|
+
self._pretty_json = pretty
|
|
719
|
+
model_iteration_dict = {}
|
|
720
|
+
if step_list is not None and not isinstance(step_list, list):
|
|
721
|
+
raise ProfilerParamTypeErrorException("Parameter step_list must be a list.")
|
|
722
|
+
if step_list:
|
|
723
|
+
if not isinstance(step_list[0], int):
|
|
724
|
+
raise ProfilerParamTypeErrorException("The elements of the parameter step_list must be integers.")
|
|
725
|
+
model_iteration_dict.setdefault(4294967295, []).append(step_list[0])
|
|
726
|
+
self._analyse(offline_path=offline_path, model_iteration_dict=model_iteration_dict)
|
|
607
727
|
|
|
608
728
|
def _analyse(self, offline_path=None, model_iteration_dict=None):
|
|
609
729
|
"""
|
|
@@ -616,7 +736,6 @@ class Profiler:
|
|
|
616
736
|
model_iteration_dict: Dictionary with model id as the key and iteration id as the value, Default: ``None``.
|
|
617
737
|
"""
|
|
618
738
|
self._model_iteration_dict = model_iteration_dict
|
|
619
|
-
|
|
620
739
|
self._init_profiler_info()
|
|
621
740
|
self._is_support_step_info_collect()
|
|
622
741
|
parallel_mode = get_auto_parallel_context("parallel_mode")
|
|
@@ -626,11 +745,10 @@ class Profiler:
|
|
|
626
745
|
ProfilerInfo.set_rank_size(self._rank_size)
|
|
627
746
|
ProfilerInfo.set_heterogeneous(self._is_heterogeneous)
|
|
628
747
|
if offline_path:
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
ProfilerInfo.save(self._output_path)
|
|
748
|
+
ProfilerInfo.set_analyse_start_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
749
|
+
self._ascend_graph_analyse(offline_path=offline_path)
|
|
750
|
+
ProfilerInfo.set_analyse_end_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
751
|
+
ProfilerInfo.save(self._output_path)
|
|
634
752
|
_offline_parse(offline_path)
|
|
635
753
|
return
|
|
636
754
|
if self._msprof_enable:
|
|
@@ -643,8 +761,6 @@ class Profiler:
|
|
|
643
761
|
self._dynamic_status = self._profiler_manager.dynamic_status()
|
|
644
762
|
_environment_check()
|
|
645
763
|
|
|
646
|
-
self._cpu_profiler.stop()
|
|
647
|
-
|
|
648
764
|
cpu_op_file = glob.glob(os.path.join(self._output_path, 'cpu_op_type_info_*'))
|
|
649
765
|
if self._device_target and self._device_target != DeviceTarget.CPU.value and cpu_op_file:
|
|
650
766
|
self._is_heterogeneous = True
|
|
@@ -673,7 +789,6 @@ class Profiler:
|
|
|
673
789
|
|
|
674
790
|
Raises:
|
|
675
791
|
RuntimeError: If the profiler has already started.
|
|
676
|
-
RuntimeError: If MD profiling has stopped, repeated start action is not supported.
|
|
677
792
|
RuntimeError: If the `start_profile` parameter is not set or is set to ``True``.
|
|
678
793
|
|
|
679
794
|
Examples:
|
|
@@ -707,17 +822,8 @@ class Profiler:
|
|
|
707
822
|
if not self._has_started:
|
|
708
823
|
if not self._has_started_twice:
|
|
709
824
|
self._has_started = True
|
|
710
|
-
self._has_started_twice = True
|
|
711
|
-
else:
|
|
712
|
-
raise RuntimeError("MindSpore Profiling has finished, repeated start and stop actions are not "
|
|
713
|
-
"supported.")
|
|
714
825
|
else:
|
|
715
|
-
raise RuntimeError("The profiler has already started.
|
|
716
|
-
"is set to False.")
|
|
717
|
-
|
|
718
|
-
# No need to start anything if parse profiling data offline
|
|
719
|
-
if self._is_offline_parser():
|
|
720
|
-
return
|
|
826
|
+
raise RuntimeError("The profiler has already started. Do not turn on again in the open state.")
|
|
721
827
|
|
|
722
828
|
self._cpu_profiler.step_profiling_enable(True)
|
|
723
829
|
if self._op_time:
|
|
@@ -778,14 +884,11 @@ class Profiler:
|
|
|
778
884
|
raise RuntimeError("The profiler has not started, so can not stop. Please call the start() method "
|
|
779
885
|
"before calling the stop() method.")
|
|
780
886
|
|
|
781
|
-
# No need to stop anything if parse profiling data offline
|
|
782
|
-
if self._is_offline_parser():
|
|
783
|
-
return
|
|
784
|
-
|
|
785
887
|
# Stop data collection after all operators are executed.
|
|
786
888
|
_pynative_executor.sync()
|
|
787
889
|
|
|
788
|
-
|
|
890
|
+
self._cpu_profiler.stop()
|
|
891
|
+
if self._data_process and self._md_profiler is not None:
|
|
789
892
|
self._md_profiler.stop()
|
|
790
893
|
self._md_profiler.save(self._output_path)
|
|
791
894
|
|
|
@@ -797,9 +900,21 @@ class Profiler:
|
|
|
797
900
|
self._stop_time = int(time.time() * 10000000)
|
|
798
901
|
ProfilerInfo.set_profiling_stop_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
799
902
|
self._init_profiler_info()
|
|
903
|
+
ProfilerInfo.set_diff_time(self._start_time - self._monotonic_time)
|
|
800
904
|
ProfilerInfo.save(self._output_path)
|
|
801
905
|
logger.info("Profiling: stop time: %d", self._stop_time)
|
|
802
906
|
|
|
907
|
+
def _set_ascend_job_id(self, ascend_job_id):
|
|
908
|
+
"""Set output_path for offline parsing performance data."""
|
|
909
|
+
if not ascend_job_id:
|
|
910
|
+
return
|
|
911
|
+
self._ascend_job_id = validate_and_normalize_path(ascend_job_id)
|
|
912
|
+
if not os.path.exists(self._ascend_job_id):
|
|
913
|
+
msg = f"Invalid ascend_job_id: {self._ascend_job_id}, Please pass the absolute path of the JOB dir"
|
|
914
|
+
logger.critical(msg)
|
|
915
|
+
raise ValueError(msg)
|
|
916
|
+
self._output_path, _ = os.path.split(self._ascend_job_id)
|
|
917
|
+
|
|
803
918
|
def _profiler_init(self, kwargs):
|
|
804
919
|
"""Initialize variables when profiler is enabled by environment variables."""
|
|
805
920
|
options = kwargs.get("env_enable")
|
|
@@ -918,15 +1033,17 @@ class Profiler:
|
|
|
918
1033
|
"output": self._output_path,
|
|
919
1034
|
"fp_point": fp_point,
|
|
920
1035
|
"bp_point": bp_point,
|
|
921
|
-
"training_trace":
|
|
922
|
-
"task_trace":
|
|
1036
|
+
"training_trace": self.ENABLE_STATUS if self._op_time else self.DISABLE_STATUS,
|
|
1037
|
+
"task_trace": self.ENABLE_STATUS if self._op_time else self.DISABLE_STATUS,
|
|
923
1038
|
"aic_metrics": AICORE_METRICS_DICT.get(self._aicore_metrics_id, "ArithmeticUtilization"),
|
|
924
|
-
"aicpu":
|
|
925
|
-
"profile_memory":
|
|
926
|
-
"hccl":
|
|
1039
|
+
"aicpu": self.ENABLE_STATUS if self._data_process or self._op_time else self.DISABLE_STATUS,
|
|
1040
|
+
"profile_memory": self.ENABLE_STATUS if self._op_time and self._profile_memory else self.DISABLE_STATUS,
|
|
1041
|
+
"hccl": self.ENABLE_STATUS if self._op_time and self._profile_communication else self.DISABLE_STATUS,
|
|
927
1042
|
"l2_cache": self._l2_cache,
|
|
928
|
-
"
|
|
929
|
-
"
|
|
1043
|
+
"hbm_ddr": self._hbm_ddr,
|
|
1044
|
+
"pcie": self._pcie,
|
|
1045
|
+
"parallel_strategy": self.ENABLE_STATUS if self._parallel_strategy else self.DISABLE_STATUS,
|
|
1046
|
+
"op_time": self.ENABLE_STATUS if self._op_time else self.DISABLE_STATUS,
|
|
930
1047
|
"profile_framework": self._profile_framework
|
|
931
1048
|
}
|
|
932
1049
|
|
|
@@ -960,11 +1077,8 @@ class Profiler:
|
|
|
960
1077
|
self._profile_communication = False
|
|
961
1078
|
|
|
962
1079
|
if self._profile_communication:
|
|
963
|
-
hccl_option = {"output": self._output_path, "task_trace":
|
|
1080
|
+
hccl_option = {"output": self._output_path, "task_trace": self.ENABLE_STATUS}
|
|
964
1081
|
os.environ['PROFILING_OPTIONS'] = json.dumps(hccl_option)
|
|
965
|
-
if not self.start_profile:
|
|
966
|
-
raise RuntimeError(f"For '{self.__class__.__name__}', the parameter profile_communication can "
|
|
967
|
-
f"not be True while starting profiler in the process of training.")
|
|
968
1082
|
|
|
969
1083
|
self._profile_memory = kwargs.pop("profile_memory", False)
|
|
970
1084
|
if not isinstance(self._profile_memory, bool):
|
|
@@ -988,10 +1102,21 @@ class Profiler:
|
|
|
988
1102
|
logger.warning(f"For '{self.__class__.__name__}', the parameter l2_cache must be bool, "
|
|
989
1103
|
f"but got type {type(l2_cache_enable)}, it will be set to False.")
|
|
990
1104
|
l2_cache_enable = False
|
|
991
|
-
if l2_cache_enable
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1105
|
+
self._l2_cache = self.ENABLE_STATUS if l2_cache_enable else self.DISABLE_STATUS
|
|
1106
|
+
|
|
1107
|
+
hbm_ddr_enable = kwargs.pop("hbm_ddr", False)
|
|
1108
|
+
if not isinstance(hbm_ddr_enable, bool):
|
|
1109
|
+
logger.warning(f"For '{self.__class__.__name__}', the parameter hbm_ddr must be bool, "
|
|
1110
|
+
f"but got type {type(hbm_ddr_enable)}, it will be set to False.")
|
|
1111
|
+
hbm_ddr_enable = False
|
|
1112
|
+
self._hbm_ddr = self.ENABLE_STATUS if hbm_ddr_enable else self.DISABLE_STATUS
|
|
1113
|
+
|
|
1114
|
+
pcie_enable = kwargs.pop("pcie", False)
|
|
1115
|
+
if not isinstance(pcie_enable, bool):
|
|
1116
|
+
logger.warning(f"For '{self.__class__.__name__}', the parameter pcie must be bool, "
|
|
1117
|
+
f"but got type {type(pcie_enable)}, it will be set to False.")
|
|
1118
|
+
pcie_enable = False
|
|
1119
|
+
self._pcie = self.ENABLE_STATUS if pcie_enable else self.DISABLE_STATUS
|
|
995
1120
|
|
|
996
1121
|
self._parallel_strategy = kwargs.pop("parallel_strategy", True)
|
|
997
1122
|
if not isinstance(self._parallel_strategy, bool):
|
|
@@ -999,28 +1124,6 @@ class Profiler:
|
|
|
999
1124
|
f"but got type {type(self._parallel_strategy)}, it will be set to True.")
|
|
1000
1125
|
self._parallel_strategy = True
|
|
1001
1126
|
|
|
1002
|
-
task_sink = os.getenv("GRAPH_OP_RUN")
|
|
1003
|
-
if task_sink and task_sink == "1":
|
|
1004
|
-
logger.warning(f"For '{self.__class__.__name__}', Profiling is not supported if set environment "
|
|
1005
|
-
f"'GRAPH_OP_RUN' value to 1, which means model training task is not sink.")
|
|
1006
|
-
|
|
1007
|
-
def _set_ascend_job_id(self, ascend_job_id):
|
|
1008
|
-
"""Set output_path for offline parsing performance data."""
|
|
1009
|
-
if not ascend_job_id:
|
|
1010
|
-
return
|
|
1011
|
-
self._ascend_job_id = validate_and_normalize_path(ascend_job_id)
|
|
1012
|
-
if not os.path.exists(self._ascend_job_id):
|
|
1013
|
-
msg = f"Invalid ascend_job_id: {self._ascend_job_id}, Please pass the absolute path of the JOB dir"
|
|
1014
|
-
logger.critical(msg)
|
|
1015
|
-
raise ValueError(msg)
|
|
1016
|
-
self._output_path, _ = os.path.split(self._ascend_job_id)
|
|
1017
|
-
|
|
1018
|
-
def _is_offline_parser(self):
|
|
1019
|
-
"""Return whether offline parser or online parser."""
|
|
1020
|
-
if self._device_target and self._device_target == DeviceTarget.ASCEND.value:
|
|
1021
|
-
return bool(self._ascend_job_id)
|
|
1022
|
-
return False
|
|
1023
|
-
|
|
1024
1127
|
def _ascend_analyse(self):
|
|
1025
1128
|
"""Collect and analyse ascend performance data."""
|
|
1026
1129
|
self._rank_size = 1
|
|
@@ -1060,7 +1163,8 @@ class Profiler:
|
|
|
1060
1163
|
# Analyze minddata information
|
|
1061
1164
|
logger.info("Profiling: analyzing the minddata information.")
|
|
1062
1165
|
try:
|
|
1063
|
-
MinddataProfilingAnalyzer(self._output_path, store_id,
|
|
1166
|
+
MinddataProfilingAnalyzer(self._output_path, store_id,
|
|
1167
|
+
self._output_path, pretty=self._pretty_json).analyze()
|
|
1064
1168
|
except ProfilerException as err:
|
|
1065
1169
|
logger.warning(err.message)
|
|
1066
1170
|
finally:
|
|
@@ -1080,7 +1184,7 @@ class Profiler:
|
|
|
1080
1184
|
|
|
1081
1185
|
step_trace_point_info_path = validate_and_normalize_path(step_trace_point_info_path)
|
|
1082
1186
|
|
|
1083
|
-
fpbp_analyse = AscendFPBPGenerator(op_summary, steptrace)
|
|
1187
|
+
fpbp_analyse = AscendFPBPGenerator(op_summary, steptrace, pretty=self._pretty_json)
|
|
1084
1188
|
points, _ = fpbp_analyse.parse()
|
|
1085
1189
|
fpbp_analyse.write(step_trace_point_info_path)
|
|
1086
1190
|
except ProfilerException as err:
|
|
@@ -1089,7 +1193,7 @@ class Profiler:
|
|
|
1089
1193
|
pass
|
|
1090
1194
|
return points
|
|
1091
1195
|
|
|
1092
|
-
def _ascend_op_analyse(self, op_summary, op_statistic, dynamic_status):
|
|
1196
|
+
def _ascend_op_analyse(self, op_summary, op_statistic, dynamic_status, launch_ops: List):
|
|
1093
1197
|
"""
|
|
1094
1198
|
Ascend graph model hwts analyse.
|
|
1095
1199
|
|
|
@@ -1116,7 +1220,7 @@ class Profiler:
|
|
|
1116
1220
|
else:
|
|
1117
1221
|
output_timeline_data_path = None
|
|
1118
1222
|
|
|
1119
|
-
op_analyser = AscendOPGenerator(op_summary, op_statistic, dynamic_status)
|
|
1223
|
+
op_analyser = AscendOPGenerator(op_summary, op_statistic, dynamic_status, launch_ops)
|
|
1120
1224
|
op_analyser.parse()
|
|
1121
1225
|
op_analyser.write(op_intermediate_detail_path, op_intermediate_type_path,
|
|
1122
1226
|
aicpu_intermediate_detail_path, framework_raw_path, output_timeline_data_path)
|
|
@@ -1143,19 +1247,22 @@ class Profiler:
|
|
|
1143
1247
|
finally:
|
|
1144
1248
|
pass
|
|
1145
1249
|
|
|
1146
|
-
def _ascend_timeline_analyse(self, op_summary, steptrace):
|
|
1250
|
+
def _ascend_timeline_analyse(self, op_summary, steptrace, source_path, mindstudio_profiler_output) -> List:
|
|
1147
1251
|
"""Analyse timeline info."""
|
|
1148
1252
|
try:
|
|
1149
1253
|
logger.info("Profiling: analyzing the timeline data")
|
|
1150
|
-
timeline_analyser = AscendTimelineGenerator(self._output_path,
|
|
1151
|
-
context.get_context('mode'))
|
|
1152
|
-
timeline_analyser.
|
|
1153
|
-
timeline_analyser.
|
|
1254
|
+
timeline_analyser = AscendTimelineGenerator(self._output_path, source_path, mindstudio_profiler_output,
|
|
1255
|
+
self._rank_id, context.get_context('mode'))
|
|
1256
|
+
timeline_analyser.parse_cluster_data(op_summary, steptrace)
|
|
1257
|
+
timeline_analyser.parse_timeline_data(pretty=self._pretty_json)
|
|
1258
|
+
timeline_analyser.write_timeline_display()
|
|
1154
1259
|
timeline_analyser.write_timeline_summary()
|
|
1260
|
+
|
|
1155
1261
|
except (ProfilerIOException, ProfilerFileNotFoundException, RuntimeError) as err:
|
|
1156
1262
|
logger.warning('Fail to write timeline data: %s', err)
|
|
1157
1263
|
finally:
|
|
1158
1264
|
pass
|
|
1265
|
+
return timeline_analyser.get_kernel_event_list()
|
|
1159
1266
|
|
|
1160
1267
|
def _ascend_dynamic_net_analyse(self, op_summary):
|
|
1161
1268
|
"""Analyse dynamic shape network info."""
|
|
@@ -1166,10 +1273,10 @@ class Profiler:
|
|
|
1166
1273
|
logger.warning("The profile_memory parameter cannot be set on the dynamic shape network.")
|
|
1167
1274
|
logger.warning(
|
|
1168
1275
|
"[Profiler]Dynamic Shape network does not support collecting step trace performance data currently.")
|
|
1169
|
-
dynamic_parser = DynamicFrameWorkParser(self._output_path, self._rank_id)
|
|
1276
|
+
dynamic_parser = DynamicFrameWorkParser(self._output_path, self._rank_id, pretty=self._pretty_json)
|
|
1170
1277
|
dynamic_parser.write_dynamic_shape_data(op_summary)
|
|
1171
1278
|
|
|
1172
|
-
def _ascend_flops_analyse(self, op_summary):
|
|
1279
|
+
def _ascend_flops_analyse(self, op_summary, launch_ops):
|
|
1173
1280
|
"""Get op FLOPs from op_summary, write output_op_flops_x.csv."""
|
|
1174
1281
|
if 'vector_fops' not in op_summary.dtype.names and 'cube_fops' not in op_summary.dtype.names:
|
|
1175
1282
|
logger.warning("[Profiler] Can not found cube fops and vector fops data in the op summary.")
|
|
@@ -1184,7 +1291,7 @@ class Profiler:
|
|
|
1184
1291
|
flops_path = validate_and_normalize_path(flops_path)
|
|
1185
1292
|
flops_summary_path = validate_and_normalize_path(flops_summary_path)
|
|
1186
1293
|
|
|
1187
|
-
flops_analyser = AscendFlopsGenerator(op_summary)
|
|
1294
|
+
flops_analyser = AscendFlopsGenerator(op_summary, launch_ops, pretty=self._pretty_json)
|
|
1188
1295
|
flops_analyser.parse()
|
|
1189
1296
|
flops_analyser.write(flops_path, flops_summary_path)
|
|
1190
1297
|
|
|
@@ -1208,7 +1315,73 @@ class Profiler:
|
|
|
1208
1315
|
finally:
|
|
1209
1316
|
pass
|
|
1210
1317
|
|
|
1211
|
-
def
|
|
1318
|
+
def _ascend_ms_analyze(self, source_path):
|
|
1319
|
+
"""Ascend ms generate"""
|
|
1320
|
+
|
|
1321
|
+
timestamp = time.strftime("%Y%m%d%H%M%S", time.localtime(time.time()))
|
|
1322
|
+
if self._rank_id:
|
|
1323
|
+
ascend_ms_path = f"rank-{self._rank_id}_{timestamp}_ascend_ms"
|
|
1324
|
+
else:
|
|
1325
|
+
ascend_ms_path = f"{socket.gethostname()}--{os.getpid()}_{timestamp}_ascend_ms"
|
|
1326
|
+
ascend_ms_path = os.path.join(self._output_path, ascend_ms_path)
|
|
1327
|
+
|
|
1328
|
+
dev_id = self._rank_id if self._device_target == DeviceTarget.ASCEND.value else self._dev_id
|
|
1329
|
+
ascend_profiler_output_path = os.path.join(ascend_ms_path, 'ASCEND_PROFILER_OUTPUT')
|
|
1330
|
+
os.makedirs(ascend_profiler_output_path, exist_ok=True)
|
|
1331
|
+
|
|
1332
|
+
source_profiler_info_path = os.path.join(self._output_path, f"profiler_info_{dev_id}.json")
|
|
1333
|
+
target_profiler_info_path = os.path.join(ascend_ms_path, f"profiler_info_{dev_id}.json")
|
|
1334
|
+
shutil.copy(source_profiler_info_path, target_profiler_info_path)
|
|
1335
|
+
|
|
1336
|
+
source_timeline_path = os.path.join(self._output_path, f"ascend_timeline_display_{dev_id}.json")
|
|
1337
|
+
target_timeline_path = os.path.join(ascend_profiler_output_path, f"trace_view.json")
|
|
1338
|
+
shutil.copy(source_timeline_path, target_timeline_path)
|
|
1339
|
+
|
|
1340
|
+
self._ascend_graph_cluster_analyse(source_path, ascend_profiler_output_path)
|
|
1341
|
+
self._ascend_graph_communicate_analyse(source_path, ascend_profiler_output_path)
|
|
1342
|
+
|
|
1343
|
+
def _ascend_graph_cluster_analyse(self, source_path, ascend_profiler_output_path):
|
|
1344
|
+
"""Analyse step trace time info"""
|
|
1345
|
+
|
|
1346
|
+
try:
|
|
1347
|
+
logger.info("Profiling: analyzing the step trace time profiler info.")
|
|
1348
|
+
|
|
1349
|
+
step_trace_time_path = os.path.join(ascend_profiler_output_path, f'step_trace_time.csv')
|
|
1350
|
+
step_trace_time_path = validate_and_normalize_path(step_trace_time_path)
|
|
1351
|
+
|
|
1352
|
+
cluster_analyse = AscendClusterGenerator(source_path)
|
|
1353
|
+
cluster_analyse.parse()
|
|
1354
|
+
cluster_analyse.write(step_trace_time_path)
|
|
1355
|
+
except (ProfilerIOException, ProfilerFileNotFoundException, ProfilerRawFileException) as err:
|
|
1356
|
+
logger.warning(err.message)
|
|
1357
|
+
finally:
|
|
1358
|
+
pass
|
|
1359
|
+
|
|
1360
|
+
def _ascend_graph_communicate_analyse(self, source_path, ascend_profiler_output_path):
|
|
1361
|
+
"""Analyse communicate info"""
|
|
1362
|
+
if not self._profile_communication:
|
|
1363
|
+
return
|
|
1364
|
+
|
|
1365
|
+
try:
|
|
1366
|
+
logger.info("Profiling: analyzing the communicate and communicate_matrix profiler info.")
|
|
1367
|
+
|
|
1368
|
+
communication_file_path = os.path.join(ascend_profiler_output_path, f'communication.json')
|
|
1369
|
+
communication_file_path = validate_and_normalize_path(communication_file_path)
|
|
1370
|
+
|
|
1371
|
+
communication_matrix_file_path = os.path.join(ascend_profiler_output_path,
|
|
1372
|
+
f"communication_matrix.json")
|
|
1373
|
+
communication_matrix_file_path = validate_and_normalize_path(communication_matrix_file_path)
|
|
1374
|
+
|
|
1375
|
+
analyze_path = os.path.abspath(os.path.join(source_path, os.path.pardir, 'analyze'))
|
|
1376
|
+
communicate_analyser = AscendCommunicationGenerator(analyze_path)
|
|
1377
|
+
communicate_analyser.parse()
|
|
1378
|
+
communicate_analyser.write(communication_file_path, communication_matrix_file_path)
|
|
1379
|
+
except (ProfilerIOException, ProfilerFileNotFoundException, ProfilerRawFileException) as err:
|
|
1380
|
+
logger.warning(err.message)
|
|
1381
|
+
finally:
|
|
1382
|
+
pass
|
|
1383
|
+
|
|
1384
|
+
def _ascend_graph_hccl_analyse(self, mindstudio_profiler_output, steptrace):
|
|
1212
1385
|
"""Analyse hccl profiler info."""
|
|
1213
1386
|
if not self._profile_communication:
|
|
1214
1387
|
return
|
|
@@ -1222,10 +1395,7 @@ class Profiler:
|
|
|
1222
1395
|
|
|
1223
1396
|
hccl_raw_path = os.path.join(self._output_path, f'hccl_raw_{dev_id}.csv')
|
|
1224
1397
|
hccl_raw_path = validate_and_normalize_path(hccl_raw_path)
|
|
1225
|
-
|
|
1226
|
-
hccl_analyse = AscendHCCLGenerator(os.path.join(source_path, 'timeline'), steptrace)
|
|
1227
|
-
else:
|
|
1228
|
-
hccl_analyse = AscendHCCLGeneratorOld(os.path.join(source_path, 'timeline'))
|
|
1398
|
+
hccl_analyse = AscendHCCLGenerator(mindstudio_profiler_output, steptrace)
|
|
1229
1399
|
hccl_analyse.parse()
|
|
1230
1400
|
hccl_analyse.write(hccl_raw_path)
|
|
1231
1401
|
|
|
@@ -1237,7 +1407,7 @@ class Profiler:
|
|
|
1237
1407
|
def _ascend_graph_msadvisor_analyse(self, job_id):
|
|
1238
1408
|
"""Call MSAdvisor function."""
|
|
1239
1409
|
logger.info("MSAdvisor starts running.")
|
|
1240
|
-
msadvisor = Msadvisor(job_id, self._rank_id, self._output_path)
|
|
1410
|
+
msadvisor = Msadvisor(job_id, self._rank_id, self._output_path, pretty=self._pretty_json)
|
|
1241
1411
|
try:
|
|
1242
1412
|
msadvisor.analyse()
|
|
1243
1413
|
except FileNotFoundError as err:
|
|
@@ -1254,11 +1424,32 @@ class Profiler:
|
|
|
1254
1424
|
if context.get_context("mode") == context.PYNATIVE_MODE:
|
|
1255
1425
|
logger.warning("Pynative mode does not support MSAdvisor analyzer currently.")
|
|
1256
1426
|
|
|
1257
|
-
def
|
|
1427
|
+
def _get_kernel_op_map(self, op_summary, kernels: List[CANNEvent]) -> List:
|
|
1428
|
+
"""Get the mapping between framework operator and device kernel."""
|
|
1429
|
+
if not kernels:
|
|
1430
|
+
return []
|
|
1431
|
+
kernel_map = {}
|
|
1432
|
+
for kernel in kernels:
|
|
1433
|
+
key = kernel.name if kernel.is_comm_op else (kernel.name, str(kernel.ts))
|
|
1434
|
+
kernel_map[key] = kernel.parent
|
|
1435
|
+
launch_ops = [None] * len(op_summary)
|
|
1436
|
+
for index, summary in enumerate(op_summary):
|
|
1437
|
+
ts = str(summary['Task Start Time(us)']).strip("\t")
|
|
1438
|
+
name = summary['Op Name']
|
|
1439
|
+
key = name if name.startswith("hcom_") else (name, ts)
|
|
1440
|
+
launch_op = kernel_map.get(key)
|
|
1441
|
+
if not launch_op:
|
|
1442
|
+
logger.warning(f"Failed to get launch operator for {name}!")
|
|
1443
|
+
continue
|
|
1444
|
+
launch_ops[index] = launch_op.name
|
|
1445
|
+
return launch_ops
|
|
1446
|
+
|
|
1447
|
+
def _ascend_graph_analyse(self, offline_path=None):
|
|
1258
1448
|
"""Ascend graph mode analyse."""
|
|
1259
|
-
|
|
1449
|
+
if not offline_path:
|
|
1450
|
+
self._ascend_profiler.finalize()
|
|
1260
1451
|
|
|
1261
|
-
job_id = self._get_profiling_job_id()
|
|
1452
|
+
job_id = self._get_profiling_job_id(offline_path)
|
|
1262
1453
|
if not job_id:
|
|
1263
1454
|
return
|
|
1264
1455
|
logger.info("Profiling: job id is %s ", job_id)
|
|
@@ -1267,28 +1458,39 @@ class Profiler:
|
|
|
1267
1458
|
source_path = os.path.join(self._output_path, job_id)
|
|
1268
1459
|
self._minddata_analyse(source_path)
|
|
1269
1460
|
if self._op_time:
|
|
1270
|
-
|
|
1461
|
+
mindstudio_profiler_output = os.path.abspath(os.path.join(source_path, os.path.pardir,
|
|
1462
|
+
'mindstudio_profiler_output'))
|
|
1463
|
+
flag = _ascend_graph_msprof_generator(mindstudio_profiler_output, self._model_iteration_dict)
|
|
1271
1464
|
if not flag:
|
|
1272
1465
|
logger.warning('Current driver package not support all export mode, use single export mode, '
|
|
1273
1466
|
'this may lead to performance degradation. Suggest upgrading the driver package.')
|
|
1274
1467
|
ProfilerInfo.set_export_flag(flag)
|
|
1275
|
-
op_summary, op_statistic, steptrace
|
|
1276
|
-
|
|
1277
|
-
self._ascend_timeline_analyse(op_summary, steptrace)
|
|
1468
|
+
op_summary, op_statistic, steptrace, steptrace_model \
|
|
1469
|
+
= _ascend_graph_msprof_analyse(mindstudio_profiler_output)
|
|
1470
|
+
kernels = self._ascend_timeline_analyse(op_summary, steptrace, source_path, mindstudio_profiler_output)
|
|
1471
|
+
launch_ops = self._get_kernel_op_map(op_summary, kernels)
|
|
1472
|
+
self._ascend_op_analyse(op_summary, op_statistic, self._dynamic_status, launch_ops)
|
|
1278
1473
|
graph_ids = np.unique(op_summary['Model ID']).tolist()
|
|
1279
1474
|
points = self._ascend_fpbp_analyse(op_summary, steptrace)
|
|
1280
1475
|
if len(graph_ids) == 1:
|
|
1281
1476
|
self._ascend_step_trace_analyse(steptrace)
|
|
1477
|
+
else:
|
|
1478
|
+
self._ascend_step_trace_analyse(steptrace_model)
|
|
1282
1479
|
if self._dynamic_status:
|
|
1283
1480
|
self._ascend_dynamic_net_analyse(op_summary)
|
|
1284
|
-
self._ascend_flops_analyse(op_summary)
|
|
1481
|
+
self._ascend_flops_analyse(op_summary, launch_ops)
|
|
1285
1482
|
self._ascend_graph_memory_analyse(points)
|
|
1286
|
-
self.
|
|
1483
|
+
self._ascend_ms_analyze(mindstudio_profiler_output)
|
|
1484
|
+
self._ascend_graph_hccl_analyse(mindstudio_profiler_output, steptrace)
|
|
1287
1485
|
self._ascend_graph_msadvisor_analyse(job_id)
|
|
1288
1486
|
ProfilerInfo.set_graph_ids(graph_ids)
|
|
1289
1487
|
|
|
1290
1488
|
def _ascend_graph_start(self):
|
|
1291
1489
|
"""Ascend graph mode start profiling."""
|
|
1490
|
+
op_range_file = os.path.join(self._framework_path, "op_range_" + str(self._rank_id))
|
|
1491
|
+
if os.path.exists(op_range_file):
|
|
1492
|
+
os.remove(op_range_file)
|
|
1493
|
+
logger.info("Clear old op range filer.")
|
|
1292
1494
|
self._ascend_profiler.start()
|
|
1293
1495
|
|
|
1294
1496
|
def _gpu_analyse(self):
|
|
@@ -1368,11 +1570,16 @@ class Profiler:
|
|
|
1368
1570
|
|
|
1369
1571
|
def _cpu_analyse(self):
|
|
1370
1572
|
"""Collect and analyse cpu performance data."""
|
|
1573
|
+
if self._has_started:
|
|
1574
|
+
self.stop()
|
|
1575
|
+
else:
|
|
1576
|
+
logger.info("No need to stop profiler because profiler has been stopped.")
|
|
1577
|
+
|
|
1371
1578
|
if not self._op_time:
|
|
1372
1579
|
return
|
|
1373
1580
|
try:
|
|
1374
1581
|
timeline_generator = CpuTimelineGenerator(self._output_path, self._rank_id, context.get_context("mode"))
|
|
1375
|
-
timeline_generator.init_timeline()
|
|
1582
|
+
timeline_generator.init_timeline(pretty=self._pretty_json)
|
|
1376
1583
|
timeline_generator.write_timeline(self._timeline_size_limit_byte)
|
|
1377
1584
|
timeline_generator.write_timeline_summary()
|
|
1378
1585
|
except (ProfilerIOException, ProfilerFileNotFoundException, RuntimeError) as err:
|
|
@@ -1462,27 +1669,19 @@ class Profiler:
|
|
|
1462
1669
|
"""Analyse memory usage data."""
|
|
1463
1670
|
integrator = Integrator(self._output_path, self._rank_id)
|
|
1464
1671
|
aicore_detail_data = integrator.get_aicore_detail_data()
|
|
1465
|
-
memory_parser = MemoryUsageParser(self._output_path, self._rank_id)
|
|
1672
|
+
memory_parser = MemoryUsageParser(self._output_path, self._rank_id, pretty=self._pretty_json)
|
|
1466
1673
|
memory_parser.init_memory_usage_info(aicore_detail_data, points)
|
|
1467
1674
|
memory_parser.write_memory_files()
|
|
1468
1675
|
|
|
1469
|
-
def _get_profiling_job_id(self):
|
|
1676
|
+
def _get_profiling_job_id(self, offline_path):
|
|
1470
1677
|
"""Get profiling job id, which was generated by ada service.
|
|
1471
1678
|
|
|
1472
1679
|
Returns:
|
|
1473
1680
|
str, profiling job id.
|
|
1474
1681
|
"""
|
|
1475
1682
|
|
|
1476
|
-
if
|
|
1477
|
-
|
|
1478
|
-
job_id = self._ascend_job_id.rstrip('/').split('/')[-1]
|
|
1479
|
-
if job_id.startswith('PROF'):
|
|
1480
|
-
device_dir = [dir for dir in os.listdir(self._ascend_job_id) if dir.startswith('device')]
|
|
1481
|
-
info_file_path = get_file_path(os.path.join(self._ascend_job_id, device_dir[0]), "info.json")
|
|
1482
|
-
training_rank_id, _ = self._parse_info_json(info_file_path)
|
|
1483
|
-
self._rank_id = int(training_rank_id)
|
|
1484
|
-
return os.path.join(job_id, device_dir[0])
|
|
1485
|
-
return job_id
|
|
1683
|
+
if offline_path:
|
|
1684
|
+
self._output_path = os.path.join(offline_path, 'profiler')
|
|
1486
1685
|
|
|
1487
1686
|
job_id = ""
|
|
1488
1687
|
job_dirs = filter(lambda item: item.startswith('JOB') or item.startswith('PROF') and os.path.isdir(
|
|
@@ -1491,16 +1690,12 @@ class Profiler:
|
|
|
1491
1690
|
job_dirs, key=lambda x: os.path.getmtime(os.path.join(self._output_path, x)), reverse=True)
|
|
1492
1691
|
|
|
1493
1692
|
for dir_name in sorted_job_dirs:
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
job_dir = os.path.join(self._output_path, dir_name, device_dir[0])
|
|
1499
|
-
else:
|
|
1500
|
-
job_dir = os.path.join(self._output_path, dir_name)
|
|
1693
|
+
prof_dir = os.path.join(self._output_path, dir_name)
|
|
1694
|
+
device_dir = [dir for dir in os.listdir(prof_dir) \
|
|
1695
|
+
if dir.startswith('device') and os.path.isdir(os.path.join(prof_dir, dir))]
|
|
1696
|
+
job_dir = os.path.join(self._output_path, dir_name, device_dir[0])
|
|
1501
1697
|
|
|
1502
|
-
|
|
1503
|
-
if start_file_path is None:
|
|
1698
|
+
if get_file_path(job_dir, "start_info") is None:
|
|
1504
1699
|
logger.warning("Find profiling job path %s, but host_start.log not exist, "
|
|
1505
1700
|
"profiler will ignore this job dir.", job_dir)
|
|
1506
1701
|
continue
|
|
@@ -1511,25 +1706,27 @@ class Profiler:
|
|
|
1511
1706
|
"profiler will ignore this job dir.", job_dir)
|
|
1512
1707
|
continue
|
|
1513
1708
|
|
|
1514
|
-
|
|
1515
|
-
|
|
1709
|
+
prof_rank_id, prof_device_id = self._parse_info_json(info_file_path)
|
|
1710
|
+
job_start_time = self._parse_job_start_time(prof_dir)
|
|
1516
1711
|
|
|
1517
|
-
if
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1712
|
+
if offline_path:
|
|
1713
|
+
if self._rank_id != prof_rank_id:
|
|
1714
|
+
continue
|
|
1715
|
+
self._start_time = int(job_start_time)
|
|
1716
|
+
else:
|
|
1717
|
+
if self._dev_id != prof_device_id and self._rank_id != prof_rank_id:
|
|
1718
|
+
logger.debug("Find profiling find job path %s, but not current training device id. "
|
|
1719
|
+
"Current training rank id %s, but job path rank id: %s, "
|
|
1720
|
+
"profiler will ignore this job dir.", job_dir, self._rank_id, prof_rank_id)
|
|
1721
|
+
continue
|
|
1522
1722
|
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1723
|
+
if job_start_time < self._start_time:
|
|
1724
|
+
logger.warning("Find profiling job path %s, but start_time(%d) is earlier than this training "
|
|
1725
|
+
"start_time(%d), profiler will ignore this job dir.",
|
|
1726
|
+
job_dir, job_start_time, self._start_time)
|
|
1727
|
+
continue
|
|
1528
1728
|
|
|
1529
|
-
|
|
1530
|
-
job_id = os.path.join(dir_name, device_dir[0])
|
|
1531
|
-
else:
|
|
1532
|
-
job_id = dir_name
|
|
1729
|
+
job_id = os.path.join(dir_name, device_dir[0])
|
|
1533
1730
|
break
|
|
1534
1731
|
|
|
1535
1732
|
if not job_id:
|
|
@@ -1630,6 +1827,7 @@ class Profiler:
|
|
|
1630
1827
|
else:
|
|
1631
1828
|
output_path = kwargs.pop("output_path")
|
|
1632
1829
|
self._output_path = validate_and_normalize_path(output_path)
|
|
1830
|
+
|
|
1633
1831
|
self._output_path = os.path.join(self._output_path, "profiler")
|
|
1634
1832
|
if not os.path.exists(self._output_path):
|
|
1635
1833
|
os.makedirs(self._output_path, exist_ok=True)
|
|
@@ -1637,6 +1835,10 @@ class Profiler:
|
|
|
1637
1835
|
else:
|
|
1638
1836
|
logger.warning("The target dir already exists. "
|
|
1639
1837
|
"There may be some old profiling data, and they will be rewritten in the end.")
|
|
1838
|
+
self._framework_path = os.path.join(self._output_path, "FRAMEWORK")
|
|
1839
|
+
if not os.path.exists(self._framework_path):
|
|
1840
|
+
os.makedirs(self._framework_path, exist_ok=True)
|
|
1841
|
+
os.chmod(self._framework_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
|
1640
1842
|
|
|
1641
1843
|
def _parser_kwargs(self, kwargs):
|
|
1642
1844
|
"""Parse kwargs vale."""
|