mindspore 2.7.0__cp310-cp310-win_amd64.whl → 2.7.1__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mindspore might be problematic. Click here for more details.
- mindspore/.commit_id +1 -1
- mindspore/__init__.py +4 -1
- mindspore/_c_dataengine.cp310-win_amd64.pyd +0 -0
- mindspore/_c_expression.cp310-win_amd64.pyd +0 -0
- mindspore/_c_mindrecord.cp310-win_amd64.pyd +0 -0
- mindspore/_extends/parse/compile_config.py +24 -1
- mindspore/_extends/parse/deprecated/deprecated_tensor_method.py +6 -2
- mindspore/_extends/parse/resources.py +1 -1
- mindspore/_extends/parse/standard_method.py +8 -1
- mindspore/_extends/parse/trope.py +2 -1
- mindspore/_extends/pijit/pijit_func_white_list.py +7 -22
- mindspore/avcodec-59.dll +0 -0
- mindspore/avdevice-59.dll +0 -0
- mindspore/avfilter-8.dll +0 -0
- mindspore/avformat-59.dll +0 -0
- mindspore/avutil-57.dll +0 -0
- mindspore/boost/base.py +29 -2
- mindspore/common/_decorator.py +3 -2
- mindspore/common/_grad_function.py +3 -1
- mindspore/common/_tensor_cpp_method.py +1 -1
- mindspore/common/_tensor_docs.py +275 -64
- mindspore/common/_utils.py +0 -44
- mindspore/common/api.py +285 -35
- mindspore/common/dump.py +7 -108
- mindspore/common/dynamic_shape/auto_dynamic_shape.py +1 -3
- mindspore/common/hook_handle.py +60 -0
- mindspore/common/jit_config.py +5 -1
- mindspore/common/jit_trace.py +27 -12
- mindspore/common/lazy_inline.py +5 -3
- mindspore/common/parameter.py +13 -107
- mindspore/common/recompute.py +4 -11
- mindspore/common/tensor.py +16 -169
- mindspore/communication/_comm_helper.py +11 -1
- mindspore/communication/comm_func.py +138 -4
- mindspore/communication/management.py +85 -1
- mindspore/config/op_info.config +0 -15
- mindspore/context.py +5 -85
- mindspore/dataset/engine/datasets.py +8 -4
- mindspore/dataset/engine/datasets_vision.py +1 -1
- mindspore/dataset/engine/validators.py +1 -15
- mindspore/dnnl.dll +0 -0
- mindspore/{experimental/llm_boost/ascend_native → graph}/__init__.py +7 -7
- mindspore/graph/custom_pass.py +55 -0
- mindspore/include/dataset/execute.h +2 -2
- mindspore/jpeg62.dll +0 -0
- mindspore/mindrecord/__init__.py +3 -3
- mindspore/mindrecord/common/exceptions.py +1 -0
- mindspore/mindrecord/config.py +1 -1
- mindspore/{parallel/mpi → mindrecord/core}/__init__.py +4 -1
- mindspore/mindrecord/{shardheader.py → core/shardheader.py} +2 -1
- mindspore/mindrecord/{shardindexgenerator.py → core/shardindexgenerator.py} +1 -1
- mindspore/mindrecord/{shardreader.py → core/shardreader.py} +2 -1
- mindspore/mindrecord/{shardsegment.py → core/shardsegment.py} +2 -2
- mindspore/mindrecord/{shardutils.py → core/shardutils.py} +1 -1
- mindspore/mindrecord/{shardwriter.py → core/shardwriter.py} +1 -1
- mindspore/mindrecord/filereader.py +4 -4
- mindspore/mindrecord/filewriter.py +5 -5
- mindspore/mindrecord/mindpage.py +2 -2
- mindspore/mindrecord/tools/cifar10.py +1 -1
- mindspore/mindrecord/tools/cifar100.py +1 -1
- mindspore/mindrecord/tools/cifar100_to_mr.py +1 -1
- mindspore/mindrecord/tools/cifar10_to_mr.py +1 -1
- mindspore/mindrecord/tools/csv_to_mr.py +1 -1
- mindspore/mindrecord/tools/imagenet_to_mr.py +1 -1
- mindspore/mindrecord/tools/mnist_to_mr.py +1 -1
- mindspore/mindrecord/tools/tfrecord_to_mr.py +1 -1
- mindspore/mindspore_backend_common.dll +0 -0
- mindspore/mindspore_backend_manager.dll +0 -0
- mindspore/mindspore_cluster.dll +0 -0
- mindspore/mindspore_common.dll +0 -0
- mindspore/mindspore_core.dll +0 -0
- mindspore/mindspore_cpu.dll +0 -0
- mindspore/mindspore_dump.dll +0 -0
- mindspore/mindspore_frontend.dll +0 -0
- mindspore/mindspore_glog.dll +0 -0
- mindspore/mindspore_hardware_abstract.dll +0 -0
- mindspore/mindspore_memory_pool.dll +0 -0
- mindspore/mindspore_ms_backend.dll +0 -0
- mindspore/mindspore_ops.dll +0 -0
- mindspore/{mindspore_ops_host.dll → mindspore_ops_cpu.dll} +0 -0
- mindspore/mindspore_profiler.dll +0 -0
- mindspore/mindspore_pyboost.dll +0 -0
- mindspore/mindspore_pynative.dll +0 -0
- mindspore/mindspore_runtime_pipeline.dll +0 -0
- mindspore/mindspore_runtime_utils.dll +0 -0
- mindspore/mindspore_tools.dll +0 -0
- mindspore/mint/__init__.py +15 -10
- mindspore/mint/distributed/distributed.py +182 -62
- mindspore/mint/nn/__init__.py +2 -16
- mindspore/mint/nn/functional.py +4 -110
- mindspore/mint/nn/layer/__init__.py +0 -2
- mindspore/mint/nn/layer/activation.py +0 -6
- mindspore/mint/nn/layer/basic.py +0 -47
- mindspore/mint/nn/layer/conv.py +4 -4
- mindspore/mint/nn/layer/normalization.py +8 -13
- mindspore/mint/nn/layer/pooling.py +0 -4
- mindspore/nn/__init__.py +1 -3
- mindspore/nn/cell.py +16 -66
- mindspore/nn/layer/basic.py +49 -1
- mindspore/nn/layer/container.py +16 -0
- mindspore/nn/layer/embedding.py +4 -169
- mindspore/nn/layer/normalization.py +2 -1
- mindspore/nn/layer/thor_layer.py +4 -85
- mindspore/nn/optim/ada_grad.py +0 -1
- mindspore/nn/optim/adafactor.py +0 -1
- mindspore/nn/optim/adam.py +31 -124
- mindspore/nn/optim/adamax.py +0 -1
- mindspore/nn/optim/asgd.py +0 -1
- mindspore/nn/optim/ftrl.py +8 -102
- mindspore/nn/optim/lamb.py +0 -1
- mindspore/nn/optim/lars.py +0 -3
- mindspore/nn/optim/lazyadam.py +25 -218
- mindspore/nn/optim/momentum.py +5 -43
- mindspore/nn/optim/optimizer.py +6 -55
- mindspore/nn/optim/proximal_ada_grad.py +0 -1
- mindspore/nn/optim/rmsprop.py +0 -1
- mindspore/nn/optim/rprop.py +0 -1
- mindspore/nn/optim/sgd.py +0 -1
- mindspore/nn/optim/tft_wrapper.py +0 -1
- mindspore/nn/optim/thor.py +0 -2
- mindspore/nn/probability/bijector/bijector.py +7 -8
- mindspore/nn/probability/bijector/gumbel_cdf.py +2 -2
- mindspore/nn/probability/bijector/power_transform.py +20 -21
- mindspore/nn/probability/bijector/scalar_affine.py +5 -5
- mindspore/nn/probability/bijector/softplus.py +13 -14
- mindspore/nn/wrap/grad_reducer.py +4 -74
- mindspore/numpy/array_creations.py +2 -2
- mindspore/numpy/fft.py +9 -9
- mindspore/{nn/reinforcement → onnx}/__init__.py +5 -8
- mindspore/onnx/onnx_export.py +137 -0
- mindspore/opencv_core4110.dll +0 -0
- mindspore/opencv_imgcodecs4110.dll +0 -0
- mindspore/{opencv_imgproc452.dll → opencv_imgproc4110.dll} +0 -0
- mindspore/ops/__init__.py +2 -0
- mindspore/ops/_grad_experimental/grad_comm_ops.py +38 -2
- mindspore/ops/_op_impl/aicpu/__init__.py +0 -10
- mindspore/ops/_op_impl/cpu/__init__.py +0 -5
- mindspore/ops/auto_generate/cpp_create_prim_instance_helper.py +16 -22
- mindspore/ops/auto_generate/gen_extend_func.py +2 -7
- mindspore/ops/auto_generate/gen_ops_def.py +98 -141
- mindspore/ops/auto_generate/gen_ops_prim.py +12708 -12686
- mindspore/ops/communication.py +97 -0
- mindspore/ops/composite/__init__.py +5 -2
- mindspore/ops/composite/base.py +15 -1
- mindspore/ops/composite/multitype_ops/__init__.py +3 -1
- mindspore/ops/composite/multitype_ops/_compile_utils.py +150 -8
- mindspore/ops/composite/multitype_ops/add_impl.py +7 -0
- mindspore/ops/composite/multitype_ops/mod_impl.py +27 -0
- mindspore/ops/function/__init__.py +1 -0
- mindspore/ops/function/array_func.py +14 -12
- mindspore/ops/function/comm_func.py +3883 -0
- mindspore/ops/function/debug_func.py +3 -4
- mindspore/ops/function/math_func.py +45 -54
- mindspore/ops/function/nn_func.py +75 -294
- mindspore/ops/function/random_func.py +9 -18
- mindspore/ops/functional.py +2 -0
- mindspore/ops/functional_overload.py +354 -18
- mindspore/ops/operations/__init__.py +2 -5
- mindspore/ops/operations/_custom_ops_utils.py +7 -9
- mindspore/ops/operations/_inner_ops.py +1 -38
- mindspore/ops/operations/_rl_inner_ops.py +0 -933
- mindspore/ops/operations/array_ops.py +1 -0
- mindspore/ops/operations/comm_ops.py +94 -2
- mindspore/ops/operations/custom_ops.py +228 -19
- mindspore/ops/operations/debug_ops.py +27 -29
- mindspore/ops/operations/manually_defined/ops_def.py +27 -306
- mindspore/ops/operations/nn_ops.py +2 -2
- mindspore/ops/operations/sparse_ops.py +0 -83
- mindspore/ops/primitive.py +1 -17
- mindspore/ops/tensor_method.py +72 -3
- mindspore/ops_generate/aclnn/aclnn_kernel_register_auto_cc_generator.py +5 -5
- mindspore/ops_generate/aclnn/gen_aclnn_implement.py +8 -8
- mindspore/ops_generate/api/functions_cc_generator.py +53 -4
- mindspore/ops_generate/api/tensor_func_reg_cpp_generator.py +25 -11
- mindspore/ops_generate/common/gen_constants.py +11 -10
- mindspore/ops_generate/common/op_proto.py +18 -1
- mindspore/ops_generate/common/template.py +102 -245
- mindspore/ops_generate/common/template_utils.py +212 -0
- mindspore/ops_generate/gen_custom_ops.py +69 -0
- mindspore/ops_generate/op_def/ops_def_cc_generator.py +78 -7
- mindspore/ops_generate/op_def_py/base_op_prim_py_generator.py +360 -0
- mindspore/ops_generate/op_def_py/custom_op_prim_py_generator.py +140 -0
- mindspore/ops_generate/op_def_py/op_def_py_generator.py +54 -7
- mindspore/ops_generate/op_def_py/op_prim_py_generator.py +5 -312
- mindspore/ops_generate/pyboost/auto_grad_impl_cc_generator.py +74 -17
- mindspore/ops_generate/pyboost/auto_grad_reg_cc_generator.py +22 -5
- mindspore/ops_generate/pyboost/op_template_parser.py +3 -2
- mindspore/ops_generate/pyboost/pyboost_functions_cpp_generator.py +21 -5
- mindspore/ops_generate/pyboost/pyboost_functions_h_generator.py +2 -2
- mindspore/ops_generate/pyboost/pyboost_functions_impl_cpp_generator.py +30 -10
- mindspore/ops_generate/pyboost/pyboost_grad_function_cpp_generator.py +10 -3
- mindspore/ops_generate/pyboost/pyboost_internal_kernel_info_adapter_generator.py +1 -1
- mindspore/ops_generate/pyboost/pyboost_native_grad_functions_generator.py +19 -9
- mindspore/ops_generate/pyboost/pyboost_op_cpp_code_generator.py +71 -28
- mindspore/ops_generate/pyboost/pyboost_overload_functions_cpp_generator.py +10 -9
- mindspore/ops_generate/pyboost/pyboost_utils.py +27 -16
- mindspore/ops_generate/resources/yaml_loader.py +13 -0
- mindspore/ops_generate/tensor_py_cc_generator.py +2 -2
- mindspore/parallel/_cell_wrapper.py +1 -1
- mindspore/parallel/_parallel_serialization.py +1 -4
- mindspore/parallel/_utils.py +29 -6
- mindspore/parallel/checkpoint_transform.py +18 -2
- mindspore/parallel/cluster/process_entity/_api.py +24 -32
- mindspore/parallel/cluster/process_entity/_utils.py +9 -5
- mindspore/{experimental/llm_boost/atb → parallel/distributed}/__init__.py +21 -23
- mindspore/parallel/distributed/distributed_data_parallel.py +393 -0
- mindspore/parallel/distributed/flatten_grad_buffer.py +295 -0
- mindspore/parallel/strategy.py +336 -0
- mindspore/parallel/transform_safetensors.py +117 -16
- mindspore/profiler/analysis/viewer/ascend_kernel_details_viewer.py +3 -0
- mindspore/profiler/analysis/viewer/ms_minddata_viewer.py +1 -1
- mindspore/profiler/common/constant.py +5 -0
- mindspore/profiler/common/file_manager.py +9 -0
- mindspore/profiler/common/msprof_cmd_tool.py +38 -2
- mindspore/profiler/common/path_manager.py +56 -24
- mindspore/profiler/common/profiler_context.py +2 -12
- mindspore/profiler/common/profiler_info.py +3 -3
- mindspore/profiler/common/profiler_path_manager.py +13 -0
- mindspore/profiler/common/util.py +30 -3
- mindspore/profiler/experimental_config.py +2 -1
- mindspore/profiler/platform/npu_profiler.py +33 -6
- mindspore/run_check/_check_version.py +108 -24
- mindspore/runtime/__init__.py +3 -2
- mindspore/runtime/executor.py +11 -3
- mindspore/runtime/memory.py +112 -0
- mindspore/swresample-4.dll +0 -0
- mindspore/swscale-6.dll +0 -0
- mindspore/tinyxml2.dll +0 -0
- mindspore/{experimental/llm_boost → tools}/__init__.py +5 -5
- mindspore/tools/data_dump.py +130 -0
- mindspore/tools/sdc_detect.py +91 -0
- mindspore/tools/stress_detect.py +63 -0
- mindspore/train/__init__.py +6 -6
- mindspore/train/_utils.py +5 -18
- mindspore/train/amp.py +6 -4
- mindspore/train/callback/_checkpoint.py +0 -9
- mindspore/train/callback/_train_fault_tolerance.py +69 -18
- mindspore/train/data_sink.py +1 -5
- mindspore/train/model.py +38 -211
- mindspore/train/serialization.py +126 -387
- mindspore/turbojpeg.dll +0 -0
- mindspore/utils/__init__.py +6 -3
- mindspore/utils/dlpack.py +92 -0
- mindspore/utils/dryrun.py +1 -1
- mindspore/utils/runtime_execution_order_check.py +10 -0
- mindspore/utils/sdc_detect.py +14 -12
- mindspore/utils/stress_detect.py +43 -0
- mindspore/utils/utils.py +144 -8
- mindspore/version.py +1 -1
- {mindspore-2.7.0.dist-info → mindspore-2.7.1.dist-info}/METADATA +3 -2
- {mindspore-2.7.0.dist-info → mindspore-2.7.1.dist-info}/RECORD +254 -267
- mindspore/experimental/llm_boost/ascend_native/llama_boost_ascend_native.py +0 -210
- mindspore/experimental/llm_boost/ascend_native/llm_boost.py +0 -52
- mindspore/experimental/llm_boost/atb/boost_base.py +0 -385
- mindspore/experimental/llm_boost/atb/llama_boost.py +0 -137
- mindspore/experimental/llm_boost/atb/qwen_boost.py +0 -124
- mindspore/experimental/llm_boost/register.py +0 -130
- mindspore/experimental/llm_boost/utils.py +0 -31
- mindspore/include/OWNERS +0 -7
- mindspore/mindspore_cpu_res_manager.dll +0 -0
- mindspore/mindspore_ops_kernel_common.dll +0 -0
- mindspore/mindspore_res_manager.dll +0 -0
- mindspore/nn/optim/_dist_optimizer_registry.py +0 -111
- mindspore/nn/reinforcement/_batch_read_write.py +0 -142
- mindspore/nn/reinforcement/_tensors_queue.py +0 -152
- mindspore/nn/reinforcement/tensor_array.py +0 -145
- mindspore/opencv_core452.dll +0 -0
- mindspore/opencv_imgcodecs452.dll +0 -0
- mindspore/ops/_op_impl/aicpu/priority_replay_buffer.py +0 -113
- mindspore/ops/_op_impl/aicpu/reservoir_replay_buffer.py +0 -96
- mindspore/ops/_op_impl/aicpu/sparse_cross.py +0 -42
- mindspore/ops/_op_impl/cpu/buffer_append.py +0 -28
- mindspore/ops/_op_impl/cpu/buffer_get.py +0 -28
- mindspore/ops/_op_impl/cpu/buffer_sample.py +0 -28
- mindspore/ops/_op_impl/cpu/priority_replay_buffer.py +0 -42
- mindspore/ops/operations/_tensor_array.py +0 -359
- mindspore/ops/operations/rl_ops.py +0 -288
- mindspore/parallel/_offload_context.py +0 -275
- mindspore/parallel/_recovery_context.py +0 -115
- mindspore/parallel/_transformer/__init__.py +0 -35
- mindspore/parallel/_transformer/layers.py +0 -765
- mindspore/parallel/_transformer/loss.py +0 -251
- mindspore/parallel/_transformer/moe.py +0 -693
- mindspore/parallel/_transformer/op_parallel_config.py +0 -222
- mindspore/parallel/_transformer/transformer.py +0 -3124
- mindspore/parallel/mpi/_mpi_config.py +0 -116
- mindspore/train/memory_profiling_pb2.py +0 -298
- {mindspore-2.7.0.dist-info → mindspore-2.7.1.dist-info}/WHEEL +0 -0
- {mindspore-2.7.0.dist-info → mindspore-2.7.1.dist-info}/entry_points.txt +0 -0
- {mindspore-2.7.0.dist-info → mindspore-2.7.1.dist-info}/top_level.txt +0 -0
|
@@ -1558,9 +1558,6 @@ def clone(input):
|
|
|
1558
1558
|
r"""
|
|
1559
1559
|
Returns a copy of the input tensor.
|
|
1560
1560
|
|
|
1561
|
-
.. warning::
|
|
1562
|
-
This is an experimental API that is subject to change or deletion.
|
|
1563
|
-
|
|
1564
1561
|
Note:
|
|
1565
1562
|
This function is differentiable, and gradients will flow back directly from the calculation
|
|
1566
1563
|
result of the function to the `input`.
|
|
@@ -1939,9 +1936,6 @@ def count_nonzero(input, dim=None):
|
|
|
1939
1936
|
r"""
|
|
1940
1937
|
Count the number of non-zero elements in the Tensor `input` on a given dimension `dim`. If no dim is specified then all non-zeros in the tensor are counted.
|
|
1941
1938
|
|
|
1942
|
-
.. warning::
|
|
1943
|
-
This is an experimental API that is subject to change or deletion.
|
|
1944
|
-
|
|
1945
1939
|
Args:
|
|
1946
1940
|
input (Tensor): Input data is used to count non-zero numbers. With shape
|
|
1947
1941
|
:math:`(*)` where :math:`*` means, any number of additional dimensions.
|
|
@@ -2268,6 +2262,13 @@ def dense(input, weight, bias=None):
|
|
|
2268
2262
|
return dense_op(input, weight, bias)
|
|
2269
2263
|
|
|
2270
2264
|
|
|
2265
|
+
def dequant_swiglu_quant(x, weight_scale, activation_scale, bias=None, quant_scale=None, quant_offset=None, group_index=None, activate_left=False, quant_mode='static'):
|
|
2266
|
+
r"""
|
|
2267
|
+
|
|
2268
|
+
"""
|
|
2269
|
+
return dequant_swiglu_quant_op(x, weight_scale, activation_scale, bias, quant_scale, quant_offset, group_index, activate_left, quant_mode)
|
|
2270
|
+
|
|
2271
|
+
|
|
2271
2272
|
def diagonal(input, offset=0, dim1=0, dim2=1):
|
|
2272
2273
|
r"""
|
|
2273
2274
|
Returns diagonals of the input tensor along specified dimension.
|
|
@@ -2436,9 +2437,6 @@ def dot(input, other):
|
|
|
2436
2437
|
r"""
|
|
2437
2438
|
Computes the dot product of two 1D tensor.
|
|
2438
2439
|
|
|
2439
|
-
.. warning::
|
|
2440
|
-
This is an experimental API that is subject to change or deletion.
|
|
2441
|
-
|
|
2442
2440
|
Args:
|
|
2443
2441
|
input (Tensor): The first input in the dot product, must be 1D.
|
|
2444
2442
|
other (Tensor): The second input in the dot product, must be 1D.
|
|
@@ -2573,104 +2571,6 @@ def elu(input_x, alpha=1.0):
|
|
|
2573
2571
|
return elu_op(input_x)
|
|
2574
2572
|
|
|
2575
2573
|
|
|
2576
|
-
def embedding_apply_adam_w(var_handle, beta1_power, beta2_power, lr, weight_decay, beta1, beta2, epsilon, grad, keys, max_grad_norm, global_step, embedding_dim, ams_grad=(0,), mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
|
|
2577
|
-
r"""
|
|
2578
|
-
|
|
2579
|
-
"""
|
|
2580
|
-
return embedding_apply_adam_w_op(var_handle, beta1_power, beta2_power, lr, weight_decay, beta1, beta2, epsilon, grad, keys, max_grad_norm, global_step, embedding_dim, ams_grad, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
def embedding_apply_adam(var_handle, beta1_power, beta2_power, lr, beta1, beta2, epsilon, grad, keys, global_step, embedding_dim, mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
|
|
2584
|
-
r"""
|
|
2585
|
-
|
|
2586
|
-
"""
|
|
2587
|
-
return embedding_apply_adam_op(var_handle, beta1_power, beta2_power, lr, beta1, beta2, epsilon, grad, keys, global_step, embedding_dim, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
def embedding_apply_ada_grad(var_handle, lr, grad, keys, global_step, embedding_dim, mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
|
|
2591
|
-
r"""
|
|
2592
|
-
|
|
2593
|
-
"""
|
|
2594
|
-
return embedding_apply_ada_grad_op(var_handle, lr, grad, keys, global_step, embedding_dim, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
def embedding_apply_ftrl(var_handle, lr, lr_power, lambda1, lambda2, grad, keys, global_step, embedding_dim, mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
|
|
2598
|
-
r"""
|
|
2599
|
-
|
|
2600
|
-
"""
|
|
2601
|
-
return embedding_apply_ftrl_op(var_handle, lr, lr_power, lambda1, lambda2, grad, keys, global_step, embedding_dim, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
def embedding_apply_rmsprop(var_handle, lr, rho, momentum, epsilon, grad, keys, global_step, embedding_dim, mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
|
|
2605
|
-
r"""
|
|
2606
|
-
|
|
2607
|
-
"""
|
|
2608
|
-
return embedding_apply_rmsprop_op(var_handle, lr, rho, momentum, epsilon, grad, keys, global_step, embedding_dim, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
def embedding_apply_sgd(var_handle, lr, grad, keys, global_step, embedding_dim, mask_zero=(0,), padding_key=(0,), padding_key_mask=(1,), completion_key=(0,), completion_key_mask=(1,), _embedding_dim=1, _max_key_num=1):
|
|
2612
|
-
r"""
|
|
2613
|
-
|
|
2614
|
-
"""
|
|
2615
|
-
return embedding_apply_sgd_op(var_handle, lr, grad, keys, global_step, embedding_dim, mask_zero, padding_key, padding_key_mask, completion_key, completion_key_mask, _embedding_dim, _max_key_num)
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
def embedding_feature_mapping_export(file_path, table_name, global_step, values, embedding_dim, feature_id, offset_id):
|
|
2619
|
-
r"""
|
|
2620
|
-
|
|
2621
|
-
"""
|
|
2622
|
-
return embedding_feature_mapping_export_op(file_path, table_name, global_step, values, embedding_dim, feature_id, offset_id)
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
def embedding_feature_mapping_file_size(file_path, table_name, global_step, embedding_dim, only_offset_flag=True):
|
|
2626
|
-
r"""
|
|
2627
|
-
|
|
2628
|
-
"""
|
|
2629
|
-
return embedding_feature_mapping_file_size_op(file_path, table_name, global_step, embedding_dim, only_offset_flag)
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
def embedding_feature_mapping_find(table_name, feature_size, num=1):
|
|
2633
|
-
r"""
|
|
2634
|
-
|
|
2635
|
-
"""
|
|
2636
|
-
return embedding_feature_mapping_find_op(table_name, feature_size, num)
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
def embedding_feature_mapping_import(file_path, teble_name, feature_size, global_step, embedding_dim, only_offset_flag=True, num=1):
|
|
2640
|
-
r"""
|
|
2641
|
-
|
|
2642
|
-
"""
|
|
2643
|
-
return embedding_feature_mapping_import_op(file_path, teble_name, feature_size, global_step, embedding_dim, only_offset_flag, num)
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
def embedding_feature_mapping_insert(table_name, num, feature_id, offset_id):
|
|
2647
|
-
r"""
|
|
2648
|
-
|
|
2649
|
-
"""
|
|
2650
|
-
return embedding_feature_mapping_insert_op(table_name, num, feature_id, offset_id)
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
def embedding_feature_mapping_table_size(table_name):
|
|
2654
|
-
r"""
|
|
2655
|
-
|
|
2656
|
-
"""
|
|
2657
|
-
return embedding_feature_mapping_table_size_op(table_name)
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
def embedding_feature_mapping_v2(table_name, feature_id, table_total_size, table_actual_size):
|
|
2661
|
-
r"""
|
|
2662
|
-
|
|
2663
|
-
"""
|
|
2664
|
-
return embedding_feature_mapping_v2_op(table_name, feature_id, table_total_size, table_actual_size)
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
def embedding_table_evict(var_handle, global_step, steps_to_live=0):
|
|
2668
|
-
r"""
|
|
2669
|
-
|
|
2670
|
-
"""
|
|
2671
|
-
return embedding_table_evict_op(var_handle, global_step, steps_to_live)
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
2574
|
def equal(input, other):
|
|
2675
2575
|
r"""
|
|
2676
2576
|
Compute the equivalence of the two inputs element-wise.
|
|
@@ -3521,6 +3421,43 @@ def floor(input):
|
|
|
3521
3421
|
return floor_op(input)
|
|
3522
3422
|
|
|
3523
3423
|
|
|
3424
|
+
def format_cast(input, acl_format):
|
|
3425
|
+
r"""
|
|
3426
|
+
Change tensor format.
|
|
3427
|
+
|
|
3428
|
+
.. warning::
|
|
3429
|
+
FormatCast will not work in the ge backend, origin input will be returned.
|
|
3430
|
+
|
|
3431
|
+
Args:
|
|
3432
|
+
input (Tensor): The input tensor.
|
|
3433
|
+
acl_format (int): enum value of acl format, the valid values are below:
|
|
3434
|
+
- ``0`` NCHW
|
|
3435
|
+
- ``1`` NHWC
|
|
3436
|
+
- ``2`` ND
|
|
3437
|
+
- ``3`` NC1HWC0
|
|
3438
|
+
- ``4`` FRACTAL_Z
|
|
3439
|
+
- ``27`` NDHWC
|
|
3440
|
+
- ``29`` FRACTAL_NZ
|
|
3441
|
+
- ``30`` NCDHW
|
|
3442
|
+
- ``32`` NDC1HWC0
|
|
3443
|
+
- ``33`` FRACTAL_Z_3D
|
|
3444
|
+
|
|
3445
|
+
Returns:
|
|
3446
|
+
Tensor
|
|
3447
|
+
|
|
3448
|
+
Supported Platforms:
|
|
3449
|
+
``Ascend``
|
|
3450
|
+
|
|
3451
|
+
Examples:
|
|
3452
|
+
>>> import mindspore
|
|
3453
|
+
>>> input = mindspore.ops.randn((2, 3, 4, 5))
|
|
3454
|
+
>>> output = mindspore.ops.format_cast(input, 2)
|
|
3455
|
+
>>> print(output.shape)
|
|
3456
|
+
(2, 3, 4, 5)
|
|
3457
|
+
"""
|
|
3458
|
+
return format_cast_op(input, acl_format)
|
|
3459
|
+
|
|
3460
|
+
|
|
3524
3461
|
def frac_ext(input):
|
|
3525
3462
|
r"""
|
|
3526
3463
|
Calculates the fractional part of each element in the input.
|
|
@@ -4016,7 +3953,6 @@ def histc_ext(input, bins=100, min=0, max=0):
|
|
|
4016
3953
|
Elements lower than min or higher than max are ignored.
|
|
4017
3954
|
|
|
4018
3955
|
.. warning::
|
|
4019
|
-
This is an experimental API that is subject to change or deletion.
|
|
4020
3956
|
If input is int64, valid values fit within int32; exceeding this may cause precision errors.
|
|
4021
3957
|
|
|
4022
3958
|
Args:
|
|
@@ -5184,6 +5120,25 @@ def inplace_scatter_add(input, dim, index, src):
|
|
|
5184
5120
|
return inplace_scatter_add_op(input, dim, index, src)
|
|
5185
5121
|
|
|
5186
5122
|
|
|
5123
|
+
def inplace_sigmoid(input):
|
|
5124
|
+
r"""
|
|
5125
|
+
sigmoid_() -> Tensor
|
|
5126
|
+
|
|
5127
|
+
In-place version of sigmoid().
|
|
5128
|
+
|
|
5129
|
+
.. warning::
|
|
5130
|
+
Only supports Ascend.
|
|
5131
|
+
"""
|
|
5132
|
+
return inplace_sigmoid_op(input)
|
|
5133
|
+
|
|
5134
|
+
|
|
5135
|
+
def inplace_sign(input):
|
|
5136
|
+
r"""
|
|
5137
|
+
|
|
5138
|
+
"""
|
|
5139
|
+
return inplace_sign_op(input)
|
|
5140
|
+
|
|
5141
|
+
|
|
5187
5142
|
def inplace_silu(input):
|
|
5188
5143
|
r"""
|
|
5189
5144
|
Computes Sigmoid Linear Unit of input element-wise. The SiLU function is defined as:
|
|
@@ -5500,7 +5455,7 @@ def isinf(input):
|
|
|
5500
5455
|
Return a boolean tensor indicating which elements are +/- inifnity.
|
|
5501
5456
|
|
|
5502
5457
|
.. warning::
|
|
5503
|
-
- This is an experimental API that is subject to change.
|
|
5458
|
+
- This is an experimental API that is subject to change or deletion.
|
|
5504
5459
|
- For Ascend, it is only supported on platforms above Atlas A2.
|
|
5505
5460
|
|
|
5506
5461
|
Args:
|
|
@@ -7371,11 +7326,18 @@ def nextafter(input, other):
|
|
|
7371
7326
|
|
|
7372
7327
|
Examples:
|
|
7373
7328
|
>>> import mindspore
|
|
7374
|
-
>>>
|
|
7375
|
-
>>>
|
|
7329
|
+
>>> import numpy as np
|
|
7330
|
+
>>> eps = np.finfo(np.float32).eps
|
|
7331
|
+
>>> input = mindspore.tensor([1.0], mindspore.float32)
|
|
7332
|
+
>>> other = mindspore.tensor([2.0], mindspore.float32)
|
|
7376
7333
|
>>> output = mindspore.ops.nextafter(input, other)
|
|
7377
|
-
>>> print(output)
|
|
7378
|
-
[
|
|
7334
|
+
>>> print(output == eps + 1)
|
|
7335
|
+
[ True]
|
|
7336
|
+
>>> input = mindspore.tensor([1.0, 2.0], mindspore.float32)
|
|
7337
|
+
>>> other = mindspore.tensor([2.0, 1.0], mindspore.float32)
|
|
7338
|
+
>>> output = mindspore.ops.nextafter(input, other)
|
|
7339
|
+
>>> print(output == mindspore.tensor([eps + 1, 2 - eps], mindspore.float32))
|
|
7340
|
+
[ True True]
|
|
7379
7341
|
"""
|
|
7380
7342
|
return next_after_op(input, other)
|
|
7381
7343
|
|
|
@@ -7429,9 +7391,6 @@ def outer_ext(input, vec2):
|
|
|
7429
7391
|
Return outer product of `input` and `vec2`. If `input` is a vector of size :math:`n`
|
|
7430
7392
|
and `vec2` is a vector of size :math:`m` , then output must be a matrix of shape :math:`(n, m)` .
|
|
7431
7393
|
|
|
7432
|
-
.. warning::
|
|
7433
|
-
This is an experimental API that is subject to change or deletion.
|
|
7434
|
-
|
|
7435
7394
|
.. note::
|
|
7436
7395
|
This function does not broadcast.
|
|
7437
7396
|
|
|
@@ -7678,12 +7637,13 @@ def range(start, end, step, maxlen=1000000):
|
|
|
7678
7637
|
Returns a tensor with a step length of `step` in the interval [ `start` , `end` ).
|
|
7679
7638
|
|
|
7680
7639
|
.. note::
|
|
7681
|
-
The types of all 3 inputs must be all integers or floating-point numbers.
|
|
7640
|
+
- The types of all 3 inputs must be all integers or floating-point numbers.
|
|
7641
|
+
- When the input is a tensor, the tensor must contain only one element, whose dtype is Number.
|
|
7682
7642
|
|
|
7683
7643
|
Args:
|
|
7684
|
-
start (
|
|
7685
|
-
end (
|
|
7686
|
-
step (
|
|
7644
|
+
start (Union[Number, Tensor]): The start value of the interval.
|
|
7645
|
+
end (Union[Number, Tensor]): The end value of the interval.
|
|
7646
|
+
step (Union[Number, Tensor]): The interval between each value.
|
|
7687
7647
|
maxlen (int, optional): Memory that can fit `maxlen` many elements
|
|
7688
7648
|
will be allocated for the output. Optional, must be positive. Default: 1000000.
|
|
7689
7649
|
If the output has more than `maxlen` elements, a runtime error will occur.
|
|
@@ -8186,9 +8146,9 @@ def ring_attention_update(prev_attn_out, prev_softmax_max, prev_softmax_sum, cur
|
|
|
8186
8146
|
- This is an experimental API that is subject to change or deletion.
|
|
8187
8147
|
- When `layout` is ``"TND"``, the last dimension of `prev_attn_out` must be a multiple of 64.
|
|
8188
8148
|
- When `layout` is ``"TND"``, `actual_seq_qlen` is mandatory.
|
|
8189
|
-
- When `layout` is ``"TND"``, N
|
|
8190
|
-
(AlignUp(
|
|
8191
|
-
DataSize is 4 bytes when `prev_attn_out` dtype is float32, 2 bytes when dtype is float16 / bfloat16.
|
|
8149
|
+
- When `layout` is ``"TND"``, N * D must satisfy the constraint:
|
|
8150
|
+
:math:`(\text{AlignUp}(N*D, 64)*(DataSize*6+8))+(\text{AlignUp}(N*8, 64)*56) <= 192*1024`.
|
|
8151
|
+
:math:`DataSize` is 4 bytes when `prev_attn_out` dtype is float32, 2 bytes when dtype is float16 / bfloat16.
|
|
8192
8152
|
- When `layout` is ``"TND"``, if `actual_seq_qlen` is not a non-decreasing sequence from 0 to T, the result is undefined.
|
|
8193
8153
|
|
|
8194
8154
|
Args:
|
|
@@ -9303,14 +9263,13 @@ def stack_ext(tensors, dim=0):
|
|
|
9303
9263
|
:math:`(x_1, x_2, ..., x_{dim}, N, x_{dim+1}, ..., x_R)`.
|
|
9304
9264
|
|
|
9305
9265
|
Args:
|
|
9306
|
-
tensors (Union[tuple, list]): A Tuple or list of Tensor objects with the same shape
|
|
9266
|
+
tensors (Union[tuple, list]): A Tuple or list of Tensor objects with the same shape.
|
|
9307
9267
|
dim (int, optional): Dimension to stack. The range is [-(R+1), R+1). Default: ``0`` .
|
|
9308
9268
|
|
|
9309
9269
|
Returns:
|
|
9310
|
-
|
|
9270
|
+
A stacked Tensor.
|
|
9311
9271
|
|
|
9312
9272
|
Raises:
|
|
9313
|
-
TypeError: If the data types of elements in `tensors` are not the same.
|
|
9314
9273
|
ValueError: If `dim` is out of the range [-(R+1), R+1);
|
|
9315
9274
|
or if the shapes of elements in `tensors` are not the same.
|
|
9316
9275
|
|
|
@@ -9946,9 +9905,6 @@ def transpose_ext_view(input, dim0, dim1):
|
|
|
9946
9905
|
r"""
|
|
9947
9906
|
Interchange two axes of a tensor.
|
|
9948
9907
|
|
|
9949
|
-
.. warning::
|
|
9950
|
-
This is an experimental API that is subject to change or deletion.
|
|
9951
|
-
|
|
9952
9908
|
Args:
|
|
9953
9909
|
input(Tensor): Input tensor.
|
|
9954
9910
|
dim0 (int): First axis.
|
|
@@ -9976,17 +9932,17 @@ def transpose_ext_view(input, dim0, dim1):
|
|
|
9976
9932
|
return transpose_ext_view_op(input, dim0, dim1)
|
|
9977
9933
|
|
|
9978
9934
|
|
|
9979
|
-
def transpose(input,
|
|
9935
|
+
def transpose(input, dims):
|
|
9980
9936
|
r"""
|
|
9981
9937
|
Transpose dimensions of the input tensor according to input permutation.
|
|
9982
9938
|
|
|
9983
9939
|
Note:
|
|
9984
|
-
On GPU and CPU, if the value of `
|
|
9985
|
-
Negative value of `
|
|
9940
|
+
On GPU and CPU, if the value of `dims` is negative, its actual value is `dims[i] + rank(input)`.
|
|
9941
|
+
Negative value of `dims` is not supported on Ascend.
|
|
9986
9942
|
|
|
9987
9943
|
Args:
|
|
9988
9944
|
input (Tensor): The input tensor.
|
|
9989
|
-
|
|
9945
|
+
dims (Union[tuple[int], list[int]]): Specify the new axis ordering.
|
|
9990
9946
|
|
|
9991
9947
|
Returns:
|
|
9992
9948
|
Tensor
|
|
@@ -10006,7 +9962,7 @@ def transpose(input, input_perm):
|
|
|
10006
9962
|
[ 8. 11.]
|
|
10007
9963
|
[ 9. 12.]]]
|
|
10008
9964
|
"""
|
|
10009
|
-
return transpose_op(input,
|
|
9965
|
+
return transpose_op(input, dims)
|
|
10010
9966
|
|
|
10011
9967
|
|
|
10012
9968
|
def transpose_view(input, input_perm):
|
|
@@ -10120,9 +10076,6 @@ def triu(input, diagonal=0):
|
|
|
10120
10076
|
r"""
|
|
10121
10077
|
Zero the input tensor below the diagonal specified.
|
|
10122
10078
|
|
|
10123
|
-
.. warning::
|
|
10124
|
-
This is an experimental API that is subject to change or deletion.
|
|
10125
|
-
|
|
10126
10079
|
Args:
|
|
10127
10080
|
input (Tensor): The input tensor.
|
|
10128
10081
|
diagonal (int, optional): The diagonal specified of 2-D tensor. Default ``0`` represents the main diagonal.
|
|
@@ -10557,7 +10510,7 @@ def grouped_matmul_v2(x, weight, bias=None, scale=None, offset=None, antiquant_s
|
|
|
10557
10510
|
return grouped_matmul_v2_op(x, weight, bias, scale, offset, antiquant_scale, antiquant_offset, group_list, split_item, group_type)
|
|
10558
10511
|
|
|
10559
10512
|
|
|
10560
|
-
def grouped_matmul_v4(x, weight, bias=None, scale=None, offset=None, antiquant_scale=None, antiquant_offset=None, pre_token_scale=None, group_list=None, activation_input=None, activation_quant_scale=None, activation_quant_offset=None, split_item=0, group_type=-1, group_list_type=0, act_type=0):
|
|
10513
|
+
def grouped_matmul_v4(x, weight, bias=None, scale=None, offset=None, antiquant_scale=None, antiquant_offset=None, pre_token_scale=None, group_list=None, activation_input=None, activation_quant_scale=None, activation_quant_offset=None, split_item=0, group_type=-1, group_list_type=0, act_type=0, output_dtype=None):
|
|
10561
10514
|
r"""
|
|
10562
10515
|
Group calculation matmul.
|
|
10563
10516
|
|
|
@@ -10572,8 +10525,10 @@ def grouped_matmul_v4(x, weight, bias=None, scale=None, offset=None, antiquant_s
|
|
|
10572
10525
|
y_i = x_i\times (weight_i + antiquant\_offset_i) * antiquant\_scale_i + bias_i
|
|
10573
10526
|
|
|
10574
10527
|
.. note::
|
|
10575
|
-
Only when `bias` , `scale` , `offset` , `antiquant_scale` and `antiquant_offset` are all None, `group_type` is 0,
|
|
10576
|
-
|
|
10528
|
+
- Only when `bias` , `scale` , `offset` , `antiquant_scale` and `antiquant_offset` are all None, `group_type` is 0,
|
|
10529
|
+
and `split_item` is 3, the reverse derivative is supported.
|
|
10530
|
+
- When `x` type is int8 and `weight` type is int4, the `scale` should be of the uint64 data type,
|
|
10531
|
+
but its memory needs to be arranged in float32 format.
|
|
10577
10532
|
|
|
10578
10533
|
** Per-Token-Quant **
|
|
10579
10534
|
|
|
@@ -10613,6 +10568,8 @@ def grouped_matmul_v4(x, weight, bias=None, scale=None, offset=None, antiquant_s
|
|
|
10613
10568
|
as the cumsum of grouping size in each group, and 1 represents the positions as the grouping size in
|
|
10614
10569
|
each group. Default: ``0``.
|
|
10615
10570
|
act_type (int): Activation function type. Currently not supported. Default: ``0``.
|
|
10571
|
+
output_dtype (mindspore.dtype): Specifies the output data type, currently taking effect only when input x is int8 and weight is int4.
|
|
10572
|
+
If None is passed in, bfloat16 will be used by default. Default: ``None``.
|
|
10616
10573
|
|
|
10617
10574
|
|
|
10618
10575
|
Parameter limitations 1
|
|
@@ -10703,7 +10660,7 @@ def grouped_matmul_v4(x, weight, bias=None, scale=None, offset=None, antiquant_s
|
|
|
10703
10660
|
[108 112]
|
|
10704
10661
|
[108 112]]
|
|
10705
10662
|
"""
|
|
10706
|
-
return grouped_matmul_v4_op(x, weight, bias, scale, offset, antiquant_scale, antiquant_offset, pre_token_scale, group_list, activation_input, activation_quant_scale, activation_quant_offset, split_item, group_type, group_list_type, act_type)
|
|
10663
|
+
return grouped_matmul_v4_op(x, weight, bias, scale, offset, antiquant_scale, antiquant_offset, pre_token_scale, group_list, activation_input, activation_quant_scale, activation_quant_offset, split_item, group_type, group_list_type, act_type, output_dtype)
|
|
10707
10664
|
|
|
10708
10665
|
|
|
10709
10666
|
def kv_cache_scatter_update(var, indices, updates, axis, reduce='none'):
|