mindspore 2.6.0rc1__cp311-cp311-win_amd64.whl → 2.7.0__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mindspore might be problematic. Click here for more details.
- mindspore/.commit_id +1 -1
- mindspore/Microsoft.VisualStudio.Telemetry.dll +0 -0
- mindspore/Newtonsoft.Json.dll +0 -0
- mindspore/__init__.py +2 -2
- mindspore/_c_dataengine.cp311-win_amd64.pyd +0 -0
- mindspore/_c_expression.cp311-win_amd64.pyd +0 -0
- mindspore/_c_mindrecord.cp311-win_amd64.pyd +0 -0
- mindspore/_checkparam.py +42 -11
- mindspore/_extends/builtin_operations.py +3 -3
- mindspore/{_deprecated → _extends/optimize}/__init__.py +9 -3
- mindspore/_extends/optimize/cell_utils.py +96 -0
- mindspore/_extends/parallel_compile/akg_compiler/custom.py +1109 -0
- mindspore/_extends/parallel_compile/akg_compiler/gen_custom_op_files.py +1 -1
- mindspore/_extends/parse/__init__.py +3 -3
- mindspore/_extends/parse/compile_config.py +44 -22
- mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +1 -2
- mindspore/_extends/parse/parser.py +65 -84
- mindspore/_extends/parse/resources.py +39 -0
- mindspore/_extends/parse/standard_method.py +58 -14
- mindspore/_extends/parse/trope.py +8 -1
- mindspore/_extends/pijit/__init__.py +1 -2
- mindspore/_extends/pijit/pijit_func_white_list.py +2 -5
- mindspore/amp.py +4 -22
- mindspore/atlprov.dll +0 -0
- mindspore/avcodec-59.dll +0 -0
- mindspore/avdevice-59.dll +0 -0
- mindspore/avfilter-8.dll +0 -0
- mindspore/avformat-59.dll +0 -0
- mindspore/avutil-57.dll +0 -0
- mindspore/boost/adasum.py +1 -1
- mindspore/boost/boost_cell_wrapper.py +4 -4
- mindspore/c1.dll +0 -0
- mindspore/c1xx.dll +0 -0
- mindspore/c2.dll +0 -0
- mindspore/common/__init__.py +43 -12
- mindspore/common/_grad_function.py +2 -1
- mindspore/common/_pijit_context.py +28 -7
- mindspore/common/_stub_tensor.py +1 -209
- mindspore/common/_tensor_cpp_method.py +1 -1
- mindspore/common/_tensor_docs.py +178 -53
- mindspore/common/_utils.py +9 -1
- mindspore/common/api.py +377 -203
- mindspore/common/dtype.py +108 -57
- mindspore/common/dump.py +11 -16
- mindspore/common/dynamic_shape/__init__.py +0 -0
- mindspore/common/{auto_dynamic_shape.py → dynamic_shape/auto_dynamic_shape.py} +17 -23
- mindspore/common/dynamic_shape/enable_dynamic.py +197 -0
- mindspore/common/file_system.py +59 -9
- mindspore/common/generator.py +5 -3
- mindspore/common/hook_handle.py +33 -5
- mindspore/common/jit_config.py +1 -1
- mindspore/common/jit_trace.py +84 -105
- mindspore/common/np_dtype.py +3 -3
- mindspore/common/parameter.py +27 -29
- mindspore/common/recompute.py +5 -7
- mindspore/common/sparse_tensor.py +0 -3
- mindspore/common/symbol.py +0 -1
- mindspore/common/tensor.py +117 -131
- mindspore/communication/_comm_helper.py +46 -4
- mindspore/communication/management.py +79 -7
- mindspore/context.py +67 -55
- mindspore/dataset/__init__.py +1 -1
- mindspore/dataset/audio/transforms.py +1 -1
- mindspore/dataset/core/config.py +38 -4
- mindspore/dataset/engine/datasets.py +350 -322
- mindspore/dataset/engine/datasets_user_defined.py +70 -24
- mindspore/dataset/engine/iterators.py +2 -2
- mindspore/dataset/engine/obs/config_loader.py +2 -2
- mindspore/dataset/engine/obs/obs_mindrecord_dataset.py +8 -0
- mindspore/dataset/transforms/c_transforms.py +2 -2
- mindspore/dataset/transforms/py_transforms.py +7 -3
- mindspore/dataset/transforms/transforms.py +10 -6
- mindspore/dataset/vision/__init__.py +1 -1
- mindspore/dataset/vision/py_transforms.py +8 -8
- mindspore/dataset/vision/transforms.py +17 -5
- mindspore/dataset/vision/utils.py +632 -21
- mindspore/dataset/vision/validators.py +1 -0
- mindspore/device_context/ascend/device.py +1 -1
- mindspore/device_context/ascend/op_tuning.py +35 -1
- mindspore/device_context/gpu/__init__.py +2 -2
- mindspore/device_context/gpu/device.py +1 -1
- mindspore/device_context/gpu/op_precision.py +4 -2
- mindspore/device_context/gpu/op_tuning.py +6 -3
- mindspore/device_manager.py +16 -9
- mindspore/dnnl.dll +0 -0
- mindspore/dpcmi.dll +0 -0
- mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +3 -4
- mindspore/experimental/llm_boost/atb/boost_base.py +2 -3
- mindspore/experimental/optim/adadelta.py +13 -20
- mindspore/experimental/optim/adagrad.py +15 -22
- mindspore/experimental/optim/adam.py +17 -24
- mindspore/experimental/optim/adamax.py +14 -22
- mindspore/experimental/optim/adamw.py +28 -34
- mindspore/experimental/optim/asgd.py +15 -25
- mindspore/experimental/optim/lr_scheduler.py +27 -45
- mindspore/experimental/optim/nadam.py +14 -24
- mindspore/experimental/optim/optimizer.py +13 -23
- mindspore/experimental/optim/radam.py +18 -24
- mindspore/experimental/optim/rmsprop.py +14 -25
- mindspore/experimental/optim/rprop.py +15 -26
- mindspore/experimental/optim/sgd.py +9 -19
- mindspore/hal/__init__.py +4 -4
- mindspore/hal/contiguous_tensors_handle.py +2 -2
- mindspore/hal/memory.py +27 -7
- mindspore/include/api/cell.h +65 -5
- mindspore/include/api/cfg.h +24 -7
- mindspore/include/api/context.h +1 -0
- mindspore/include/api/delegate.h +10 -2
- mindspore/include/api/dual_abi_helper.h +100 -19
- mindspore/include/api/graph.h +14 -1
- mindspore/include/api/kernel.h +16 -3
- mindspore/include/api/kernel_api.h +9 -1
- mindspore/include/api/metrics/accuracy.h +9 -0
- mindspore/include/api/model.h +8 -1
- mindspore/include/api/model_group.h +4 -0
- mindspore/include/api/model_parallel_runner.h +2 -0
- mindspore/include/api/status.h +48 -10
- mindspore/include/api/types.h +8 -3
- mindspore/include/c_api/model_c.h +0 -58
- mindspore/include/c_api/tensor_c.h +0 -26
- mindspore/include/dataset/constants.h +9 -0
- mindspore/include/dataset/vision_ascend.h +1 -1
- mindspore/jpeg62.dll +0 -0
- mindspore/mindrecord/tools/cifar10.py +61 -11
- mindspore/mindrecord/tools/cifar10_to_mr.py +5 -0
- mindspore/mindspore_backend_common.dll +0 -0
- mindspore/mindspore_backend_manager.dll +0 -0
- mindspore/mindspore_common.dll +0 -0
- mindspore/mindspore_core.dll +0 -0
- mindspore/mindspore_cpu_res_manager.dll +0 -0
- mindspore/mindspore_dump.dll +0 -0
- mindspore/mindspore_frontend.dll +0 -0
- mindspore/mindspore_glog.dll +0 -0
- mindspore/mindspore_memory_pool.dll +0 -0
- mindspore/mindspore_ms_backend.dll +0 -0
- mindspore/mindspore_ops.dll +0 -0
- mindspore/mindspore_ops_host.dll +0 -0
- mindspore/mindspore_ops_kernel_common.dll +0 -0
- mindspore/mindspore_profiler.dll +0 -0
- mindspore/mindspore_pyboost.dll +0 -0
- mindspore/mindspore_pynative.dll +0 -0
- mindspore/mindspore_res_manager.dll +0 -0
- mindspore/mindspore_runtime_pipeline.dll +0 -0
- mindspore/mint/__init__.py +6 -46
- mindspore/mint/distributed/__init__.py +5 -0
- mindspore/mint/distributed/distributed.py +429 -23
- mindspore/mint/nn/__init__.py +1 -1
- mindspore/mint/nn/functional.py +53 -6
- mindspore/mint/nn/layer/_functions.py +163 -294
- mindspore/mint/nn/layer/activation.py +8 -6
- mindspore/mint/nn/layer/conv.py +140 -104
- mindspore/mint/nn/layer/normalization.py +11 -25
- mindspore/mint/optim/adam.py +19 -18
- mindspore/mint/optim/adamw.py +14 -8
- mindspore/mint/optim/sgd.py +5 -5
- mindspore/msobj140.dll +0 -0
- mindspore/mspdb140.dll +0 -0
- mindspore/mspdbcore.dll +0 -0
- mindspore/mspdbst.dll +0 -0
- mindspore/mspft140.dll +0 -0
- mindspore/msvcdis140.dll +0 -0
- mindspore/msvcp140_1.dll +0 -0
- mindspore/msvcp140_2.dll +0 -0
- mindspore/msvcp140_atomic_wait.dll +0 -0
- mindspore/msvcp140_codecvt_ids.dll +0 -0
- mindspore/nn/cell.py +491 -623
- mindspore/nn/grad/cell_grad.py +11 -12
- mindspore/nn/layer/activation.py +36 -36
- mindspore/nn/layer/basic.py +74 -77
- mindspore/nn/layer/channel_shuffle.py +4 -4
- mindspore/nn/layer/combined.py +4 -2
- mindspore/nn/layer/conv.py +117 -110
- mindspore/nn/layer/dense.py +9 -7
- mindspore/nn/layer/embedding.py +50 -52
- mindspore/nn/layer/image.py +38 -40
- mindspore/nn/layer/math.py +111 -112
- mindspore/nn/layer/normalization.py +56 -44
- mindspore/nn/layer/pooling.py +58 -63
- mindspore/nn/layer/rnn_cells.py +33 -33
- mindspore/nn/layer/rnns.py +56 -56
- mindspore/nn/layer/thor_layer.py +74 -73
- mindspore/nn/layer/transformer.py +11 -1
- mindspore/nn/learning_rate_schedule.py +20 -20
- mindspore/nn/loss/loss.py +79 -81
- mindspore/nn/optim/adam.py +4 -6
- mindspore/nn/optim/adasum.py +2 -2
- mindspore/nn/optim/asgd.py +2 -0
- mindspore/nn/optim/lamb.py +1 -3
- mindspore/nn/optim/optimizer.py +1 -1
- mindspore/nn/optim/tft_wrapper.py +2 -3
- mindspore/nn/optim/thor.py +2 -2
- mindspore/nn/probability/distribution/_utils/utils.py +2 -2
- mindspore/nn/probability/distribution/exponential.py +2 -1
- mindspore/nn/probability/distribution/poisson.py +2 -1
- mindspore/nn/sparse/sparse.py +3 -3
- mindspore/nn/wrap/cell_wrapper.py +73 -42
- mindspore/nn/wrap/grad_reducer.py +37 -52
- mindspore/nn/wrap/loss_scale.py +72 -74
- mindspore/numpy/array_creations.py +7 -7
- mindspore/numpy/fft.py +1 -1
- mindspore/numpy/math_ops.py +5 -5
- mindspore/numpy/utils_const.py +1 -1
- mindspore/opencv_core452.dll +0 -0
- mindspore/opencv_imgcodecs452.dll +0 -0
- mindspore/opencv_imgproc452.dll +0 -0
- mindspore/ops/_grad_experimental/grad_comm_ops.py +51 -13
- mindspore/ops/_grad_experimental/grad_debug_ops.py +14 -0
- mindspore/ops/_grad_experimental/grad_inner_ops.py +0 -9
- mindspore/ops/_op_impl/cpu/__init__.py +1 -0
- mindspore/{experimental/es/__init__.py → ops/_op_impl/cpu/joinedstr_op.py} +12 -6
- mindspore/ops/_vmap/vmap_array_ops.py +31 -13
- mindspore/ops/_vmap/vmap_nn_ops.py +8 -16
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +54 -13
- mindspore/ops/auto_generate/gen_extend_func.py +27 -145
- mindspore/ops/auto_generate/gen_ops_def.py +1027 -347
- mindspore/ops/auto_generate/gen_ops_prim.py +2341 -1117
- mindspore/ops/auto_generate/pyboost_inner_prim.py +31 -1
- mindspore/ops/composite/__init__.py +10 -0
- mindspore/ops/composite/base.py +9 -5
- mindspore/ops/composite/multitype_ops/__init__.py +12 -1
- mindspore/ops/composite/multitype_ops/_compile_utils.py +133 -109
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +1 -1
- mindspore/ops/composite/multitype_ops/add_impl.py +70 -2
- mindspore/ops/composite/multitype_ops/div_impl.py +49 -0
- mindspore/ops/composite/multitype_ops/floordiv_impl.py +29 -0
- mindspore/ops/composite/multitype_ops/getitem_impl.py +11 -0
- mindspore/ops/composite/multitype_ops/mod_impl.py +5 -3
- mindspore/ops/composite/multitype_ops/mul_impl.py +49 -0
- mindspore/ops/composite/multitype_ops/setitem_impl.py +57 -0
- mindspore/ops/composite/multitype_ops/sub_impl.py +34 -0
- mindspore/ops/composite/multitype_ops/zeros_like_impl.py +14 -0
- mindspore/ops/function/__init__.py +4 -1
- mindspore/ops/function/_add_attr_func.py +11 -6
- mindspore/ops/function/array_func.py +19 -102
- mindspore/ops/function/debug_func.py +8 -5
- mindspore/ops/function/grad/grad_func.py +5 -13
- mindspore/ops/function/math_func.py +77 -572
- mindspore/ops/function/nn_func.py +46 -94
- mindspore/ops/function/other_func.py +4 -1
- mindspore/ops/function/random_func.py +44 -5
- mindspore/ops/function/vmap_func.py +2 -1
- mindspore/ops/functional.py +4 -4
- mindspore/ops/functional_overload.py +594 -18
- mindspore/ops/op_info_register.py +21 -0
- mindspore/ops/operations/__init__.py +16 -11
- mindspore/ops/operations/_custom_ops_utils.py +689 -34
- mindspore/ops/operations/_inner_ops.py +14 -18
- mindspore/ops/operations/_sequence_ops.py +1 -1
- mindspore/ops/operations/array_ops.py +5 -51
- mindspore/ops/operations/comm_ops.py +186 -41
- mindspore/ops/operations/custom_ops.py +303 -177
- mindspore/ops/operations/debug_ops.py +59 -4
- mindspore/ops/operations/image_ops.py +13 -13
- mindspore/ops/operations/manually_defined/ops_def.py +27 -28
- mindspore/ops/operations/math_ops.py +8 -9
- mindspore/ops/operations/nn_ops.py +8 -40
- mindspore/ops/primitive.py +9 -20
- mindspore/ops/tensor_method.py +63 -15
- mindspore/ops_generate/api/cpp_create_prim_instance_helper_generator.py +1 -1
- mindspore/ops_generate/api/functional_map_cpp_generator.py +10 -9
- mindspore/ops_generate/api/functions_cc_generator.py +58 -10
- mindspore/ops_generate/api/tensor_func_reg_cpp_generator.py +1 -1
- mindspore/ops_generate/common/base_generator.py +14 -0
- mindspore/ops_generate/common/gen_constants.py +8 -3
- mindspore/ops_generate/common/gen_utils.py +0 -19
- mindspore/ops_generate/common/op_proto.py +11 -4
- mindspore/ops_generate/common/template.py +88 -11
- mindspore/ops_generate/gen_ops.py +1 -1
- mindspore/ops_generate/op_def/lite_ops_cpp_generator.py +4 -4
- mindspore/ops_generate/op_def/ops_def_cc_generator.py +0 -3
- mindspore/ops_generate/op_def/ops_name_h_generator.py +0 -3
- mindspore/ops_generate/op_def/ops_primitive_h_generator.py +0 -4
- mindspore/ops_generate/op_def_py/op_prim_py_generator.py +5 -2
- mindspore/ops_generate/pyboost/auto_grad_impl_cc_generator.py +49 -8
- mindspore/ops_generate/pyboost/auto_grad_reg_cc_generator.py +2 -2
- mindspore/ops_generate/pyboost/gen_pyboost_func.py +31 -16
- mindspore/ops_generate/pyboost/op_template_parser.py +98 -72
- mindspore/ops_generate/pyboost/pyboost_functions_cpp_generator.py +70 -273
- mindspore/ops_generate/pyboost/pyboost_functions_h_generator.py +14 -6
- mindspore/ops_generate/pyboost/pyboost_functions_impl_cpp_generator.py +316 -0
- mindspore/ops_generate/pyboost/pyboost_functions_py_generator.py +1 -1
- mindspore/ops_generate/pyboost/pyboost_grad_function_cpp_generator.py +5 -3
- mindspore/ops_generate/pyboost/pyboost_inner_prim_generator.py +1 -1
- mindspore/ops_generate/pyboost/pyboost_internal_functions_cpp_generator.py +76 -0
- mindspore/ops_generate/pyboost/pyboost_internal_functions_h_generator.py +76 -0
- mindspore/ops_generate/pyboost/pyboost_internal_kernel_info_adapter_generator.py +125 -0
- mindspore/ops_generate/pyboost/pyboost_native_grad_functions_generator.py +4 -3
- mindspore/ops_generate/pyboost/pyboost_op_cpp_code_generator.py +348 -61
- mindspore/ops_generate/pyboost/pyboost_overload_functions_cpp_generator.py +1 -1
- mindspore/ops_generate/pyboost/pyboost_utils.py +118 -9
- mindspore/ops_generate/tensor_py_cc_generator.py +1 -24
- mindspore/parallel/_auto_parallel_context.py +16 -23
- mindspore/parallel/_cell_wrapper.py +113 -45
- mindspore/parallel/_parallel_serialization.py +4 -3
- mindspore/parallel/_ps_context.py +4 -6
- mindspore/parallel/_tensor.py +167 -12
- mindspore/parallel/_transformer/moe.py +1 -1
- mindspore/parallel/_transformer/transformer.py +17 -12
- mindspore/parallel/_utils.py +5 -11
- mindspore/parallel/auto_parallel.py +35 -14
- mindspore/parallel/checkpoint_convert.py +3 -3
- mindspore/parallel/checkpoint_transform.py +13 -7
- mindspore/parallel/cluster/process_entity/_api.py +88 -49
- mindspore/parallel/cluster/process_entity/_utils.py +95 -7
- mindspore/parallel/cluster/run.py +48 -7
- mindspore/parallel/function/__init__.py +8 -1
- mindspore/parallel/function/reshard_func.py +12 -12
- mindspore/parallel/nn/__init__.py +15 -2
- mindspore/parallel/nn/parallel_cell_wrapper.py +50 -14
- mindspore/parallel/nn/parallel_grad_reducer.py +7 -14
- mindspore/parallel/shard.py +10 -25
- mindspore/parallel/transform_safetensors.py +469 -174
- mindspore/pgodb140.dll +0 -0
- mindspore/pgort140.dll +0 -0
- mindspore/profiler/__init__.py +2 -1
- mindspore/profiler/analysis/parser/timeline_assembly_factory/ascend_timeline_assembler.py +7 -7
- mindspore/profiler/analysis/parser/timeline_assembly_factory/base_timeline_assembler.py +3 -0
- mindspore/profiler/analysis/parser/timeline_assembly_factory/trace_view_container.py +12 -6
- mindspore/profiler/analysis/parser/timeline_creator/cpu_op_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_creator/fwk_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_creator/msprof_timeline_creator.py +4 -4
- mindspore/profiler/analysis/parser/timeline_creator/scope_layer_timeline_creator.py +3 -3
- mindspore/profiler/analysis/parser/timeline_event/fwk_event.py +4 -1
- mindspore/profiler/analysis/parser/timeline_event/timeline_event_pool.py +2 -1
- mindspore/profiler/analysis/task_manager.py +1 -1
- mindspore/profiler/analysis/viewer/ascend_communication_viewer.py +5 -1
- mindspore/profiler/analysis/viewer/ascend_integrate_viewer.py +2 -1
- mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +10 -9
- mindspore/profiler/analysis/viewer/ascend_op_memory_viewer.py +43 -23
- mindspore/profiler/analysis/viewer/ascend_step_trace_time_viewer.py +3 -2
- mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +9 -5
- mindspore/profiler/analysis/viewer/ms_operator_details_viewer.py +132 -0
- mindspore/profiler/common/constant.py +16 -0
- mindspore/profiler/common/msprof_cmd_tool.py +2 -2
- mindspore/profiler/common/path_manager.py +9 -0
- mindspore/profiler/common/profiler_context.py +50 -29
- mindspore/profiler/common/profiler_info.py +0 -16
- mindspore/profiler/common/profiler_meta_data.py +1 -0
- mindspore/profiler/common/profiler_op_analyse.py +239 -0
- mindspore/profiler/common/profiler_output_path.py +23 -8
- mindspore/profiler/common/profiler_parameters.py +128 -35
- mindspore/profiler/dynamic_profile/__init__.py +0 -0
- mindspore/profiler/dynamic_profile/dynamic_monitor_proxy.py +39 -0
- mindspore/profiler/dynamic_profile/dynamic_profiler_config_context.py +666 -0
- mindspore/profiler/dynamic_profile/dynamic_profiler_utils.py +62 -0
- mindspore/profiler/dynamic_profiler.py +374 -338
- mindspore/profiler/envprofiler.py +42 -12
- mindspore/profiler/experimental_config.py +112 -7
- mindspore/profiler/mstx.py +33 -12
- mindspore/profiler/platform/__init__.py +2 -3
- mindspore/profiler/platform/cpu_profiler.py +10 -4
- mindspore/profiler/platform/npu_profiler.py +30 -20
- mindspore/profiler/profiler.py +218 -154
- mindspore/profiler/profiler_action_controller.py +65 -77
- mindspore/profiler/profiler_interface.py +2 -2
- mindspore/profiler/schedule.py +10 -4
- mindspore/rewrite/common/config.py +1 -0
- mindspore/rewrite/common/namer.py +1 -0
- mindspore/rewrite/common/namespace.py +1 -0
- mindspore/rewrite/node/node.py +31 -11
- mindspore/rewrite/parsers/assign_parser.py +1 -1
- mindspore/rewrite/symbol_tree/symbol_tree.py +2 -2
- mindspore/run_check/_check_version.py +7 -10
- mindspore/runtime/__init__.py +8 -6
- mindspore/runtime/event.py +10 -4
- mindspore/runtime/executor.py +87 -45
- mindspore/runtime/memory.py +31 -32
- mindspore/runtime/thread_bind_core.py +299 -165
- mindspore/safeguard/rewrite_obfuscation.py +12 -13
- mindspore/swresample-4.dll +0 -0
- mindspore/swscale-6.dll +0 -0
- mindspore/tbbmalloc.dll +0 -0
- mindspore/tinyxml2.dll +0 -0
- mindspore/train/_utils.py +17 -7
- mindspore/train/amp.py +43 -23
- mindspore/train/callback/__init__.py +5 -5
- mindspore/train/callback/_callback.py +2 -1
- mindspore/train/callback/_checkpoint.py +4 -14
- mindspore/train/callback/_flops_collector.py +11 -7
- mindspore/train/callback/_landscape.py +0 -1
- mindspore/train/callback/_train_fault_tolerance.py +98 -21
- mindspore/train/data_sink.py +15 -6
- mindspore/train/dataset_helper.py +14 -5
- mindspore/train/model.py +133 -69
- mindspore/train/serialization.py +168 -126
- mindspore/train/summary/summary_record.py +13 -2
- mindspore/train/train_thor/model_thor.py +2 -2
- mindspore/turbojpeg.dll +0 -0
- mindspore/utils/__init__.py +3 -2
- mindspore/utils/dryrun.py +0 -6
- mindspore/utils/runtime_execution_order_check.py +163 -77
- mindspore/utils/sdc_detect.py +68 -0
- mindspore/utils/utils.py +14 -17
- mindspore/vcmeta.dll +0 -0
- mindspore/vcruntime140.dll +0 -0
- mindspore/vcruntime140_1.dll +0 -0
- mindspore/version.py +1 -1
- {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0.dist-info}/METADATA +5 -4
- {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0.dist-info}/RECORD +403 -442
- mindspore/_deprecated/jit.py +0 -198
- mindspore/_extends/remote/kernel_build_server_ascend.py +0 -75
- mindspore/communication/_hccl_management.py +0 -297
- mindspore/experimental/es/embedding_service.py +0 -891
- mindspore/experimental/es/embedding_service_layer.py +0 -581
- mindspore/profiler/common/validator/__init__.py +0 -14
- mindspore/profiler/common/validator/validate_path.py +0 -84
- mindspore/profiler/parser/__init__.py +0 -14
- mindspore/profiler/parser/aicpu_data_parser.py +0 -272
- mindspore/profiler/parser/ascend_analysis/__init__.py +0 -14
- mindspore/profiler/parser/ascend_analysis/constant.py +0 -71
- mindspore/profiler/parser/ascend_analysis/file_manager.py +0 -180
- mindspore/profiler/parser/ascend_analysis/function_event.py +0 -185
- mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +0 -136
- mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +0 -131
- mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +0 -104
- mindspore/profiler/parser/ascend_analysis/path_manager.py +0 -313
- mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +0 -123
- mindspore/profiler/parser/ascend_analysis/tlv_decoder.py +0 -86
- mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +0 -75
- mindspore/profiler/parser/ascend_cluster_generator.py +0 -116
- mindspore/profiler/parser/ascend_communicate_generator.py +0 -314
- mindspore/profiler/parser/ascend_flops_generator.py +0 -116
- mindspore/profiler/parser/ascend_fpbp_generator.py +0 -82
- mindspore/profiler/parser/ascend_hccl_generator.py +0 -271
- mindspore/profiler/parser/ascend_integrate_generator.py +0 -42
- mindspore/profiler/parser/ascend_memory_generator.py +0 -185
- mindspore/profiler/parser/ascend_msprof_exporter.py +0 -282
- mindspore/profiler/parser/ascend_msprof_generator.py +0 -187
- mindspore/profiler/parser/ascend_op_generator.py +0 -334
- mindspore/profiler/parser/ascend_steptrace_generator.py +0 -94
- mindspore/profiler/parser/ascend_timeline_generator.py +0 -545
- mindspore/profiler/parser/base_timeline_generator.py +0 -483
- mindspore/profiler/parser/container.py +0 -229
- mindspore/profiler/parser/cpu_gpu_timeline_generator.py +0 -697
- mindspore/profiler/parser/flops_parser.py +0 -531
- mindspore/profiler/parser/framework_enum.py +0 -111
- mindspore/profiler/parser/framework_parser.py +0 -464
- mindspore/profiler/parser/framework_struct.py +0 -61
- mindspore/profiler/parser/gpu_analysis/__init__.py +0 -14
- mindspore/profiler/parser/gpu_analysis/function_event.py +0 -44
- mindspore/profiler/parser/gpu_analysis/fwk_file_parser.py +0 -89
- mindspore/profiler/parser/gpu_analysis/profiler_info_parser.py +0 -72
- mindspore/profiler/parser/hccl_parser.py +0 -573
- mindspore/profiler/parser/hwts_log_parser.py +0 -122
- mindspore/profiler/parser/integrator.py +0 -526
- mindspore/profiler/parser/memory_usage_parser.py +0 -277
- mindspore/profiler/parser/minddata_analyzer.py +0 -800
- mindspore/profiler/parser/minddata_parser.py +0 -186
- mindspore/profiler/parser/minddata_pipeline_parser.py +0 -299
- mindspore/profiler/parser/op_intermediate_parser.py +0 -149
- mindspore/profiler/parser/optime_parser.py +0 -250
- mindspore/profiler/parser/profiler_info.py +0 -213
- mindspore/profiler/parser/step_trace_parser.py +0 -666
- mindspore/utils/hooks.py +0 -81
- /mindspore/common/{_auto_dynamic.py → dynamic_shape/_auto_dynamic.py} +0 -0
- {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0.dist-info}/WHEEL +0 -0
- {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0.dist-info}/entry_points.txt +0 -0
- {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0.dist-info}/top_level.txt +0 -0
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
# Copyright 2020 Huawei Technologies Co., Ltd
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
# ============================================================================
|
|
15
|
-
"""Op compute time files parser."""
|
|
16
|
-
import os
|
|
17
|
-
import stat
|
|
18
|
-
from mindspore.profiler.common.util import fwrite_format
|
|
19
|
-
from mindspore.profiler.common.exceptions.exceptions import ProfilerFileNotFoundException, \
|
|
20
|
-
ProfilerIOException
|
|
21
|
-
from mindspore import log as logger
|
|
22
|
-
from mindspore.profiler.common.validator.validate_path import validate_and_normalize_path
|
|
23
|
-
from mindspore.profiler.parser.container import HWTSContainer
|
|
24
|
-
|
|
25
|
-
TIMELINE_FILE_COLUMN_TITLE = 'op_name, stream_id, start_time(ms), duration(ms)'
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class OPComputeTimeParser:
|
|
29
|
-
"""
|
|
30
|
-
Join hwts info and framework info, get op time info, and output to the result file.
|
|
31
|
-
|
|
32
|
-
Args:
|
|
33
|
-
hwts_output_file (str): The file path of hwts_output_file. Such as: './output_format_data_hwts_0.txt".
|
|
34
|
-
output_filename (str): The output data file path and name. Such as: './output_op_compute_time_0.txt'.
|
|
35
|
-
op_task_info (dict): The task and op relation info. The format: {task_id, [opname, stream_id, block dim]}.
|
|
36
|
-
"""
|
|
37
|
-
|
|
38
|
-
_dst_file_title = 'title:op compute time'
|
|
39
|
-
_dst_file_column_title = 'op_name compute_time(ms) stream_id execution_times'
|
|
40
|
-
_dst_file_column_title += '\n------------ --------------- ---------'
|
|
41
|
-
|
|
42
|
-
def __init__(self, hwts_output_file, output_filename, op_task_info,
|
|
43
|
-
output_path, device_id):
|
|
44
|
-
hwts_output_file = validate_and_normalize_path(hwts_output_file)
|
|
45
|
-
self._hwts_output_file = hwts_output_file
|
|
46
|
-
self._output_filename = output_filename
|
|
47
|
-
self._op_task_info = op_task_info
|
|
48
|
-
self._output_path = output_path
|
|
49
|
-
self._device_id = device_id
|
|
50
|
-
self._min_cycle_counter = float("inf")
|
|
51
|
-
|
|
52
|
-
@property
|
|
53
|
-
def min_cycle_counter(self):
|
|
54
|
-
"""Get minimum cycle counter."""
|
|
55
|
-
return self._min_cycle_counter
|
|
56
|
-
|
|
57
|
-
@staticmethod
|
|
58
|
-
def _convert_op_time_unit(op_data_list, op_name_time_dict, op_name_stream_dict,
|
|
59
|
-
op_name_count_dict, op_name_task_dict, op_name_start_time):
|
|
60
|
-
"""
|
|
61
|
-
Calculate the execution time of operator and convert it into millisecond.
|
|
62
|
-
|
|
63
|
-
Args:
|
|
64
|
-
op_data_list (list): The list of operator metadata.
|
|
65
|
-
op_name_time_dict (dict): The mapping relation of operator name and its execution time.
|
|
66
|
-
op_name_stream_dict (dict): The mapping relation of operator name and its stream id.
|
|
67
|
-
op_name_count_dict (dict): The mapping relation of operator name and its count.
|
|
68
|
-
op_name_task_dict (dict): The mapping relation of operator name and its task id.
|
|
69
|
-
op_name_start_time (dict): The mapping relation of operator name and its start time.
|
|
70
|
-
"""
|
|
71
|
-
factor = 1e5
|
|
72
|
-
for item in op_data_list:
|
|
73
|
-
op_name = item.op_name
|
|
74
|
-
# Unit conversion: converting the cycle counter into ms.
|
|
75
|
-
op_start_time_str = str(item.cycle_counter / factor)
|
|
76
|
-
op_duration = item.duration / factor
|
|
77
|
-
op_duration_str = str(item.duration / factor)
|
|
78
|
-
if op_name in op_name_time_dict.keys():
|
|
79
|
-
op_name_time_dict[op_name] += op_duration
|
|
80
|
-
op_name_count_dict[op_name] += 1
|
|
81
|
-
op_name_start_time[op_name].append(
|
|
82
|
-
(op_start_time_str, op_duration_str)
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
else:
|
|
86
|
-
op_name_time_dict[op_name] = op_duration
|
|
87
|
-
op_name_stream_dict[op_name] = item.stream_id
|
|
88
|
-
op_name_task_dict[op_name] = item.task_id
|
|
89
|
-
op_name_count_dict[op_name] = 1
|
|
90
|
-
op_name_start_time[op_name] = []
|
|
91
|
-
op_name_start_time[op_name].append(
|
|
92
|
-
(op_start_time_str, op_duration_str)
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
def execute(self):
|
|
96
|
-
"""Execute the parser, compute all op, get op time, and write it to the output file."""
|
|
97
|
-
# Calculate the execution time of operators,
|
|
98
|
-
# and update the minimum cycle counter.
|
|
99
|
-
tmp_result_data = self._calculate_op_execution_time()
|
|
100
|
-
|
|
101
|
-
# Convert time units from nanoseconds to milliseconds.
|
|
102
|
-
# The unit of the cycle counter is 10 nanoseconds.
|
|
103
|
-
op_name_time_dict = {}
|
|
104
|
-
op_name_stream_dict = {}
|
|
105
|
-
op_name_count_dict = {}
|
|
106
|
-
op_name_task_dict = {}
|
|
107
|
-
op_name_start_time = {}
|
|
108
|
-
self._convert_op_time_unit(
|
|
109
|
-
tmp_result_data, op_name_time_dict, op_name_stream_dict,
|
|
110
|
-
op_name_count_dict, op_name_task_dict, op_name_start_time
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
result_data = ""
|
|
114
|
-
total_time = 0
|
|
115
|
-
for op_name, time in op_name_time_dict.items():
|
|
116
|
-
if op_name in op_name_stream_dict.keys():
|
|
117
|
-
stream_id = op_name_stream_dict.get(op_name)
|
|
118
|
-
if op_name_count_dict.get(op_name) == 0:
|
|
119
|
-
raise ValueError("The number of operations can not be 0.")
|
|
120
|
-
avg_time = time / op_name_count_dict.get(op_name)
|
|
121
|
-
total_time += avg_time
|
|
122
|
-
result_data += ("%s %s %s %s\n" % (op_name, str(avg_time), stream_id, op_name_count_dict.get(op_name)))
|
|
123
|
-
result_data += ("total op %s 0" % (str(total_time)))
|
|
124
|
-
|
|
125
|
-
timeline_data = []
|
|
126
|
-
for op_name, _ in op_name_time_dict.items():
|
|
127
|
-
if op_name in op_name_stream_dict.keys():
|
|
128
|
-
stream_id = op_name_stream_dict[op_name]
|
|
129
|
-
start_time_list = op_name_start_time.get(op_name)
|
|
130
|
-
for (start_time, duration) in start_time_list:
|
|
131
|
-
timeline_data.append([op_name, stream_id, start_time, duration])
|
|
132
|
-
|
|
133
|
-
# Write the metadata of operators into the file,
|
|
134
|
-
# including operator name, average time, and stream id.
|
|
135
|
-
self._write_op_time_into_file(result_data)
|
|
136
|
-
# Write the timeline data into file,
|
|
137
|
-
# including operator name, stream id, start time, and duration.
|
|
138
|
-
self._write_timeline_data_into_file(timeline_data)
|
|
139
|
-
|
|
140
|
-
def _get_op_task_id_map(self):
|
|
141
|
-
"""
|
|
142
|
-
Read hwts data file, get the task time info.
|
|
143
|
-
|
|
144
|
-
Returns:
|
|
145
|
-
list: all hwts task time info.
|
|
146
|
-
"""
|
|
147
|
-
|
|
148
|
-
op_map_result = []
|
|
149
|
-
hwts_list = []
|
|
150
|
-
|
|
151
|
-
if not os.path.exists(self._hwts_output_file):
|
|
152
|
-
logger.critical('The hwts output file does not exist.')
|
|
153
|
-
raise ProfilerFileNotFoundException('hwts output file')
|
|
154
|
-
|
|
155
|
-
with open(self._hwts_output_file, 'r') as data_file:
|
|
156
|
-
lines = data_file.readlines()
|
|
157
|
-
for line in lines:
|
|
158
|
-
if line.startswith("Start of task") or line.startswith("End of task"):
|
|
159
|
-
line_split = line.split()
|
|
160
|
-
container = HWTSContainer(line_split)
|
|
161
|
-
hwts_list.append(container)
|
|
162
|
-
|
|
163
|
-
# hwts op map by taskId
|
|
164
|
-
for hwts in hwts_list:
|
|
165
|
-
if hwts.task_id in self._op_task_info.keys():
|
|
166
|
-
hwts.op_name = self._op_task_info[hwts.task_id]
|
|
167
|
-
op_map_result.append(hwts)
|
|
168
|
-
|
|
169
|
-
return op_map_result
|
|
170
|
-
|
|
171
|
-
def _write_op_time_into_file(self, result_data):
|
|
172
|
-
"""
|
|
173
|
-
Write the metadata of operators into the file, including
|
|
174
|
-
op name, average time, and stream id.
|
|
175
|
-
|
|
176
|
-
Args:
|
|
177
|
-
result_data (str): The metadata to be written into the file.
|
|
178
|
-
'op_name_1', 'avg_time_1', 'stream_id_1',
|
|
179
|
-
'op_name_2', 'avg_time_2', 'stream_id_2',
|
|
180
|
-
...
|
|
181
|
-
"""
|
|
182
|
-
|
|
183
|
-
fwrite_format(self._output_filename, data_source=self._dst_file_title, is_start=True)
|
|
184
|
-
fwrite_format(self._output_filename, data_source=self._dst_file_column_title)
|
|
185
|
-
fwrite_format(self._output_filename, data_source=result_data)
|
|
186
|
-
|
|
187
|
-
def _write_timeline_data_into_file(self, timeline_data):
|
|
188
|
-
"""
|
|
189
|
-
Write the timeline information into the file, including
|
|
190
|
-
operator name, stream id, start time and duration.
|
|
191
|
-
|
|
192
|
-
Args:
|
|
193
|
-
timeline_data (list): The metadata to be written into the file.
|
|
194
|
-
[
|
|
195
|
-
['op_name_1', 'stream_id_1', 'start_time_1', 'duration_1'],
|
|
196
|
-
['op_name_2', 'stream_id_2', 'start_time_2', 'duration_2'],
|
|
197
|
-
[...]
|
|
198
|
-
]
|
|
199
|
-
"""
|
|
200
|
-
# sorted by start times
|
|
201
|
-
timeline_data.sort(key=lambda x: float(x[2]))
|
|
202
|
-
filename = 'output_timeline_data_{}.txt'.format(self._device_id)
|
|
203
|
-
file_path = os.path.join(self._output_path, filename)
|
|
204
|
-
file_path = validate_and_normalize_path(file_path)
|
|
205
|
-
|
|
206
|
-
# write to file
|
|
207
|
-
try:
|
|
208
|
-
with os.fdopen(os.open(file_path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600), 'w') as f_obj:
|
|
209
|
-
f_obj.write(TIMELINE_FILE_COLUMN_TITLE + '\n')
|
|
210
|
-
for timeline in timeline_data:
|
|
211
|
-
timeline = [str(item) for item in timeline]
|
|
212
|
-
f_obj.write(','.join(timeline) + '\n')
|
|
213
|
-
os.chmod(file_path, stat.S_IREAD | stat.S_IWRITE)
|
|
214
|
-
except (IOError, OSError) as err:
|
|
215
|
-
logger.critical('Error occurred when writing intermediate timeline file: %s', err)
|
|
216
|
-
raise ProfilerIOException from err
|
|
217
|
-
|
|
218
|
-
def _calculate_op_execution_time(self):
|
|
219
|
-
"""
|
|
220
|
-
Calculate the execution time of each operator.
|
|
221
|
-
|
|
222
|
-
Returns:
|
|
223
|
-
list, including the intermediate data of op execution time.
|
|
224
|
-
"""
|
|
225
|
-
tmp_result_data = []
|
|
226
|
-
op_map_list = self._get_op_task_id_map()
|
|
227
|
-
tmp_op_dict = dict()
|
|
228
|
-
|
|
229
|
-
cur_index = 0
|
|
230
|
-
length = len(op_map_list)
|
|
231
|
-
min_cycle_counter = float("inf")
|
|
232
|
-
while cur_index < length:
|
|
233
|
-
op_time = op_map_list[cur_index]
|
|
234
|
-
if op_time.status == "Start":
|
|
235
|
-
tmp_op_dict[op_time.op_name] = op_time
|
|
236
|
-
elif op_time.status == "End" and op_time.op_name in tmp_op_dict:
|
|
237
|
-
op_start = tmp_op_dict.get(op_time.op_name, None)
|
|
238
|
-
if op_start:
|
|
239
|
-
op_start.duration = op_time.cycle_counter - op_start.cycle_counter
|
|
240
|
-
tmp_result_data.append(op_start)
|
|
241
|
-
del tmp_op_dict[op_time.op_name]
|
|
242
|
-
if not op_time.op_name.startswith("assign"):
|
|
243
|
-
min_cycle_counter = min(min_cycle_counter, op_time.cycle_counter)
|
|
244
|
-
|
|
245
|
-
cur_index += 1
|
|
246
|
-
|
|
247
|
-
# Update the value of minimum cycle counter.
|
|
248
|
-
self._min_cycle_counter = min_cycle_counter / 1e5 # Convert the time unit from 10ns to 1ms
|
|
249
|
-
|
|
250
|
-
return tmp_result_data
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
# Copyright 2022 Huawei Technologies Co., Ltd
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
# ============================================================================
|
|
15
|
-
"""Record profiler information"""
|
|
16
|
-
import glob
|
|
17
|
-
import os
|
|
18
|
-
import stat
|
|
19
|
-
|
|
20
|
-
from mindspore.version import __version__ as ms_version
|
|
21
|
-
from mindspore.profiler.parser.ascend_analysis.file_manager import FileManager
|
|
22
|
-
from mindspore import log as logger
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class ProfilerInfo:
|
|
26
|
-
"""
|
|
27
|
-
This class is used to record profiler information.
|
|
28
|
-
it contains context_mode, rank_id, rank_size, parallel_mode, pipeline_stage_num, pipeline_stage_id,
|
|
29
|
-
profiling_start_time, profiling_stop_time, analyse_start_time, analyse_end_time
|
|
30
|
-
"""
|
|
31
|
-
|
|
32
|
-
_file_name = "profiler_info_{}.json"
|
|
33
|
-
_file_path = ""
|
|
34
|
-
_profiler_info_dict = dict()
|
|
35
|
-
JIT_LEVEL = "jit_level"
|
|
36
|
-
|
|
37
|
-
@staticmethod
|
|
38
|
-
def init_info(context_mode, rank_id):
|
|
39
|
-
"""Profiler info initialization must include context_mode, rank_id and output_path."""
|
|
40
|
-
ProfilerInfo._profiler_info_dict["context_mode"] = context_mode
|
|
41
|
-
ProfilerInfo._profiler_info_dict["rank_id"] = rank_id
|
|
42
|
-
ProfilerInfo._profiler_info_dict["ms_version"] = ms_version
|
|
43
|
-
ProfilerInfo._file_name = ProfilerInfo._file_name.format(rank_id)
|
|
44
|
-
|
|
45
|
-
@staticmethod
|
|
46
|
-
def set_parallel_info(parallel_mode="", stage_num=1):
|
|
47
|
-
"""Set parallel info include parallel_mode, pipeline_stage_num and pipeline_stage_id."""
|
|
48
|
-
info = dict()
|
|
49
|
-
info["parallel_mode"] = parallel_mode
|
|
50
|
-
info["stage_num"] = stage_num
|
|
51
|
-
ProfilerInfo._profiler_info_dict.update(info)
|
|
52
|
-
|
|
53
|
-
@staticmethod
|
|
54
|
-
def set_profiling_start_time(start_time):
|
|
55
|
-
"""Set the profiling start time."""
|
|
56
|
-
info = dict()
|
|
57
|
-
info["profiling_start_time"] = start_time
|
|
58
|
-
ProfilerInfo._profiler_info_dict.update(info)
|
|
59
|
-
|
|
60
|
-
@staticmethod
|
|
61
|
-
def set_profiling_stop_time(stop_time):
|
|
62
|
-
"""Set the profiling stop time."""
|
|
63
|
-
info = dict()
|
|
64
|
-
info["profiling_stop_time"] = stop_time
|
|
65
|
-
ProfilerInfo._profiler_info_dict.update(info)
|
|
66
|
-
|
|
67
|
-
@staticmethod
|
|
68
|
-
def set_analyse_start_time(start_time):
|
|
69
|
-
"""Set the analyse start time."""
|
|
70
|
-
info = dict()
|
|
71
|
-
info["analyse_start_time"] = start_time
|
|
72
|
-
ProfilerInfo._profiler_info_dict.update(info)
|
|
73
|
-
|
|
74
|
-
@staticmethod
|
|
75
|
-
def set_analyse_end_time(end_time):
|
|
76
|
-
"""Set the analyse end time."""
|
|
77
|
-
info = dict()
|
|
78
|
-
info["analyse_end_time"] = end_time
|
|
79
|
-
ProfilerInfo._profiler_info_dict.update(info)
|
|
80
|
-
|
|
81
|
-
@staticmethod
|
|
82
|
-
def set_export_start_time(start_time):
|
|
83
|
-
"""Set the export start time."""
|
|
84
|
-
info = dict()
|
|
85
|
-
info["export_start_time"] = start_time
|
|
86
|
-
ProfilerInfo._profiler_info_dict.update(info)
|
|
87
|
-
|
|
88
|
-
@staticmethod
|
|
89
|
-
def set_export_end_time(end_time):
|
|
90
|
-
"""Set the export end time."""
|
|
91
|
-
info = dict()
|
|
92
|
-
info["export_end_time"] = end_time
|
|
93
|
-
ProfilerInfo._profiler_info_dict.update(info)
|
|
94
|
-
|
|
95
|
-
@staticmethod
|
|
96
|
-
def set_export_flag(flag):
|
|
97
|
-
"""Set whether all-export or not."""
|
|
98
|
-
ProfilerInfo._profiler_info_dict["all_export"] = flag
|
|
99
|
-
|
|
100
|
-
@staticmethod
|
|
101
|
-
def set_system_time(sys_time):
|
|
102
|
-
"""Set system time."""
|
|
103
|
-
ProfilerInfo._profiler_info_dict["system_time"] = sys_time
|
|
104
|
-
|
|
105
|
-
@staticmethod
|
|
106
|
-
def set_system_cnt(sys_cnt):
|
|
107
|
-
"""Set system cnt."""
|
|
108
|
-
ProfilerInfo._profiler_info_dict["system_cnt"] = sys_cnt
|
|
109
|
-
|
|
110
|
-
@staticmethod
|
|
111
|
-
def set_diff_time(diff_time):
|
|
112
|
-
"""synchronize timestamps between different devices"""
|
|
113
|
-
ProfilerInfo._profiler_info_dict["diff_time"] = diff_time
|
|
114
|
-
|
|
115
|
-
@staticmethod
|
|
116
|
-
def set_graph_ids(graph_ids):
|
|
117
|
-
"""Set the graph id list."""
|
|
118
|
-
ProfilerInfo._profiler_info_dict["graph_ids"] = graph_ids
|
|
119
|
-
|
|
120
|
-
@staticmethod
|
|
121
|
-
def set_rank_size(rank_size):
|
|
122
|
-
"""Set the rank size."""
|
|
123
|
-
ProfilerInfo._profiler_info_dict["rank_size"] = rank_size
|
|
124
|
-
|
|
125
|
-
@staticmethod
|
|
126
|
-
def set_heterogeneous(is_heterogeneous):
|
|
127
|
-
"""Set is it heterogeneous."""
|
|
128
|
-
ProfilerInfo._profiler_info_dict["is_heterogeneous"] = is_heterogeneous
|
|
129
|
-
|
|
130
|
-
@staticmethod
|
|
131
|
-
def get_profiler_info():
|
|
132
|
-
"""Get the profiler info."""
|
|
133
|
-
return ProfilerInfo._profiler_info_dict
|
|
134
|
-
|
|
135
|
-
@staticmethod
|
|
136
|
-
def set_profiling_options(profiling_options):
|
|
137
|
-
"""Set profiling options to profiler info dict"""
|
|
138
|
-
ProfilerInfo._profiler_info_dict["profiling_options"] = profiling_options
|
|
139
|
-
|
|
140
|
-
@staticmethod
|
|
141
|
-
def set_jit_level(jit_level):
|
|
142
|
-
"""Set jit_level to profiler info dict"""
|
|
143
|
-
ProfilerInfo._profiler_info_dict[ProfilerInfo.JIT_LEVEL] = jit_level
|
|
144
|
-
|
|
145
|
-
@staticmethod
|
|
146
|
-
def set_data_simplification(data_simplification):
|
|
147
|
-
"""
|
|
148
|
-
Function Description:
|
|
149
|
-
Set the data simplification to profiler info dict
|
|
150
|
-
Parameter:
|
|
151
|
-
data_simplification: Whether data simplification is enabled
|
|
152
|
-
"""
|
|
153
|
-
ProfilerInfo._profiler_info_dict["data_simplification"] = data_simplification
|
|
154
|
-
|
|
155
|
-
@staticmethod
|
|
156
|
-
def save(output_path):
|
|
157
|
-
"""Save the profiler info to file."""
|
|
158
|
-
ProfilerInfo._file_path = os.path.join(output_path, ProfilerInfo._file_name)
|
|
159
|
-
FileManager.create_json_file(output_path, ProfilerInfo._profiler_info_dict, ProfilerInfo._file_name, indent=4)
|
|
160
|
-
os.chmod(ProfilerInfo._file_path, stat.S_IREAD | stat.S_IWRITE)
|
|
161
|
-
|
|
162
|
-
@staticmethod
|
|
163
|
-
def load_profiler_info_dict(input_path):
|
|
164
|
-
"""Load the profiler info from input path."""
|
|
165
|
-
ProfilerInfo._file_path = os.path.join(input_path, ProfilerInfo._file_name)
|
|
166
|
-
try:
|
|
167
|
-
load_info_dict = FileManager.read_json_file(ProfilerInfo._file_path)
|
|
168
|
-
except RuntimeError as err:
|
|
169
|
-
logger.warning(f"Cannot read file: {ProfilerInfo._file_path}, Error: {err}")
|
|
170
|
-
return
|
|
171
|
-
if not load_info_dict:
|
|
172
|
-
msg = f"Offline analysis failed load the ProfilerInfo._profiler_info_dict from: {ProfilerInfo._file_path}"
|
|
173
|
-
logger.warning(msg)
|
|
174
|
-
return
|
|
175
|
-
ProfilerInfo._profiler_info_dict = load_info_dict
|
|
176
|
-
os.chmod(ProfilerInfo._file_path, stat.S_IREAD | stat.S_IWRITE)
|
|
177
|
-
|
|
178
|
-
@staticmethod
|
|
179
|
-
def get_rank_id(profiler_dir: str):
|
|
180
|
-
"""
|
|
181
|
-
Function Description:
|
|
182
|
-
Get rank id from profiler_info_*.json
|
|
183
|
-
Parameter:
|
|
184
|
-
profiler_dir: the directory path of profiler data, eg: rank_0/profiler
|
|
185
|
-
Return:
|
|
186
|
-
str type rank id
|
|
187
|
-
"""
|
|
188
|
-
prof_info_path = os.path.join(profiler_dir, "profiler_info_*.json")
|
|
189
|
-
prof_info_path = glob.glob(prof_info_path)
|
|
190
|
-
if not prof_info_path:
|
|
191
|
-
logger.warning("Cannot find profiler_info.json in the profiler directory.")
|
|
192
|
-
return "-1"
|
|
193
|
-
|
|
194
|
-
info_data = FileManager.read_json_file(prof_info_path[0])
|
|
195
|
-
return info_data.get("rank_id", "-1")
|
|
196
|
-
|
|
197
|
-
@staticmethod
|
|
198
|
-
def get_device_id(prof_dir: str):
|
|
199
|
-
"""
|
|
200
|
-
Function Description:
|
|
201
|
-
Get device id from PROF_XXX dir
|
|
202
|
-
Parameter:
|
|
203
|
-
prof_dir: the directory path of PROF_XXX
|
|
204
|
-
Return:
|
|
205
|
-
str type device id
|
|
206
|
-
"""
|
|
207
|
-
device_dir = os.path.join(prof_dir, "device_*")
|
|
208
|
-
device_dir = glob.glob(device_dir)
|
|
209
|
-
if not device_dir:
|
|
210
|
-
logger.warning("Cannot find device_XXX in the %s.", prof_dir)
|
|
211
|
-
return "-1"
|
|
212
|
-
|
|
213
|
-
return device_dir[0].split("device_")[-1]
|