mindspore 2.2.11__cp39-cp39-macosx_11_0_arm64.whl → 2.4.0__cp39-cp39-macosx_11_0_arm64.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 +9 -5
- mindspore/_c_dataengine.cpython-39-darwin.so +0 -0
- mindspore/_c_expression.cpython-39-darwin.so +0 -0
- mindspore/_c_mindrecord.cpython-39-darwin.so +0 -0
- mindspore/_checkparam.py +124 -25
- mindspore/_extends/builtin_operations.py +2 -1
- mindspore/_extends/graph_kernel/model/graph_parallel.py +16 -6
- mindspore/_extends/parallel_compile/akg_compiler/akg_process.py +3 -16
- mindspore/_extends/parallel_compile/akg_compiler/build_tbe_kernel.py +16 -4
- mindspore/_extends/parallel_compile/akg_compiler/compiler.py +1 -0
- mindspore/_extends/parallel_compile/akg_compiler/gen_custom_op_files.py +96 -0
- mindspore/_extends/parallel_compile/akg_compiler/tbe_topi.py +2 -1
- mindspore/_extends/parallel_compile/akg_compiler/util.py +5 -2
- mindspore/_extends/parse/__init__.py +18 -14
- mindspore/_extends/parse/compile_config.py +299 -0
- mindspore/_extends/parse/namespace.py +2 -2
- mindspore/_extends/parse/parser.py +182 -68
- mindspore/_extends/parse/resources.py +45 -14
- mindspore/_extends/parse/standard_method.py +192 -252
- mindspore/{ops/_op_impl/tbe/atomic_addr_clean.py → _extends/pijit/__init__.py} +6 -16
- mindspore/_extends/pijit/pijit_func_white_list.py +669 -0
- mindspore/_extends/remote/kernel_build_server.py +2 -0
- mindspore/_profiler.py +30 -0
- mindspore/amp.py +67 -26
- mindspore/boost/adasum.py +1 -1
- mindspore/boost/base.py +1 -1
- mindspore/boost/boost_cell_wrapper.py +2 -2
- mindspore/boost/grad_freeze.py +2 -2
- mindspore/boost/group_loss_scale_manager.py +1 -1
- mindspore/boost/less_batch_normalization.py +9 -6
- mindspore/common/__init__.py +20 -7
- mindspore/common/_jit_fallback_utils.py +2 -3
- mindspore/common/_pijit_context.py +190 -0
- mindspore/common/_register_for_adapter.py +7 -0
- mindspore/common/_register_for_recompute.py +48 -0
- mindspore/common/_register_for_tensor.py +10 -10
- mindspore/common/_stub_tensor.py +7 -1
- mindspore/common/_tensor_overload.py +139 -0
- mindspore/common/_utils.py +5 -17
- mindspore/common/api.py +449 -129
- mindspore/common/auto_dynamic_shape.py +27 -14
- mindspore/common/dtype.py +17 -10
- mindspore/common/dump.py +8 -11
- mindspore/common/file_system.py +48 -0
- mindspore/common/generator.py +254 -0
- mindspore/common/hook_handle.py +65 -30
- mindspore/common/initializer.py +1 -1
- mindspore/common/jit_config.py +34 -14
- mindspore/common/lazy_inline.py +72 -19
- mindspore/common/mindir_util.py +12 -2
- mindspore/common/mutable.py +79 -14
- mindspore/common/no_inline.py +54 -0
- mindspore/common/np_dtype.py +25 -0
- mindspore/common/parameter.py +73 -21
- mindspore/common/recompute.py +292 -0
- mindspore/common/seed.py +9 -9
- mindspore/common/sparse_tensor.py +276 -24
- mindspore/common/symbol.py +122 -0
- mindspore/common/tensor.py +668 -516
- mindspore/communication/__init__.py +6 -11
- mindspore/communication/_comm_helper.py +43 -3
- mindspore/communication/comm_func.py +1395 -0
- mindspore/communication/management.py +120 -104
- mindspore/config/op_info.config +22 -54
- mindspore/context.py +487 -73
- mindspore/dataset/__init__.py +5 -5
- mindspore/dataset/audio/__init__.py +6 -6
- mindspore/dataset/audio/transforms.py +711 -158
- mindspore/dataset/callback/ds_callback.py +2 -2
- mindspore/dataset/core/config.py +7 -0
- mindspore/dataset/core/validator_helpers.py +7 -0
- mindspore/dataset/engine/cache_client.py +2 -2
- mindspore/dataset/engine/datasets.py +224 -116
- mindspore/dataset/engine/datasets_audio.py +14 -14
- mindspore/dataset/engine/datasets_standard_format.py +83 -3
- mindspore/dataset/engine/datasets_text.py +39 -39
- mindspore/dataset/engine/datasets_user_defined.py +230 -141
- mindspore/dataset/engine/datasets_vision.py +78 -74
- mindspore/dataset/engine/iterators.py +29 -0
- mindspore/dataset/engine/obs/util.py +7 -0
- mindspore/dataset/engine/offload.py +5 -7
- mindspore/dataset/engine/queue.py +138 -66
- mindspore/dataset/engine/serializer_deserializer.py +2 -2
- mindspore/dataset/engine/validators.py +41 -15
- mindspore/dataset/text/__init__.py +2 -5
- mindspore/dataset/text/transforms.py +408 -121
- mindspore/dataset/text/utils.py +9 -9
- mindspore/dataset/transforms/__init__.py +0 -3
- mindspore/dataset/transforms/transforms.py +261 -76
- mindspore/dataset/utils/browse_dataset.py +9 -9
- mindspore/dataset/utils/line_reader.py +2 -0
- mindspore/dataset/vision/__init__.py +7 -10
- mindspore/dataset/vision/c_transforms.py +10 -10
- mindspore/dataset/vision/py_transforms_util.py +3 -3
- mindspore/dataset/vision/transforms.py +2844 -549
- mindspore/dataset/vision/utils.py +161 -10
- mindspore/dataset/vision/validators.py +16 -3
- mindspore/{rewrite/ast_creator_register.py → experimental/es/__init__.py} +5 -20
- mindspore/experimental/es/embedding_service.py +883 -0
- mindspore/experimental/es/embedding_service_layer.py +581 -0
- mindspore/experimental/llm_boost/__init__.py +21 -0
- mindspore/experimental/llm_boost/atb/__init__.py +23 -0
- mindspore/experimental/llm_boost/atb/boost_base.py +211 -0
- mindspore/experimental/llm_boost/atb/llama_boost.py +115 -0
- mindspore/experimental/llm_boost/atb/qwen_boost.py +101 -0
- mindspore/experimental/llm_boost/register.py +129 -0
- mindspore/experimental/llm_boost/utils.py +31 -0
- mindspore/experimental/optim/__init__.py +12 -2
- mindspore/experimental/optim/adadelta.py +161 -0
- mindspore/experimental/optim/adagrad.py +168 -0
- mindspore/experimental/optim/adam.py +35 -34
- mindspore/experimental/optim/adamax.py +170 -0
- mindspore/experimental/optim/adamw.py +124 -15
- mindspore/experimental/optim/asgd.py +153 -0
- mindspore/experimental/optim/lr_scheduler.py +71 -127
- mindspore/experimental/optim/nadam.py +157 -0
- mindspore/experimental/optim/optimizer.py +18 -8
- mindspore/experimental/optim/radam.py +194 -0
- mindspore/experimental/optim/rmsprop.py +154 -0
- mindspore/experimental/optim/rprop.py +164 -0
- mindspore/experimental/optim/sgd.py +28 -19
- mindspore/hal/__init__.py +40 -0
- mindspore/hal/_ascend.py +57 -0
- mindspore/hal/_base.py +57 -0
- mindspore/hal/_cpu.py +56 -0
- mindspore/hal/_gpu.py +57 -0
- mindspore/hal/contiguous_tensors_handle.py +175 -0
- mindspore/hal/device.py +356 -0
- mindspore/hal/event.py +179 -0
- mindspore/hal/memory.py +326 -0
- mindspore/hal/stream.py +357 -0
- mindspore/include/api/data_type.h +2 -2
- mindspore/include/api/dual_abi_helper.h +16 -3
- mindspore/include/api/model.h +4 -3
- mindspore/include/api/model_group.h +13 -1
- mindspore/include/api/status.h +14 -0
- mindspore/include/api/types.h +10 -10
- mindspore/include/c_api/model_c.h +173 -0
- mindspore/include/c_api/types_c.h +19 -0
- mindspore/include/dataset/config.h +2 -2
- mindspore/include/dataset/constants.h +2 -2
- mindspore/include/dataset/execute.h +3 -5
- mindspore/include/dataset/vision.h +58 -2
- mindspore/lib/libavcodec.59.dylib +0 -0
- mindspore/lib/libavdevice.59.dylib +0 -0
- mindspore/lib/libavfilter.8.dylib +0 -0
- mindspore/lib/libavformat.59.dylib +0 -0
- mindspore/lib/libavutil.57.dylib +0 -0
- mindspore/lib/libdnnl.2.dylib +0 -0
- mindspore/lib/libmindspore_backend.dylib +0 -0
- mindspore/lib/libmindspore_common.dylib +0 -0
- mindspore/lib/libmindspore_core.dylib +0 -0
- mindspore/lib/libmindspore_glog.0.dylib +0 -0
- mindspore/lib/libmindspore_gpr.15.dylib +0 -0
- mindspore/lib/libmindspore_grpc++.1.dylib +0 -0
- mindspore/lib/libmindspore_grpc.15.dylib +0 -0
- mindspore/lib/libmindspore_np_dtype.dylib +0 -0
- mindspore/lib/libmindspore_ops.dylib +0 -0
- mindspore/lib/libnnacl.dylib +0 -0
- mindspore/lib/libopencv_core.4.5.dylib +0 -0
- mindspore/lib/libopencv_imgcodecs.4.5.dylib +0 -0
- mindspore/lib/libopencv_imgproc.4.5.dylib +0 -0
- mindspore/lib/libps_cache.dylib +0 -0
- mindspore/lib/libswresample.4.dylib +0 -0
- mindspore/lib/libswscale.6.dylib +0 -0
- mindspore/lib/libtinyxml2.8.dylib +0 -0
- mindspore/log.py +3 -3
- mindspore/mindrecord/__init__.py +5 -1
- mindspore/mindrecord/config.py +809 -0
- mindspore/mindrecord/filereader.py +25 -0
- mindspore/mindrecord/filewriter.py +138 -103
- mindspore/mindrecord/mindpage.py +40 -6
- mindspore/mindrecord/shardutils.py +3 -2
- mindspore/mindrecord/shardwriter.py +7 -0
- mindspore/mindrecord/tools/cifar100_to_mr.py +53 -66
- mindspore/mindrecord/tools/cifar10_to_mr.py +48 -63
- mindspore/mindrecord/tools/csv_to_mr.py +7 -17
- mindspore/mindrecord/tools/imagenet_to_mr.py +3 -8
- mindspore/mindrecord/tools/mnist_to_mr.py +11 -21
- mindspore/mindrecord/tools/tfrecord_to_mr.py +2 -10
- mindspore/mint/__init__.py +1586 -0
- mindspore/mint/distributed/__init__.py +31 -0
- mindspore/mint/distributed/distributed.py +254 -0
- mindspore/{rewrite/ast_transformers → mint/linalg}/__init__.py +9 -4
- mindspore/mint/nn/__init__.py +757 -0
- mindspore/mint/nn/functional.py +679 -0
- mindspore/mint/nn/layer/__init__.py +39 -0
- mindspore/mint/nn/layer/activation.py +133 -0
- mindspore/mint/nn/layer/normalization.py +477 -0
- mindspore/mint/nn/layer/pooling.py +110 -0
- mindspore/mint/optim/__init__.py +24 -0
- mindspore/mint/optim/adamw.py +206 -0
- mindspore/mint/special/__init__.py +63 -0
- mindspore/multiprocessing/__init__.py +73 -0
- mindspore/nn/cell.py +461 -323
- mindspore/nn/dynamic_lr.py +2 -2
- mindspore/nn/layer/activation.py +293 -136
- mindspore/nn/layer/basic.py +288 -83
- mindspore/nn/layer/channel_shuffle.py +3 -16
- mindspore/nn/layer/container.py +3 -3
- mindspore/nn/layer/conv.py +75 -66
- mindspore/nn/layer/embedding.py +223 -47
- mindspore/nn/layer/image.py +4 -7
- mindspore/nn/layer/math.py +1 -1
- mindspore/nn/layer/normalization.py +150 -68
- mindspore/nn/layer/padding.py +64 -87
- mindspore/nn/layer/pooling.py +175 -12
- mindspore/nn/layer/rnn_cells.py +6 -16
- mindspore/nn/layer/rnns.py +6 -5
- mindspore/nn/layer/thor_layer.py +1 -2
- mindspore/nn/layer/timedistributed.py +1 -1
- mindspore/nn/layer/transformer.py +55 -53
- mindspore/nn/learning_rate_schedule.py +6 -5
- mindspore/nn/loss/__init__.py +2 -2
- mindspore/nn/loss/loss.py +146 -89
- mindspore/nn/optim/__init__.py +2 -1
- mindspore/nn/optim/ada_grad.py +6 -4
- mindspore/nn/optim/adadelta.py +4 -2
- mindspore/nn/optim/adafactor.py +1 -1
- mindspore/nn/optim/adam.py +102 -181
- mindspore/nn/optim/adamax.py +4 -2
- mindspore/nn/optim/adasum.py +3 -3
- mindspore/nn/optim/asgd.py +4 -2
- mindspore/nn/optim/ftrl.py +31 -61
- mindspore/nn/optim/lamb.py +5 -3
- mindspore/nn/optim/lars.py +2 -2
- mindspore/nn/optim/lazyadam.py +6 -4
- mindspore/nn/optim/momentum.py +13 -25
- mindspore/nn/optim/optimizer.py +6 -3
- mindspore/nn/optim/proximal_ada_grad.py +4 -2
- mindspore/nn/optim/rmsprop.py +9 -3
- mindspore/nn/optim/rprop.py +4 -2
- mindspore/nn/optim/sgd.py +7 -4
- mindspore/nn/optim/tft_wrapper.py +127 -0
- mindspore/nn/optim/thor.py +2 -2
- mindspore/nn/probability/distribution/_utils/custom_ops.py +2 -2
- mindspore/nn/probability/distribution/beta.py +2 -2
- mindspore/nn/probability/distribution/categorical.py +4 -6
- mindspore/nn/probability/distribution/cauchy.py +2 -2
- mindspore/nn/probability/distribution/exponential.py +2 -2
- mindspore/nn/probability/distribution/geometric.py +1 -1
- mindspore/nn/probability/distribution/gumbel.py +2 -2
- mindspore/nn/probability/distribution/logistic.py +1 -1
- mindspore/nn/probability/distribution/poisson.py +2 -2
- mindspore/nn/probability/distribution/uniform.py +2 -2
- mindspore/nn/reinforcement/_tensors_queue.py +13 -1
- mindspore/nn/wrap/__init__.py +2 -1
- mindspore/nn/wrap/cell_wrapper.py +46 -12
- mindspore/nn/wrap/grad_reducer.py +148 -8
- mindspore/nn/wrap/loss_scale.py +44 -7
- mindspore/numpy/__init__.py +2 -0
- mindspore/numpy/array_creations.py +67 -68
- mindspore/numpy/array_ops.py +70 -66
- mindspore/numpy/dtypes.py +3 -3
- mindspore/numpy/fft.py +966 -0
- mindspore/numpy/logic_ops.py +11 -10
- mindspore/numpy/math_ops.py +146 -151
- mindspore/numpy/utils.py +3 -0
- mindspore/numpy/utils_const.py +4 -4
- mindspore/ops/__init__.py +9 -3
- mindspore/ops/_grad_experimental/grad_array_ops.py +4 -160
- mindspore/ops/_grad_experimental/grad_comm_ops.py +139 -38
- mindspore/ops/_grad_experimental/grad_inner_ops.py +8 -0
- mindspore/ops/_grad_experimental/grad_math_ops.py +70 -287
- mindspore/ops/_grad_experimental/grad_nn_ops.py +0 -53
- mindspore/ops/_grad_experimental/grad_quant_ops.py +3 -3
- mindspore/ops/_grad_experimental/grad_sparse.py +1 -1
- mindspore/ops/_grad_experimental/grad_sparse_ops.py +3 -3
- mindspore/ops/_op_impl/__init__.py +0 -1
- mindspore/ops/_op_impl/aicpu/__init__.py +1 -0
- mindspore/ops/_op_impl/aicpu/gamma.py +2 -0
- mindspore/ops/_op_impl/{cpu/concat.py → aicpu/generate_eod_mask.py} +16 -17
- mindspore/ops/_op_impl/aicpu/log_uniform_candidate_sampler.py +1 -3
- mindspore/ops/_op_impl/aicpu/poisson.py +2 -0
- mindspore/ops/_op_impl/cpu/__init__.py +1 -3
- mindspore/ops/_op_impl/cpu/adam.py +2 -2
- mindspore/ops/_op_impl/cpu/adam_weight_decay.py +3 -2
- mindspore/ops/_op_impl/cpu/maximum_grad.py +16 -14
- mindspore/ops/_op_impl/cpu/minimum_grad.py +8 -0
- mindspore/ops/_vmap/vmap_array_ops.py +162 -101
- mindspore/ops/_vmap/vmap_base.py +8 -1
- mindspore/ops/_vmap/vmap_grad_math_ops.py +95 -9
- mindspore/ops/_vmap/vmap_grad_nn_ops.py +143 -58
- mindspore/ops/_vmap/vmap_image_ops.py +70 -13
- mindspore/ops/_vmap/vmap_math_ops.py +147 -59
- mindspore/ops/_vmap/vmap_nn_ops.py +292 -117
- mindspore/ops/_vmap/vmap_other_ops.py +1 -1
- mindspore/ops/auto_generate/__init__.py +31 -0
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +309 -0
- mindspore/ops/auto_generate/gen_arg_dtype_cast.py +252 -0
- mindspore/ops/auto_generate/gen_arg_handler.py +197 -0
- mindspore/ops/auto_generate/gen_extend_func.py +1701 -0
- mindspore/ops/auto_generate/gen_ops_def.py +8482 -0
- mindspore/ops/auto_generate/gen_ops_prim.py +16704 -0
- mindspore/ops/auto_generate/pyboost_inner_prim.py +549 -0
- mindspore/ops/composite/__init__.py +5 -2
- mindspore/ops/composite/base.py +201 -66
- mindspore/ops/composite/math_ops.py +10 -49
- mindspore/ops/composite/multitype_ops/_compile_utils.py +192 -618
- mindspore/ops/composite/multitype_ops/_constexpr_utils.py +25 -134
- mindspore/ops/composite/multitype_ops/add_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/bitwise_and_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/bitwise_or_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/bitwise_xor_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/div_impl.py +8 -0
- mindspore/ops/composite/multitype_ops/equal_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/floordiv_impl.py +8 -0
- mindspore/ops/composite/multitype_ops/getitem_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/greater_equal_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/greater_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/in_impl.py +8 -2
- mindspore/ops/composite/multitype_ops/left_shift_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/less_equal_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/less_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/logic_not_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/logical_and_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/logical_or_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/mod_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/mul_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/negative_impl.py +9 -3
- mindspore/ops/composite/multitype_ops/not_equal_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/not_in_impl.py +8 -3
- mindspore/ops/composite/multitype_ops/ones_like_impl.py +2 -2
- mindspore/ops/composite/multitype_ops/pow_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/right_shift_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/setitem_impl.py +32 -21
- mindspore/ops/composite/multitype_ops/sub_impl.py +6 -0
- mindspore/ops/composite/multitype_ops/zeros_like_impl.py +6 -3
- mindspore/ops/deprecated.py +14 -3
- mindspore/ops/function/__init__.py +53 -11
- mindspore/ops/function/array_func.py +1271 -1822
- mindspore/ops/function/clip_func.py +19 -31
- mindspore/ops/function/debug_func.py +115 -6
- mindspore/ops/function/fft_func.py +44 -0
- mindspore/ops/function/grad/grad_func.py +30 -22
- mindspore/ops/function/image_func.py +27 -21
- mindspore/ops/function/linalg_func.py +30 -53
- mindspore/ops/function/math_func.py +1233 -2757
- mindspore/ops/function/nn_func.py +2123 -1133
- mindspore/ops/function/other_func.py +8 -8
- mindspore/ops/function/parameter_func.py +6 -92
- mindspore/ops/function/random_func.py +435 -113
- mindspore/ops/function/reshard_func.py +104 -0
- mindspore/ops/function/sparse_func.py +4 -4
- mindspore/ops/function/sparse_unary_func.py +11 -18
- mindspore/ops/function/spectral_func.py +1 -1
- mindspore/ops/function/vmap_func.py +17 -15
- mindspore/ops/functional.py +355 -346
- mindspore/ops/op_info_register.py +18 -45
- mindspore/ops/operations/__init__.py +38 -24
- mindspore/ops/operations/_embedding_cache_ops.py +1 -1
- mindspore/ops/operations/_grad_ops.py +21 -927
- mindspore/ops/operations/_infer_ops.py +19 -0
- mindspore/ops/operations/_inner_ops.py +178 -557
- mindspore/ops/operations/_quant_ops.py +4 -4
- mindspore/ops/operations/_rl_inner_ops.py +3 -3
- mindspore/ops/operations/_scalar_ops.py +5 -480
- mindspore/ops/operations/_sequence_ops.py +6 -36
- mindspore/ops/operations/_tensor_array.py +8 -8
- mindspore/ops/operations/array_ops.py +110 -2830
- mindspore/ops/operations/comm_ops.py +799 -127
- mindspore/ops/operations/custom_ops.py +125 -120
- mindspore/ops/operations/debug_ops.py +143 -42
- mindspore/ops/operations/image_ops.py +3 -219
- mindspore/ops/operations/inner_ops.py +54 -40
- mindspore/ops/operations/linalg_ops.py +1 -49
- mindspore/{offline_debug → ops/operations/manually_defined}/__init__.py +9 -6
- mindspore/ops/operations/manually_defined/_inner.py +73 -0
- mindspore/ops/operations/manually_defined/ops_def.py +2271 -0
- mindspore/ops/operations/math_ops.py +1107 -5351
- mindspore/ops/operations/nn_ops.py +210 -2214
- mindspore/ops/operations/other_ops.py +60 -49
- mindspore/ops/operations/random_ops.py +50 -52
- mindspore/ops/operations/reshard_ops.py +53 -0
- mindspore/ops/operations/sparse_ops.py +8 -8
- mindspore/ops/primitive.py +216 -103
- mindspore/ops_generate/__init__.py +27 -0
- mindspore/ops_generate/arg_dtype_cast.py +252 -0
- mindspore/ops_generate/arg_handler.py +197 -0
- mindspore/ops_generate/gen_aclnn_implement.py +263 -0
- mindspore/ops_generate/gen_constants.py +36 -0
- mindspore/ops_generate/gen_ops.py +1099 -0
- mindspore/ops_generate/gen_ops_inner_prim.py +131 -0
- mindspore/ops_generate/gen_pyboost_func.py +1052 -0
- mindspore/ops_generate/gen_utils.py +209 -0
- mindspore/ops_generate/op_proto.py +145 -0
- mindspore/ops_generate/pyboost_utils.py +367 -0
- mindspore/ops_generate/template.py +261 -0
- mindspore/parallel/__init__.py +9 -4
- mindspore/parallel/_auto_parallel_context.py +182 -13
- mindspore/parallel/_cell_wrapper.py +99 -9
- mindspore/parallel/_cost_model_context.py +1 -1
- mindspore/parallel/_dp_allreduce_fusion.py +159 -159
- mindspore/parallel/_parallel_serialization.py +100 -24
- mindspore/parallel/_ps_context.py +1 -1
- mindspore/parallel/_recovery_context.py +1 -1
- mindspore/parallel/_tensor.py +99 -20
- mindspore/parallel/_transformer/__init__.py +1 -1
- mindspore/parallel/_transformer/layers.py +1 -1
- mindspore/parallel/_transformer/loss.py +1 -1
- mindspore/parallel/_transformer/moe.py +1 -1
- mindspore/parallel/_transformer/op_parallel_config.py +1 -1
- mindspore/parallel/_transformer/transformer.py +10 -10
- mindspore/parallel/_utils.py +173 -6
- mindspore/parallel/algo_parameter_config.py +8 -10
- mindspore/parallel/checkpoint_transform.py +379 -67
- mindspore/parallel/cluster/__init__.py +15 -0
- mindspore/parallel/cluster/process_entity/__init__.py +18 -0
- mindspore/parallel/cluster/process_entity/_api.py +352 -0
- mindspore/parallel/cluster/process_entity/_utils.py +101 -0
- mindspore/parallel/cluster/run.py +136 -0
- mindspore/parallel/mpi/__init__.py +1 -1
- mindspore/parallel/mpi/_mpi_config.py +1 -1
- mindspore/parallel/parameter_broadcast.py +151 -0
- mindspore/parallel/shard.py +279 -37
- mindspore/parallel/transform_safetensors.py +993 -0
- mindspore/profiler/__init__.py +4 -2
- mindspore/profiler/common/constant.py +29 -0
- mindspore/profiler/common/process_pool.py +41 -0
- mindspore/profiler/common/registry.py +47 -0
- mindspore/profiler/common/singleton.py +28 -0
- mindspore/profiler/common/util.py +153 -0
- mindspore/profiler/dynamic_profiler.py +694 -0
- mindspore/profiler/envprofiling.py +18 -20
- mindspore/{_extends/parallel_compile/tbe_compiler → profiler/parser/ascend_analysis}/__init__.py +1 -1
- mindspore/profiler/parser/ascend_analysis/constant.py +71 -0
- mindspore/profiler/parser/ascend_analysis/file_manager.py +180 -0
- mindspore/profiler/parser/ascend_analysis/function_event.py +185 -0
- mindspore/profiler/parser/ascend_analysis/fwk_cann_parser.py +136 -0
- mindspore/profiler/parser/ascend_analysis/fwk_file_parser.py +131 -0
- mindspore/profiler/parser/ascend_analysis/msprof_timeline_parser.py +104 -0
- mindspore/profiler/parser/ascend_analysis/path_manager.py +313 -0
- mindspore/profiler/parser/ascend_analysis/profiler_info_parser.py +123 -0
- mindspore/profiler/parser/ascend_analysis/tlv_decoder.py +86 -0
- mindspore/profiler/parser/ascend_analysis/trace_event_manager.py +75 -0
- mindspore/profiler/parser/ascend_cluster_generator.py +116 -0
- mindspore/profiler/parser/ascend_communicate_generator.py +314 -0
- mindspore/profiler/parser/ascend_flops_generator.py +27 -5
- mindspore/profiler/parser/ascend_fpbp_generator.py +8 -2
- mindspore/profiler/parser/ascend_hccl_generator.py +31 -280
- mindspore/profiler/parser/ascend_integrate_generator.py +42 -0
- mindspore/profiler/parser/ascend_memory_generator.py +185 -0
- mindspore/profiler/parser/ascend_msprof_exporter.py +152 -126
- mindspore/profiler/parser/ascend_msprof_generator.py +75 -274
- mindspore/profiler/parser/ascend_op_generator.py +94 -36
- mindspore/profiler/parser/ascend_timeline_generator.py +299 -131
- mindspore/profiler/parser/base_timeline_generator.py +32 -24
- mindspore/profiler/parser/cpu_gpu_timeline_generator.py +27 -13
- mindspore/profiler/parser/framework_parser.py +12 -395
- mindspore/profiler/parser/gpu_analysis/__init__.py +14 -0
- mindspore/profiler/parser/gpu_analysis/function_event.py +44 -0
- mindspore/profiler/parser/gpu_analysis/fwk_file_parser.py +89 -0
- mindspore/profiler/parser/gpu_analysis/profiler_info_parser.py +72 -0
- mindspore/profiler/parser/integrator.py +3 -1
- mindspore/profiler/parser/memory_usage_parser.py +0 -148
- mindspore/profiler/parser/minddata_analyzer.py +8 -2
- mindspore/profiler/parser/minddata_parser.py +73 -4
- mindspore/profiler/parser/profiler_info.py +94 -7
- mindspore/profiler/profiler.py +153 -0
- mindspore/profiler/profiling.py +701 -506
- mindspore/rewrite/__init__.py +2 -14
- mindspore/rewrite/api/node.py +123 -37
- mindspore/rewrite/api/pattern_engine.py +2 -3
- mindspore/rewrite/api/scoped_value.py +16 -15
- mindspore/rewrite/api/symbol_tree.py +46 -30
- mindspore/rewrite/ast_helpers/__init__.py +3 -6
- mindspore/rewrite/ast_helpers/ast_converter.py +143 -0
- mindspore/rewrite/ast_helpers/ast_finder.py +48 -0
- mindspore/rewrite/ast_helpers/ast_flattener.py +268 -0
- mindspore/rewrite/ast_helpers/ast_modifier.py +160 -92
- mindspore/rewrite/common/__init__.py +1 -2
- mindspore/rewrite/common/config.py +24 -0
- mindspore/rewrite/common/{rewrite_elog.py → error_log.py} +39 -39
- mindspore/rewrite/{namer.py → common/namer.py} +63 -18
- mindspore/rewrite/common/namespace.py +118 -0
- mindspore/rewrite/node/__init__.py +5 -5
- mindspore/rewrite/node/call_function.py +23 -7
- mindspore/rewrite/node/cell_container.py +7 -3
- mindspore/rewrite/node/control_flow.py +53 -28
- mindspore/rewrite/node/node.py +212 -196
- mindspore/rewrite/node/node_manager.py +51 -22
- mindspore/rewrite/node/node_topological_manager.py +3 -23
- mindspore/rewrite/parsers/__init__.py +12 -0
- mindspore/rewrite/parsers/arguments_parser.py +8 -9
- mindspore/rewrite/parsers/assign_parser.py +637 -413
- mindspore/rewrite/parsers/attribute_parser.py +3 -4
- mindspore/rewrite/parsers/class_def_parser.py +115 -148
- mindspore/rewrite/parsers/constant_parser.py +5 -5
- mindspore/rewrite/parsers/container_parser.py +4 -6
- mindspore/rewrite/parsers/expr_parser.py +55 -0
- mindspore/rewrite/parsers/for_parser.py +31 -98
- mindspore/rewrite/parsers/function_def_parser.py +13 -5
- mindspore/rewrite/parsers/if_parser.py +28 -10
- mindspore/rewrite/parsers/module_parser.py +8 -182
- mindspore/rewrite/parsers/parser.py +1 -5
- mindspore/rewrite/parsers/parser_register.py +1 -1
- mindspore/rewrite/parsers/return_parser.py +5 -10
- mindspore/rewrite/parsers/while_parser.py +59 -0
- mindspore/rewrite/sparsify/utils.py +1 -1
- mindspore/rewrite/symbol_tree/__init__.py +20 -0
- mindspore/rewrite/{symbol_tree.py → symbol_tree/symbol_tree.py} +705 -186
- mindspore/rewrite/{symbol_tree_builder.py → symbol_tree/symbol_tree_builder.py} +8 -8
- mindspore/rewrite/{symbol_tree_dumper.py → symbol_tree/symbol_tree_dumper.py} +4 -4
- mindspore/run_check/_check_version.py +40 -115
- mindspore/run_check/run_check.py +1 -1
- mindspore/safeguard/rewrite_obfuscation.py +597 -263
- mindspore/scipy/__init__.py +2 -1
- mindspore/scipy/fft.py +264 -0
- mindspore/scipy/linalg.py +198 -55
- mindspore/scipy/ops.py +16 -70
- mindspore/scipy/ops_grad.py +5 -34
- mindspore/scipy/optimize/__init__.py +2 -2
- mindspore/scipy/optimize/_lagrange.py +4 -3
- mindspore/scipy/optimize/line_search.py +2 -2
- mindspore/scipy/optimize/minimize.py +1 -1
- mindspore/train/__init__.py +7 -5
- mindspore/train/_utils.py +204 -4
- mindspore/train/amp.py +335 -295
- mindspore/train/anf_ir_pb2.py +14 -2
- mindspore/train/callback/__init__.py +5 -2
- mindspore/train/callback/_backup_and_restore.py +5 -5
- mindspore/train/callback/_callback.py +4 -4
- mindspore/train/callback/_checkpoint.py +228 -51
- mindspore/train/callback/_cluster_monitor.py +201 -0
- mindspore/train/callback/_early_stop.py +2 -2
- mindspore/train/callback/_flops_collector.py +239 -0
- mindspore/train/callback/_landscape.py +16 -11
- mindspore/train/callback/_loss_monitor.py +5 -5
- mindspore/train/callback/_on_request_exit.py +136 -33
- mindspore/train/callback/_reduce_lr_on_plateau.py +2 -2
- mindspore/train/callback/_summary_collector.py +18 -19
- mindspore/train/callback/_tft_register.py +352 -0
- mindspore/train/callback/_time_monitor.py +3 -3
- mindspore/train/data_sink.py +6 -5
- mindspore/train/dataset_helper.py +72 -23
- mindspore/train/loss_scale_manager.py +2 -2
- mindspore/train/metrics/accuracy.py +7 -7
- mindspore/train/metrics/confusion_matrix.py +8 -6
- mindspore/train/metrics/cosine_similarity.py +6 -4
- mindspore/train/metrics/error.py +2 -2
- mindspore/train/metrics/metric.py +3 -3
- mindspore/train/metrics/perplexity.py +2 -1
- mindspore/train/metrics/roc.py +4 -4
- mindspore/train/metrics/topk.py +2 -2
- mindspore/train/mind_ir_pb2.py +116 -37
- mindspore/train/model.py +390 -72
- mindspore/train/serialization.py +793 -289
- mindspore/train/summary/_summary_adapter.py +1 -1
- mindspore/train/summary/_writer_pool.py +1 -1
- mindspore/train/summary/summary_record.py +56 -34
- mindspore/train/train_thor/convert_utils.py +3 -3
- mindspore/utils/__init__.py +21 -0
- mindspore/utils/utils.py +60 -0
- mindspore/version.py +1 -1
- {mindspore-2.2.11.dist-info → mindspore-2.4.0.dist-info}/METADATA +8 -4
- mindspore-2.4.0.dist-info/RECORD +1387 -0
- {mindspore-2.2.11.dist-info → mindspore-2.4.0.dist-info}/entry_points.txt +1 -0
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py +0 -662
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py +0 -377
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_job.py +0 -201
- mindspore/_extends/parallel_compile/tbe_compiler/tbe_job_manager.py +0 -515
- mindspore/_mindspore_offline_debug.cpython-39-darwin.so +0 -0
- mindspore/gen_ops.py +0 -273
- mindspore/include/c_api/ms/abstract.h +0 -67
- mindspore/include/c_api/ms/attribute.h +0 -197
- mindspore/include/c_api/ms/base/handle_types.h +0 -43
- mindspore/include/c_api/ms/base/macros.h +0 -32
- mindspore/include/c_api/ms/base/status.h +0 -33
- mindspore/include/c_api/ms/base/types.h +0 -282
- mindspore/include/c_api/ms/context.h +0 -102
- mindspore/include/c_api/ms/graph.h +0 -160
- mindspore/include/c_api/ms/node.h +0 -606
- mindspore/include/c_api/ms/tensor.h +0 -161
- mindspore/include/c_api/ms/value.h +0 -84
- mindspore/lib/libmindspore_shared_lib.dylib +0 -0
- mindspore/nn/layer/flash_attention.py +0 -189
- mindspore/offline_debug/convert_async.py +0 -280
- mindspore/offline_debug/dbg_services.py +0 -1386
- mindspore/offline_debug/mi_validator_helpers.py +0 -158
- mindspore/offline_debug/mi_validators.py +0 -272
- mindspore/ops/_op_impl/aicpu/strided_slice_v2.py +0 -93
- mindspore/ops/_op_impl/aicpu/strided_slice_v2_grad.py +0 -66
- mindspore/ops/_op_impl/cpu/tensor_shape.py +0 -42
- mindspore/ops/_op_impl/tbe/__init__.py +0 -47
- mindspore/ops/_op_impl/tbe/abs.py +0 -38
- mindspore/ops/_op_impl/tbe/abs_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/abs_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/abs_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/accumulate_n_v2.py +0 -41
- mindspore/ops/_op_impl/tbe/accumulate_n_v2_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/acos.py +0 -37
- mindspore/ops/_op_impl/tbe/acos_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/acos_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/acos_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/acosh.py +0 -37
- mindspore/ops/_op_impl/tbe/acosh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/acosh_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/acosh_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/act_ulq_clamp_max_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/act_ulq_clamp_min_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/acts_ulq.py +0 -45
- mindspore/ops/_op_impl/tbe/acts_ulq_input_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/adam_apply_one.py +0 -50
- mindspore/ops/_op_impl/tbe/adam_apply_one_assign.py +0 -53
- mindspore/ops/_op_impl/tbe/adam_apply_one_ds.py +0 -51
- mindspore/ops/_op_impl/tbe/adam_apply_one_with_decay.py +0 -54
- mindspore/ops/_op_impl/tbe/adam_apply_one_with_decay_assign.py +0 -54
- mindspore/ops/_op_impl/tbe/adam_apply_one_with_decay_ds.py +0 -55
- mindspore/ops/_op_impl/tbe/adaptive_max_pool2d.py +0 -37
- mindspore/ops/_op_impl/tbe/add.py +0 -42
- mindspore/ops/_op_impl/tbe/add_ds.py +0 -43
- mindspore/ops/_op_impl/tbe/add_n.py +0 -39
- mindspore/ops/_op_impl/tbe/add_n_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/addcdiv.py +0 -41
- mindspore/ops/_op_impl/tbe/addcdiv_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/addcmul.py +0 -43
- mindspore/ops/_op_impl/tbe/addcmul_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/apply_ada_max.py +0 -68
- mindspore/ops/_op_impl/tbe/apply_ada_max_ds.py +0 -69
- mindspore/ops/_op_impl/tbe/apply_adadelta.py +0 -66
- mindspore/ops/_op_impl/tbe/apply_adadelta_ds.py +0 -67
- mindspore/ops/_op_impl/tbe/apply_adagrad.py +0 -55
- mindspore/ops/_op_impl/tbe/apply_adagrad_d_a.py +0 -67
- mindspore/ops/_op_impl/tbe/apply_adagrad_ds.py +0 -56
- mindspore/ops/_op_impl/tbe/apply_adagrad_v2.py +0 -48
- mindspore/ops/_op_impl/tbe/apply_adagrad_v2_ds.py +0 -49
- mindspore/ops/_op_impl/tbe/apply_adam.py +0 -79
- mindspore/ops/_op_impl/tbe/apply_adam_ds.py +0 -80
- mindspore/ops/_op_impl/tbe/apply_adam_with_amsgrad.py +0 -60
- mindspore/ops/_op_impl/tbe/apply_adam_with_amsgrad_ds.py +0 -61
- mindspore/ops/_op_impl/tbe/apply_add_sign.py +0 -65
- mindspore/ops/_op_impl/tbe/apply_add_sign_ds.py +0 -66
- mindspore/ops/_op_impl/tbe/apply_centered_rms_prop.py +0 -77
- mindspore/ops/_op_impl/tbe/apply_centered_rms_prop_ds.py +0 -78
- mindspore/ops/_op_impl/tbe/apply_ftrl.py +0 -67
- mindspore/ops/_op_impl/tbe/apply_ftrl_ds.py +0 -68
- mindspore/ops/_op_impl/tbe/apply_gradient_descent.py +0 -44
- mindspore/ops/_op_impl/tbe/apply_gradient_descent_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/apply_keras_momentum.py +0 -49
- mindspore/ops/_op_impl/tbe/apply_momentum.py +0 -64
- mindspore/ops/_op_impl/tbe/apply_momentum_ds.py +0 -65
- mindspore/ops/_op_impl/tbe/apply_power_sign.py +0 -65
- mindspore/ops/_op_impl/tbe/apply_power_sign_ds.py +0 -66
- mindspore/ops/_op_impl/tbe/apply_proximal_adagrad.py +0 -57
- mindspore/ops/_op_impl/tbe/apply_proximal_adagrad_ds.py +0 -58
- mindspore/ops/_op_impl/tbe/apply_proximal_gradient_descent.py +0 -54
- mindspore/ops/_op_impl/tbe/apply_proximal_gradient_descent_ds.py +0 -55
- mindspore/ops/_op_impl/tbe/apply_rms_prop.py +0 -52
- mindspore/ops/_op_impl/tbe/approximate_equal.py +0 -39
- mindspore/ops/_op_impl/tbe/approximate_equal_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/arg_max.py +0 -38
- mindspore/ops/_op_impl/tbe/arg_max_with_value.py +0 -38
- mindspore/ops/_op_impl/tbe/arg_max_with_value_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/arg_min.py +0 -38
- mindspore/ops/_op_impl/tbe/arg_min_v2_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/arg_min_with_value.py +0 -38
- mindspore/ops/_op_impl/tbe/arg_min_with_value_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/asin.py +0 -37
- mindspore/ops/_op_impl/tbe/asin_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/asin_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/asin_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/asinh.py +0 -37
- mindspore/ops/_op_impl/tbe/asinh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/asinh_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/asinh_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/assign.py +0 -79
- mindspore/ops/_op_impl/tbe/assign_add.py +0 -59
- mindspore/ops/_op_impl/tbe/assign_add_ds.py +0 -60
- mindspore/ops/_op_impl/tbe/assign_ds.py +0 -80
- mindspore/ops/_op_impl/tbe/assign_sub.py +0 -55
- mindspore/ops/_op_impl/tbe/assign_sub_ds.py +0 -56
- mindspore/ops/_op_impl/tbe/atan.py +0 -37
- mindspore/ops/_op_impl/tbe/atan2.py +0 -38
- mindspore/ops/_op_impl/tbe/atan2_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/atan_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/atan_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/atan_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/atanh.py +0 -37
- mindspore/ops/_op_impl/tbe/atanh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/avg_pool.py +0 -43
- mindspore/ops/_op_impl/tbe/avg_pool_3d.py +0 -44
- mindspore/ops/_op_impl/tbe/avg_pool_3d_grad.py +0 -45
- mindspore/ops/_op_impl/tbe/avg_pool_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/avg_pool_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/avg_pool_grad_vm.py +0 -42
- mindspore/ops/_op_impl/tbe/basic_lstm_cell.py +0 -57
- mindspore/ops/_op_impl/tbe/basic_lstm_cell_c_state_grad.py +0 -50
- mindspore/ops/_op_impl/tbe/basic_lstm_cell_c_state_grad_v2.py +0 -51
- mindspore/ops/_op_impl/tbe/basic_lstm_cell_input_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/basic_lstm_cell_weight_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/batch_matmul.py +0 -42
- mindspore/ops/_op_impl/tbe/batch_matmul_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/batch_matmul_v2.py +0 -47
- mindspore/ops/_op_impl/tbe/batch_to_space.py +0 -38
- mindspore/ops/_op_impl/tbe/batch_to_space_nd.py +0 -38
- mindspore/ops/_op_impl/tbe/batch_to_space_nd_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/batch_to_space_nd_v2.py +0 -41
- mindspore/ops/_op_impl/tbe/batchnorm.py +0 -58
- mindspore/ops/_op_impl/tbe/batchnorm_grad.py +0 -58
- mindspore/ops/_op_impl/tbe/bce_with_logits_loss.py +0 -42
- mindspore/ops/_op_impl/tbe/bessel_i0e.py +0 -37
- mindspore/ops/_op_impl/tbe/bessel_i0e_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/bessel_i1e.py +0 -37
- mindspore/ops/_op_impl/tbe/bessel_i1e_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/bias_add.py +0 -38
- mindspore/ops/_op_impl/tbe/bias_add_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/bias_add_grad.py +0 -53
- mindspore/ops/_op_impl/tbe/binary_cross_entropy.py +0 -39
- mindspore/ops/_op_impl/tbe/binary_cross_entropy_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/binary_cross_entropy_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/binary_cross_entropy_grad_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/bitwise_and.py +0 -39
- mindspore/ops/_op_impl/tbe/bitwise_and_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/bitwise_or.py +0 -39
- mindspore/ops/_op_impl/tbe/bitwise_or_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/bitwise_xor.py +0 -39
- mindspore/ops/_op_impl/tbe/bitwise_xor_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/bn_infer.py +0 -43
- mindspore/ops/_op_impl/tbe/bn_infer_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/bn_infer_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/bn_infer_grad_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/bn_inference.py +0 -50
- mindspore/ops/_op_impl/tbe/bn_training_reduce.py +0 -38
- mindspore/ops/_op_impl/tbe/bn_training_reduce_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/bn_training_reduce_grad.py +0 -46
- mindspore/ops/_op_impl/tbe/bn_training_reduce_grad_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/bn_training_update.py +0 -52
- mindspore/ops/_op_impl/tbe/bn_training_update_ds.py +0 -53
- mindspore/ops/_op_impl/tbe/bn_training_update_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/bn_training_update_grad_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/bn_training_update_v2.py +0 -48
- mindspore/ops/_op_impl/tbe/bn_training_update_v3.py +0 -51
- mindspore/ops/_op_impl/tbe/bounding_box_decode.py +0 -41
- mindspore/ops/_op_impl/tbe/bounding_box_decode_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/bounding_box_encode.py +0 -38
- mindspore/ops/_op_impl/tbe/broadcast_to.py +0 -40
- mindspore/ops/_op_impl/tbe/broadcast_to_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/cast.py +0 -55
- mindspore/ops/_op_impl/tbe/cast_ds.py +0 -58
- mindspore/ops/_op_impl/tbe/cdist.py +0 -38
- mindspore/ops/_op_impl/tbe/cdist_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/ceil.py +0 -37
- mindspore/ops/_op_impl/tbe/ceil_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/celu.py +0 -39
- mindspore/ops/_op_impl/tbe/centralization.py +0 -39
- mindspore/ops/_op_impl/tbe/check_valid.py +0 -38
- mindspore/ops/_op_impl/tbe/check_valid_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/clip_by_norm_no_div_sum.py +0 -41
- mindspore/ops/_op_impl/tbe/clip_by_norm_no_div_sum_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/clip_by_value.py +0 -41
- mindspore/ops/_op_impl/tbe/clip_by_value_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/concat.py +0 -40
- mindspore/ops/_op_impl/tbe/concat_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/confusion_matrix.py +0 -63
- mindspore/ops/_op_impl/tbe/confusion_mul_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/confusion_softmax_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/confusion_transpose_d.py +0 -39
- mindspore/ops/_op_impl/tbe/conv2d.py +0 -47
- mindspore/ops/_op_impl/tbe/conv2d_backprop_filter.py +0 -42
- mindspore/ops/_op_impl/tbe/conv2d_backprop_filter_ds.py +0 -43
- mindspore/ops/_op_impl/tbe/conv2d_backprop_input.py +0 -42
- mindspore/ops/_op_impl/tbe/conv2d_backprop_input_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/conv2d_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/conv2d_transpose.py +0 -48
- mindspore/ops/_op_impl/tbe/conv3d.py +0 -45
- mindspore/ops/_op_impl/tbe/conv3d_backprop_filter.py +0 -42
- mindspore/ops/_op_impl/tbe/conv3d_backprop_input.py +0 -42
- mindspore/ops/_op_impl/tbe/conv3d_transpose.py +0 -47
- mindspore/ops/_op_impl/tbe/conv3d_transpose_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/cos.py +0 -37
- mindspore/ops/_op_impl/tbe/cos_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/cosh.py +0 -37
- mindspore/ops/_op_impl/tbe/cosh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/ctc_loss_v2.py +0 -42
- mindspore/ops/_op_impl/tbe/ctc_loss_v2_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/cum_sum.py +0 -42
- mindspore/ops/_op_impl/tbe/cum_sum_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/cummin.py +0 -41
- mindspore/ops/_op_impl/tbe/cumprod.py +0 -42
- mindspore/ops/_op_impl/tbe/data_format_dim_map.py +0 -38
- mindspore/ops/_op_impl/tbe/data_format_dim_map_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/deformable_offsets.py +0 -45
- mindspore/ops/_op_impl/tbe/deformable_offsets_grad.py +0 -48
- mindspore/ops/_op_impl/tbe/depth_to_space_ds.py +0 -49
- mindspore/ops/_op_impl/tbe/depthwise_conv2d.py +0 -44
- mindspore/ops/_op_impl/tbe/depthwise_conv2d_backprop_filter.py +0 -41
- mindspore/ops/_op_impl/tbe/depthwise_conv2d_backprop_input.py +0 -41
- mindspore/ops/_op_impl/tbe/diag.py +0 -38
- mindspore/ops/_op_impl/tbe/diag_part.py +0 -38
- mindspore/ops/_op_impl/tbe/dilation.py +0 -40
- mindspore/ops/_op_impl/tbe/div.py +0 -41
- mindspore/ops/_op_impl/tbe/div_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/div_no_nan.py +0 -41
- mindspore/ops/_op_impl/tbe/div_no_nan_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/dropout_do_mask.py +0 -38
- mindspore/ops/_op_impl/tbe/dropout_do_mask_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/dropout_do_mask_v3.py +0 -39
- mindspore/ops/_op_impl/tbe/dynamic_atomic_addr_clean.py +0 -34
- mindspore/ops/_op_impl/tbe/dynamic_gru_v2.py +0 -95
- mindspore/ops/_op_impl/tbe/dynamic_rnn.py +0 -82
- mindspore/ops/_op_impl/tbe/elu.py +0 -38
- mindspore/ops/_op_impl/tbe/elu_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/elu_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/elu_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/equal.py +0 -42
- mindspore/ops/_op_impl/tbe/equal_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/erf.py +0 -37
- mindspore/ops/_op_impl/tbe/erf_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/erfc.py +0 -37
- mindspore/ops/_op_impl/tbe/erfc_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/erfinv.py +0 -36
- mindspore/ops/_op_impl/tbe/exp.py +0 -40
- mindspore/ops/_op_impl/tbe/exp_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/expand_dims.py +0 -38
- mindspore/ops/_op_impl/tbe/expm1.py +0 -37
- mindspore/ops/_op_impl/tbe/expm1_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/extract_image_patches.py +0 -41
- mindspore/ops/_op_impl/tbe/extract_volume_patches.py +0 -39
- mindspore/ops/_op_impl/tbe/fake_quant_with_min_max_vars.py +0 -39
- mindspore/ops/_op_impl/tbe/fake_quant_with_min_max_vars_gradient.py +0 -43
- mindspore/ops/_op_impl/tbe/fake_quant_with_min_max_vars_per_channel.py +0 -39
- mindspore/ops/_op_impl/tbe/fake_quant_with_min_max_vars_per_channel_gradient.py +0 -43
- mindspore/ops/_op_impl/tbe/fast_gelu.py +0 -37
- mindspore/ops/_op_impl/tbe/fast_gelu_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/fast_gelu_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/fast_gelu_grad_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/fill.py +0 -56
- mindspore/ops/_op_impl/tbe/fill_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/flatten.py +0 -48
- mindspore/ops/_op_impl/tbe/floor.py +0 -37
- mindspore/ops/_op_impl/tbe/floor_div.py +0 -41
- mindspore/ops/_op_impl/tbe/floor_div_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/floor_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/floor_mod.py +0 -39
- mindspore/ops/_op_impl/tbe/floor_mod_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/fused_dbn_dw.py +0 -52
- mindspore/ops/_op_impl/tbe/fused_mul_add.py +0 -38
- mindspore/ops/_op_impl/tbe/fused_mul_add_n.py +0 -48
- mindspore/ops/_op_impl/tbe/fused_mul_add_n_l2loss.py +0 -53
- mindspore/ops/_op_impl/tbe/fused_mul_apply_momentum.py +0 -57
- mindspore/ops/_op_impl/tbe/fused_mul_apply_momentum_extern.py +0 -67
- mindspore/ops/_op_impl/tbe/gather_nd.py +0 -52
- mindspore/ops/_op_impl/tbe/gather_nd_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/gather_v2.py +0 -56
- mindspore/ops/_op_impl/tbe/gather_v2_ds.py +0 -68
- mindspore/ops/_op_impl/tbe/gelu.py +0 -37
- mindspore/ops/_op_impl/tbe/gelu_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/gelu_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/gelu_grad_ds.py +0 -43
- mindspore/ops/_op_impl/tbe/ger.py +0 -43
- mindspore/ops/_op_impl/tbe/ger_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/greater.py +0 -43
- mindspore/ops/_op_impl/tbe/greater_equal.py +0 -41
- mindspore/ops/_op_impl/tbe/greater_equal_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/gru_v2_hidden_grad.py +0 -51
- mindspore/ops/_op_impl/tbe/gru_v2_hidden_grad_cell.py +0 -52
- mindspore/ops/_op_impl/tbe/hard_swish.py +0 -37
- mindspore/ops/_op_impl/tbe/hard_swish_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/hard_swish_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/hard_swish_grad_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/histogram_fixed_width.py +0 -40
- mindspore/ops/_op_impl/tbe/hshrink.py +0 -33
- mindspore/ops/_op_impl/tbe/hshrink_grad.py +0 -37
- mindspore/ops/_op_impl/tbe/hsigmoid.py +0 -45
- mindspore/ops/_op_impl/tbe/hsigmoid_grad.py +0 -39
- mindspore/ops/_op_impl/tbe/ifmr.py +0 -47
- mindspore/ops/_op_impl/tbe/ifmr_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/im2col.py +0 -42
- mindspore/ops/_op_impl/tbe/in_top_k.py +0 -37
- mindspore/ops/_op_impl/tbe/inplace_add.py +0 -39
- mindspore/ops/_op_impl/tbe/inplace_index_add.py +0 -46
- mindspore/ops/_op_impl/tbe/inplace_sub.py +0 -39
- mindspore/ops/_op_impl/tbe/inplace_update.py +0 -39
- mindspore/ops/_op_impl/tbe/inplace_update_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/inv.py +0 -38
- mindspore/ops/_op_impl/tbe/inv_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/inv_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/inv_grad_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/invert.py +0 -37
- mindspore/ops/_op_impl/tbe/invert_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/iou.py +0 -38
- mindspore/ops/_op_impl/tbe/iou_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/is_close.py +0 -40
- mindspore/ops/_op_impl/tbe/kl_div_loss.py +0 -38
- mindspore/ops/_op_impl/tbe/kl_div_loss_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/kl_div_loss_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/l2_loss.py +0 -36
- mindspore/ops/_op_impl/tbe/l2_loss_ds.py +0 -37
- mindspore/ops/_op_impl/tbe/l2_normalize.py +0 -38
- mindspore/ops/_op_impl/tbe/l2_normalize_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/lamb_apply_optimizer_assign.py +0 -55
- mindspore/ops/_op_impl/tbe/lamb_apply_weight_assign.py +0 -42
- mindspore/ops/_op_impl/tbe/lamb_next_mv.py +0 -59
- mindspore/ops/_op_impl/tbe/lamb_next_mv_with_decay.py +0 -59
- mindspore/ops/_op_impl/tbe/lamb_next_right.py +0 -44
- mindspore/ops/_op_impl/tbe/lamb_update_with_lr.py +0 -48
- mindspore/ops/_op_impl/tbe/lamb_update_with_lr_v2.py +0 -44
- mindspore/ops/_op_impl/tbe/lars_update.py +0 -50
- mindspore/ops/_op_impl/tbe/lars_update_ds.py +0 -51
- mindspore/ops/_op_impl/tbe/layer_norm.py +0 -46
- mindspore/ops/_op_impl/tbe/layer_norm_beta_gamma_backprop.py +0 -44
- mindspore/ops/_op_impl/tbe/layer_norm_beta_gamma_backprop_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/layer_norm_beta_gamma_backprop_v2.py +0 -40
- mindspore/ops/_op_impl/tbe/layer_norm_beta_gamma_backprop_v2_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/layer_norm_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/layer_norm_grad.py +0 -48
- mindspore/ops/_op_impl/tbe/layer_norm_x_backprop.py +0 -43
- mindspore/ops/_op_impl/tbe/layer_norm_x_backprop_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/layer_norm_x_backprop_v2.py +0 -45
- mindspore/ops/_op_impl/tbe/layer_norm_x_backprop_v2_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/lerp.py +0 -38
- mindspore/ops/_op_impl/tbe/less.py +0 -41
- mindspore/ops/_op_impl/tbe/less_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/less_equal.py +0 -41
- mindspore/ops/_op_impl/tbe/less_equal_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/log.py +0 -40
- mindspore/ops/_op_impl/tbe/log1p.py +0 -37
- mindspore/ops/_op_impl/tbe/log1p_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/log_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/logical_and.py +0 -37
- mindspore/ops/_op_impl/tbe/logical_and_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/logical_not.py +0 -36
- mindspore/ops/_op_impl/tbe/logical_not_ds.py +0 -37
- mindspore/ops/_op_impl/tbe/logical_or.py +0 -37
- mindspore/ops/_op_impl/tbe/logical_or_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/logsoftmax.py +0 -37
- mindspore/ops/_op_impl/tbe/logsoftmax_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/logsoftmax_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/logsoftmax_grad_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/lp_norm.py +0 -40
- mindspore/ops/_op_impl/tbe/lp_norm_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/lrn.py +0 -41
- mindspore/ops/_op_impl/tbe/lrn_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/lstm_input_grad.py +0 -51
- mindspore/ops/_op_impl/tbe/masked_fill.py +0 -40
- mindspore/ops/_op_impl/tbe/masked_fill_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/matmul.py +0 -53
- mindspore/ops/_op_impl/tbe/matmul_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/matmul_v2.py +0 -50
- mindspore/ops/_op_impl/tbe/matrix_diag.py +0 -45
- mindspore/ops/_op_impl/tbe/matrix_diag_part.py +0 -45
- mindspore/ops/_op_impl/tbe/matrix_set_diag.py +0 -46
- mindspore/ops/_op_impl/tbe/max_pool.py +0 -39
- mindspore/ops/_op_impl/tbe/max_pool3d.py +0 -44
- mindspore/ops/_op_impl/tbe/max_pool3d_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/max_pool3d_grad_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/max_pool_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/max_pool_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/max_pool_grad_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/max_pool_grad_grad_with_argmax.py +0 -41
- mindspore/ops/_op_impl/tbe/max_pool_grad_with_argmax.py +0 -42
- mindspore/ops/_op_impl/tbe/max_pool_with_argmax.py +0 -40
- mindspore/ops/_op_impl/tbe/maximum.py +0 -39
- mindspore/ops/_op_impl/tbe/maximum_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/maximum_grad.py +0 -46
- mindspore/ops/_op_impl/tbe/maximum_grad_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/mem_set.py +0 -38
- mindspore/ops/_op_impl/tbe/minimum.py +0 -40
- mindspore/ops/_op_impl/tbe/minimum_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/minimum_grad.py +0 -46
- mindspore/ops/_op_impl/tbe/minimum_grad_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/mish.py +0 -37
- mindspore/ops/_op_impl/tbe/mod.py +0 -41
- mindspore/ops/_op_impl/tbe/mod_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/mul.py +0 -37
- mindspore/ops/_op_impl/tbe/mul_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/mul_no_nan.py +0 -39
- mindspore/ops/_op_impl/tbe/mul_no_nan_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/multilabel_margin_loss.py +0 -39
- mindspore/ops/_op_impl/tbe/neg.py +0 -39
- mindspore/ops/_op_impl/tbe/neg_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/new_im2col.py +0 -40
- mindspore/ops/_op_impl/tbe/nll_loss.py +0 -41
- mindspore/ops/_op_impl/tbe/nll_loss_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/nms_with_mask.py +0 -39
- mindspore/ops/_op_impl/tbe/not_equal.py +0 -41
- mindspore/ops/_op_impl/tbe/not_equal_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/npu_alloc_float_status.py +0 -34
- mindspore/ops/_op_impl/tbe/npu_clear_float_status.py +0 -35
- mindspore/ops/_op_impl/tbe/npu_clear_float_status_v2.py +0 -35
- mindspore/ops/_op_impl/tbe/npu_get_float_status.py +0 -35
- mindspore/ops/_op_impl/tbe/npu_get_float_status_v2.py +0 -35
- mindspore/ops/_op_impl/tbe/one_hot.py +0 -48
- mindspore/ops/_op_impl/tbe/one_hot_ds.py +0 -45
- mindspore/ops/_op_impl/tbe/ones_like.py +0 -40
- mindspore/ops/_op_impl/tbe/ones_like_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/p_s_r_o_i_pooling.py +0 -40
- mindspore/ops/_op_impl/tbe/p_s_r_o_i_pooling_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/pack.py +0 -58
- mindspore/ops/_op_impl/tbe/pack_ds.py +0 -59
- mindspore/ops/_op_impl/tbe/pad_d.py +0 -40
- mindspore/ops/_op_impl/tbe/pad_d_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/parallel_concat.py +0 -70
- mindspore/ops/_op_impl/tbe/parallel_resize_bilinear.py +0 -45
- mindspore/ops/_op_impl/tbe/parallel_resize_bilinear_grad.py +0 -44
- mindspore/ops/_op_impl/tbe/pdist.py +0 -36
- mindspore/ops/_op_impl/tbe/pooling.py +0 -46
- mindspore/ops/_op_impl/tbe/population_count.py +0 -38
- mindspore/ops/_op_impl/tbe/pow.py +0 -41
- mindspore/ops/_op_impl/tbe/pow_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/prelu.py +0 -37
- mindspore/ops/_op_impl/tbe/prelu_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/prelu_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/range.py +0 -39
- mindspore/ops/_op_impl/tbe/real_div.py +0 -38
- mindspore/ops/_op_impl/tbe/real_div_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/reciprocal.py +0 -36
- mindspore/ops/_op_impl/tbe/reciprocal_ds.py +0 -37
- mindspore/ops/_op_impl/tbe/reciprocal_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/reciprocal_grad_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/reduce_all.py +0 -38
- mindspore/ops/_op_impl/tbe/reduce_all_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/reduce_any.py +0 -38
- mindspore/ops/_op_impl/tbe/reduce_any_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/reduce_max.py +0 -43
- mindspore/ops/_op_impl/tbe/reduce_max_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/reduce_mean.py +0 -40
- mindspore/ops/_op_impl/tbe/reduce_mean_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/reduce_min.py +0 -41
- mindspore/ops/_op_impl/tbe/reduce_min_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/reduce_prod.py +0 -42
- mindspore/ops/_op_impl/tbe/reduce_prod_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/reduce_std.py +0 -44
- mindspore/ops/_op_impl/tbe/reduce_sum.py +0 -39
- mindspore/ops/_op_impl/tbe/reduce_sum_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/relu.py +0 -39
- mindspore/ops/_op_impl/tbe/relu6.py +0 -38
- mindspore/ops/_op_impl/tbe/relu6_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/relu6_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/relu6_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/relu_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/relu_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/relu_grad_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/relu_grad_v2.py +0 -40
- mindspore/ops/_op_impl/tbe/relu_grad_v2_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/relu_v2.py +0 -40
- mindspore/ops/_op_impl/tbe/relu_v2_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/renorm.py +0 -39
- mindspore/ops/_op_impl/tbe/resize_bilinear.py +0 -40
- mindspore/ops/_op_impl/tbe/resize_bilinear_grad.py +0 -41
- mindspore/ops/_op_impl/tbe/resize_bilinear_v2.py +0 -43
- mindspore/ops/_op_impl/tbe/resize_nearest_neighbor.py +0 -40
- mindspore/ops/_op_impl/tbe/resize_nearest_neighbor_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/resize_nearest_neighbor_grad.py +0 -39
- mindspore/ops/_op_impl/tbe/resize_nearest_neighbor_grad_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/reverse_v2_d.py +0 -37
- mindspore/ops/_op_impl/tbe/rint.py +0 -37
- mindspore/ops/_op_impl/tbe/rint_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/roi_align.py +0 -43
- mindspore/ops/_op_impl/tbe/roi_align_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/roi_align_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/roi_align_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/roll.py +0 -42
- mindspore/ops/_op_impl/tbe/round.py +0 -38
- mindspore/ops/_op_impl/tbe/round_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/rsqrt.py +0 -37
- mindspore/ops/_op_impl/tbe/rsqrt_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/rsqrt_grad.py +0 -40
- mindspore/ops/_op_impl/tbe/rsqrt_grad_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/scatter_add.py +0 -44
- mindspore/ops/_op_impl/tbe/scatter_div.py +0 -46
- mindspore/ops/_op_impl/tbe/scatter_max.py +0 -45
- mindspore/ops/_op_impl/tbe/scatter_min.py +0 -45
- mindspore/ops/_op_impl/tbe/scatter_mul.py +0 -44
- mindspore/ops/_op_impl/tbe/scatter_nd.py +0 -41
- mindspore/ops/_op_impl/tbe/scatter_nd_add.py +0 -45
- mindspore/ops/_op_impl/tbe/scatter_nd_d.py +0 -41
- mindspore/ops/_op_impl/tbe/scatter_nd_ds.py +0 -49
- mindspore/ops/_op_impl/tbe/scatter_nd_sub.py +0 -47
- mindspore/ops/_op_impl/tbe/scatter_nd_sub_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/scatter_nd_update.py +0 -47
- mindspore/ops/_op_impl/tbe/scatter_nd_update_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/scatter_non_aliasing_add.py +0 -39
- mindspore/ops/_op_impl/tbe/scatter_non_aliasing_add_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/scatter_sub.py +0 -47
- mindspore/ops/_op_impl/tbe/scatter_sub_ds.py +0 -48
- mindspore/ops/_op_impl/tbe/scatter_update.py +0 -43
- mindspore/ops/_op_impl/tbe/select.py +0 -38
- mindspore/ops/_op_impl/tbe/select_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/selu.py +0 -39
- mindspore/ops/_op_impl/tbe/selu_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/sgd.py +0 -62
- mindspore/ops/_op_impl/tbe/sigmoid.py +0 -37
- mindspore/ops/_op_impl/tbe/sigmoid_cross_entropy_with_logits.py +0 -41
- mindspore/ops/_op_impl/tbe/sigmoid_cross_entropy_with_logits_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/sigmoid_cross_entropy_with_logits_grad.py +0 -42
- mindspore/ops/_op_impl/tbe/sigmoid_cross_entropy_with_logits_grad_ds.py +0 -43
- mindspore/ops/_op_impl/tbe/sigmoid_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/sigmoid_grad.py +0 -39
- mindspore/ops/_op_impl/tbe/sigmoid_grad_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/sign.py +0 -38
- mindspore/ops/_op_impl/tbe/sign_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/sin.py +0 -37
- mindspore/ops/_op_impl/tbe/sin_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/sinh.py +0 -37
- mindspore/ops/_op_impl/tbe/sinh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/slice.py +0 -58
- mindspore/ops/_op_impl/tbe/smooth_l1_loss.py +0 -45
- mindspore/ops/_op_impl/tbe/smooth_l1_loss_ds.py +0 -46
- mindspore/ops/_op_impl/tbe/smooth_l1_loss_grad.py +0 -46
- mindspore/ops/_op_impl/tbe/smooth_l1_loss_grad_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/soft_margin_loss.py +0 -38
- mindspore/ops/_op_impl/tbe/soft_margin_loss_grad.py +0 -39
- mindspore/ops/_op_impl/tbe/soft_shrink.py +0 -36
- mindspore/ops/_op_impl/tbe/soft_shrink_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/softmax.py +0 -37
- mindspore/ops/_op_impl/tbe/softmax_cross_entropy_with_logits.py +0 -38
- mindspore/ops/_op_impl/tbe/softmax_cross_entropy_with_logits_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/softmax_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/softmax_grad_ext.py +0 -42
- mindspore/ops/_op_impl/tbe/softmax_v2_with_dropout_do_mask_v3.py +0 -39
- mindspore/ops/_op_impl/tbe/softplus.py +0 -37
- mindspore/ops/_op_impl/tbe/softplus_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/softplus_grad.py +0 -38
- mindspore/ops/_op_impl/tbe/softplus_grad_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/softsign.py +0 -37
- mindspore/ops/_op_impl/tbe/softsign_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/sort.py +0 -38
- mindspore/ops/_op_impl/tbe/sort_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/space_to_batch.py +0 -38
- mindspore/ops/_op_impl/tbe/space_to_batch_nd.py +0 -38
- mindspore/ops/_op_impl/tbe/space_to_depth.py +0 -47
- mindspore/ops/_op_impl/tbe/sparse_apply_adadelta.py +0 -56
- mindspore/ops/_op_impl/tbe/sparse_apply_adagrad.py +0 -45
- mindspore/ops/_op_impl/tbe/sparse_apply_adagrad_ds.py +0 -46
- mindspore/ops/_op_impl/tbe/sparse_apply_adagrad_v2.py +0 -46
- mindspore/ops/_op_impl/tbe/sparse_apply_adagrad_v2_ds.py +0 -47
- mindspore/ops/_op_impl/tbe/sparse_apply_ftrl_d.py +0 -53
- mindspore/ops/_op_impl/tbe/sparse_apply_ftrl_d_ds.py +0 -50
- mindspore/ops/_op_impl/tbe/sparse_apply_ftrl_v2.py +0 -50
- mindspore/ops/_op_impl/tbe/sparse_apply_proximal_adagrad.py +0 -66
- mindspore/ops/_op_impl/tbe/sparse_apply_proximal_adagrad_ds.py +0 -67
- mindspore/ops/_op_impl/tbe/sparse_apply_r_m_s_prop.py +0 -57
- mindspore/ops/_op_impl/tbe/sparse_apply_r_m_s_prop_ds.py +0 -58
- mindspore/ops/_op_impl/tbe/sparse_gather_v2.py +0 -56
- mindspore/ops/_op_impl/tbe/sparse_gather_v2_ds.py +0 -58
- mindspore/ops/_op_impl/tbe/split_d.py +0 -38
- mindspore/ops/_op_impl/tbe/split_d_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/split_v.py +0 -39
- mindspore/ops/_op_impl/tbe/splitv.py +0 -39
- mindspore/ops/_op_impl/tbe/sqrt.py +0 -37
- mindspore/ops/_op_impl/tbe/sqrt_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/sqrt_grad.py +0 -43
- mindspore/ops/_op_impl/tbe/sqrt_grad_ds.py +0 -44
- mindspore/ops/_op_impl/tbe/square.py +0 -38
- mindspore/ops/_op_impl/tbe/square_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/square_sum_all.py +0 -40
- mindspore/ops/_op_impl/tbe/square_sum_all_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/square_sum_v1.py +0 -38
- mindspore/ops/_op_impl/tbe/square_sum_v1_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/square_sum_v2.py +0 -39
- mindspore/ops/_op_impl/tbe/squared_difference.py +0 -39
- mindspore/ops/_op_impl/tbe/squared_difference_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/squeeze.py +0 -37
- mindspore/ops/_op_impl/tbe/strided_read.py +0 -38
- mindspore/ops/_op_impl/tbe/strided_slice_d.py +0 -44
- mindspore/ops/_op_impl/tbe/strided_slice_ds.py +0 -71
- mindspore/ops/_op_impl/tbe/strided_slice_grad_d.py +0 -51
- mindspore/ops/_op_impl/tbe/strided_slice_grad_ds.py +0 -57
- mindspore/ops/_op_impl/tbe/strided_write.py +0 -38
- mindspore/ops/_op_impl/tbe/sub.py +0 -39
- mindspore/ops/_op_impl/tbe/sub_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/tan.py +0 -38
- mindspore/ops/_op_impl/tbe/tan_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/tanh.py +0 -37
- mindspore/ops/_op_impl/tbe/tanh_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/tanh_grad.py +0 -39
- mindspore/ops/_op_impl/tbe/tanh_grad_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/tensor_move.py +0 -49
- mindspore/ops/_op_impl/tbe/tensor_move_ds.py +0 -50
- mindspore/ops/_op_impl/tbe/tensor_scatter_update.py +0 -41
- mindspore/ops/_op_impl/tbe/tile.py +0 -37
- mindspore/ops/_op_impl/tbe/tile_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/top_k.py +0 -42
- mindspore/ops/_op_impl/tbe/top_k_ds.py +0 -43
- mindspore/ops/_op_impl/tbe/trans_data.py +0 -167
- mindspore/ops/_op_impl/tbe/trans_data_ds.py +0 -180
- mindspore/ops/_op_impl/tbe/trans_data_rnn.py +0 -44
- mindspore/ops/_op_impl/tbe/transpose.py +0 -60
- mindspore/ops/_op_impl/tbe/transpose_d.py +0 -47
- mindspore/ops/_op_impl/tbe/transpose_nod.py +0 -60
- mindspore/ops/_op_impl/tbe/trunc.py +0 -39
- mindspore/ops/_op_impl/tbe/truncate_div.py +0 -41
- mindspore/ops/_op_impl/tbe/truncate_div_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/truncate_mod.py +0 -41
- mindspore/ops/_op_impl/tbe/truncate_mod_ds.py +0 -42
- mindspore/ops/_op_impl/tbe/unpack.py +0 -38
- mindspore/ops/_op_impl/tbe/unpack_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/unsorted_segment_max.py +0 -49
- mindspore/ops/_op_impl/tbe/unsorted_segment_max_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/unsorted_segment_min.py +0 -49
- mindspore/ops/_op_impl/tbe/unsorted_segment_min_ds.py +0 -40
- mindspore/ops/_op_impl/tbe/unsorted_segment_prod.py +0 -49
- mindspore/ops/_op_impl/tbe/unsorted_segment_prod_ds.py +0 -38
- mindspore/ops/_op_impl/tbe/unsorted_segment_sum.py +0 -38
- mindspore/ops/_op_impl/tbe/unsorted_segment_sum_ds.py +0 -41
- mindspore/ops/_op_impl/tbe/wts_arq.py +0 -40
- mindspore/ops/_op_impl/tbe/xdivy.py +0 -38
- mindspore/ops/_op_impl/tbe/xdivy_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/xlogy.py +0 -38
- mindspore/ops/_op_impl/tbe/xlogy_ds.py +0 -39
- mindspore/ops/_op_impl/tbe/zeros_like.py +0 -41
- mindspore/ops/_op_impl/tbe/zeros_like_ds.py +0 -42
- mindspore/ops/_tracefunc.py +0 -241
- mindspore/ops/arg_dtype_cast.py +0 -54
- mindspore/profiler/parser/msadvisor_analyzer.py +0 -80
- mindspore/profiler/parser/msadvisor_parser.py +0 -234
- mindspore/rewrite/api/tree_node_helper.py +0 -60
- mindspore/rewrite/ast_helpers/ast_creator.py +0 -115
- mindspore/rewrite/ast_transformers/flatten_recursive_stmt.py +0 -267
- mindspore/rewrite/ast_transformers/remove_return_out_of_if.py +0 -228
- mindspore/rewrite/namespace.py +0 -53
- mindspore-2.2.11.dist-info/RECORD +0 -1906
- {mindspore-2.2.11.dist-info → mindspore-2.4.0.dist-info}/WHEEL +0 -0
- {mindspore-2.2.11.dist-info → mindspore-2.4.0.dist-info}/top_level.txt +0 -0
mindspore/.commit_id
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__commit_id__ = ''[sha1]:
|
|
1
|
+
__commit_id__ = ''[sha1]:8c86f33f,[branch]:(HEAD,origin/master,origin/HEAD,master)''
|
mindspore/__init__.py
CHANGED
|
@@ -17,25 +17,29 @@ from __future__ import absolute_import
|
|
|
17
17
|
|
|
18
18
|
from mindspore.run_check import run_check
|
|
19
19
|
from mindspore import common, dataset, mindrecord, train, log, amp
|
|
20
|
-
from mindspore import profiler, communication, numpy, parallel
|
|
20
|
+
from mindspore import profiler, communication, numpy, parallel, hal
|
|
21
21
|
from mindspore.common import *
|
|
22
22
|
from mindspore.mindrecord import *
|
|
23
|
-
from mindspore.ops import _op_impl, grad, value_and_grad, vjp, jvp, jacfwd, jacrev, vmap, get_grad, constexpr
|
|
23
|
+
from mindspore.ops import _op_impl, grad, value_and_grad, vjp, jvp, jacfwd, jacrev, vmap, get_grad, constexpr, reshard
|
|
24
24
|
from mindspore.train import *
|
|
25
25
|
from mindspore.log import *
|
|
26
|
+
from mindspore.utils import *
|
|
26
27
|
from mindspore.context import GRAPH_MODE, PYNATIVE_MODE, set_context, get_context, set_auto_parallel_context, \
|
|
27
28
|
get_auto_parallel_context, reset_auto_parallel_context, ParallelMode, set_ps_context, \
|
|
28
29
|
get_ps_context, reset_ps_context, set_offload_context, get_offload_context, STRICT, COMPATIBLE, LAX
|
|
29
30
|
from mindspore.version import __version__
|
|
30
31
|
from mindspore.profiler import Profiler, EnvProfiler
|
|
31
32
|
from mindspore.parallel import set_algo_parameters, get_algo_parameters, reset_algo_parameters, \
|
|
32
|
-
rank_list_for_transform, transform_checkpoint_by_rank, transform_checkpoints, merge_pipeline_strategys, shard
|
|
33
|
-
|
|
33
|
+
rank_list_for_transform, transform_checkpoint_by_rank, transform_checkpoints, merge_pipeline_strategys, shard, \
|
|
34
|
+
Layout, sync_pipeline_shared_parameters, parameter_broadcast, load_segmented_checkpoints, \
|
|
35
|
+
safetensors_to_ckpt, ckpt_to_safetensors, unified_safetensors
|
|
36
|
+
from mindspore.rewrite import SymbolTree, ScopedValue, Node, NodeType
|
|
34
37
|
from mindspore.safeguard import obfuscate_ckpt, load_obf_params_into_net
|
|
35
38
|
from mindspore._check_jit_forbidden_api import get_obj_module_and_name_info, is_jit_forbidden_module, \
|
|
36
39
|
is_invalid_or_jit_forbidden_method
|
|
37
40
|
from mindspore import _install_custom
|
|
38
|
-
|
|
41
|
+
from mindspore import mint
|
|
42
|
+
from mindspore.ops_generate import arg_dtype_cast, arg_handler
|
|
39
43
|
|
|
40
44
|
__all__ = ["run_check"]
|
|
41
45
|
__all__.extend(__version__)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
mindspore/_checkparam.py
CHANGED
|
@@ -18,6 +18,7 @@ from __future__ import absolute_import
|
|
|
18
18
|
import re
|
|
19
19
|
import inspect
|
|
20
20
|
import math
|
|
21
|
+
from types import FunctionType, MethodType
|
|
21
22
|
from functools import reduce, wraps
|
|
22
23
|
from itertools import repeat
|
|
23
24
|
from collections.abc import Iterable
|
|
@@ -28,7 +29,6 @@ from mindspore import log as logger
|
|
|
28
29
|
from mindspore.common import dtype as mstype
|
|
29
30
|
from mindspore._c_expression import Tensor as Tensor_
|
|
30
31
|
|
|
31
|
-
|
|
32
32
|
EQ = 1 # ==
|
|
33
33
|
NE = 2 # !=
|
|
34
34
|
LT = 3 # <
|
|
@@ -147,7 +147,7 @@ def _check_3d_int_or_tuple(arg_name, arg_value, prim_name, allow_five=False, ret
|
|
|
147
147
|
ret = (1, 1, arg_value, arg_value, arg_value) if ret_five else (arg_value, arg_value, arg_value)
|
|
148
148
|
elif len(arg_value) == 3:
|
|
149
149
|
ret = (1, 1, arg_value[0], arg_value[1], arg_value[2]) if ret_five else arg_value
|
|
150
|
-
else:
|
|
150
|
+
else: # case: len(arg_value) == 5
|
|
151
151
|
ret = arg_value if ret_five else (arg_value[2], arg_value[3], arg_value[4])
|
|
152
152
|
|
|
153
153
|
return ret
|
|
@@ -239,6 +239,7 @@ def check_is_number(arg_value, arg_type, arg_name=None, prim_name=None):
|
|
|
239
239
|
else:
|
|
240
240
|
raise TypeError(f"{prim_name} type of {arg_name} must be '{arg_type.__name__}', " \
|
|
241
241
|
f"but got '{type(arg_value).__name__}'.")
|
|
242
|
+
|
|
242
243
|
_check_param()
|
|
243
244
|
return arg_value
|
|
244
245
|
|
|
@@ -264,6 +265,7 @@ def check_number_range(arg_value, lower_limit, upper_limit, rel, value_type, arg
|
|
|
264
265
|
rel_str = _format_str_two_value(lower_limit, upper_limit, rel)
|
|
265
266
|
raise ValueError(f"{prim_name} {arg_name} must be in range of {rel_str}, " \
|
|
266
267
|
f"but got {arg_value} with type '{type(arg_value).__name__}'.")
|
|
268
|
+
|
|
267
269
|
_check_param()
|
|
268
270
|
return arg_value
|
|
269
271
|
|
|
@@ -273,6 +275,7 @@ def check(arg_name, arg_value, value_name, value, rel=EQ, prim_name=None, excp_c
|
|
|
273
275
|
Method for judging relation between two int values or list/tuple made up of ints.
|
|
274
276
|
This method is not suitable for judging relation between floats, since it does not consider float error.
|
|
275
277
|
"""
|
|
278
|
+
|
|
276
279
|
def _check():
|
|
277
280
|
if not _check_binary_rel(arg_value, value, rel):
|
|
278
281
|
rel_str = _format_str_one_value(f'{value_name}: {value}', rel)
|
|
@@ -474,20 +477,24 @@ def check_non_negative_float(arg_value, arg_name=None, prim_name=None):
|
|
|
474
477
|
|
|
475
478
|
def check_number(arg_name, arg_value, value, rel, prim_name):
|
|
476
479
|
"""Number value judgment."""
|
|
480
|
+
|
|
477
481
|
def _check():
|
|
478
482
|
if not _check_binary_rel(arg_value, value, rel):
|
|
479
483
|
rel_str = _format_str_one_value(value, rel)
|
|
480
484
|
raise ValueError(f'For \'{prim_name}\', the argument \'{arg_name}\' ' \
|
|
481
485
|
f'must {rel_str}, but got {arg_value}.')
|
|
486
|
+
|
|
482
487
|
_check()
|
|
483
488
|
return arg_value
|
|
484
489
|
|
|
485
490
|
|
|
486
491
|
def check_isinstance(arg_name, arg_value, classes):
|
|
487
492
|
"""Check arg isinstance of classes"""
|
|
493
|
+
|
|
488
494
|
def _check():
|
|
489
495
|
if not isinstance(arg_value, classes):
|
|
490
496
|
raise ValueError(f'The parameter \'{arg_name}\' must be isinstance of {classes}, but got {arg_value}.')
|
|
497
|
+
|
|
491
498
|
_check()
|
|
492
499
|
return arg_value
|
|
493
500
|
|
|
@@ -506,6 +513,7 @@ def check_bool(arg_value, arg_name=None, prim_name=None):
|
|
|
506
513
|
def _check():
|
|
507
514
|
if not isinstance(arg_value, bool):
|
|
508
515
|
raise TypeError(f"{prim_name} {arg_name} must be a bool, but got {type(arg_value).__name__}.")
|
|
516
|
+
|
|
509
517
|
_check()
|
|
510
518
|
return arg_value
|
|
511
519
|
|
|
@@ -546,6 +554,7 @@ def check_string(arg_value, valid_values, arg_name=None, prim_name=None):
|
|
|
546
554
|
if not (isinstance(arg_value, str) and arg_value in valid_values):
|
|
547
555
|
raise ValueError(f"{msg_prefix} '{arg_name}' must be str and must be in '{valid_values}'," \
|
|
548
556
|
f" but got '{arg_value}'.")
|
|
557
|
+
|
|
549
558
|
_check()
|
|
550
559
|
return arg_value
|
|
551
560
|
|
|
@@ -625,10 +634,12 @@ def check_subclass(arg_name, type_, template_types, prim_name, addition_error_in
|
|
|
625
634
|
|
|
626
635
|
def check_valid_input(arg_name, arg_value, prim_name):
|
|
627
636
|
"""Checks valid value."""
|
|
637
|
+
|
|
628
638
|
def _check():
|
|
629
639
|
if arg_value is None:
|
|
630
640
|
raise ValueError(f"For \'{prim_name}\', the argument '{arg_name}'" \
|
|
631
641
|
f"can not be None, but got {arg_value}.")
|
|
642
|
+
|
|
632
643
|
_check()
|
|
633
644
|
return arg_value
|
|
634
645
|
|
|
@@ -785,6 +796,7 @@ def check_astype_dtype(dtype):
|
|
|
785
796
|
|
|
786
797
|
def check_transpose_axis(axes, ndim):
|
|
787
798
|
"""Check the axis argument for tensor.transpose"""
|
|
799
|
+
|
|
788
800
|
def _check_dim():
|
|
789
801
|
# if multiple arguments provided, it must be `ndim` number of ints
|
|
790
802
|
if len(axes) != ndim:
|
|
@@ -792,7 +804,7 @@ def check_transpose_axis(axes, ndim):
|
|
|
792
804
|
f"but got {len(axes)} in the number of axes.")
|
|
793
805
|
|
|
794
806
|
if not axes or (len(axes) == 1 and axes[0] is None):
|
|
795
|
-
return tuple(range(ndim-1, -1, -1))
|
|
807
|
+
return tuple(range(ndim - 1, -1, -1))
|
|
796
808
|
|
|
797
809
|
if len(axes) == 1:
|
|
798
810
|
perm = axes[0]
|
|
@@ -911,6 +923,7 @@ def prepare_shape_for_squeeze(shape, axes):
|
|
|
911
923
|
|
|
912
924
|
def check_axis_in_range(axis, ndim):
|
|
913
925
|
"""Checks axes are with the bounds of ndim"""
|
|
926
|
+
|
|
914
927
|
def _check():
|
|
915
928
|
if not isinstance(axis, int):
|
|
916
929
|
raise TypeError(f'The axes must be integers, but got {type(axis)}')
|
|
@@ -927,6 +940,7 @@ def check_axis_valid(axes, ndim):
|
|
|
927
940
|
Checks axes are valid given ndim, and returns axes that can be passed
|
|
928
941
|
to the built-in operator (non-negative, int or tuple)
|
|
929
942
|
"""
|
|
943
|
+
|
|
930
944
|
def _check_range(axes):
|
|
931
945
|
for axis in axes:
|
|
932
946
|
check_axis_in_range(axis, ndim)
|
|
@@ -976,16 +990,17 @@ def infer_out_shape(*shapes):
|
|
|
976
990
|
"""
|
|
977
991
|
Returns shape of output after broadcasting. Raises ValueError if shapes cannot be broadcast.
|
|
978
992
|
"""
|
|
993
|
+
|
|
979
994
|
def _check(items, max_size, shapes):
|
|
980
995
|
for item in items:
|
|
981
996
|
if item not in (1, max_size):
|
|
982
997
|
raise ValueError(f'For Tensor, the dimension on each axis must be 1 or the max value on the axis' \
|
|
983
998
|
f'to support broadcasting, but got shapes {shapes,}')
|
|
999
|
+
|
|
984
1000
|
shape_out = ()
|
|
985
1001
|
max_len = max([len(it) for it in shapes])
|
|
986
1002
|
for i in range(max_len):
|
|
987
|
-
items = [it[i-(max_len-len(it))] if i - (max_len - len(it))
|
|
988
|
-
>= 0 else 1 for it in shapes]
|
|
1003
|
+
items = [it[i - (max_len - len(it))] if i - (max_len - len(it)) >= 0 else 1 for it in shapes]
|
|
989
1004
|
max_size = 0 if 0 in items else max(items)
|
|
990
1005
|
_check(items, max_size, shapes)
|
|
991
1006
|
shape_out = shape_out + (max_size,)
|
|
@@ -1014,6 +1029,7 @@ def check_axis_type(axis, type_int=True, type_tuple=True, type_list=True):
|
|
|
1014
1029
|
|
|
1015
1030
|
def check_and_canonicalize_axes(axes, ndim):
|
|
1016
1031
|
"""Check whether the types and values of input axes are valid."""
|
|
1032
|
+
|
|
1017
1033
|
def _check(axes, ax, ndim):
|
|
1018
1034
|
if not isinstance(ax, int):
|
|
1019
1035
|
raise TypeError(f"Each axis should be integer, but got {type(ax)} in {axes}.")
|
|
@@ -1090,8 +1106,8 @@ def check_csr_tensor_shape(indptr_shp, indices_shp, values_shp, csr_shp):
|
|
|
1090
1106
|
f"{len(csr_shp)}")
|
|
1091
1107
|
if values_shp[1:] != csr_shp[2:]:
|
|
1092
1108
|
raise ValueError(f"CSRTensor's shape[2: ] must be equal to value's shape[1: ]," \
|
|
1093
|
-
f"but CSRTensor's shape[2: ] got: {csr_shp[2:
|
|
1094
|
-
f"got: {values_shp[1:
|
|
1109
|
+
f"but CSRTensor's shape[2: ] got: {csr_shp[2:]} and value's shape[1: ]" \
|
|
1110
|
+
f"got: {values_shp[1:]}")
|
|
1095
1111
|
|
|
1096
1112
|
|
|
1097
1113
|
def check_csr_tensor_dtype(indptr_dtype, indices_dtype):
|
|
@@ -1144,19 +1160,8 @@ def check_coo_tensor_dtype(indices_dtype):
|
|
|
1144
1160
|
f"{indices_dtype}.")
|
|
1145
1161
|
|
|
1146
1162
|
|
|
1147
|
-
def check_dynamic_shape(dyn_elem, actual_input, i):
|
|
1148
|
-
"""Check the consistency of dynamic shape tensors and actual input tensors."""
|
|
1149
|
-
if dyn_elem.dtype != actual_input.dtype:
|
|
1150
|
-
raise TypeError(f"The data type of '{i}'th args in actual input tensors should be '{dyn_elem.dtype}', " \
|
|
1151
|
-
f"but got '{actual_input.dtype}'.")
|
|
1152
|
-
if dyn_elem.ndim != actual_input.ndim:
|
|
1153
|
-
raise ValueError(f"The dimension of '{i}'th args in actual input tensors should be '{dyn_elem.ndim}', " \
|
|
1154
|
-
f"but got '{actual_input.ndim}'.")
|
|
1155
|
-
check_dyn_shape_value_equal(i, dyn_elem.shape, actual_input.shape)
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
1163
|
def check_element_type_of_iterable(arg_name, arg_value, valid_types, prim_name=None):
|
|
1159
|
-
"""Check type of the element of a iterabel object,
|
|
1164
|
+
"""Check type of the element of a iterabel object, except dict."""
|
|
1160
1165
|
check_value_type(arg_name, arg_value, [list, tuple], prim_name)
|
|
1161
1166
|
type_names = [t.__name__ if hasattr(t, '__name__') else str(t) for t in valid_types]
|
|
1162
1167
|
num_types = len(valid_types)
|
|
@@ -1196,12 +1201,61 @@ def check_size_and_element_type_of_tuple(arg_name, arg_value, expect_size, expec
|
|
|
1196
1201
|
check_element_type_of_iterable('arg_name', arg_value, [expect_element_type], prim_name)
|
|
1197
1202
|
|
|
1198
1203
|
|
|
1199
|
-
def
|
|
1200
|
-
"""Check
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1204
|
+
def _check_symbol(dyn_input, net_input, index, symbolic_shape_data):
|
|
1205
|
+
"""Check symbolic shape values."""
|
|
1206
|
+
actual_shape = net_input.shape
|
|
1207
|
+
for i, sym in enumerate(dyn_input.symbolic_shape):
|
|
1208
|
+
# the Symbol is converted to dict
|
|
1209
|
+
if not isinstance(sym, dict):
|
|
1210
|
+
continue
|
|
1211
|
+
# the value of symbols with same "id" should be equal.
|
|
1212
|
+
if "id" in sym:
|
|
1213
|
+
sym_id = sym["id"]
|
|
1214
|
+
k_idval = "unique_id_value_map"
|
|
1215
|
+
if k_idval not in symbolic_shape_data:
|
|
1216
|
+
symbolic_shape_data[k_idval] = {}
|
|
1217
|
+
unique_id_value = symbolic_shape_data[k_idval]
|
|
1218
|
+
if sym_id not in unique_id_value:
|
|
1219
|
+
unique_id_value[sym_id] = actual_shape[i]
|
|
1220
|
+
elif unique_id_value[sym_id] != actual_shape[i]:
|
|
1221
|
+
raise ValueError(
|
|
1222
|
+
f"The {i + 1}th shape value of {index + 1}th actual input args is a unique symbol, all values must "
|
|
1223
|
+
f"be the same. The previous value is {unique_id_value[sym_id]}, but the current value is "
|
|
1224
|
+
f"{actual_shape[i]}. Actual shape: {actual_shape}, axis: {i}.")
|
|
1225
|
+
# check the value in range [min, max].
|
|
1226
|
+
if "min" in sym and actual_shape[i] < sym["min"]:
|
|
1227
|
+
raise ValueError(
|
|
1228
|
+
f"The {i + 1}th shape value of {index + 1}th actual input args must be greater than or equal to the "
|
|
1229
|
+
f"'min' value '{sym['min']}' of `Symbol`, but got '{actual_shape[i]}'. Actual shape: {actual_shape}, "
|
|
1230
|
+
f"axis: {i}.")
|
|
1231
|
+
if "max" in sym and actual_shape[i] > sym["max"]:
|
|
1232
|
+
raise ValueError(
|
|
1233
|
+
f"The {i + 1}th shape value of {index + 1}th actual input args must be less than or equal to the "
|
|
1234
|
+
f"'max' value '{sym['max']}' of `Symbol`, but got '{actual_shape[i]}'. Actual shape: {actual_shape}, "
|
|
1235
|
+
f"axis: {i}.")
|
|
1236
|
+
# check the shape item that satisfies the "divisor * N + remainder, N >= 1".
|
|
1237
|
+
d = sym.get("divisor", 1)
|
|
1238
|
+
r = sym.get("remainder", 0)
|
|
1239
|
+
if actual_shape[i] < d or actual_shape[i] % d != r:
|
|
1240
|
+
raise ValueError(
|
|
1241
|
+
f"The {i + 1}th shape value of {index + 1}th actual input args must be match the 'divisor'(d) and "
|
|
1242
|
+
f"'remainder'(r) of `Symbol`. The value should be 'd * N + r' for 'N > 0', got d={d} and r={r}, but "
|
|
1243
|
+
f"actual shape value is '{actual_shape[i]}'. Actual shape: {actual_shape}, axis: {i}")
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
def check_symbolic_shape(dynamic_inputs, actual_inputs):
|
|
1247
|
+
"""Check the symboic shape"""
|
|
1248
|
+
symbolic_shape_data = {}
|
|
1249
|
+
|
|
1250
|
+
def run_check(dyn_inputs, net_inputs):
|
|
1251
|
+
"""the real checking function"""
|
|
1252
|
+
for index, (dyn_input, net_input) in enumerate(zip(dyn_inputs, net_inputs)):
|
|
1253
|
+
if isinstance(dyn_input, (tuple, list)):
|
|
1254
|
+
run_check(dyn_input, net_input)
|
|
1255
|
+
elif hasattr(dyn_input, "symbolic_shape"):
|
|
1256
|
+
_check_symbol(dyn_input, net_input, index, symbolic_shape_data)
|
|
1257
|
+
|
|
1258
|
+
run_check(dynamic_inputs, actual_inputs)
|
|
1205
1259
|
|
|
1206
1260
|
|
|
1207
1261
|
def check_input_format(input_param):
|
|
@@ -1317,4 +1371,49 @@ def args_type_check(*type_args, **type_kwargs):
|
|
|
1317
1371
|
return type_check
|
|
1318
1372
|
|
|
1319
1373
|
|
|
1374
|
+
def check_hook_fn(hook_type, hook_fn):
|
|
1375
|
+
"""Check hook fn"""
|
|
1376
|
+
if context.get_context("mode") != context.PYNATIVE_MODE:
|
|
1377
|
+
logger.warning(f"'{hook_type}' function is only supported in pynative mode, you can use "
|
|
1378
|
+
f"context.set_context to set pynative mode.")
|
|
1379
|
+
return False
|
|
1380
|
+
|
|
1381
|
+
if not isinstance(hook_fn, (FunctionType, MethodType)):
|
|
1382
|
+
raise TypeError(f"When using 'hook_type(hook_fn)', the type of 'hook_fn' must be python "
|
|
1383
|
+
f"function, but got {type(hook_fn)}.")
|
|
1384
|
+
|
|
1385
|
+
if hook_fn.__code__.co_name == "staging_specialize":
|
|
1386
|
+
raise TypeError(f"Decorating hook function {hook_fn.__name__} with '@jit' is not supported.")
|
|
1387
|
+
|
|
1388
|
+
tensor_hook_func_args_num = 1
|
|
1389
|
+
pre_hook_func_args_num = 2
|
|
1390
|
+
forward_hook_and_backward_hook_func_args_num = 3
|
|
1391
|
+
# Real args number, exclude class method self param
|
|
1392
|
+
hook_fn_args_num = len(inspect.signature(hook_fn).parameters)
|
|
1393
|
+
|
|
1394
|
+
if hook_type == "register_hook" and hook_fn_args_num != tensor_hook_func_args_num:
|
|
1395
|
+
raise TypeError(f"Tensor hook function {hook_fn.__name__} arg num should be {tensor_hook_func_args_num}, but "
|
|
1396
|
+
f"got {hook_fn_args_num}")
|
|
1397
|
+
|
|
1398
|
+
if hook_type == "register_forward_pre_hook" and hook_fn_args_num != pre_hook_func_args_num:
|
|
1399
|
+
raise TypeError(f"forward_pre_hook function {hook_fn.__name__} args num should be {pre_hook_func_args_num}, "
|
|
1400
|
+
f"but got {hook_fn_args_num}")
|
|
1401
|
+
|
|
1402
|
+
if (hook_type == "register_forward_hook" and
|
|
1403
|
+
hook_fn_args_num != forward_hook_and_backward_hook_func_args_num):
|
|
1404
|
+
raise TypeError(f"forward_hook function {hook_fn.__name__} args num should be "
|
|
1405
|
+
f"{forward_hook_and_backward_hook_func_args_num}, but got {hook_fn_args_num}")
|
|
1406
|
+
|
|
1407
|
+
if hook_type == "register_backward_pre_hook" and hook_fn_args_num != pre_hook_func_args_num:
|
|
1408
|
+
raise TypeError(f"backward_pre_hook function {hook_fn.__name__} args num should be {pre_hook_func_args_num},"
|
|
1409
|
+
f" but got {hook_fn_args_num}")
|
|
1410
|
+
|
|
1411
|
+
if (hook_type == "register_backward_hook" and
|
|
1412
|
+
hook_fn_args_num != forward_hook_and_backward_hook_func_args_num):
|
|
1413
|
+
raise TypeError(f"backward_hook function {hook_fn.__name__} args num should be "
|
|
1414
|
+
f"{forward_hook_and_backward_hook_func_args_num}, but got {hook_fn_args_num}")
|
|
1415
|
+
|
|
1416
|
+
return True
|
|
1417
|
+
|
|
1418
|
+
|
|
1320
1419
|
_set_record = {}
|
|
@@ -216,7 +216,8 @@ def mixed_precision_cast(dst_type, x):
|
|
|
216
216
|
"""Implement `mixed_precision_cast`."""
|
|
217
217
|
|
|
218
218
|
def cast_inner(data):
|
|
219
|
-
if isinstance(data, Tensor) and data.dtype in (mstype.float32, mstype.float16,
|
|
219
|
+
if isinstance(data, Tensor) and data.dtype in (mstype.float32, mstype.float16,
|
|
220
|
+
mstype.float64, mstype.bfloat16):
|
|
220
221
|
return F.cast(data, dst_type)
|
|
221
222
|
return data
|
|
222
223
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright 2021-
|
|
1
|
+
# Copyright 2021-2024 Huawei Technologies Co., Ltd
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
@@ -290,12 +290,22 @@ def block_parallel_estimate(graphs):
|
|
|
290
290
|
return ParalGain(fusion_type, max_weight, sum_weight - max_weight, blocks, type_info)
|
|
291
291
|
|
|
292
292
|
|
|
293
|
+
def block_parallel_estimate_dvm(graphs):
|
|
294
|
+
"""estimate block parallel gain when on Ascend platform"""
|
|
295
|
+
max_ops = 96
|
|
296
|
+
total_ops = 0
|
|
297
|
+
bottleneck = 1000
|
|
298
|
+
gain = 1000
|
|
299
|
+
for g in graphs:
|
|
300
|
+
total_ops += len(g.ops)
|
|
301
|
+
if total_ops > max_ops:
|
|
302
|
+
gain = 0
|
|
303
|
+
return ParalGain("block_fusion", bottleneck, gain, list(0 for _ in graphs), None)
|
|
304
|
+
return ParalGain("block_fusion", bottleneck, gain, list(1 for _ in graphs), None)
|
|
305
|
+
|
|
306
|
+
|
|
293
307
|
def parallel_estimate(graphs, target):
|
|
294
308
|
"""Estimate parallel gain"""
|
|
295
309
|
if target == "aicore":
|
|
296
|
-
|
|
297
|
-
type_info = None
|
|
298
|
-
fake_estimate = 1000
|
|
299
|
-
fake_blocks = list(1 for g in graphs)
|
|
300
|
-
return ParalGain(fusion_type, fake_estimate, fake_estimate, fake_blocks, type_info)
|
|
310
|
+
return block_parallel_estimate_dvm(graphs)
|
|
301
311
|
return block_parallel_estimate(graphs)
|
|
@@ -21,7 +21,7 @@ from multiprocessing import Pool, cpu_count
|
|
|
21
21
|
from mindspore import log as logger
|
|
22
22
|
from mindspore._extends.parallel_compile.akg_compiler.get_file_path import get_akg_path
|
|
23
23
|
from mindspore._extends.parallel_compile.akg_compiler.util import get_ascend_compile_dirs, create_compile_dirs, \
|
|
24
|
-
get_log_level, update_attr, select_best, print_compile_log,
|
|
24
|
+
get_log_level, update_attr, select_best, print_compile_log, get_kernel_meta_parent_dir
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def _compile_akg_task_default(json_strs, attrs, func):
|
|
@@ -66,7 +66,6 @@ def _compile_akg_task_ascend(json_strs, attrs):
|
|
|
66
66
|
compile_dirs = get_ascend_compile_dirs(attrs)
|
|
67
67
|
kernel_meta_dir = compile_dirs.get("kernel_meta_dir")
|
|
68
68
|
akg_compile_dir = compile_dirs.get("akg_compile_dir")
|
|
69
|
-
tbe_compile_dir = compile_dirs.get("tbe_compile_dir")
|
|
70
69
|
composite_graph_dir = compile_dirs.get("composite_graph_dir")
|
|
71
70
|
attrs = update_attr(attrs, {"dump_composite_graph": composite_graph_dir, "optimize_for_tbe": True})
|
|
72
71
|
for json_str in json_strs:
|
|
@@ -79,24 +78,12 @@ def _compile_akg_task_ascend(json_strs, attrs):
|
|
|
79
78
|
info_path = os.path.join(kernel_meta_dir, op_name + ".info")
|
|
80
79
|
if not os.path.isfile(info_path):
|
|
81
80
|
raise FileNotFoundError("Can not compile non-existing file \"{}\"".format(info_path))
|
|
82
|
-
|
|
83
81
|
# Compile json str with AKG
|
|
84
82
|
_compile_subprocess(compiler, akg_compile_dir, info_path, "AKG", attrs, compile_log, log_level)
|
|
85
83
|
|
|
86
|
-
# Load composite optimized json str and compile it with TBE
|
|
87
|
-
composite_graph_path = os.path.join(composite_graph_dir, op_name + ".info")
|
|
88
|
-
if not os.path.isfile(composite_graph_path):
|
|
89
|
-
composite_graph_path = info_path
|
|
90
|
-
with open(composite_graph_path, 'r') as f:
|
|
91
|
-
composite_graph = f.read()
|
|
92
|
-
if "buffer_stitch" not in json_desc and "parallel_fusion" not in json_desc and \
|
|
93
|
-
check_tbe_support(json.loads(composite_graph)):
|
|
94
|
-
_compile_subprocess(compiler, tbe_compile_dir, composite_graph_path, "TBE", attrs, compile_log, log_level)
|
|
95
|
-
|
|
96
84
|
print_compile_log(compile_log)
|
|
97
85
|
# Select best compile result
|
|
98
|
-
res = select_best([os.path.join(akg_compile_dir, "
|
|
99
|
-
tbe_compile_dir, "kernel_meta")], kernel_meta_dir, op_name)
|
|
86
|
+
res = select_best([os.path.join(akg_compile_dir, "kernel_meta")], kernel_meta_dir, op_name)
|
|
100
87
|
if not res:
|
|
101
88
|
if log_level == "ERROR":
|
|
102
89
|
raise ValueError("Compile error, json str: {}! build attrs: {}".format(json_str, attrs))
|
|
@@ -116,7 +103,7 @@ def create_akg_parallel_process(process_num, wait_time, platform):
|
|
|
116
103
|
def _is_input_shape_dynamic(desc_d):
|
|
117
104
|
input_lists = desc_d.get("input_desc", [])
|
|
118
105
|
if input_lists is None:
|
|
119
|
-
return
|
|
106
|
+
return False
|
|
120
107
|
for input_desc in input_lists:
|
|
121
108
|
shape = input_desc[0].get("shape", ())
|
|
122
109
|
if -1 in shape or -2 in shape:
|
|
@@ -41,11 +41,22 @@ ENABLE_VECTOR_2X = "enable_vector_2x"
|
|
|
41
41
|
ENABLE_GROUP_INPLACE = "enable_group_inplace"
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
def
|
|
44
|
+
def get_arch_name(op_json):
|
|
45
|
+
"""Get the arch name from op json."""
|
|
46
|
+
target_info = op_json.get("target_info")
|
|
47
|
+
if isinstance(target_info, dict):
|
|
48
|
+
arch_name = target_info.get("arch")
|
|
49
|
+
if arch_name:
|
|
50
|
+
return arch_name
|
|
51
|
+
return "Ascend910A"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def initialize(kernel_meta_parent_dir, arch_name):
|
|
45
55
|
"""Initialize the TBE compile environment."""
|
|
46
56
|
os.environ["CONTEXT_MODELCOMPILING"] = "TRUE"
|
|
57
|
+
core_type = "VectorCore" if arch_name != "Ascend910A" else ""
|
|
47
58
|
# socVersion, coreType, coreNum, l1Fusion, l2Mode, l2Fusion
|
|
48
|
-
soc_info = [
|
|
59
|
+
soc_info = [arch_name, core_type, "", "false", "2", "false",
|
|
49
60
|
{"op_impl_mode": "",
|
|
50
61
|
"op_debug_level": "3",
|
|
51
62
|
"op_impl_mode_list": [],
|
|
@@ -83,7 +94,7 @@ def add_new_shape(names, shapes, new_shapes, inputs):
|
|
|
83
94
|
if shapes[i] == new_shapes[i]:
|
|
84
95
|
continue
|
|
85
96
|
if name not in inputs:
|
|
86
|
-
|
|
97
|
+
continue
|
|
87
98
|
if NEW_SHAPE not in inputs[name]:
|
|
88
99
|
inputs[name][NEW_SHAPE] = new_shapes[i]
|
|
89
100
|
elif new_shapes[i] != inputs[name][NEW_SHAPE]:
|
|
@@ -512,6 +523,7 @@ def build(json_str, kernel_meta_parent_dir):
|
|
|
512
523
|
|
|
513
524
|
def build_tbe_kernel(json_str, kernel_meta_parent_dir):
|
|
514
525
|
"""Build TBE kernel."""
|
|
515
|
-
|
|
526
|
+
arch_name = get_arch_name(json.loads(json_str))
|
|
527
|
+
initialize(kernel_meta_parent_dir, arch_name)
|
|
516
528
|
with build_config(kernel_meta_parent_dir=kernel_meta_parent_dir):
|
|
517
529
|
build(json_str, kernel_meta_parent_dir)
|
|
@@ -39,6 +39,7 @@ def run_compiler(op_json, compile_backend="AKG", attrs=None, kernel_meta_parent_
|
|
|
39
39
|
build_tbe_kernel(op_json, kernel_meta_parent_dir)
|
|
40
40
|
else:
|
|
41
41
|
os.environ["MS_COMPILER_CACHE_PATH"] = kernel_meta_parent_dir
|
|
42
|
+
os.environ["KERNEL_META_DIR"] = "kernel_meta"
|
|
42
43
|
from get_file_path import get_akg_path
|
|
43
44
|
sys.path.insert(0, get_akg_path())
|
|
44
45
|
p = __import__("akg", globals(), locals(), ['ms'], 0)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# coding: utf-8
|
|
3
|
+
# Copyright 2023 Huawei Technologies Co., Ltd
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
"""Used to generate custom akg op files, which will be invoked by GE."""
|
|
17
|
+
|
|
18
|
+
import os
|
|
19
|
+
import sys
|
|
20
|
+
import json
|
|
21
|
+
import shutil
|
|
22
|
+
from itertools import product
|
|
23
|
+
|
|
24
|
+
SUPPORTED_INPUT_NUM = [1, 2, 3, 4, 5, 6, 7]
|
|
25
|
+
SUPPORTED_OUTPUT_NUM = [1, 2, 3, 4, 5]
|
|
26
|
+
SUPPORTED_DEVICE_ARCH = ["ascend910", "ascend910b"]
|
|
27
|
+
VALUE_ALL = "all"
|
|
28
|
+
VALUE = "value"
|
|
29
|
+
NAME = "name"
|
|
30
|
+
SHAPE = "shape"
|
|
31
|
+
REQUIRED = "required"
|
|
32
|
+
PARAM_TYPE = "paramType"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def gen_ops_info():
|
|
36
|
+
"""Generate the custom akg op registration information."""
|
|
37
|
+
ops_info = {}
|
|
38
|
+
# supported_io_num: [(1, 1), (1, 2), ...], list of (input_num, output_num)
|
|
39
|
+
supported_io_num = list(product(SUPPORTED_INPUT_NUM, SUPPORTED_OUTPUT_NUM))
|
|
40
|
+
for input_num, output_num in supported_io_num:
|
|
41
|
+
op_info = {"attr": {"list": "info_path"},
|
|
42
|
+
"attr_info_path": {PARAM_TYPE: REQUIRED, "type": "str", VALUE: VALUE_ALL},
|
|
43
|
+
"opFile": {VALUE: "custom"},
|
|
44
|
+
"opInterface": {VALUE: "custom_train"},
|
|
45
|
+
"dynamicFormat": {"flag": "true"}}
|
|
46
|
+
for i in range(input_num):
|
|
47
|
+
op_info["input" + str(i)] = {NAME: "x" + str(i),
|
|
48
|
+
PARAM_TYPE: REQUIRED,
|
|
49
|
+
SHAPE: VALUE_ALL}
|
|
50
|
+
for i in range(output_num):
|
|
51
|
+
op_info["output" + str(i)] = {NAME: "y" + str(i),
|
|
52
|
+
PARAM_TYPE: REQUIRED,
|
|
53
|
+
SHAPE: VALUE_ALL}
|
|
54
|
+
op_type = "Fused_x{}_y{}".format(input_num, output_num)
|
|
55
|
+
ops_info[op_type] = op_info
|
|
56
|
+
return ops_info
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def gen_custom_op_files(config_dir, dsl_dir):
|
|
60
|
+
"""Copy custom akg op registration information file to config_dir, and copy python dsl file to dsl_dir."""
|
|
61
|
+
if not os.path.isdir(config_dir):
|
|
62
|
+
os.makedirs(config_dir, exist_ok=True)
|
|
63
|
+
config_dir = os.path.realpath(config_dir)
|
|
64
|
+
if not os.path.isdir(dsl_dir):
|
|
65
|
+
os.makedirs(dsl_dir, exist_ok=True)
|
|
66
|
+
dsl_dir = os.path.realpath(dsl_dir)
|
|
67
|
+
cur_path = os.path.split(os.path.realpath(__file__))[0]
|
|
68
|
+
|
|
69
|
+
# generate custom akg op registration information
|
|
70
|
+
ops_info = gen_ops_info()
|
|
71
|
+
for device_arch in SUPPORTED_DEVICE_ARCH:
|
|
72
|
+
sub_dir = os.path.join(config_dir, device_arch)
|
|
73
|
+
if not os.path.isdir(sub_dir):
|
|
74
|
+
os.makedirs(sub_dir)
|
|
75
|
+
ops_info_path = os.path.join(sub_dir, "aic-{}-ops-info.json".format(device_arch))
|
|
76
|
+
if os.path.isfile(ops_info_path):
|
|
77
|
+
with open(ops_info_path, 'r') as f:
|
|
78
|
+
info_des = json.loads(f.read())
|
|
79
|
+
ops_info.update(info_des)
|
|
80
|
+
with os.fdopen(os.open(ops_info_path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o660), 'w') as f:
|
|
81
|
+
f.write(json.dumps(ops_info, indent=4))
|
|
82
|
+
|
|
83
|
+
# custom akg op dsl file
|
|
84
|
+
custom_py = os.path.join(cur_path, "../../../../../lite/tools/kernel_builder/ascend/akg/custom.py")
|
|
85
|
+
if not os.path.isfile(custom_py):
|
|
86
|
+
raise RuntimeError("custom.py path is invalid: {}".format(custom_py))
|
|
87
|
+
shutil.copy(custom_py, dsl_dir)
|
|
88
|
+
shutil.copy(os.path.join(cur_path, "compiler.py"), dsl_dir)
|
|
89
|
+
shutil.copy(os.path.join(cur_path, "build_tbe_kernel.py"), dsl_dir)
|
|
90
|
+
shutil.copy(os.path.join(cur_path, "tbe_topi.py"), dsl_dir)
|
|
91
|
+
shutil.copy(os.path.join(cur_path, "get_file_path.py"), dsl_dir)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
if __name__ == "__main__":
|
|
95
|
+
if len(sys.argv) == 3:
|
|
96
|
+
gen_custom_op_files(sys.argv[1], sys.argv[2])
|
|
@@ -114,7 +114,8 @@ def _add(x0, x1, attrs=None):
|
|
|
114
114
|
return tbe.dsl.vadds(x1, x0)
|
|
115
115
|
x0, x1 = _broadcast(x0, x1)
|
|
116
116
|
from impl.add import add_compute
|
|
117
|
-
|
|
117
|
+
output_desc = {"dtype": x1.dtype, "shape": x1.shape}
|
|
118
|
+
return add_compute(x0, x1, output_desc, kernel_name=attrs["fusion_op_name"])
|
|
118
119
|
|
|
119
120
|
|
|
120
121
|
@reg_op("Asin", pattern=OpPattern.ELEMWISE)
|
|
@@ -20,6 +20,7 @@ from mindspore import log as logger
|
|
|
20
20
|
from mindspore._extends.parallel_compile.akg_compiler.tbe_topi import get_op_reg_info
|
|
21
21
|
|
|
22
22
|
O_SUFFIX = ".o"
|
|
23
|
+
SO_SUFFIX = ".so"
|
|
23
24
|
JSON_SUFFIX = ".json"
|
|
24
25
|
|
|
25
26
|
|
|
@@ -27,7 +28,7 @@ def update_attr(attr, new_attr):
|
|
|
27
28
|
"""Update new_attr to attr."""
|
|
28
29
|
if attr is None:
|
|
29
30
|
attr = {}
|
|
30
|
-
|
|
31
|
+
if isinstance(attr, str):
|
|
31
32
|
attr = json.loads(attr)
|
|
32
33
|
if isinstance(attr, dict):
|
|
33
34
|
attr.update(new_attr)
|
|
@@ -114,7 +115,7 @@ def select_best(src_dirs, dst_dir, op_name):
|
|
|
114
115
|
max_block_dim = 1
|
|
115
116
|
max_block_dim_idx = -1
|
|
116
117
|
for i, src_dir in enumerate(src_dirs):
|
|
117
|
-
o_path = os.path.join(src_dir, op_name +
|
|
118
|
+
o_path = os.path.join(src_dir, op_name + SO_SUFFIX)
|
|
118
119
|
json_path = os.path.join(src_dir, op_name + JSON_SUFFIX)
|
|
119
120
|
if os.path.isfile(o_path) and os.path.isfile(json_path):
|
|
120
121
|
with open(json_path, 'r') as f:
|
|
@@ -125,8 +126,10 @@ def select_best(src_dirs, dst_dir, op_name):
|
|
|
125
126
|
max_block_dim = json_dict["blockDim"]
|
|
126
127
|
if max_block_dim_idx >= 0:
|
|
127
128
|
o_path = os.path.join(src_dirs[max_block_dim_idx], op_name + O_SUFFIX)
|
|
129
|
+
so_path = os.path.join(src_dirs[max_block_dim_idx], op_name + SO_SUFFIX)
|
|
128
130
|
json_path = os.path.join(src_dirs[max_block_dim_idx], op_name + JSON_SUFFIX)
|
|
129
131
|
_copy_file(o_path, os.path.join(dst_dir, op_name + O_SUFFIX))
|
|
132
|
+
_copy_file(so_path, os.path.join(dst_dir, op_name + SO_SUFFIX))
|
|
130
133
|
_copy_file(json_path, os.path.join(dst_dir, op_name + JSON_SUFFIX))
|
|
131
134
|
logger.info("{}, best compile result dir: {}".format(op_name, src_dirs[max_block_dim_idx]))
|
|
132
135
|
return True
|