mindspore 2.2.14__cp37-cp37m-manylinux1_x86_64.whl → 2.3.0rc2__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.
- mindspore/.commit_id +1 -1
- mindspore/__init__.py +4 -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/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 +18 -8
- 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 +78 -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 +127 -206
- mindspore/_extends/remote/kernel_build_server.py +2 -0
- mindspore/_mindspore_offline_debug.cpython-37m-x86_64-linux-gnu.so +0 -0
- mindspore/{ops/_op_impl/tbe/atomic_addr_clean.py → _profiler.py} +13 -16
- 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 +7 -3
- mindspore/common/_jit_fallback_utils.py +2 -3
- mindspore/common/_register_for_adapter.py +7 -0
- mindspore/common/_register_for_recompute.py +48 -0
- mindspore/common/_stub_tensor.py +7 -1
- mindspore/common/_utils.py +5 -17
- mindspore/common/api.py +145 -50
- mindspore/common/auto_dynamic_shape.py +27 -14
- mindspore/common/dtype.py +9 -6
- mindspore/common/dump.py +5 -4
- mindspore/common/hook_handle.py +51 -4
- mindspore/common/initializer.py +1 -1
- mindspore/common/jit_config.py +33 -13
- mindspore/common/lazy_inline.py +58 -17
- mindspore/common/mindir_util.py +12 -2
- mindspore/common/mutable.py +79 -14
- mindspore/common/parameter.py +24 -4
- mindspore/common/recompute.py +247 -0
- mindspore/common/seed.py +9 -9
- mindspore/common/sparse_tensor.py +251 -18
- mindspore/common/symbol.py +122 -0
- mindspore/common/tensor.py +391 -465
- mindspore/communication/__init__.py +3 -3
- mindspore/communication/_comm_helper.py +5 -0
- mindspore/communication/management.py +53 -38
- mindspore/config/op_info.config +22 -54
- mindspore/context.py +176 -55
- 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 +72 -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/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/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 +66 -121
- 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 +339 -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 +12 -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 +6318 -1760
- 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.1 → 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/log.py +2 -2
- 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 +8 -13
- mindspore/mindrecord/tools/cifar10_to_mr.py +9 -15
- mindspore/mindrecord/tools/csv_to_mr.py +4 -9
- mindspore/mindrecord/tools/imagenet_to_mr.py +3 -8
- mindspore/mindrecord/tools/mnist_to_mr.py +7 -12
- mindspore/mindrecord/tools/tfrecord_to_mr.py +1 -6
- mindspore/mint/__init__.py +457 -0
- mindspore/mint/nn/__init__.py +430 -0
- mindspore/mint/nn/functional.py +424 -0
- mindspore/mint/optim/__init__.py +24 -0
- mindspore/mint/optim/adamw.py +186 -0
- mindspore/multiprocessing/__init__.py +72 -0
- mindspore/nn/__init__.py +3 -0
- mindspore/nn/cell.py +131 -174
- mindspore/nn/dynamic_lr.py +2 -2
- mindspore/nn/extend/__init__.py +29 -0
- mindspore/nn/extend/basic.py +140 -0
- mindspore/nn/extend/embedding.py +143 -0
- mindspore/{rewrite/ast_creator_register.py → nn/extend/layer/__init__.py} +9 -19
- mindspore/nn/extend/layer/normalization.py +107 -0
- mindspore/nn/extend/pooling.py +117 -0
- mindspore/nn/generator.py +297 -0
- mindspore/nn/layer/activation.py +79 -90
- mindspore/nn/layer/basic.py +113 -81
- 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 +105 -44
- mindspore/nn/layer/image.py +4 -7
- mindspore/nn/layer/normalization.py +52 -66
- mindspore/nn/layer/padding.py +30 -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 +43 -64
- mindspore/nn/optim/ada_grad.py +4 -2
- 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 +6 -5
- 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 +54 -60
- mindspore/numpy/utils.py +3 -0
- mindspore/ops/__init__.py +5 -4
- mindspore/ops/_grad_experimental/grad_array_ops.py +4 -129
- mindspore/ops/_grad_experimental/grad_comm_ops.py +14 -18
- mindspore/ops/_grad_experimental/grad_math_ops.py +68 -283
- 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/gamma.py +2 -0
- mindspore/ops/_op_impl/aicpu/generate_eod_mask.py +1 -1
- 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 +143 -58
- mindspore/ops/_vmap/vmap_image_ops.py +70 -13
- mindspore/ops/_vmap/vmap_math_ops.py +101 -57
- mindspore/ops/_vmap/vmap_nn_ops.py +230 -97
- 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 +205 -0
- mindspore/ops/auto_generate/gen_arg_dtype_cast.py +257 -0
- mindspore/ops/auto_generate/gen_arg_handler.py +171 -0
- mindspore/ops/auto_generate/gen_extend_func.py +404 -0
- mindspore/ops/auto_generate/gen_ops_def.py +5653 -0
- mindspore/ops/auto_generate/gen_ops_prim.py +11623 -0
- mindspore/ops/auto_generate/pyboost_inner_prim.py +359 -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 +168 -602
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +24 -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 +54 -0
- mindspore/ops/extend/array_func.py +259 -0
- mindspore/ops/extend/math_func.py +76 -0
- mindspore/ops/extend/nn_func.py +384 -0
- mindspore/ops/function/__init__.py +37 -12
- mindspore/ops/function/array_func.py +702 -1867
- mindspore/ops/function/clip_func.py +19 -31
- mindspore/ops/function/debug_func.py +1 -4
- 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 +35 -68
- mindspore/ops/function/math_func.py +639 -2531
- mindspore/ops/function/nn_func.py +1274 -832
- mindspore/ops/function/other_func.py +4 -5
- mindspore/ops/function/parameter_func.py +5 -93
- mindspore/ops/function/random_func.py +84 -71
- mindspore/ops/function/sparse_unary_func.py +9 -16
- mindspore/ops/function/spectral_func.py +1 -1
- mindspore/ops/function/vmap_func.py +14 -14
- mindspore/ops/functional.py +57 -63
- mindspore/ops/op_info_register.py +16 -43
- mindspore/ops/operations/__init__.py +19 -20
- mindspore/ops/operations/_grad_ops.py +20 -828
- mindspore/ops/operations/_inner_ops.py +180 -288
- mindspore/ops/operations/_scalar_ops.py +5 -480
- mindspore/ops/operations/_sequence_ops.py +6 -36
- mindspore/ops/operations/array_ops.py +83 -2697
- mindspore/ops/operations/comm_ops.py +38 -46
- mindspore/ops/operations/custom_ops.py +14 -96
- mindspore/ops/operations/debug_ops.py +100 -31
- mindspore/ops/operations/image_ops.py +1 -217
- mindspore/ops/operations/inner_ops.py +3 -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 +1716 -0
- mindspore/ops/operations/math_ops.py +581 -4629
- mindspore/ops/operations/nn_ops.py +260 -1941
- mindspore/ops/operations/other_ops.py +50 -42
- mindspore/ops/operations/random_ops.py +3 -52
- mindspore/ops/operations/sparse_ops.py +3 -3
- mindspore/ops/primitive.py +196 -96
- mindspore/ops_generate/__init__.py +27 -0
- mindspore/ops_generate/arg_dtype_cast.py +257 -0
- mindspore/ops_generate/arg_handler.py +171 -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 +131 -0
- mindspore/ops_generate/gen_pyboost_func.py +939 -0
- mindspore/ops_generate/gen_utils.py +188 -0
- mindspore/ops_generate/op_proto.py +138 -0
- mindspore/ops_generate/pyboost_utils.py +349 -0
- mindspore/ops_generate/template.py +238 -0
- mindspore/parallel/__init__.py +6 -4
- mindspore/parallel/_auto_parallel_context.py +52 -2
- 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 +29 -13
- mindspore/parallel/_ps_context.py +1 -1
- mindspore/parallel/_recovery_context.py +1 -1
- mindspore/parallel/_tensor.py +19 -7
- 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 +1 -1
- mindspore/parallel/_utils.py +147 -6
- mindspore/parallel/algo_parameter_config.py +6 -6
- mindspore/parallel/checkpoint_transform.py +180 -24
- 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 +109 -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 +116 -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 +14 -9
- mindspore/profiler/parser/ascend_communicate_generator.py +0 -1
- mindspore/profiler/parser/ascend_flops_generator.py +20 -4
- mindspore/profiler/parser/ascend_hccl_generator.py +25 -277
- mindspore/profiler/parser/ascend_msprof_exporter.py +112 -132
- mindspore/profiler/parser/ascend_msprof_generator.py +73 -283
- mindspore/profiler/parser/ascend_op_generator.py +92 -42
- mindspore/profiler/parser/ascend_timeline_generator.py +294 -133
- mindspore/profiler/parser/base_timeline_generator.py +6 -0
- mindspore/profiler/parser/framework_parser.py +3 -2
- mindspore/profiler/parser/integrator.py +3 -1
- mindspore/profiler/parser/msadvisor_analyzer.py +1 -1
- mindspore/profiler/parser/msadvisor_parser.py +1 -1
- mindspore/profiler/parser/profiler_info.py +16 -1
- mindspore/profiler/profiling.py +305 -167
- mindspore/rewrite/__init__.py +2 -13
- mindspore/rewrite/api/node.py +121 -35
- mindspore/rewrite/api/pattern_engine.py +2 -3
- mindspore/rewrite/api/scoped_value.py +16 -15
- mindspore/rewrite/api/symbol_tree.py +45 -29
- 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/anf_ir_pb2.py +8 -2
- mindspore/train/callback/_backup_and_restore.py +4 -4
- mindspore/train/callback/_callback.py +4 -4
- mindspore/train/callback/_checkpoint.py +39 -13
- mindspore/train/callback/_early_stop.py +2 -2
- mindspore/train/callback/_landscape.py +14 -8
- 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 +7 -7
- mindspore/train/callback/_time_monitor.py +2 -2
- mindspore/train/data_sink.py +1 -1
- mindspore/train/dataset_helper.py +18 -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 +89 -15
- mindspore/train/model.py +24 -22
- mindspore/train/serialization.py +257 -133
- mindspore/train/summary/summary_record.py +51 -28
- mindspore/train/train_thor/convert_utils.py +3 -3
- mindspore/version.py +1 -1
- {mindspore-2.2.14.dist-info → mindspore-2.3.0rc2.dist-info}/METADATA +2 -2
- {mindspore-2.2.14.dist-info → mindspore-2.3.0rc2.dist-info}/RECORD +534 -1066
- {mindspore-2.2.14.dist-info → mindspore-2.3.0rc2.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/nn/layer/flash_attention.py +0 -189
- mindspore/ops/_op_impl/cpu/concat.py +0 -39
- 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_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.14.dist-info → mindspore-2.3.0rc2.dist-info}/WHEEL +0 -0
- {mindspore-2.2.14.dist-info → mindspore-2.3.0rc2.dist-info}/top_level.txt +0 -0
mindspore/profiler/profiling.py
CHANGED
|
@@ -14,15 +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
|
|
23
26
|
import socket
|
|
24
|
-
import shutil
|
|
25
27
|
from enum import Enum
|
|
28
|
+
from multiprocessing import Process
|
|
29
|
+
from typing import List
|
|
26
30
|
import numpy as np
|
|
27
31
|
|
|
28
32
|
from mindspore import log as logger, context
|
|
@@ -31,13 +35,14 @@ from mindspore.communication.management import GlobalComm, get_rank, get_group_s
|
|
|
31
35
|
import mindspore._c_expression as c_expression
|
|
32
36
|
import mindspore._c_dataengine as cde
|
|
33
37
|
from mindspore.profiler.common.exceptions.exceptions import ProfilerFileNotFoundException, \
|
|
34
|
-
ProfilerIOException, ProfilerException, ProfilerRawFileException
|
|
38
|
+
ProfilerIOException, ProfilerException, ProfilerRawFileException, ProfilerParamTypeErrorException
|
|
35
39
|
from mindspore.profiler.common.exceptions.exceptions import ProfilerPathErrorException
|
|
36
40
|
from mindspore.profiler.common.exceptions.exceptions import ProfilerDirNotFoundException
|
|
37
41
|
from mindspore.profiler.common.util import get_file_path
|
|
38
42
|
from mindspore.profiler.common.validator.validate_path import validate_and_normalize_path
|
|
39
43
|
from mindspore.profiler.parser.framework_parser import GpuFrameWorkParser, DynamicFrameWorkParser
|
|
40
44
|
from mindspore.profiler.parser.integrator import Integrator, DeviceTarget
|
|
45
|
+
from mindspore.profiler.parser.ascend_analysis.function_event import CANNEvent
|
|
41
46
|
from mindspore.profiler.parser.cpu_gpu_timeline_generator import GpuTimelineGenerator, CpuTimelineGenerator
|
|
42
47
|
from mindspore.profiler.parser.ascend_timeline_generator import AscendTimelineGenerator
|
|
43
48
|
from mindspore.profiler.parser.memory_usage_parser import MemoryUsageParser
|
|
@@ -50,13 +55,13 @@ from mindspore.profiler.parser.msadvisor_analyzer import Msadvisor
|
|
|
50
55
|
from mindspore.profiler.parser.profiler_info import ProfilerInfo
|
|
51
56
|
from mindspore.common.api import _pynative_executor
|
|
52
57
|
from mindspore.profiler.parser.ascend_msprof_exporter import AscendMsprofExporter
|
|
53
|
-
from mindspore.profiler.parser.ascend_msprof_generator import AscendMsprofDataGenerator
|
|
58
|
+
from mindspore.profiler.parser.ascend_msprof_generator import AscendMsprofDataGenerator
|
|
54
59
|
from mindspore.profiler.parser.ascend_fpbp_generator import AscendFPBPGenerator
|
|
55
60
|
from mindspore.profiler.parser.ascend_op_generator import AscendOPGenerator
|
|
56
61
|
from mindspore.profiler.parser.ascend_steptrace_generator import AscendStepTraceGenerator
|
|
57
62
|
from mindspore.profiler.parser.ascend_flops_generator import AscendFlopsGenerator
|
|
58
63
|
from mindspore.profiler.parser.ascend_cluster_generator import AscendClusterGenerator
|
|
59
|
-
from mindspore.profiler.parser.ascend_hccl_generator import AscendHCCLGenerator
|
|
64
|
+
from mindspore.profiler.parser.ascend_hccl_generator import AscendHCCLGenerator
|
|
60
65
|
from mindspore.profiler.parser.ascend_communicate_generator import AscendCommunicationGenerator
|
|
61
66
|
|
|
62
67
|
INIT_OP_NAME = 'Default/InitDataSetQueue'
|
|
@@ -68,10 +73,18 @@ AICORE_METRICS_DICT = {
|
|
|
68
73
|
3: "MemoryL0",
|
|
69
74
|
4: "ResourceConflictRatio",
|
|
70
75
|
5: "MemoryUB",
|
|
76
|
+
6: "L2Cache",
|
|
71
77
|
-1: "None"
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
|
|
81
|
+
class ModelTraingMode(Enum):
|
|
82
|
+
PYNATIVE = 0
|
|
83
|
+
GRAPH = 1
|
|
84
|
+
KERNEL_BY_KERNEL = 2
|
|
85
|
+
UNKNOWN = 3
|
|
86
|
+
|
|
87
|
+
|
|
75
88
|
class DeviceSupportParam(Enum):
|
|
76
89
|
"""The device target enum."""
|
|
77
90
|
CPU = ['start', 'start_profile', 'output_path', 'timeline_limit', 'profile_framework', 'op_time']
|
|
@@ -81,14 +94,14 @@ class DeviceSupportParam(Enum):
|
|
|
81
94
|
]
|
|
82
95
|
ASCEND = [
|
|
83
96
|
'start', 'start_profile', 'output_path', 'data_process', 'timeline_limit', 'profile_memory',
|
|
84
|
-
'parallel_strategy', 'profile_communication', 'aicore_metrics', 'l2_cache', '
|
|
85
|
-
'profile_framework'
|
|
97
|
+
'parallel_strategy', 'profile_communication', 'aicore_metrics', 'l2_cache', 'hbm_ddr', 'pcie', 'op_time',
|
|
98
|
+
'ascend_job_id', 'profile_framework'
|
|
86
99
|
]
|
|
87
100
|
|
|
88
101
|
|
|
89
102
|
ALWAYS_VALID_PARAM = [
|
|
90
103
|
'start', 'start_profile', 'output_path', 'data_process', 'parallel_strategy', 'l2_cache',
|
|
91
|
-
'ascend_job_id', 'op_time', 'profile_framework'
|
|
104
|
+
'hbm_ddr', 'pcie', 'ascend_job_id', 'op_time', 'profile_framework'
|
|
92
105
|
]
|
|
93
106
|
|
|
94
107
|
|
|
@@ -277,11 +290,11 @@ def _parse_host_info(input_file, output_timeline_file, output_memory_file, is_de
|
|
|
277
290
|
logger.warning("No valid time_stamp is record in file: %s", input_file)
|
|
278
291
|
|
|
279
292
|
|
|
280
|
-
def _ascend_graph_msprof_generator(
|
|
293
|
+
def _ascend_graph_msprof_generator(mindstudio_profiler_output, model_iteration_dict):
|
|
281
294
|
"""Executing the msprof export mode."""
|
|
282
295
|
try:
|
|
283
296
|
ProfilerInfo.set_export_start_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
284
|
-
msprof_exporter = AscendMsprofExporter(
|
|
297
|
+
msprof_exporter = AscendMsprofExporter(mindstudio_profiler_output)
|
|
285
298
|
flag = msprof_exporter.export(model_iteration_dict)
|
|
286
299
|
ProfilerInfo.set_export_end_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
287
300
|
return flag
|
|
@@ -291,27 +304,24 @@ def _ascend_graph_msprof_generator(source_path, model_iteration_dict):
|
|
|
291
304
|
return False
|
|
292
305
|
|
|
293
306
|
|
|
294
|
-
def _ascend_graph_msprof_analyse(
|
|
307
|
+
def _ascend_graph_msprof_analyse(mindstudio_profiler_output):
|
|
295
308
|
"""
|
|
296
309
|
Ascend graph model msprof data analyse.
|
|
297
310
|
|
|
298
311
|
Returns:
|
|
299
|
-
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
|
|
300
313
|
"""
|
|
301
|
-
|
|
302
|
-
df_op_statistic = []
|
|
303
|
-
df_step_trace = []
|
|
314
|
+
res = ([], [], [], [])
|
|
304
315
|
try:
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
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
|
+
|
|
310
320
|
except ProfilerException as err:
|
|
311
321
|
logger.warning(err.message)
|
|
312
322
|
finally:
|
|
313
323
|
pass
|
|
314
|
-
return
|
|
324
|
+
return res
|
|
315
325
|
|
|
316
326
|
|
|
317
327
|
class Profiler:
|
|
@@ -320,7 +330,7 @@ class Profiler:
|
|
|
320
330
|
MindSpore users can import the mindspore.Profiler, initialize the Profiler object to start profiling,
|
|
321
331
|
and use Profiler.analyse() to stop profiling and analyse the results.
|
|
322
332
|
Users can visualize the results using the `MindSpore Insight
|
|
323
|
-
<https://www.mindspore.cn/mindinsight/docs/en/
|
|
333
|
+
<https://www.mindspore.cn/mindinsight/docs/en/master/index.html>`_ tool.
|
|
324
334
|
Now, Profiler supports AICORE operator, AICPU operator, HostCPU operator, memory,
|
|
325
335
|
correspondence, cluster, etc data analysis.
|
|
326
336
|
|
|
@@ -328,7 +338,7 @@ class Profiler:
|
|
|
328
338
|
output_path (str, optional): Output data path. Default: ``"./data"`` .
|
|
329
339
|
op_time (bool, optional): (Ascend/GPU) Whether to collect operators performance data. Default value: ``True``.
|
|
330
340
|
profile_communication (bool, optional): (Ascend only) Whether to collect communication performance data in
|
|
331
|
-
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
|
|
332
342
|
training. When using this parameter, `op_time` must be set to ``True`` . Default: ``False`` .
|
|
333
343
|
profile_memory (bool, optional): (Ascend only) Whether to collect tensor memory data, collect when ``True`` .
|
|
334
344
|
When using this parameter, `op_time` must be set to True. Default: ``False`` .
|
|
@@ -348,9 +358,14 @@ class Profiler:
|
|
|
348
358
|
- 3: MemoryL0 contains l0a_read/write_bw, l0b_read/write_bw, l0c_read/write_bw etc.
|
|
349
359
|
- 4: ResourceConflictRatio contains vec_bankgroup/bank/resc_cflt_ratio etc.
|
|
350
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.
|
|
351
362
|
|
|
352
363
|
l2_cache (bool, optional): (Ascend only) Whether to collect l2 cache data, collect when True.
|
|
353
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`` .
|
|
354
369
|
sync_enable (bool, optional): (GPU only) Whether the profiler collects operators in a synchronous way.
|
|
355
370
|
Default: ``True`` .
|
|
356
371
|
|
|
@@ -428,8 +443,13 @@ class Profiler:
|
|
|
428
443
|
_has_initialized = False
|
|
429
444
|
_ascend_profiling_options = ""
|
|
430
445
|
_ascend_job_id = ""
|
|
446
|
+
ENABLE_STATUS = "on"
|
|
447
|
+
DISABLE_STATUS = "off"
|
|
431
448
|
|
|
432
449
|
def __init__(self, **kwargs):
|
|
450
|
+
if os.getenv("PROFILING_MODE"):
|
|
451
|
+
raise RuntimeError("Profiling is already enabled by env.")
|
|
452
|
+
|
|
433
453
|
self._dev_id = None
|
|
434
454
|
self._cpu_profiler = None
|
|
435
455
|
self._gpu_profiler = None
|
|
@@ -451,7 +471,9 @@ class Profiler:
|
|
|
451
471
|
_environment_check()
|
|
452
472
|
# default aicore_metrics type is ArithmeticUtilization
|
|
453
473
|
self._aicore_metrics_id = 0
|
|
454
|
-
self._l2_cache =
|
|
474
|
+
self._l2_cache = self.DISABLE_STATUS
|
|
475
|
+
self._hbm_ddr = self.DISABLE_STATUS
|
|
476
|
+
self._pcie = self.DISABLE_STATUS
|
|
455
477
|
self._data_process = True
|
|
456
478
|
self._op_time = True
|
|
457
479
|
self._profile_communication = False
|
|
@@ -465,22 +487,41 @@ class Profiler:
|
|
|
465
487
|
self._profile_framework = "all"
|
|
466
488
|
self._msprof_enable = os.getenv("PROFILER_SAMPLECONFIG")
|
|
467
489
|
self._pretty_json = False
|
|
490
|
+
self._analyse_only = kwargs.get("analyse_only", False)
|
|
468
491
|
if self._msprof_enable:
|
|
469
492
|
return
|
|
470
|
-
self._start_time = int(time.time() *
|
|
493
|
+
self._start_time = int(time.time() * 1e6) # us
|
|
494
|
+
self._monotonic_time = int(time.monotonic() * 1e6) # us
|
|
471
495
|
logger.info("Profiling: start time: %d", self._start_time)
|
|
472
496
|
if kwargs.get("env_enable"):
|
|
473
497
|
self._profiler_init(kwargs)
|
|
474
498
|
return
|
|
475
|
-
|
|
476
499
|
Profiler._has_initialized = True
|
|
477
500
|
# get device_id and device_target
|
|
478
|
-
self.
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
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
|
|
484
525
|
|
|
485
526
|
@staticmethod
|
|
486
527
|
def _check_output_path(output_path):
|
|
@@ -496,9 +537,9 @@ class Profiler:
|
|
|
496
537
|
return output_path
|
|
497
538
|
|
|
498
539
|
@staticmethod
|
|
499
|
-
def
|
|
540
|
+
def _parse_job_start_time(prof_dir):
|
|
500
541
|
"""
|
|
501
|
-
|
|
542
|
+
Get the start time of the job.
|
|
502
543
|
|
|
503
544
|
Args:
|
|
504
545
|
input_file (str): The file path of the host start log file.
|
|
@@ -506,12 +547,32 @@ class Profiler:
|
|
|
506
547
|
Returns:
|
|
507
548
|
str, job start time.
|
|
508
549
|
"""
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
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
|
|
515
576
|
|
|
516
577
|
@staticmethod
|
|
517
578
|
def _parse_info_json(info_file):
|
|
@@ -535,6 +596,47 @@ class Profiler:
|
|
|
535
596
|
|
|
536
597
|
return str(rank_id), str(dev_id)
|
|
537
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
|
+
|
|
538
640
|
def op_analyse(self, op_name, device_id=None):
|
|
539
641
|
"""
|
|
540
642
|
Profiler users can use this interface to obtain operator performance data.
|
|
@@ -560,12 +662,12 @@ class Profiler:
|
|
|
560
662
|
>>> # Profiler init.
|
|
561
663
|
>>> profiler = Profiler()
|
|
562
664
|
>>> # Train Model or eval Model, taking LeNet5 as an example.
|
|
563
|
-
>>> # Refer to https://gitee.com/mindspore/docs/blob/
|
|
665
|
+
>>> # Refer to https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/lenet.py
|
|
564
666
|
>>> net = LeNet5()
|
|
565
667
|
>>> optimizer = nn.Momentum(net.trainable_params(), learning_rate=0.1, momentum=0.9)
|
|
566
668
|
>>> loss = nn.SoftmaxCrossEntropyWithLogits(sparse=True)
|
|
567
669
|
>>> # Create the dataset taking MNIST as an example.
|
|
568
|
-
>>> # Refer to https://gitee.com/mindspore/docs/blob/
|
|
670
|
+
>>> # Refer to https://gitee.com/mindspore/docs/blob/master/docs/mindspore/code/mnist.py
|
|
569
671
|
>>> dataloader = create_dataset()
|
|
570
672
|
>>> model = Model(net, loss, optimizer)
|
|
571
673
|
>>> model.train(5, dataloader, dataset_sink_mode=False)
|
|
@@ -600,18 +702,28 @@ class Profiler:
|
|
|
600
702
|
return message
|
|
601
703
|
return op_info
|
|
602
704
|
|
|
603
|
-
def analyse(self, offline_path=None, pretty=False):
|
|
705
|
+
def analyse(self, offline_path=None, pretty=False, step_list=None):
|
|
604
706
|
"""
|
|
605
707
|
Collect and analyze training performance data, support calls during and after training. The example shows above.
|
|
606
708
|
|
|
607
709
|
Args:
|
|
608
|
-
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.
|
|
609
711
|
Offline mode isused in abnormal exit scenario. This parameter should be set to ``None``
|
|
610
712
|
for online mode. Default: ``None``.
|
|
611
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.
|
|
612
716
|
"""
|
|
613
|
-
|
|
614
|
-
|
|
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)
|
|
615
727
|
|
|
616
728
|
def _analyse(self, offline_path=None, model_iteration_dict=None):
|
|
617
729
|
"""
|
|
@@ -624,21 +736,18 @@ class Profiler:
|
|
|
624
736
|
model_iteration_dict: Dictionary with model id as the key and iteration id as the value, Default: ``None``.
|
|
625
737
|
"""
|
|
626
738
|
self._model_iteration_dict = model_iteration_dict
|
|
627
|
-
|
|
628
739
|
self._init_profiler_info()
|
|
629
740
|
self._is_support_step_info_collect()
|
|
630
741
|
parallel_mode = get_auto_parallel_context("parallel_mode")
|
|
631
742
|
stage_num = get_auto_parallel_context("pipeline_stages")
|
|
632
743
|
|
|
633
744
|
ProfilerInfo.set_parallel_info(parallel_mode, stage_num)
|
|
634
|
-
ProfilerInfo.set_rank_size(self._rank_size)
|
|
635
745
|
ProfilerInfo.set_heterogeneous(self._is_heterogeneous)
|
|
636
746
|
if offline_path:
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
ProfilerInfo.save(self._output_path)
|
|
747
|
+
ProfilerInfo.set_analyse_start_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
748
|
+
self._ascend_graph_analyse(offline_path=offline_path)
|
|
749
|
+
ProfilerInfo.set_analyse_end_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
750
|
+
ProfilerInfo.save(self._output_path)
|
|
642
751
|
_offline_parse(offline_path)
|
|
643
752
|
return
|
|
644
753
|
if self._msprof_enable:
|
|
@@ -715,10 +824,6 @@ class Profiler:
|
|
|
715
824
|
else:
|
|
716
825
|
raise RuntimeError("The profiler has already started. Do not turn on again in the open state.")
|
|
717
826
|
|
|
718
|
-
# No need to start anything if parse profiling data offline
|
|
719
|
-
if self._is_offline_parser():
|
|
720
|
-
return
|
|
721
|
-
|
|
722
827
|
self._cpu_profiler.step_profiling_enable(True)
|
|
723
828
|
if self._op_time:
|
|
724
829
|
self._cpu_profiler.enable_op_time()
|
|
@@ -736,6 +841,8 @@ class Profiler:
|
|
|
736
841
|
self._md_profiler.start()
|
|
737
842
|
self._ascend_graph_start()
|
|
738
843
|
ProfilerInfo.set_profiling_start_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
844
|
+
ProfilerInfo.set_system_time(int(c_expression.get_clock_time() * 1e3)) # cast us to ns
|
|
845
|
+
ProfilerInfo.set_system_cnt(c_expression.get_clock_syscnt())
|
|
739
846
|
|
|
740
847
|
def stop(self):
|
|
741
848
|
"""
|
|
@@ -778,10 +885,6 @@ class Profiler:
|
|
|
778
885
|
raise RuntimeError("The profiler has not started, so can not stop. Please call the start() method "
|
|
779
886
|
"before calling the stop() method.")
|
|
780
887
|
|
|
781
|
-
# No need to stop anything if parse profiling data offline
|
|
782
|
-
if self._is_offline_parser():
|
|
783
|
-
return
|
|
784
|
-
|
|
785
888
|
# Stop data collection after all operators are executed.
|
|
786
889
|
_pynative_executor.sync()
|
|
787
890
|
|
|
@@ -798,9 +901,21 @@ class Profiler:
|
|
|
798
901
|
self._stop_time = int(time.time() * 10000000)
|
|
799
902
|
ProfilerInfo.set_profiling_stop_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
|
|
800
903
|
self._init_profiler_info()
|
|
904
|
+
ProfilerInfo.set_diff_time(self._start_time - self._monotonic_time)
|
|
801
905
|
ProfilerInfo.save(self._output_path)
|
|
802
906
|
logger.info("Profiling: stop time: %d", self._stop_time)
|
|
803
907
|
|
|
908
|
+
def _set_ascend_job_id(self, ascend_job_id):
|
|
909
|
+
"""Set output_path for offline parsing performance data."""
|
|
910
|
+
if not ascend_job_id:
|
|
911
|
+
return
|
|
912
|
+
self._ascend_job_id = validate_and_normalize_path(ascend_job_id)
|
|
913
|
+
if not os.path.exists(self._ascend_job_id):
|
|
914
|
+
msg = f"Invalid ascend_job_id: {self._ascend_job_id}, Please pass the absolute path of the JOB dir"
|
|
915
|
+
logger.critical(msg)
|
|
916
|
+
raise ValueError(msg)
|
|
917
|
+
self._output_path, _ = os.path.split(self._ascend_job_id)
|
|
918
|
+
|
|
804
919
|
def _profiler_init(self, kwargs):
|
|
805
920
|
"""Initialize variables when profiler is enabled by environment variables."""
|
|
806
921
|
options = kwargs.get("env_enable")
|
|
@@ -919,15 +1034,17 @@ class Profiler:
|
|
|
919
1034
|
"output": self._output_path,
|
|
920
1035
|
"fp_point": fp_point,
|
|
921
1036
|
"bp_point": bp_point,
|
|
922
|
-
"training_trace":
|
|
923
|
-
"task_trace":
|
|
1037
|
+
"training_trace": self.ENABLE_STATUS if self._op_time else self.DISABLE_STATUS,
|
|
1038
|
+
"task_trace": self.ENABLE_STATUS if self._op_time else self.DISABLE_STATUS,
|
|
924
1039
|
"aic_metrics": AICORE_METRICS_DICT.get(self._aicore_metrics_id, "ArithmeticUtilization"),
|
|
925
|
-
"aicpu":
|
|
926
|
-
"profile_memory":
|
|
927
|
-
"hccl":
|
|
1040
|
+
"aicpu": self.ENABLE_STATUS if self._data_process or self._op_time else self.DISABLE_STATUS,
|
|
1041
|
+
"profile_memory": self.ENABLE_STATUS if self._op_time and self._profile_memory else self.DISABLE_STATUS,
|
|
1042
|
+
"hccl": self.ENABLE_STATUS if self._op_time and self._profile_communication else self.DISABLE_STATUS,
|
|
928
1043
|
"l2_cache": self._l2_cache,
|
|
929
|
-
"
|
|
930
|
-
"
|
|
1044
|
+
"hbm_ddr": self._hbm_ddr,
|
|
1045
|
+
"pcie": self._pcie,
|
|
1046
|
+
"parallel_strategy": self.ENABLE_STATUS if self._parallel_strategy else self.DISABLE_STATUS,
|
|
1047
|
+
"op_time": self.ENABLE_STATUS if self._op_time else self.DISABLE_STATUS,
|
|
931
1048
|
"profile_framework": self._profile_framework
|
|
932
1049
|
}
|
|
933
1050
|
|
|
@@ -961,7 +1078,7 @@ class Profiler:
|
|
|
961
1078
|
self._profile_communication = False
|
|
962
1079
|
|
|
963
1080
|
if self._profile_communication:
|
|
964
|
-
hccl_option = {"output": self._output_path, "task_trace":
|
|
1081
|
+
hccl_option = {"output": self._output_path, "task_trace": self.ENABLE_STATUS}
|
|
965
1082
|
os.environ['PROFILING_OPTIONS'] = json.dumps(hccl_option)
|
|
966
1083
|
|
|
967
1084
|
self._profile_memory = kwargs.pop("profile_memory", False)
|
|
@@ -986,10 +1103,21 @@ class Profiler:
|
|
|
986
1103
|
logger.warning(f"For '{self.__class__.__name__}', the parameter l2_cache must be bool, "
|
|
987
1104
|
f"but got type {type(l2_cache_enable)}, it will be set to False.")
|
|
988
1105
|
l2_cache_enable = False
|
|
989
|
-
if l2_cache_enable
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1106
|
+
self._l2_cache = self.ENABLE_STATUS if l2_cache_enable else self.DISABLE_STATUS
|
|
1107
|
+
|
|
1108
|
+
hbm_ddr_enable = kwargs.pop("hbm_ddr", False)
|
|
1109
|
+
if not isinstance(hbm_ddr_enable, bool):
|
|
1110
|
+
logger.warning(f"For '{self.__class__.__name__}', the parameter hbm_ddr must be bool, "
|
|
1111
|
+
f"but got type {type(hbm_ddr_enable)}, it will be set to False.")
|
|
1112
|
+
hbm_ddr_enable = False
|
|
1113
|
+
self._hbm_ddr = self.ENABLE_STATUS if hbm_ddr_enable else self.DISABLE_STATUS
|
|
1114
|
+
|
|
1115
|
+
pcie_enable = kwargs.pop("pcie", False)
|
|
1116
|
+
if not isinstance(pcie_enable, bool):
|
|
1117
|
+
logger.warning(f"For '{self.__class__.__name__}', the parameter pcie must be bool, "
|
|
1118
|
+
f"but got type {type(pcie_enable)}, it will be set to False.")
|
|
1119
|
+
pcie_enable = False
|
|
1120
|
+
self._pcie = self.ENABLE_STATUS if pcie_enable else self.DISABLE_STATUS
|
|
993
1121
|
|
|
994
1122
|
self._parallel_strategy = kwargs.pop("parallel_strategy", True)
|
|
995
1123
|
if not isinstance(self._parallel_strategy, bool):
|
|
@@ -997,28 +1125,6 @@ class Profiler:
|
|
|
997
1125
|
f"but got type {type(self._parallel_strategy)}, it will be set to True.")
|
|
998
1126
|
self._parallel_strategy = True
|
|
999
1127
|
|
|
1000
|
-
task_sink = os.getenv("GRAPH_OP_RUN")
|
|
1001
|
-
if task_sink and task_sink == "1":
|
|
1002
|
-
logger.warning(f"For '{self.__class__.__name__}', Profiling is not supported if set environment "
|
|
1003
|
-
f"'GRAPH_OP_RUN' value to 1, which means model training task is not sink.")
|
|
1004
|
-
|
|
1005
|
-
def _set_ascend_job_id(self, ascend_job_id):
|
|
1006
|
-
"""Set output_path for offline parsing performance data."""
|
|
1007
|
-
if not ascend_job_id:
|
|
1008
|
-
return
|
|
1009
|
-
self._ascend_job_id = validate_and_normalize_path(ascend_job_id)
|
|
1010
|
-
if not os.path.exists(self._ascend_job_id):
|
|
1011
|
-
msg = f"Invalid ascend_job_id: {self._ascend_job_id}, Please pass the absolute path of the JOB dir"
|
|
1012
|
-
logger.critical(msg)
|
|
1013
|
-
raise ValueError(msg)
|
|
1014
|
-
self._output_path, _ = os.path.split(self._ascend_job_id)
|
|
1015
|
-
|
|
1016
|
-
def _is_offline_parser(self):
|
|
1017
|
-
"""Return whether offline parser or online parser."""
|
|
1018
|
-
if self._device_target and self._device_target == DeviceTarget.ASCEND.value:
|
|
1019
|
-
return bool(self._ascend_job_id)
|
|
1020
|
-
return False
|
|
1021
|
-
|
|
1022
1128
|
def _ascend_analyse(self):
|
|
1023
1129
|
"""Collect and analyse ascend performance data."""
|
|
1024
1130
|
self._rank_size = 1
|
|
@@ -1029,6 +1135,7 @@ class Profiler:
|
|
|
1029
1135
|
self._rank_size = get_group_size()
|
|
1030
1136
|
else:
|
|
1031
1137
|
self._rank_size = int(os.getenv('RANK_SIZE', '1'))
|
|
1138
|
+
ProfilerInfo.set_rank_size(self._rank_size)
|
|
1032
1139
|
|
|
1033
1140
|
if self._has_started:
|
|
1034
1141
|
self.stop()
|
|
@@ -1088,7 +1195,7 @@ class Profiler:
|
|
|
1088
1195
|
pass
|
|
1089
1196
|
return points
|
|
1090
1197
|
|
|
1091
|
-
def _ascend_op_analyse(self, op_summary, op_statistic, dynamic_status):
|
|
1198
|
+
def _ascend_op_analyse(self, op_summary, op_statistic, dynamic_status, launch_ops: List):
|
|
1092
1199
|
"""
|
|
1093
1200
|
Ascend graph model hwts analyse.
|
|
1094
1201
|
|
|
@@ -1115,7 +1222,7 @@ class Profiler:
|
|
|
1115
1222
|
else:
|
|
1116
1223
|
output_timeline_data_path = None
|
|
1117
1224
|
|
|
1118
|
-
op_analyser = AscendOPGenerator(op_summary, op_statistic, dynamic_status)
|
|
1225
|
+
op_analyser = AscendOPGenerator(op_summary, op_statistic, dynamic_status, launch_ops)
|
|
1119
1226
|
op_analyser.parse()
|
|
1120
1227
|
op_analyser.write(op_intermediate_detail_path, op_intermediate_type_path,
|
|
1121
1228
|
aicpu_intermediate_detail_path, framework_raw_path, output_timeline_data_path)
|
|
@@ -1142,19 +1249,22 @@ class Profiler:
|
|
|
1142
1249
|
finally:
|
|
1143
1250
|
pass
|
|
1144
1251
|
|
|
1145
|
-
def _ascend_timeline_analyse(self, op_summary, steptrace):
|
|
1252
|
+
def _ascend_timeline_analyse(self, op_summary, steptrace, source_path, mindstudio_profiler_output) -> List:
|
|
1146
1253
|
"""Analyse timeline info."""
|
|
1147
1254
|
try:
|
|
1148
1255
|
logger.info("Profiling: analyzing the timeline data")
|
|
1149
|
-
timeline_analyser = AscendTimelineGenerator(self._output_path,
|
|
1150
|
-
context.get_context('mode'))
|
|
1151
|
-
timeline_analyser.
|
|
1152
|
-
timeline_analyser.
|
|
1256
|
+
timeline_analyser = AscendTimelineGenerator(self._output_path, source_path, mindstudio_profiler_output,
|
|
1257
|
+
self._rank_id, self._rank_size, context.get_context('mode'))
|
|
1258
|
+
timeline_analyser.parse_cluster_data(op_summary, steptrace)
|
|
1259
|
+
timeline_analyser.parse_timeline_data(pretty=self._pretty_json)
|
|
1260
|
+
timeline_analyser.write_timeline_display()
|
|
1153
1261
|
timeline_analyser.write_timeline_summary()
|
|
1262
|
+
|
|
1154
1263
|
except (ProfilerIOException, ProfilerFileNotFoundException, RuntimeError) as err:
|
|
1155
1264
|
logger.warning('Fail to write timeline data: %s', err)
|
|
1156
1265
|
finally:
|
|
1157
1266
|
pass
|
|
1267
|
+
return timeline_analyser.get_kernel_event_list()
|
|
1158
1268
|
|
|
1159
1269
|
def _ascend_dynamic_net_analyse(self, op_summary):
|
|
1160
1270
|
"""Analyse dynamic shape network info."""
|
|
@@ -1168,7 +1278,7 @@ class Profiler:
|
|
|
1168
1278
|
dynamic_parser = DynamicFrameWorkParser(self._output_path, self._rank_id, pretty=self._pretty_json)
|
|
1169
1279
|
dynamic_parser.write_dynamic_shape_data(op_summary)
|
|
1170
1280
|
|
|
1171
|
-
def _ascend_flops_analyse(self, op_summary):
|
|
1281
|
+
def _ascend_flops_analyse(self, op_summary, launch_ops):
|
|
1172
1282
|
"""Get op FLOPs from op_summary, write output_op_flops_x.csv."""
|
|
1173
1283
|
if 'vector_fops' not in op_summary.dtype.names and 'cube_fops' not in op_summary.dtype.names:
|
|
1174
1284
|
logger.warning("[Profiler] Can not found cube fops and vector fops data in the op summary.")
|
|
@@ -1183,7 +1293,7 @@ class Profiler:
|
|
|
1183
1293
|
flops_path = validate_and_normalize_path(flops_path)
|
|
1184
1294
|
flops_summary_path = validate_and_normalize_path(flops_summary_path)
|
|
1185
1295
|
|
|
1186
|
-
flops_analyser = AscendFlopsGenerator(op_summary, pretty=self._pretty_json)
|
|
1296
|
+
flops_analyser = AscendFlopsGenerator(op_summary, launch_ops, pretty=self._pretty_json)
|
|
1187
1297
|
flops_analyser.parse()
|
|
1188
1298
|
flops_analyser.write(flops_path, flops_summary_path)
|
|
1189
1299
|
|
|
@@ -1209,22 +1319,20 @@ class Profiler:
|
|
|
1209
1319
|
|
|
1210
1320
|
def _ascend_ms_analyze(self, source_path):
|
|
1211
1321
|
"""Ascend ms generate"""
|
|
1212
|
-
|
|
1322
|
+
|
|
1323
|
+
timestamp = time.strftime("%Y%m%d%H%M%S", time.localtime(time.time()))
|
|
1213
1324
|
if self._rank_id:
|
|
1214
|
-
ascend_ms_path = f"rank-{self._rank_id}_{
|
|
1325
|
+
ascend_ms_path = f"rank-{self._rank_id}_{timestamp}_ascend_ms"
|
|
1215
1326
|
else:
|
|
1216
|
-
ascend_ms_path = f"{socket.gethostname()}--{os.getpid()}_{
|
|
1217
|
-
|
|
1218
|
-
if not os.path.exists(self._ascend_ms_path):
|
|
1219
|
-
os.makedirs(self._ascend_ms_path, exist_ok=True)
|
|
1220
|
-
os.chmod(self._ascend_ms_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
|
1327
|
+
ascend_ms_path = f"{socket.gethostname()}--{os.getpid()}_{timestamp}_ascend_ms"
|
|
1328
|
+
ascend_ms_path = os.path.join(self._output_path, ascend_ms_path)
|
|
1221
1329
|
|
|
1222
1330
|
dev_id = self._rank_id if self._device_target == DeviceTarget.ASCEND.value else self._dev_id
|
|
1223
|
-
ascend_profiler_output_path = os.path.join(
|
|
1331
|
+
ascend_profiler_output_path = os.path.join(ascend_ms_path, 'ASCEND_PROFILER_OUTPUT')
|
|
1224
1332
|
os.makedirs(ascend_profiler_output_path, exist_ok=True)
|
|
1225
1333
|
|
|
1226
1334
|
source_profiler_info_path = os.path.join(self._output_path, f"profiler_info_{dev_id}.json")
|
|
1227
|
-
target_profiler_info_path = os.path.join(
|
|
1335
|
+
target_profiler_info_path = os.path.join(ascend_ms_path, f"profiler_info_{dev_id}.json")
|
|
1228
1336
|
shutil.copy(source_profiler_info_path, target_profiler_info_path)
|
|
1229
1337
|
|
|
1230
1338
|
source_timeline_path = os.path.join(self._output_path, f"ascend_timeline_display_{dev_id}.json")
|
|
@@ -1243,7 +1351,7 @@ class Profiler:
|
|
|
1243
1351
|
step_trace_time_path = os.path.join(ascend_profiler_output_path, f'step_trace_time.csv')
|
|
1244
1352
|
step_trace_time_path = validate_and_normalize_path(step_trace_time_path)
|
|
1245
1353
|
|
|
1246
|
-
cluster_analyse = AscendClusterGenerator(
|
|
1354
|
+
cluster_analyse = AscendClusterGenerator(source_path)
|
|
1247
1355
|
cluster_analyse.parse()
|
|
1248
1356
|
cluster_analyse.write(step_trace_time_path)
|
|
1249
1357
|
except (ProfilerIOException, ProfilerFileNotFoundException, ProfilerRawFileException) as err:
|
|
@@ -1262,10 +1370,11 @@ class Profiler:
|
|
|
1262
1370
|
communication_file_path = os.path.join(ascend_profiler_output_path, f'communication.json')
|
|
1263
1371
|
communication_file_path = validate_and_normalize_path(communication_file_path)
|
|
1264
1372
|
|
|
1265
|
-
communication_matrix_file_path = os.path.join(ascend_profiler_output_path,
|
|
1373
|
+
communication_matrix_file_path = os.path.join(ascend_profiler_output_path,
|
|
1374
|
+
f"communication_matrix.json")
|
|
1266
1375
|
communication_matrix_file_path = validate_and_normalize_path(communication_matrix_file_path)
|
|
1267
1376
|
|
|
1268
|
-
analyze_path = os.path.
|
|
1377
|
+
analyze_path = os.path.abspath(os.path.join(source_path, os.path.pardir, 'analyze'))
|
|
1269
1378
|
communicate_analyser = AscendCommunicationGenerator(analyze_path)
|
|
1270
1379
|
communicate_analyser.parse()
|
|
1271
1380
|
communicate_analyser.write(communication_file_path, communication_matrix_file_path)
|
|
@@ -1274,7 +1383,7 @@ class Profiler:
|
|
|
1274
1383
|
finally:
|
|
1275
1384
|
pass
|
|
1276
1385
|
|
|
1277
|
-
def _ascend_graph_hccl_analyse(self,
|
|
1386
|
+
def _ascend_graph_hccl_analyse(self, mindstudio_profiler_output, steptrace):
|
|
1278
1387
|
"""Analyse hccl profiler info."""
|
|
1279
1388
|
if not self._profile_communication:
|
|
1280
1389
|
return
|
|
@@ -1288,10 +1397,7 @@ class Profiler:
|
|
|
1288
1397
|
|
|
1289
1398
|
hccl_raw_path = os.path.join(self._output_path, f'hccl_raw_{dev_id}.csv')
|
|
1290
1399
|
hccl_raw_path = validate_and_normalize_path(hccl_raw_path)
|
|
1291
|
-
|
|
1292
|
-
hccl_analyse = AscendHCCLGenerator(os.path.join(source_path, 'timeline'), steptrace)
|
|
1293
|
-
else:
|
|
1294
|
-
hccl_analyse = AscendHCCLGeneratorOld(os.path.join(source_path, 'timeline'))
|
|
1400
|
+
hccl_analyse = AscendHCCLGenerator(mindstudio_profiler_output, steptrace)
|
|
1295
1401
|
hccl_analyse.parse()
|
|
1296
1402
|
hccl_analyse.write(hccl_raw_path)
|
|
1297
1403
|
|
|
@@ -1320,11 +1426,33 @@ class Profiler:
|
|
|
1320
1426
|
if context.get_context("mode") == context.PYNATIVE_MODE:
|
|
1321
1427
|
logger.warning("Pynative mode does not support MSAdvisor analyzer currently.")
|
|
1322
1428
|
|
|
1323
|
-
def
|
|
1429
|
+
def _get_kernel_op_map(self, op_summary, kernels: List[CANNEvent]) -> List:
|
|
1430
|
+
"""Get the mapping between framework operator and device kernel."""
|
|
1431
|
+
if not kernels:
|
|
1432
|
+
return []
|
|
1433
|
+
kernel_map = {}
|
|
1434
|
+
for kernel in kernels:
|
|
1435
|
+
key = kernel.name if kernel.is_comm_op else (kernel.name, str(kernel.ts))
|
|
1436
|
+
kernel_map[key] = kernel.parent
|
|
1437
|
+
launch_ops = [None] * len(op_summary)
|
|
1438
|
+
for index, summary in enumerate(op_summary):
|
|
1439
|
+
ts = str(summary['Task Start Time(us)']).strip("\t")
|
|
1440
|
+
name = summary['Op Name']
|
|
1441
|
+
key = name if name.startswith("hcom_") else (name, ts)
|
|
1442
|
+
launch_op = kernel_map.get(key)
|
|
1443
|
+
if not launch_op:
|
|
1444
|
+
if context.get_context("mode") == context.GRAPH_MODE or not name.startswith("aclnn"):
|
|
1445
|
+
logger.warning(f"Failed to get launch operator for {name}!")
|
|
1446
|
+
continue
|
|
1447
|
+
launch_ops[index] = launch_op.name
|
|
1448
|
+
return launch_ops
|
|
1449
|
+
|
|
1450
|
+
def _ascend_graph_analyse(self, offline_path=None):
|
|
1324
1451
|
"""Ascend graph mode analyse."""
|
|
1325
|
-
|
|
1452
|
+
if not offline_path:
|
|
1453
|
+
self._ascend_profiler.finalize()
|
|
1326
1454
|
|
|
1327
|
-
job_id = self._get_profiling_job_id()
|
|
1455
|
+
job_id = self._get_profiling_job_id(offline_path)
|
|
1328
1456
|
if not job_id:
|
|
1329
1457
|
return
|
|
1330
1458
|
logger.info("Profiling: job id is %s ", job_id)
|
|
@@ -1333,29 +1461,42 @@ class Profiler:
|
|
|
1333
1461
|
source_path = os.path.join(self._output_path, job_id)
|
|
1334
1462
|
self._minddata_analyse(source_path)
|
|
1335
1463
|
if self._op_time:
|
|
1336
|
-
|
|
1464
|
+
mindstudio_profiler_output = os.path.abspath(os.path.join(source_path, os.path.pardir,
|
|
1465
|
+
'mindstudio_profiler_output'))
|
|
1466
|
+
flag = _ascend_graph_msprof_generator(mindstudio_profiler_output, self._model_iteration_dict)
|
|
1337
1467
|
if not flag:
|
|
1338
1468
|
logger.warning('Current driver package not support all export mode, use single export mode, '
|
|
1339
1469
|
'this may lead to performance degradation. Suggest upgrading the driver package.')
|
|
1340
1470
|
ProfilerInfo.set_export_flag(flag)
|
|
1341
|
-
op_summary, op_statistic, steptrace
|
|
1342
|
-
|
|
1343
|
-
|
|
1471
|
+
op_summary, op_statistic, steptrace, steptrace_model \
|
|
1472
|
+
= _ascend_graph_msprof_analyse(mindstudio_profiler_output)
|
|
1473
|
+
if isinstance(op_statistic, np.ndarray) and op_statistic.shape[0] == 0 or \
|
|
1474
|
+
not isinstance(op_statistic, np.ndarray) and not op_statistic:
|
|
1475
|
+
return
|
|
1476
|
+
kernels = self._ascend_timeline_analyse(op_summary, steptrace, source_path, mindstudio_profiler_output)
|
|
1477
|
+
launch_ops = self._get_kernel_op_map(op_summary, kernels)
|
|
1478
|
+
self._ascend_op_analyse(op_summary, op_statistic, self._dynamic_status, launch_ops)
|
|
1344
1479
|
graph_ids = np.unique(op_summary['Model ID']).tolist()
|
|
1345
1480
|
points = self._ascend_fpbp_analyse(op_summary, steptrace)
|
|
1346
1481
|
if len(graph_ids) == 1:
|
|
1347
1482
|
self._ascend_step_trace_analyse(steptrace)
|
|
1483
|
+
else:
|
|
1484
|
+
self._ascend_step_trace_analyse(steptrace_model)
|
|
1348
1485
|
if self._dynamic_status:
|
|
1349
1486
|
self._ascend_dynamic_net_analyse(op_summary)
|
|
1350
|
-
self._ascend_flops_analyse(op_summary)
|
|
1487
|
+
self._ascend_flops_analyse(op_summary, launch_ops)
|
|
1351
1488
|
self._ascend_graph_memory_analyse(points)
|
|
1352
|
-
self._ascend_ms_analyze(
|
|
1353
|
-
self._ascend_graph_hccl_analyse(
|
|
1489
|
+
self._ascend_ms_analyze(mindstudio_profiler_output)
|
|
1490
|
+
self._ascend_graph_hccl_analyse(mindstudio_profiler_output, steptrace)
|
|
1354
1491
|
self._ascend_graph_msadvisor_analyse(job_id)
|
|
1355
1492
|
ProfilerInfo.set_graph_ids(graph_ids)
|
|
1356
1493
|
|
|
1357
1494
|
def _ascend_graph_start(self):
|
|
1358
1495
|
"""Ascend graph mode start profiling."""
|
|
1496
|
+
op_range_file = os.path.join(self._framework_path, "op_range_" + str(self._rank_id))
|
|
1497
|
+
if os.path.exists(op_range_file):
|
|
1498
|
+
os.remove(op_range_file)
|
|
1499
|
+
logger.info("Clear old op range filer.")
|
|
1359
1500
|
self._ascend_profiler.start()
|
|
1360
1501
|
|
|
1361
1502
|
def _gpu_analyse(self):
|
|
@@ -1370,6 +1511,8 @@ class Profiler:
|
|
|
1370
1511
|
else:
|
|
1371
1512
|
self._rank_size = int(os.getenv('RANK_SIZE', '1'))
|
|
1372
1513
|
|
|
1514
|
+
ProfilerInfo.set_rank_size(self._rank_size)
|
|
1515
|
+
|
|
1373
1516
|
if self._has_started:
|
|
1374
1517
|
self.stop()
|
|
1375
1518
|
else:
|
|
@@ -1438,7 +1581,8 @@ class Profiler:
|
|
|
1438
1581
|
if self._has_started:
|
|
1439
1582
|
self.stop()
|
|
1440
1583
|
else:
|
|
1441
|
-
logger.info("No need to stop profiler because profiler has been stopped
|
|
1584
|
+
logger.info("No need to stop profiler because profiler has been stopped.")
|
|
1585
|
+
|
|
1442
1586
|
if not self._op_time:
|
|
1443
1587
|
return
|
|
1444
1588
|
try:
|
|
@@ -1537,23 +1681,15 @@ class Profiler:
|
|
|
1537
1681
|
memory_parser.init_memory_usage_info(aicore_detail_data, points)
|
|
1538
1682
|
memory_parser.write_memory_files()
|
|
1539
1683
|
|
|
1540
|
-
def _get_profiling_job_id(self):
|
|
1684
|
+
def _get_profiling_job_id(self, offline_path):
|
|
1541
1685
|
"""Get profiling job id, which was generated by ada service.
|
|
1542
1686
|
|
|
1543
1687
|
Returns:
|
|
1544
1688
|
str, profiling job id.
|
|
1545
1689
|
"""
|
|
1546
1690
|
|
|
1547
|
-
if
|
|
1548
|
-
|
|
1549
|
-
job_id = self._ascend_job_id.rstrip('/').split('/')[-1]
|
|
1550
|
-
if job_id.startswith('PROF'):
|
|
1551
|
-
device_dir = [dir for dir in os.listdir(self._ascend_job_id) if dir.startswith('device')]
|
|
1552
|
-
info_file_path = get_file_path(os.path.join(self._ascend_job_id, device_dir[0]), "info.json")
|
|
1553
|
-
training_rank_id, _ = self._parse_info_json(info_file_path)
|
|
1554
|
-
self._rank_id = int(training_rank_id)
|
|
1555
|
-
return os.path.join(job_id, device_dir[0])
|
|
1556
|
-
return job_id
|
|
1691
|
+
if offline_path:
|
|
1692
|
+
self._output_path = os.path.join(offline_path, 'profiler')
|
|
1557
1693
|
|
|
1558
1694
|
job_id = ""
|
|
1559
1695
|
job_dirs = filter(lambda item: item.startswith('JOB') or item.startswith('PROF') and os.path.isdir(
|
|
@@ -1562,16 +1698,12 @@ class Profiler:
|
|
|
1562
1698
|
job_dirs, key=lambda x: os.path.getmtime(os.path.join(self._output_path, x)), reverse=True)
|
|
1563
1699
|
|
|
1564
1700
|
for dir_name in sorted_job_dirs:
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
job_dir = os.path.join(self._output_path, dir_name, device_dir[0])
|
|
1570
|
-
else:
|
|
1571
|
-
job_dir = os.path.join(self._output_path, dir_name)
|
|
1701
|
+
prof_dir = os.path.join(self._output_path, dir_name)
|
|
1702
|
+
device_dir = [dir for dir in os.listdir(prof_dir) \
|
|
1703
|
+
if dir.startswith('device') and os.path.isdir(os.path.join(prof_dir, dir))]
|
|
1704
|
+
job_dir = os.path.join(self._output_path, dir_name, device_dir[0])
|
|
1572
1705
|
|
|
1573
|
-
|
|
1574
|
-
if start_file_path is None:
|
|
1706
|
+
if get_file_path(job_dir, "start_info") is None:
|
|
1575
1707
|
logger.warning("Find profiling job path %s, but host_start.log not exist, "
|
|
1576
1708
|
"profiler will ignore this job dir.", job_dir)
|
|
1577
1709
|
continue
|
|
@@ -1582,25 +1714,27 @@ class Profiler:
|
|
|
1582
1714
|
"profiler will ignore this job dir.", job_dir)
|
|
1583
1715
|
continue
|
|
1584
1716
|
|
|
1585
|
-
|
|
1586
|
-
|
|
1717
|
+
prof_rank_id, prof_device_id = self._parse_info_json(info_file_path)
|
|
1718
|
+
job_start_time = self._parse_job_start_time(prof_dir)
|
|
1587
1719
|
|
|
1588
|
-
if
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1720
|
+
if offline_path:
|
|
1721
|
+
if self._rank_id != prof_rank_id:
|
|
1722
|
+
continue
|
|
1723
|
+
self._start_time = int(job_start_time)
|
|
1724
|
+
else:
|
|
1725
|
+
if self._dev_id != prof_device_id and self._rank_id != prof_rank_id:
|
|
1726
|
+
logger.debug("Find profiling find job path %s, but not current training device id. "
|
|
1727
|
+
"Current training rank id %s, but job path rank id: %s, "
|
|
1728
|
+
"profiler will ignore this job dir.", job_dir, self._rank_id, prof_rank_id)
|
|
1729
|
+
continue
|
|
1593
1730
|
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1731
|
+
if job_start_time < self._start_time:
|
|
1732
|
+
logger.warning("Find profiling job path %s, but start_time(%d) is earlier than this training "
|
|
1733
|
+
"start_time(%d), profiler will ignore this job dir.",
|
|
1734
|
+
job_dir, job_start_time, self._start_time)
|
|
1735
|
+
continue
|
|
1599
1736
|
|
|
1600
|
-
|
|
1601
|
-
job_id = os.path.join(dir_name, device_dir[0])
|
|
1602
|
-
else:
|
|
1603
|
-
job_id = dir_name
|
|
1737
|
+
job_id = os.path.join(dir_name, device_dir[0])
|
|
1604
1738
|
break
|
|
1605
1739
|
|
|
1606
1740
|
if not job_id:
|
|
@@ -1709,6 +1843,10 @@ class Profiler:
|
|
|
1709
1843
|
else:
|
|
1710
1844
|
logger.warning("The target dir already exists. "
|
|
1711
1845
|
"There may be some old profiling data, and they will be rewritten in the end.")
|
|
1846
|
+
self._framework_path = os.path.join(self._output_path, "FRAMEWORK")
|
|
1847
|
+
if not os.path.exists(self._framework_path):
|
|
1848
|
+
os.makedirs(self._framework_path, exist_ok=True)
|
|
1849
|
+
os.chmod(self._framework_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
|
1712
1850
|
|
|
1713
1851
|
def _parser_kwargs(self, kwargs):
|
|
1714
1852
|
"""Parse kwargs vale."""
|