mindspore 2.6.0rc1__cp39-cp39-win_amd64.whl → 2.7.0rc1__cp39-cp39-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/__init__.py +1 -1
- mindspore/_c_dataengine.cp39-win_amd64.pyd +0 -0
- mindspore/_c_expression.cp39-win_amd64.pyd +0 -0
- mindspore/_c_mindrecord.cp39-win_amd64.pyd +0 -0
- mindspore/_checkparam.py +40 -9
- mindspore/{_deprecated → _extends/optimize}/__init__.py +9 -3
- mindspore/_extends/optimize/cell_utils.py +96 -0
- mindspore/_extends/parse/__init__.py +2 -2
- mindspore/_extends/parse/compile_config.py +44 -22
- mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +1 -1
- mindspore/_extends/parse/parser.py +37 -62
- mindspore/_extends/parse/resources.py +39 -0
- mindspore/_extends/parse/standard_method.py +43 -13
- mindspore/_extends/parse/trope.py +8 -1
- mindspore/_extends/pijit/__init__.py +1 -2
- mindspore/amp.py +4 -4
- 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/common/__init__.py +27 -2
- 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 +77 -16
- mindspore/common/api.py +238 -113
- mindspore/common/dtype.py +21 -11
- mindspore/common/dump.py +10 -15
- mindspore/common/generator.py +5 -3
- mindspore/common/hook_handle.py +11 -2
- mindspore/common/jit_config.py +1 -1
- mindspore/common/jit_trace.py +84 -105
- mindspore/common/parameter.py +26 -12
- mindspore/common/recompute.py +3 -3
- mindspore/common/sparse_tensor.py +0 -3
- mindspore/common/symbol.py +0 -1
- mindspore/common/tensor.py +81 -81
- mindspore/communication/_comm_helper.py +46 -4
- mindspore/communication/management.py +79 -7
- mindspore/context.py +58 -40
- mindspore/dataset/core/config.py +3 -3
- mindspore/dataset/engine/datasets.py +20 -7
- mindspore/dataset/engine/datasets_user_defined.py +33 -3
- 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/py_transforms.py +7 -3
- mindspore/dataset/transforms/transforms.py +7 -3
- mindspore/dataset/vision/validators.py +1 -0
- mindspore/device_context/ascend/device.py +1 -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/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +3 -7
- 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 +37 -1
- mindspore/include/api/delegate.h +10 -0
- mindspore/include/api/model.h +3 -0
- mindspore/include/api/types.h +2 -2
- mindspore/include/c_api/model_c.h +0 -58
- mindspore/include/c_api/tensor_c.h +0 -26
- mindspore/include/dataset/vision_ascend.h +1 -1
- mindspore/jpeg62.dll +0 -0
- mindspore/mindrecord/tools/cifar10.py +60 -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 +1 -0
- mindspore/mint/distributed/distributed.py +212 -9
- mindspore/mint/nn/__init__.py +1 -1
- mindspore/mint/nn/functional.py +53 -6
- mindspore/mint/nn/layer/_functions.py +164 -294
- mindspore/mint/nn/layer/activation.py +8 -6
- mindspore/mint/nn/layer/conv.py +137 -101
- mindspore/mint/nn/layer/normalization.py +8 -22
- mindspore/mint/optim/adam.py +19 -18
- mindspore/mint/optim/adamw.py +14 -8
- mindspore/mint/optim/sgd.py +5 -5
- mindspore/nn/cell.py +328 -502
- mindspore/nn/grad/cell_grad.py +11 -12
- mindspore/nn/layer/activation.py +32 -34
- mindspore/nn/layer/basic.py +67 -64
- 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 +37 -39
- 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 +3 -3
- mindspore/nn/optim/adasum.py +2 -2
- mindspore/nn/optim/asgd.py +2 -0
- mindspore/nn/optim/optimizer.py +1 -1
- mindspore/nn/optim/thor.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 +34 -37
- mindspore/nn/wrap/grad_reducer.py +37 -37
- mindspore/nn/wrap/loss_scale.py +72 -74
- mindspore/numpy/array_creations.py +5 -5
- mindspore/numpy/fft.py +1 -1
- mindspore/numpy/math_ops.py +5 -5
- 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/_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 +42 -11
- mindspore/ops/auto_generate/gen_extend_func.py +23 -141
- mindspore/ops/auto_generate/gen_ops_def.py +727 -321
- mindspore/ops/auto_generate/gen_ops_prim.py +1721 -984
- mindspore/ops/auto_generate/pyboost_inner_prim.py +31 -1
- mindspore/ops/composite/__init__.py +10 -0
- mindspore/ops/composite/base.py +8 -4
- mindspore/ops/composite/multitype_ops/__init__.py +12 -1
- mindspore/ops/composite/multitype_ops/_compile_utils.py +133 -109
- 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 +3 -1
- mindspore/ops/function/_add_attr_func.py +11 -6
- mindspore/ops/function/array_func.py +9 -96
- mindspore/ops/function/debug_func.py +4 -3
- mindspore/ops/function/grad/grad_func.py +1 -1
- mindspore/ops/function/math_func.py +33 -540
- mindspore/ops/function/nn_func.py +28 -74
- 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 +2 -3
- mindspore/ops/functional_overload.py +571 -6
- 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 +3 -6
- mindspore/ops/operations/_sequence_ops.py +1 -1
- mindspore/ops/operations/array_ops.py +2 -2
- mindspore/ops/operations/comm_ops.py +185 -26
- mindspore/ops/operations/custom_ops.py +294 -174
- mindspore/ops/operations/debug_ops.py +59 -4
- mindspore/ops/operations/image_ops.py +13 -13
- mindspore/ops/operations/manually_defined/ops_def.py +15 -16
- mindspore/ops/operations/math_ops.py +3 -4
- mindspore/ops/operations/nn_ops.py +7 -39
- mindspore/ops/primitive.py +6 -10
- mindspore/ops/tensor_method.py +47 -8
- 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 -0
- 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 +11 -8
- mindspore/parallel/_cell_wrapper.py +113 -45
- mindspore/parallel/_parallel_serialization.py +1 -1
- 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 +13 -8
- mindspore/parallel/auto_parallel.py +14 -7
- mindspore/parallel/checkpoint_convert.py +3 -3
- mindspore/parallel/checkpoint_transform.py +11 -7
- mindspore/parallel/cluster/process_entity/_api.py +84 -48
- mindspore/parallel/cluster/process_entity/_utils.py +95 -7
- mindspore/parallel/cluster/run.py +43 -4
- mindspore/parallel/function/__init__.py +8 -1
- mindspore/parallel/function/reshard_func.py +6 -7
- mindspore/parallel/nn/__init__.py +15 -2
- mindspore/parallel/nn/parallel_cell_wrapper.py +9 -10
- mindspore/parallel/nn/parallel_grad_reducer.py +7 -6
- mindspore/parallel/shard.py +3 -4
- mindspore/parallel/transform_safetensors.py +463 -174
- 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_op_memory_viewer.py +42 -22
- 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/profiler_context.py +25 -27
- mindspore/profiler/common/profiler_info.py +0 -16
- mindspore/profiler/common/profiler_op_analyse.py +235 -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 +305 -314
- mindspore/profiler/envprofiler.py +12 -7
- mindspore/profiler/experimental_config.py +96 -6
- mindspore/profiler/mstx.py +33 -12
- mindspore/profiler/platform/__init__.py +2 -3
- mindspore/profiler/platform/npu_profiler.py +29 -19
- mindspore/profiler/profiler.py +35 -19
- mindspore/profiler/profiler_action_controller.py +64 -76
- 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 +1 -1
- mindspore/run_check/_check_version.py +7 -10
- mindspore/runtime/__init__.py +5 -5
- mindspore/runtime/event.py +10 -4
- mindspore/runtime/executor.py +60 -45
- mindspore/runtime/memory.py +30 -32
- mindspore/runtime/thread_bind_core.py +298 -164
- mindspore/safeguard/rewrite_obfuscation.py +12 -13
- mindspore/swresample-4.dll +0 -0
- mindspore/swscale-6.dll +0 -0
- mindspore/tinyxml2.dll +0 -0
- mindspore/train/_utils.py +14 -4
- mindspore/train/amp.py +43 -20
- mindspore/train/callback/__init__.py +5 -5
- mindspore/train/callback/_checkpoint.py +3 -6
- mindspore/train/callback/_flops_collector.py +1 -1
- mindspore/train/callback/_landscape.py +0 -1
- mindspore/train/callback/_train_fault_tolerance.py +97 -16
- mindspore/train/data_sink.py +11 -2
- mindspore/train/dataset_helper.py +9 -0
- mindspore/train/model.py +135 -55
- mindspore/train/serialization.py +133 -111
- mindspore/train/summary/summary_record.py +13 -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 +6 -9
- mindspore/version.py +1 -1
- {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0rc1.dist-info}/METADATA +5 -4
- {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0rc1.dist-info}/RECORD +333 -371
- mindspore/_deprecated/jit.py +0 -198
- mindspore/experimental/es/__init__.py +0 -22
- mindspore/experimental/es/embedding_service.py +0 -891
- mindspore/experimental/es/embedding_service_layer.py +0 -581
- 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-2.6.0rc1.dist-info → mindspore-2.7.0rc1.dist-info}/WHEEL +0 -0
- {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0rc1.dist-info}/entry_points.txt +0 -0
- {mindspore-2.6.0rc1.dist-info → mindspore-2.7.0rc1.dist-info}/top_level.txt +0 -0
mindspore/hal/memory.py
CHANGED
|
@@ -14,14 +14,18 @@
|
|
|
14
14
|
# ============================================================================
|
|
15
15
|
|
|
16
16
|
"""Hardware memory interfaces."""
|
|
17
|
-
from mindspore._c_expression import _memory_stats, _reset_max_mem_reserved, _reset_max_mem_allocated
|
|
17
|
+
from mindspore._c_expression import _memory_stats, _reset_max_mem_reserved, _reset_max_mem_allocated, _empty_cache, \
|
|
18
|
+
DeviceContextManager
|
|
18
19
|
from mindspore import log as logger
|
|
20
|
+
import mindspore as ms
|
|
19
21
|
from .device import _check_inputs_validation, is_initialized
|
|
20
22
|
|
|
23
|
+
|
|
21
24
|
function_memory_status = {'memory_stats': False, 'memory_reserved': False, 'max_memory_reserved': False,
|
|
22
25
|
'empty_cache': False, 'reset_peak_memory_stats': False, 'memory_summary': False,
|
|
23
26
|
'memory_allocated': False, 'max_memory_allocated': False,
|
|
24
27
|
'reset_max_memory_reserved': False, 'reset_max_memory_allocated': False}
|
|
28
|
+
_device_context_mgr = DeviceContextManager.get_instance()
|
|
25
29
|
|
|
26
30
|
|
|
27
31
|
@_check_inputs_validation
|
|
@@ -131,20 +135,36 @@ def max_memory_reserved(device_target=None):
|
|
|
131
135
|
return _memory_stats(device_target).get("max_reserved_memory", 0)
|
|
132
136
|
|
|
133
137
|
|
|
138
|
+
def _is_initialized(device_target):
|
|
139
|
+
"""
|
|
140
|
+
Returns whether specified backend is initialized.
|
|
141
|
+
"""
|
|
142
|
+
_device_context = _device_context_mgr.get_device_context(device_target)
|
|
143
|
+
if _device_context is None:
|
|
144
|
+
return False
|
|
145
|
+
return _device_context.initialized()
|
|
146
|
+
|
|
147
|
+
|
|
134
148
|
@_check_inputs_validation
|
|
135
149
|
def empty_cache():
|
|
136
150
|
"""
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
the api :func:`mindspore.runtime.empty_cache` instead.
|
|
151
|
+
Empty cache in the memory pool, this api will be deprecated and removed in future versions.
|
|
152
|
+
Please use the api :func:`mindspore.runtime.empty_cache` instead.
|
|
140
153
|
|
|
141
154
|
Note:
|
|
142
|
-
|
|
143
|
-
|
|
155
|
+
- Empty cache help reduce the fragmentation of device memory.
|
|
156
|
+
- Support Atlas A2 series products.
|
|
157
|
+
|
|
158
|
+
Supported Platforms:
|
|
159
|
+
``Ascend``
|
|
144
160
|
"""
|
|
145
161
|
if not function_memory_status['empty_cache']:
|
|
146
162
|
function_memory_status['empty_cache'] = True
|
|
147
|
-
|
|
163
|
+
device_target = ms.context.get_context("device_target")
|
|
164
|
+
if not _is_initialized(device_target):
|
|
165
|
+
logger.warning(f"Backend {device_target} is not initialized yet.")
|
|
166
|
+
return
|
|
167
|
+
_empty_cache(device_target)
|
|
148
168
|
|
|
149
169
|
|
|
150
170
|
@_check_inputs_validation
|
mindspore/include/api/cell.h
CHANGED
|
@@ -33,8 +33,22 @@ class MS_API CellBase {
|
|
|
33
33
|
public:
|
|
34
34
|
CellBase() = default;
|
|
35
35
|
virtual ~CellBase() = default;
|
|
36
|
+
/// \brief Construct using inputs.
|
|
37
|
+
///
|
|
38
|
+
/// \param[in] inputs Vector of inputs.
|
|
39
|
+
///
|
|
40
|
+
/// \return Vector of outputs.
|
|
36
41
|
virtual std::vector<Output> Construct(const std::vector<Input> &inputs) { return {}; }
|
|
42
|
+
/// \brief Clone a cellbase.
|
|
43
|
+
///
|
|
44
|
+
/// \return Shared pointer of Cellbase.
|
|
37
45
|
virtual std::shared_ptr<CellBase> Clone() const = 0;
|
|
46
|
+
/// \brief Run a cellbase.
|
|
47
|
+
///
|
|
48
|
+
/// \param[in] inputs Vector of MSTensor as inputs.
|
|
49
|
+
/// \param[in] outputs Vector of MSTensor as outputs.
|
|
50
|
+
///
|
|
51
|
+
/// \return Status of the operation.
|
|
38
52
|
virtual Status Run(const std::vector<MSTensor> &inputs, std::vector<MSTensor> *outputs) { return kSuccess; }
|
|
39
53
|
std::vector<Output> operator()(const std::vector<Input> &inputs) const;
|
|
40
54
|
};
|
|
@@ -56,12 +70,34 @@ class MS_API GraphCell final : public Cell<GraphCell> {
|
|
|
56
70
|
explicit GraphCell(const Graph &graph);
|
|
57
71
|
explicit GraphCell(Graph &&graph);
|
|
58
72
|
explicit GraphCell(const std::shared_ptr<Graph> &graph);
|
|
59
|
-
|
|
73
|
+
/// \brief Set a context.
|
|
74
|
+
///
|
|
75
|
+
/// \param[in] context Context to be set.
|
|
60
76
|
void SetContext(const std::shared_ptr<Context> &context);
|
|
77
|
+
/// \brief Get back the graph.
|
|
78
|
+
///
|
|
79
|
+
/// \return Graph of the graphcell.
|
|
61
80
|
const std::shared_ptr<Graph> &GetGraph() const { return graph_; }
|
|
81
|
+
/// \brief Run the graphcell.
|
|
82
|
+
///
|
|
83
|
+
/// \param[in] inputs Vector of MSTensor as inputs.
|
|
84
|
+
/// \param[in] outputs Vector of MSTensor as outputs.
|
|
85
|
+
///
|
|
86
|
+
/// \return Status of the operation.
|
|
62
87
|
Status Run(const std::vector<MSTensor> &inputs, std::vector<MSTensor> *outputs) override;
|
|
88
|
+
/// \brief Get the inputs.
|
|
89
|
+
///
|
|
90
|
+
/// \return Inputs.
|
|
63
91
|
std::vector<MSTensor> GetInputs();
|
|
92
|
+
/// \brief Get the outputs.
|
|
93
|
+
///
|
|
94
|
+
/// \return Outputs.
|
|
64
95
|
std::vector<MSTensor> GetOutputs();
|
|
96
|
+
/// \brief Load the device.
|
|
97
|
+
///
|
|
98
|
+
/// \param[in] device_id Device id to be loaded.
|
|
99
|
+
///
|
|
100
|
+
/// \return Status of the operation.
|
|
65
101
|
Status Load(uint32_t device_id);
|
|
66
102
|
|
|
67
103
|
private:
|
mindspore/include/api/delegate.h
CHANGED
|
@@ -130,11 +130,21 @@ class Delegate : public IDelegate<LiteDelegateGraph, kernel::Kernel, kernel::Ker
|
|
|
130
130
|
/// \return Status. If Status is kLiteNotSupport, the program will return to the MindSpore Lite inner inference.
|
|
131
131
|
virtual Status Init() = 0;
|
|
132
132
|
|
|
133
|
+
/// \brief Create kernel.
|
|
134
|
+
///
|
|
135
|
+
/// \param[in] node The kernel to be created.
|
|
136
|
+
///
|
|
137
|
+
/// \return Created kernel.
|
|
133
138
|
std::shared_ptr<kernel::Kernel> CreateKernel(const std::shared_ptr<kernel::Kernel> &node) override {
|
|
134
139
|
// return node as kernel since they are same one.
|
|
135
140
|
return node;
|
|
136
141
|
}
|
|
137
142
|
|
|
143
|
+
/// \brief Check if the node is delegate node.
|
|
144
|
+
///
|
|
145
|
+
/// \param[in] node The kernel to verify.
|
|
146
|
+
///
|
|
147
|
+
/// \return True if the node is delegate.
|
|
138
148
|
bool IsDelegateNode(const std::shared_ptr<kernel::Kernel> &node) override { return false; }
|
|
139
149
|
|
|
140
150
|
/// \brief Replace the nodes in model with delegate nodes, delegate will create kernels by its delegate nodes.
|
mindspore/include/api/model.h
CHANGED
|
@@ -370,6 +370,9 @@ class MS_API Model {
|
|
|
370
370
|
/// \return The value of the model info associated with the given key.
|
|
371
371
|
inline std::string GetModelInfo(const std::string &key);
|
|
372
372
|
|
|
373
|
+
/// \brief Finish the model. (Only used for mindspore_lite's ascend backend.)
|
|
374
|
+
///
|
|
375
|
+
/// \return Status of the operation.
|
|
373
376
|
// release inference resourcec, only used for mindspore_lite's ascend backend now.
|
|
374
377
|
Status Finalize();
|
|
375
378
|
|
mindspore/include/api/types.h
CHANGED
|
@@ -243,14 +243,14 @@ class MS_API MSTensor {
|
|
|
243
243
|
|
|
244
244
|
/// \brief Get the boolean value that indicates whether the MSTensor equals tensor.
|
|
245
245
|
///
|
|
246
|
-
/// \param[in]
|
|
246
|
+
/// \param[in] tensor MSTensor.
|
|
247
247
|
///
|
|
248
248
|
/// \return The boolean value that indicates whether the MSTensor equals tensor.
|
|
249
249
|
bool operator==(const MSTensor &tensor) const;
|
|
250
250
|
|
|
251
251
|
/// \brief Get the boolean value that indicates whether the MSTensor not equals tensor.
|
|
252
252
|
///
|
|
253
|
-
/// \param[in]
|
|
253
|
+
/// \param[in] tensor MSTensor.
|
|
254
254
|
///
|
|
255
255
|
/// \return The boolean value that indicates whether the MSTensor not equals tensor.
|
|
256
256
|
bool operator!=(const MSTensor &tensor) const;
|
|
@@ -48,140 +48,111 @@ typedef bool (*MSKernelCallBackC)(const MSTensorHandleArray inputs, const MSTens
|
|
|
48
48
|
const MSCallBackParamC kernel_Info);
|
|
49
49
|
|
|
50
50
|
/// \brief Create a model object.
|
|
51
|
-
///
|
|
52
51
|
/// \return Model object handle.
|
|
53
52
|
MS_API MSModelHandle MSModelCreate();
|
|
54
53
|
|
|
55
54
|
/// \brief Destroy the model object.
|
|
56
|
-
///
|
|
57
55
|
/// \param[in] model Model object handle address.
|
|
58
56
|
MS_API void MSModelDestroy(MSModelHandle *model);
|
|
59
57
|
|
|
60
58
|
/// \brief Set workspace for the model object. Only valid for Iot.
|
|
61
|
-
///
|
|
62
59
|
/// \param[in] model Model object handle.
|
|
63
60
|
/// \param[in] workspace Define the workspace address.
|
|
64
61
|
/// \param[in] workspace_size Define the workspace size.
|
|
65
62
|
MS_API void MSModelSetWorkspace(MSModelHandle model, void *workspace, size_t workspace_size);
|
|
66
63
|
|
|
67
64
|
/// \brief Calculate the workspace size required for model inference. Only valid for Iot.
|
|
68
|
-
///
|
|
69
65
|
/// \param[in] model Model object handle.
|
|
70
66
|
MS_API size_t MSModelCalcWorkspaceSize(MSModelHandle model);
|
|
71
67
|
|
|
72
68
|
/// \brief Build the model from model file buffer so that it can run on a device.
|
|
73
|
-
///
|
|
74
69
|
/// \param[in] model Model object handle.
|
|
75
70
|
/// \param[in] model_data Define the buffer read from a model file.
|
|
76
71
|
/// \param[in] data_size Define bytes number of model file buffer.
|
|
77
72
|
/// \param[in] model_type Define The type of model file.
|
|
78
73
|
/// \param[in] model_context Define the context used to store options during execution.
|
|
79
|
-
///
|
|
80
74
|
/// \return MSStatus.
|
|
81
75
|
MS_API MSStatus MSModelBuild(MSModelHandle model, const void *model_data, size_t data_size, MSModelType model_type,
|
|
82
76
|
const MSContextHandle model_context);
|
|
83
77
|
|
|
84
78
|
/// \brief Load and build the model from model path so that it can run on a device.
|
|
85
|
-
///
|
|
86
79
|
/// \param[in] model Model object handle.
|
|
87
80
|
/// \param[in] model_path Define the model file path.
|
|
88
81
|
/// \param[in] model_type Define The type of model file.
|
|
89
82
|
/// \param[in] model_context Define the context used to store options during execution.
|
|
90
|
-
///
|
|
91
83
|
/// \return MSStatus.
|
|
92
84
|
MS_API MSStatus MSModelBuildFromFile(MSModelHandle model, const char *model_path, MSModelType model_type,
|
|
93
85
|
const MSContextHandle model_context);
|
|
94
86
|
|
|
95
87
|
/// \brief Resize the shapes of inputs.
|
|
96
|
-
///
|
|
97
88
|
/// \param[in] model Model object handle.
|
|
98
89
|
/// \param[in] inputs The array that includes all input tensor handles.
|
|
99
90
|
/// \param[in] shape_infos Defines the new shapes of inputs, should be consistent with inputs.
|
|
100
91
|
/// \param[in] shape_info_num The num of shape_infos.
|
|
101
|
-
///
|
|
102
92
|
/// \return MSStatus.
|
|
103
93
|
MS_API MSStatus MSModelResize(MSModelHandle model, const MSTensorHandleArray inputs, MSShapeInfo *shape_infos,
|
|
104
94
|
size_t shape_info_num);
|
|
105
95
|
|
|
106
96
|
/// \brief Inference model.
|
|
107
|
-
///
|
|
108
97
|
/// \param[in] model Model object handle.
|
|
109
98
|
/// \param[in] inputs The array that includes all input tensor handles.
|
|
110
99
|
/// \param[out] outputs The array that includes all output tensor handles.
|
|
111
100
|
/// \param[in] before CallBack before predict.
|
|
112
101
|
/// \param[in] after CallBack after predict.
|
|
113
|
-
///
|
|
114
102
|
/// \return MSStatus.
|
|
115
103
|
MS_API MSStatus MSModelPredict(MSModelHandle model, const MSTensorHandleArray inputs, MSTensorHandleArray *outputs,
|
|
116
104
|
const MSKernelCallBackC before, const MSKernelCallBackC after);
|
|
117
105
|
|
|
118
106
|
/// \brief Run model by step. Only valid for Iot.
|
|
119
|
-
///
|
|
120
107
|
/// \param[in] model Model object handle.
|
|
121
108
|
/// \param[in] before CallBack before RunStep.
|
|
122
109
|
/// \param[in] after CallBack after RunStep.
|
|
123
|
-
///
|
|
124
110
|
/// \return MSStatus.
|
|
125
111
|
MS_API MSStatus MSModelRunStep(MSModelHandle model, const MSKernelCallBackC before, const MSKernelCallBackC after);
|
|
126
112
|
|
|
127
113
|
/// \brief Set the model running mode. Only valid for Iot.
|
|
128
|
-
///
|
|
129
114
|
/// \param[in] model Model object handle.
|
|
130
115
|
/// \param[in] train True means model runs in Train Mode, otherwise Eval Mode.
|
|
131
|
-
///
|
|
132
116
|
/// \return Status of operation.
|
|
133
117
|
MS_API MSStatus MSModelSetTrainMode(const MSModelHandle model, bool train);
|
|
134
118
|
|
|
135
119
|
/// \brief Export the weights of model to the binary file. Only valid for Iot.
|
|
136
|
-
///
|
|
137
120
|
/// \param[in] model Model object handle.
|
|
138
121
|
/// \param[in] export_path Define the export weight file path.
|
|
139
|
-
///
|
|
140
122
|
/// \return Status of operation.
|
|
141
123
|
MS_API MSStatus MSModelExportWeight(const MSModelHandle model, const char *export_path);
|
|
142
124
|
|
|
143
125
|
/// \brief Obtain all input tensor handles of the model.
|
|
144
|
-
///
|
|
145
126
|
/// \param[in] model Model object handle.
|
|
146
|
-
///
|
|
147
127
|
/// \return The array that includes all input tensor handles.
|
|
148
128
|
MS_API MSTensorHandleArray MSModelGetInputs(const MSModelHandle model);
|
|
149
129
|
|
|
150
130
|
/// \brief Obtain all output tensor handles of the model.
|
|
151
|
-
///
|
|
152
131
|
/// \param[in] model Model object handle.
|
|
153
|
-
///
|
|
154
132
|
/// \return The array that includes all output tensor handles.
|
|
155
133
|
MS_API MSTensorHandleArray MSModelGetOutputs(const MSModelHandle model);
|
|
156
134
|
|
|
157
135
|
/// \brief Obtain the input tensor handle of the model by name.
|
|
158
|
-
///
|
|
159
136
|
/// \param[in] model Model object handle.
|
|
160
137
|
/// \param[in] tensor_name The name of tensor.
|
|
161
|
-
///
|
|
162
138
|
/// \return The input tensor handle with the given name, if the name is not found, an NULL is returned.
|
|
163
139
|
MS_API MSTensorHandle MSModelGetInputByTensorName(const MSModelHandle model, const char *tensor_name);
|
|
164
140
|
|
|
165
141
|
/// \brief Obtain the output tensor handle of the model by name.
|
|
166
|
-
///
|
|
167
142
|
/// \param[in] model Model object handle.
|
|
168
143
|
/// \param[in] tensor_name The name of tensor.
|
|
169
|
-
///
|
|
170
144
|
/// \return The output tensor handle with the given name, if the name is not found, an NULL is returned.
|
|
171
145
|
MS_API MSTensorHandle MSModelGetOutputByTensorName(const MSModelHandle model, const char *tensor_name);
|
|
172
146
|
|
|
173
147
|
/// \brief Create a TrainCfg object. Only valid for Lite Train.
|
|
174
|
-
///
|
|
175
148
|
/// \return TrainCfg object handle.
|
|
176
149
|
MS_API MSTrainCfgHandle MSTrainCfgCreate();
|
|
177
150
|
|
|
178
151
|
/// \brief Destroy the train_cfg object. Only valid for Lite Train.
|
|
179
|
-
///
|
|
180
152
|
/// \param[in] train_cfg TrainCfg object handle.
|
|
181
153
|
MS_API void MSTrainCfgDestroy(MSTrainCfgHandle *train_cfg);
|
|
182
154
|
|
|
183
155
|
/// \brief Obtains part of the name that identify a loss kernel. Only valid for Lite Train.
|
|
184
|
-
///
|
|
185
156
|
/// \param[in] train_cfg TrainCfg object handle.
|
|
186
157
|
/// \param[in] num The num of loss_name.
|
|
187
158
|
///
|
|
@@ -189,112 +160,88 @@ MS_API void MSTrainCfgDestroy(MSTrainCfgHandle *train_cfg);
|
|
|
189
160
|
MS_API char **MSTrainCfgGetLossName(MSTrainCfgHandle train_cfg, size_t *num);
|
|
190
161
|
|
|
191
162
|
/// \brief Set part of the name that identify a loss kernel. Only valid for Lite Train.
|
|
192
|
-
///
|
|
193
163
|
/// \param[in] train_cfg TrainCfg object handle.
|
|
194
164
|
/// \param[in] loss_name define part of the name that identify a loss kernel.
|
|
195
165
|
/// \param[in] num The num of loss_name.
|
|
196
166
|
MS_API void MSTrainCfgSetLossName(MSTrainCfgHandle train_cfg, const char **loss_name, size_t num);
|
|
197
167
|
|
|
198
168
|
/// \brief Obtains optimization level of the train_cfg. Only valid for Lite Train.
|
|
199
|
-
///
|
|
200
169
|
/// \param[in] train_cfg TrainCfg object handle.
|
|
201
|
-
///
|
|
202
170
|
/// \return MSOptimizationLevel.
|
|
203
171
|
MS_API MSOptimizationLevel MSTrainCfgGetOptimizationLevel(MSTrainCfgHandle train_cfg);
|
|
204
172
|
|
|
205
173
|
/// \brief Set optimization level of the train_cfg. Only valid for Lite Train.
|
|
206
|
-
///
|
|
207
174
|
/// \param[in] train_cfg TrainCfg object handle.
|
|
208
175
|
/// \param[in] level The optimization level of train_cfg.
|
|
209
176
|
MS_API void MSTrainCfgSetOptimizationLevel(MSTrainCfgHandle train_cfg, MSOptimizationLevel level);
|
|
210
177
|
|
|
211
178
|
/// \brief Build the train model from model buffer so that it can run on a device. Only valid for Lite Train.
|
|
212
|
-
///
|
|
213
179
|
/// \param[in] model Model object handle.
|
|
214
180
|
/// \param[in] model_data Define the buffer read from a model file.
|
|
215
181
|
/// \param[in] data_size Define bytes number of model file buffer.
|
|
216
182
|
/// \param[in] model_type Define The type of model file.
|
|
217
183
|
/// \param[in] model_context Define the context used to store options during execution.
|
|
218
184
|
/// \param[in] train_cfg Define the config used by training.
|
|
219
|
-
///
|
|
220
185
|
/// \return MSStatus.
|
|
221
186
|
MS_API MSStatus MSTrainModelBuild(MSModelHandle model, const void *model_data, size_t data_size, MSModelType model_type,
|
|
222
187
|
const MSContextHandle model_context, const MSTrainCfgHandle train_cfg);
|
|
223
188
|
|
|
224
189
|
/// \brief Build the train model from model file buffer so that it can run on a device. Only valid for Lite Train.
|
|
225
|
-
///
|
|
226
190
|
/// \param[in] model Model object handle.
|
|
227
191
|
/// \param[in] model_path Define the model path.
|
|
228
192
|
/// \param[in] model_type Define The type of model file.
|
|
229
193
|
/// \param[in] model_context Define the context used to store options during execution.
|
|
230
194
|
/// \param[in] train_cfg Define the config used by training.
|
|
231
|
-
///
|
|
232
195
|
/// \return MSStatus.
|
|
233
196
|
MS_API MSStatus MSTrainModelBuildFromFile(MSModelHandle model, const char *model_path, MSModelType model_type,
|
|
234
197
|
const MSContextHandle model_context, const MSTrainCfgHandle train_cfg);
|
|
235
198
|
|
|
236
199
|
/// \brief Train model by step. Only valid for Lite Train.
|
|
237
|
-
///
|
|
238
200
|
/// \param[in] model Model object handle.
|
|
239
201
|
/// \param[in] before CallBack before predict.
|
|
240
202
|
/// \param[in] after CallBack after predict.
|
|
241
|
-
///
|
|
242
203
|
/// \return MSStatus.
|
|
243
204
|
MS_API MSStatus MSRunStep(MSModelHandle model, const MSKernelCallBackC before, const MSKernelCallBackC after);
|
|
244
205
|
|
|
245
206
|
/// \brief Sets the Learning Rate of the training. Only valid for Lite Train.
|
|
246
|
-
///
|
|
247
207
|
/// \param[in] learning_rate to set.
|
|
248
|
-
///
|
|
249
208
|
/// \return MSStatus of operation.
|
|
250
209
|
MS_API MSStatus MSModelSetLearningRate(MSModelHandle model, float learning_rate);
|
|
251
210
|
|
|
252
211
|
/// \brief Obtains the Learning Rate of the optimizer. Only valid for Lite Train.
|
|
253
|
-
///
|
|
254
212
|
/// \return Learning rate. 0.0 if no optimizer was found.
|
|
255
213
|
MS_API float MSModelGetLearningRate(MSModelHandle model);
|
|
256
214
|
|
|
257
215
|
/// \brief Obtains all weights tensors of the model. Only valid for Lite Train.
|
|
258
|
-
///
|
|
259
216
|
/// \param[in] model Model object handle.
|
|
260
|
-
///
|
|
261
217
|
/// \return The vector that includes all gradient tensors.
|
|
262
218
|
MS_API MSTensorHandleArray MSModelGetWeights(MSModelHandle model);
|
|
263
219
|
|
|
264
220
|
/// \brief update weights tensors of the model. Only valid for Lite Train.
|
|
265
|
-
///
|
|
266
221
|
/// \param[in] new_weights A vector new weights.
|
|
267
|
-
///
|
|
268
222
|
/// \return MSStatus
|
|
269
223
|
MS_API MSStatus MSModelUpdateWeights(MSModelHandle model, const MSTensorHandleArray new_weights);
|
|
270
224
|
|
|
271
225
|
/// \brief Get the model running mode.
|
|
272
|
-
///
|
|
273
226
|
/// \param[in] model Model object handle.
|
|
274
|
-
///
|
|
275
227
|
/// \return Is Train Mode or not.
|
|
276
228
|
MS_API bool MSModelGetTrainMode(MSModelHandle model);
|
|
277
229
|
|
|
278
230
|
/// \brief Set the model running mode. Only valid for Lite Train.
|
|
279
|
-
///
|
|
280
231
|
/// \param[in] model Model object handle.
|
|
281
232
|
/// \param[in] train True means model runs in Train Mode, otherwise Eval Mode.
|
|
282
|
-
///
|
|
283
233
|
/// \return MSStatus.
|
|
284
234
|
MS_API MSStatus MSModelSetTrainMode(MSModelHandle model, bool train);
|
|
285
235
|
|
|
286
236
|
/// \brief Setup training with virtual batches. Only valid for Lite Train.
|
|
287
|
-
///
|
|
288
237
|
/// \param[in] model Model object handle.
|
|
289
238
|
/// \param[in] virtual_batch_multiplier - virtual batch multiplier, use any number < 1 to disable.
|
|
290
239
|
/// \param[in] lr - learning rate to use for virtual batch, -1 for internal configuration.
|
|
291
240
|
/// \param[in] momentum - batch norm momentum to use for virtual batch, -1 for internal configuration.
|
|
292
|
-
///
|
|
293
241
|
/// \return MSStatus.
|
|
294
242
|
MS_API MSStatus MSModelSetupVirtualBatch(MSModelHandle model, int virtual_batch_multiplier, float lr, float momentum);
|
|
295
243
|
|
|
296
244
|
/// \brief Export training model from file. Only valid for Lite Train.
|
|
297
|
-
///
|
|
298
245
|
/// \param[in] model The model data.
|
|
299
246
|
/// \param[in] model_type The model file type.
|
|
300
247
|
/// \param[in] model_file The exported model file.
|
|
@@ -303,14 +250,12 @@ MS_API MSStatus MSModelSetupVirtualBatch(MSModelHandle model, int virtual_batch_
|
|
|
303
250
|
/// \param[in] output_tensor_name The set the name of the output tensor of the exported reasoning model, default as
|
|
304
251
|
/// empty, and export the complete reasoning model.
|
|
305
252
|
/// \param[in] num The number of output_tensor_name.
|
|
306
|
-
///
|
|
307
253
|
/// \return MSStatus.
|
|
308
254
|
MS_API MSStatus MSExportModel(MSModelHandle model, MSModelType model_type, const char *model_file,
|
|
309
255
|
MSQuantizationType quantization_type, bool export_inference_only,
|
|
310
256
|
char **output_tensor_name, size_t num);
|
|
311
257
|
|
|
312
258
|
/// \brief Export training model from buffer. Only valid for Lite Train.
|
|
313
|
-
///
|
|
314
259
|
/// \param[in] model The model data.
|
|
315
260
|
/// \param[in] model_type The model file type.
|
|
316
261
|
/// \param[in] model_data The exported model buffer.
|
|
@@ -320,14 +265,12 @@ MS_API MSStatus MSExportModel(MSModelHandle model, MSModelType model_type, const
|
|
|
320
265
|
/// \param[in] output_tensor_name The set the name of the output tensor of the exported reasoning model, default as
|
|
321
266
|
/// empty, and export the complete reasoning model.
|
|
322
267
|
/// \param[in] num The number of output_tensor_name.
|
|
323
|
-
///
|
|
324
268
|
/// \return MSStatus.
|
|
325
269
|
MS_API MSStatus MSExportModelBuffer(MSModelHandle model, MSModelType model_type, char **model_data, size_t *data_size,
|
|
326
270
|
MSQuantizationType quantization_type, bool export_inference_only,
|
|
327
271
|
char **output_tensor_name, size_t num);
|
|
328
272
|
|
|
329
273
|
/// \brief Export model's weights, which can be used in micro only. Only valid for Lite Train.
|
|
330
|
-
///
|
|
331
274
|
/// \param[in] model The model data.
|
|
332
275
|
/// \param[in] model_type The model file type.
|
|
333
276
|
/// \param[in] weight_file The path of exported weight file.
|
|
@@ -335,7 +278,6 @@ MS_API MSStatus MSExportModelBuffer(MSModelHandle model, MSModelType model_type,
|
|
|
335
278
|
/// \param[in] enable_fp16 Float-weight is whether to be saved in float16 format.
|
|
336
279
|
/// \param[in] changeable_weights_name The set the name of these weight tensors, whose shape is changeable.
|
|
337
280
|
/// \param[in] num The number of changeable_weights_name.
|
|
338
|
-
///
|
|
339
281
|
/// \return MSStatus.
|
|
340
282
|
MS_API MSStatus MSExportWeightsCollaborateWithMicro(MSModelHandle model, MSModelType model_type,
|
|
341
283
|
const char *weight_file, bool is_inference, bool enable_fp16,
|
|
@@ -28,115 +28,89 @@ extern "C" {
|
|
|
28
28
|
typedef void *MSTensorHandle;
|
|
29
29
|
|
|
30
30
|
/// \brief Create a tensor object.
|
|
31
|
-
///
|
|
32
31
|
/// \param[in] name The name of the tensor.
|
|
33
32
|
/// \param[in] type The data type of the tensor.
|
|
34
33
|
/// \param[in] shape The shape of the tensor.
|
|
35
34
|
/// \param[in] shape_num The num of the shape.
|
|
36
35
|
/// \param[in] data The data pointer that points to allocated memory.
|
|
37
36
|
/// \param[in] data_len The length of the memory, in bytes.
|
|
38
|
-
///
|
|
39
37
|
/// \return Tensor object handle.
|
|
40
38
|
MS_API MSTensorHandle MSTensorCreate(const char *name, MSDataType type, const int64_t *shape, size_t shape_num,
|
|
41
39
|
const void *data, size_t data_len);
|
|
42
40
|
|
|
43
41
|
/// \brief Destroy the tensor object.
|
|
44
|
-
///
|
|
45
42
|
/// \param[in] tensor Tensor object handle address.
|
|
46
43
|
MS_API void MSTensorDestroy(MSTensorHandle *tensor);
|
|
47
44
|
|
|
48
45
|
/// \brief Obtain a deep copy of the tensor.
|
|
49
|
-
///
|
|
50
46
|
/// \param[in] tensor Tensor object handle.
|
|
51
|
-
///
|
|
52
47
|
/// \return Tensor object handle.
|
|
53
48
|
MS_API MSTensorHandle MSTensorClone(MSTensorHandle tensor);
|
|
54
49
|
|
|
55
50
|
/// \brief Set the name for the tensor.
|
|
56
|
-
///
|
|
57
51
|
/// \param[in] tensor Tensor object handle.
|
|
58
52
|
/// \param[in] name The name of the tensor.
|
|
59
53
|
MS_API void MSTensorSetName(MSTensorHandle tensor, const char *name);
|
|
60
54
|
|
|
61
55
|
/// \brief Obtain the name of the tensor.
|
|
62
|
-
///
|
|
63
56
|
/// \param[in] tensor Tensor object handle.
|
|
64
|
-
///
|
|
65
57
|
/// \return The name of the tensor.
|
|
66
58
|
MS_API const char *MSTensorGetName(const MSTensorHandle tensor);
|
|
67
59
|
|
|
68
60
|
/// \brief Set the data type for the tensor.
|
|
69
|
-
///
|
|
70
61
|
/// \param[in] tensor Tensor object handle.
|
|
71
62
|
/// \param[in] type The data type of the tensor.
|
|
72
63
|
MS_API void MSTensorSetDataType(MSTensorHandle tensor, MSDataType type);
|
|
73
64
|
|
|
74
65
|
/// \brief Obtain the data type of the tensor.
|
|
75
|
-
///
|
|
76
66
|
/// \param[in] tensor Tensor object handle.
|
|
77
|
-
///
|
|
78
67
|
/// \return The date type of the tensor.
|
|
79
68
|
MS_API MSDataType MSTensorGetDataType(const MSTensorHandle tensor);
|
|
80
69
|
|
|
81
70
|
/// \brief Set the shape for the tensor.
|
|
82
|
-
///
|
|
83
71
|
/// \param[in] tensor Tensor object handle.
|
|
84
72
|
/// \param[in] shape The shape array.
|
|
85
73
|
/// \param[in] shape_num Dimension of shape.
|
|
86
74
|
MS_API void MSTensorSetShape(MSTensorHandle tensor, const int64_t *shape, size_t shape_num);
|
|
87
75
|
|
|
88
76
|
/// \brief Obtain the shape of the tensor.
|
|
89
|
-
///
|
|
90
77
|
/// \param[in] tensor Tensor object handle.
|
|
91
78
|
/// \param[out] shape_num Dimension of shape.
|
|
92
|
-
///
|
|
93
79
|
/// \return The shape array of the tensor.
|
|
94
80
|
MS_API const int64_t *MSTensorGetShape(const MSTensorHandle tensor, size_t *shape_num);
|
|
95
81
|
|
|
96
82
|
/// \brief Set the format for the tensor.
|
|
97
|
-
///
|
|
98
83
|
/// \param[in] tensor Tensor object handle.
|
|
99
84
|
/// \param[in] format The format of the tensor.
|
|
100
85
|
MS_API void MSTensorSetFormat(MSTensorHandle tensor, MSFormat format);
|
|
101
86
|
|
|
102
87
|
/// \brief Obtain the format of the tensor.
|
|
103
|
-
///
|
|
104
88
|
/// \param[in] tensor Tensor object handle.
|
|
105
|
-
///
|
|
106
89
|
/// \return The format of the tensor.
|
|
107
90
|
MS_API MSFormat MSTensorGetFormat(const MSTensorHandle tensor);
|
|
108
91
|
|
|
109
92
|
/// \brief Obtain the data for the tensor.
|
|
110
|
-
///
|
|
111
93
|
/// \param[in] tensor Tensor object handle.
|
|
112
94
|
/// \param[in] data A pointer to the data of the tensor.
|
|
113
95
|
MS_API void MSTensorSetData(MSTensorHandle tensor, void *data);
|
|
114
96
|
|
|
115
97
|
/// \brief Obtain the data pointer of the tensor.
|
|
116
|
-
///
|
|
117
98
|
/// \param[in] tensor Tensor object handle.
|
|
118
|
-
///
|
|
119
99
|
/// \return The data pointer of the tensor.
|
|
120
100
|
MS_API const void *MSTensorGetData(const MSTensorHandle tensor);
|
|
121
101
|
|
|
122
102
|
/// \brief Obtain the mutable data pointer of the tensor. If the internal data is empty, it will allocate memory.
|
|
123
|
-
///
|
|
124
103
|
/// \param[in] tensor Tensor object handle.
|
|
125
|
-
///
|
|
126
104
|
/// \return The data pointer of the tensor.
|
|
127
105
|
MS_API void *MSTensorGetMutableData(const MSTensorHandle tensor);
|
|
128
106
|
|
|
129
107
|
/// \brief Obtain the element number of the tensor.
|
|
130
|
-
///
|
|
131
108
|
/// \param[in] tensor Tensor object handle.
|
|
132
|
-
///
|
|
133
109
|
/// \return The element number of the tensor.
|
|
134
110
|
MS_API int64_t MSTensorGetElementNum(const MSTensorHandle tensor);
|
|
135
111
|
|
|
136
112
|
/// \brief Obtain the data size fo the tensor.
|
|
137
|
-
///
|
|
138
113
|
/// \param[in] tensor Tensor object handle.
|
|
139
|
-
///
|
|
140
114
|
/// \return The data size of the tensor.
|
|
141
115
|
MS_API size_t MSTensorGetDataSize(const MSTensorHandle tensor);
|
|
142
116
|
|
|
@@ -31,7 +31,7 @@ namespace mindspore {
|
|
|
31
31
|
namespace dataset {
|
|
32
32
|
// Transform operations for performing computer vision.
|
|
33
33
|
namespace vision {
|
|
34
|
-
/* ##################################### API class
|
|
34
|
+
/* ##################################### API class ########################################### */
|
|
35
35
|
|
|
36
36
|
/// \brief Decode and resize JPEG image using the hardware algorithm of
|
|
37
37
|
/// Ascend series chip DVPP module.
|
mindspore/jpeg62.dll
CHANGED
|
Binary file
|