From 1f8fa3d102354ff3d026b1c898efc4b48608136b Mon Sep 17 00:00:00 2001 From: hbhu_bin Date: Wed, 30 Jul 2025 15:42:36 +0800 Subject: [PATCH] add docs for ASDSIP FFT operators --- .../source_en/custom_program/op_custom.rst | 1 + .../operation/cpp_api_for_custom_ops.md | 47 +++++++ .../operation/op_customopbuilder.md | 1 + .../operation/op_customopbuilder_asdsip.md | 128 ++++++++++++++++++ .../source_zh_cn/custom_program/op_custom.rst | 1 + .../operation/cpp_api_for_custom_ops.md | 47 +++++++ .../operation/op_customopbuilder.md | 1 + .../operation/op_customopbuilder_asdsip.md | 128 ++++++++++++++++++ 8 files changed, 354 insertions(+) create mode 100644 tutorials/source_en/custom_program/operation/op_customopbuilder_asdsip.md create mode 100644 tutorials/source_zh_cn/custom_program/operation/op_customopbuilder_asdsip.md diff --git a/tutorials/source_en/custom_program/op_custom.rst b/tutorials/source_en/custom_program/op_custom.rst index 00bff33121..f237861d22 100644 --- a/tutorials/source_en/custom_program/op_custom.rst +++ b/tutorials/source_en/custom_program/op_custom.rst @@ -16,6 +16,7 @@ Custom Operators operation/op_customopbuilder operation/cpp_api_for_custom_ops operation/op_customopbuilder_atb + operation/op_customopbuilder_asdsip When built-in operators cannot meet requirements during network development, you can use MindSpore's custom operator functionality to integrate your operators. Currently, MindSpore provides two approaches for integrating custom operators: diff --git a/tutorials/source_en/custom_program/operation/cpp_api_for_custom_ops.md b/tutorials/source_en/custom_program/operation/cpp_api_for_custom_ops.md index 833893c277..64559b22ef 100644 --- a/tutorials/source_en/custom_program/operation/cpp_api_for_custom_ops.md +++ b/tutorials/source_en/custom_program/operation/cpp_api_for_custom_ops.md @@ -517,3 +517,50 @@ void RunAtbOp(const std::string &op_name, const ParamType ¶m, const std::vec - `param`: Parameters required to initialize the ATB operator. - `inputs`: A list of input tensors for the operator. - `outputs`: A list of output tensors for the operator. + +### class AsdSipFFTOpRunner + +The `AsdSipFFTOpRunner` class is a runner for executing Ascend Sip Boost (ASDSIP) operators, defined in the [asdsip_common.h](https://gitee.com/mindspore/mindspore/blob/master/mindspore/ccsrc/ms_extension/ascend/asdsip/asdsip_common.h) header file. + +This class inherits from `PyboostRunner` and encapsulates the process of invoking ASDSIP FFT operators, including initialization, running the ASDSIP FFT operator, managing input/output tensor, memory allocation, and kernel scheduling. + +Refer to the tutorial [CustomOpBuilder Integrates the ASDSIP FFT Operators through AsdSipFFTOpRunner](https://www.mindspore.cn/tutorials/en/master/custom_program/operation/op_customopbuilder_asdsip.html) for usage methods. + +#### Constructor + +- **AsdSipFFTOpRunner** + + ```cpp + explicit AsdSipFFTOpRunner(std::string op_name) : PyboostRunner(op_name) {} + ``` + + Constructor inherited from `PyboostRunner`. + +#### Public Methods + +- **Init(const FFTParam ¶m);** + + ```cpp + void Init(const FFTParam ¶m); + ``` + + - **Description**: [API] Initializes the ASDSIP FFT operator with the given parameters. This method creates a corresponding `asdFftHandle` instance for the operator via `AsdFftCreate` and places it in the cache. Only one `asdFftHandle` instance is created for operators with the same `param`. + - **Parameters**: + - `param`: Parameters used to configure the ASDSIP FFT operator. + +### function RunAsdSipFFTOp + +The interface for executing ASDSIP FFT operators in dynamic graphs, defined in the [asdsip_common.h](https://gitee.com/mindspore/mindspore/blob/master/mindspore/ccsrc/ms_extension/ascend/asdsip/asdsip_common.h) header file. + +```cpp +inline void RunAsdSipFFTOp(const std::string &op_name, const FFTParam &fft_param, const ms::Tensor &input, + const ms::Tensor &output) +``` + +[API] Executes an ASDSIP FFT operator using the provided parameters, input, and output. This function is a wrapper around `AsdSipFFTOpRunner`. + +- **Parameters** + - `op_name`: The name of the ASDSIP FFT operator to execute. + - `fft_param`: Parameters required to initialize the ASDSIP FFT operator. + - `inputs`: A list of input tensor for the operator. + - `outputs`: A list of output tensor for the operator. \ No newline at end of file diff --git a/tutorials/source_en/custom_program/operation/op_customopbuilder.md b/tutorials/source_en/custom_program/operation/op_customopbuilder.md index 08e005acad..ea09954dbb 100644 --- a/tutorials/source_en/custom_program/operation/op_customopbuilder.md +++ b/tutorials/source_en/custom_program/operation/op_customopbuilder.md @@ -215,3 +215,4 @@ Running the above script produces the following result: ## More Usage Scenarios - [Integrating ATB Operators Using AtbOpRunner](https://www.mindspore.cn/tutorials/en/master/custom_program/operation/op_customopbuilder_atb.html): Introduces methods for quickly integrating ATB operators as custom operators. +- [Integrating ASDSIP FFT Operators Using AsdSipFFTOpRunner](https://www.mindspore.cn/tutorials/zh-CN/master/custom_program/operation/op_customopbuilder_asdsip.html): Introduces methods for quickly integrating ASDSIP FFT operators as custom operators. diff --git a/tutorials/source_en/custom_program/operation/op_customopbuilder_asdsip.md b/tutorials/source_en/custom_program/operation/op_customopbuilder_asdsip.md new file mode 100644 index 0000000000..2d14959aab --- /dev/null +++ b/tutorials/source_en/custom_program/operation/op_customopbuilder_asdsip.md @@ -0,0 +1,128 @@ +# CustomOpBuilder: Integrating ASDSIP FFT Operators Using AsdSipFFTOpRunner + +[![View Source File](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source_en.svg)](https://gitee.com/mindspore/docs/blob/master/tutorials/source_en/custom_program/operation/op_customopbuilder.md) + +## Overview + +[Ascend Sip Boost (ASDSIP) Operator Acceleration Library](https://www.hiascend.com/document/detail/zh/canncommercial/82RC1/acce/SiP/SIP_0000.html) is an operator library specifically designed for signal process, based on Huawei's Ascend AI processors. + +When users need to use operators from the ASDSIP acceleration library that are not provided by MindSpore, they can quickly integrate and use them through custom operators. + +In [Custom Operators Based on CustomOpBuilder](https://www.mindspore.cn/tutorials/en/master/custom_program/operation/op_customopbuilder.html), MindSpore provides the `PyboostRunner` tool to allow users to integrate custom operators in dynamic graphs. Now, for ASDSIP FFT operators, MindSpore additionally provides the `AsdSipFFTOpRunner` tool to encapsulate the ASDSIP FFT operator's workflow and the dynamic graph's multi-stage pipeline. + +When integrating ASDSIP FFT operators using the [AsdSipFFTOpRunner class](https://www.mindspore.cn/tutorials/en/master/custom_program/operation/cpp_api_for_custom_ops.html#class-asdsipfftoprunner), users only need to provide a `Param` (used as the key for caching `Operation`) and call the `Init` interface for initialization (constructing `Operation`), followed by the `Run` interface to execute the ASDSIP FFT operator. Additionally, users can directly call the [RunAsdSipFFTOp](https://www.mindspore.cn/tutorials/en/master/custom_program/operation/cpp_api_for_custom_ops.html#function-launchasdsipfft) function for one-click execution (the function internally includes calls to both `Init` and `Run` interfaces). + +This guide uses `FftC2C` as an example to demonstrate the ASDSIP FFT operator integration process. The complete code can be found in the [code repository](https://gitee.com/mindspore/mindspore/blob/master/tests/st/graph_kernel/custom/jit_test_files/asdsip_fftc2c.cpp). + +## Installing the ASDSIP Acceleration Library + +[Click here for installation tutorial](https://www.hiascend.com/document/detail/zh/canncommercial/82RC1/acce/SiP/SIP_0001.html) + +After successful installation, the users need to activate the environment variable for the ASDSIP acceleration library: + +```sh +source /usr/local/Ascend/nnal/asdsip/set_env.sh &> /dev/null +``` + +## Integrating the FftC2C Operator + +Here we use `ms::pynative::RunLaunchAsdSipFFTAtbOp` to integrate the operator and call the function interface through `ms::pynative::PyboostRunner::Call`: + +```cpp +#include "ms_extension/api.h" + +ms::Tensor InferFFTForward(const ms::Tensor &input) { + ShapeVector out_tensor_shape(input.shape()); + return ms::Tensor(input.data_type(), out_tensor_shape); +} + +ms::Tensor npu_fft(const ms::Tensor &input, int64_t n, int64_t batch_size) { + ms::pynative::FFTParam param; + param.fftXSize = n; + param.fftYSize = 0; + param.fftType = ms::pynative::asdFftType::ASCEND_FFT_C2C; + param.direction = ms::pynative::asdFftDirection::ASCEND_FFT_FORWARD; + param.batchSize = batch_size; + param.dimType = ms::pynative::asdFft1dDimType::ASCEND_FFT_HORIZONTAL; + auto output = InferFFTForward(input); + ms::pynative::RunAsdSipFFTOp("asdFftExecC2C", param, input, output); + return output; +} + +auto pyboost_npu_fft(const ms::Tensor &input, int64_t n, int64_t batch_size) { + return ms::pynative::PyboostRunner::Call<1>(npu_fft, input, n, batch_size); +} + +PYBIND11_MODULE(MS_EXTENSION_NAME, m) { + m.def("fft", &pyboost_npu_fft, "FFT C2C", pybind11::arg("input"), pybind11::arg("n"), + pybind11::arg("batch_size")); +} +``` + +### 1. Infer the Output Information of the Operator + +```cpp +ms::Tensor InferFFT1DForward(const ms::Tensor &input) { + ShapeVector out_tensor_shape(input.shape()); + return ms::Tensor(input.data_type(), out_tensor_shape); +} +``` + +For the `FftC2C` operator, the output tensor has the same data type and shape as the input tensor, an empty tensor is constructed using the `ms::Tensor` constructor. + +### 2. Create and Set the Operator Attribute Structure + +```cpp +ms::pynative::FFTParam param; +param.fftXSize = n; +param.fftYSize = 0; +param.fftType = ms::pynative::asdFftType::ASCEND_FFT_C2C; +param.direction = ms::pynative::asdFftDirection::ASCEND_FFT_FORWARD; +param.batchSize = batch_size; +param.dimType = ms::pynative::asdFft1dDimType::ASCEND_FFT_HORIZONTAL; +``` + +### 3. Execute the Operator via the RunAtbOp Interface + +```cpp +ms::pynative::PyboostRunner::Call<1>(npu_fft, input, n, batch_size); +``` + +This is a template interface, equivalent to: + +```cpp +auto runner = std::make_shared("FFTExecC2C"); +runner->Init(fft_param); +runner->Run({input}, {output}); +``` + +By passing in the operator name, attributes, input tensor list, and output tensor list, the corresponding ASDSIP operator can be invoked. This interface supports multi-stage pipeline execution in dynamic graphs. + +### 4. Bind the C++ Function to a Python Function via pybind11 + +```cpp +auto pyboost_npu_fft(const ms::Tensor &input, int64_t n, int64_t batch_size) { + return ms::pynative::PyboostRunner::Call<1>(npu_fft, input, n, batch_size); +} + +PYBIND11_MODULE(MS_EXTENSION_NAME, m) { + m.def("fft", &pyboost_npu_fft, "FFT C2C", pybind11::arg("input"), pybind11::arg("n"), + pybind11::arg("batch_size")); +} +``` + +### 5. Compile the Custom Operator Using CustomOpBuilder + +Save the above C++ code as a file named `asdsip_fftc2c.cpp`, and then compile it using the Python interface `CustomOpBuilder`. + +```python +input_np = np.random.rand(2, 16) +real_np = input_np.astype(np.float32) +imag_np = input_np.astype(np.float32) +complex_np = real_np + 1j * imag_np +my_ops = CustomOpBuilder("asdsip_fftc2c", "jit_test_files/asdsip_fftc2c.cpp", enable_asdsip=True).load() +output_tensor = my_ops.fft(input_tensor, 16, 2) +print(output_tensor) +``` + +Here, the parameter `enable_asdsip=True` is passed into `CustomOpBuilder`, and MindSpore will automatically add compilation and linking options related to the ASDSIP acceleration library. Users only need to ensure that the `set_env.sh` script for the ASDSIP library has been correctly executed, and the environment contains the `ASDSIP_HOME_PATH` variable. \ No newline at end of file diff --git a/tutorials/source_zh_cn/custom_program/op_custom.rst b/tutorials/source_zh_cn/custom_program/op_custom.rst index 13f5a13fff..f30ac98b4c 100644 --- a/tutorials/source_zh_cn/custom_program/op_custom.rst +++ b/tutorials/source_zh_cn/custom_program/op_custom.rst @@ -16,6 +16,7 @@ operation/op_customopbuilder operation/cpp_api_for_custom_ops operation/op_customopbuilder_atb + operation/op_customopbuilder_asdsip 当开发网络遇到内置算子不足以满足需求时,你可以利用MindSpore的自定义算子功能接入你的算子。当前MindSpore提供了两种方式接入自定义算子,分别是 `基于Custom原语接入 `_ 和 `基于CustomOpBuilder接入 `_ 。 diff --git a/tutorials/source_zh_cn/custom_program/operation/cpp_api_for_custom_ops.md b/tutorials/source_zh_cn/custom_program/operation/cpp_api_for_custom_ops.md index abca0f6710..4c77055275 100644 --- a/tutorials/source_zh_cn/custom_program/operation/cpp_api_for_custom_ops.md +++ b/tutorials/source_zh_cn/custom_program/operation/cpp_api_for_custom_ops.md @@ -517,3 +517,50 @@ void RunAtbOp(const std::string &op_name, const ParamType ¶m, const std::vec - `param`:初始化 ATB 算子所需的参数。 - `inputs`:算子的输入 Tensor 列表。 - `outputs`:算子的输出 Tensor 列表。 + +### class AsdSipFFTOpRunner + +用于执行 Ascend Sip Boost (ASDSIP) 算子的运行器类,定义在[asdsip_common.h](https://gitee.com/mindspore/mindspore/blob/master/mindspore/ccsrc/ms_extension/ascend/asdsip/asdsip_common.h)头文件中。 + +此类继承自 `PyboostRunner`,并封装了 ASDSIP FFT 算子的调用流程,包括初始化和运行 ASDSIP FFT 算子、管理输入输出 Tensor、内存分配及内核调度。 + +可以查看教程 [CustomOpBuilder通过AsdSipFFTOpRunner接入ASDSIP FFT算子](https://www.mindspore.cn/tutorials/zh-CN/master/custom_program/operation/op_customopbuilder_asdsip.html) 获取使用方法。 + +#### 构造函数 + +- **AsdSipFFTOpRunner** + + ```cpp + explicit AsdSipFFTOpRunner(std::string op_name) : PyboostRunner(op_name) {} + ``` + + 继承自 `PyboostRunner` 的构造函数。 + +#### 公共方法 + +- **Init(const FFTParam ¶m);** + + ```cpp + void Init(const FFTParam ¶m); + ``` + + - **描述**: 【API】 使用给定参数初始化 ASDSIP FFT 算子。此方法通过 `AsdFftCreate` 创建对应算子的 `asdFftHandle` 实例,并将其放入缓存中。对于`param`相同的算子,只会创建一份 `asdFftHandle` 实例。 + - **参数** + - `param`:用于配置 ASDSIP FFT 算子的参数。 + +### function RunAsdSipFFTOp + +动态图执行ASDSIP FFT算子的接口,定义在[asdsip_common.h](https://gitee.com/mindspore/mindspore/blob/master/mindspore/ccsrc/ms_extension/ascend/asdsip/asdsip_common.h)头文件中。 + +```cpp +inline void RunAsdSipFFTOp(const std::string &op_name, const FFTParam &fft_param, const ms::Tensor &input, + const ms::Tensor &output) +``` + +【API】 使用提供的参数、输入和输出执行一个 ASDSIP FFT 算子。此函数是对 `AsdSipFFTOpRunner` 的一层封装。 + +- **参数** + - `op_name`:要执行的 ASDSIP FFT 算子名称。 + - `fft_param`:初始化 ASDSIP FFT 算子所需的参数。 + - `inputs`:算子的输入 Tensor。 + - `outputs`:算子的输出 Tensor。 diff --git a/tutorials/source_zh_cn/custom_program/operation/op_customopbuilder.md b/tutorials/source_zh_cn/custom_program/operation/op_customopbuilder.md index 9622958823..f3481fe131 100644 --- a/tutorials/source_zh_cn/custom_program/operation/op_customopbuilder.md +++ b/tutorials/source_zh_cn/custom_program/operation/op_customopbuilder.md @@ -215,3 +215,4 @@ print(out) ## 更多场景示例 - [通过AtbOpRunner接入ATB算子](https://www.mindspore.cn/tutorials/zh-CN/master/custom_program/operation/op_customopbuilder_atb.html):介绍通过自定义算子快速对接ATB算子的方法。 +- [通过AsdSipFFTOpRunner接入ASDSIP FFT算子](https://www.mindspore.cn/tutorials/zh-CN/master/custom_program/operation/op_customopbuilder_asdsip.html):介绍通过自定义算子快速对接ASDSIP FFT算子的方法。 diff --git a/tutorials/source_zh_cn/custom_program/operation/op_customopbuilder_asdsip.md b/tutorials/source_zh_cn/custom_program/operation/op_customopbuilder_asdsip.md new file mode 100644 index 0000000000..781f456634 --- /dev/null +++ b/tutorials/source_zh_cn/custom_program/operation/op_customopbuilder_asdsip.md @@ -0,0 +1,128 @@ +# CustomOpBuilder通过AsdSipFFTOpRunner接入ASDSIP FFT算子 + +[![查看源文件](https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg)](https://gitee.com/mindspore/docs/blob/master/tutorials/source_zh_cn/custom_program/operation/op_customopbuilder_asdsip.md) + +## 概述 + +[Ascend Sip Boost (ASDSIP) 算子加速库](https://www.hiascend.com/document/detail/zh/canncommercial/82RC1/acce/SiP/SIP_0000.html) 是基于华为Ascend AI处理器,专门为信号处理领域而设计的算子库。 + +当用户需要使用ASDSIP加速库的FFT类算子,而MindSpore未提供相应算子接口时,用户可以使用自定义算子的方法快速接入使用。 + +在 [基于CustomOpBuilder的自定义算子](https://www.mindspore.cn/tutorials/zh-CN/master/custom_program/operation/op_customopbuilder.html) 中,MindSpore提供了 `PyboostRunner` 方便用户在动态图接入自定义算子。现在针对ASDSIP算子,MindSpore又额外提供了一套`AsdSipFFTOpRunner`用于把ASDSIP FFT算子的调用流程和动态图多级流水封装到一起。 + +用户基于 [AsdSipFFTOpRunner类](https://www.mindspore.cn/tutorials/zh-CN/master/custom_program/operation/cpp_api_for_custom_ops.html#class-asdsipfftoprunner) 对接ASDSIP FFT算子时,仅需要提供`Param`,并调用`Init`接口初始化(即构造`Operation`),再调用`Run`接口即可执行ASDSIP算子。还可以直接调用 [RunAsdSipFFTOp](https://www.mindspore.cn/tutorials/zh-CN/master/custom_program/operation/cpp_api_for_custom_ops.html#function-launchasdsipfft)函数一键执行(函数内包含了`Init`和`Run`接口的调用)。 + +本指南以一个`FftC2C`为例,展示ASDSIP FFT算子的接入流程。完整代码请参阅[代码仓库](https://gitee.com/mindspore/mindspore/blob/master/tests/st/graph_kernel/custom/jit_test_files/asdsip_fftc2c.cpp)。 + +## 安装ASDSIP加速库 + +[点这里查看安装教程](https://www.hiascend.com/document/detail/zh/canncommercial/82RC1/acce/SiP/SIP_0001.html) + +安装成功之后,需要激活ASDSIP加速库的环境变量: + +```sh +source /usr/local/Ascend/nnal/asdsip/set_env.sh &> /dev/null +``` + +## FftC2C算子接入 + +这里使用`ms::pynative::RunAsdSipFFTOp`接入算子,并通过`ms::pynative::PyboostRunner::Call`调用函数接口: + +```cpp +#include "ms_extension/api.h" + +ms::Tensor InferFFTForward(const ms::Tensor &input) { + ShapeVector out_tensor_shape(input.shape()); + return ms::Tensor(input.data_type(), out_tensor_shape); +} + +ms::Tensor npu_fft(const ms::Tensor &input, int64_t n, int64_t batch_size) { + ms::pynative::FFTParam param; + param.fftXSize = n; + param.fftYSize = 0; + param.fftType = ms::pynative::asdFftType::ASCEND_FFT_C2C; + param.direction = ms::pynative::asdFftDirection::ASCEND_FFT_FORWARD; + param.batchSize = batch_size; + param.dimType = ms::pynative::asdFft1dDimType::ASCEND_FFT_HORIZONTAL; + auto output = InferFFTForward(input); + ms::pynative::RunAsdSipFFTOp("asdFftExecC2C", param, input, output); + return output; +} + +auto pyboost_npu_fft(const ms::Tensor &input, int64_t n, int64_t batch_size) { + return ms::pynative::PyboostRunner::Call<1>(npu_fft, input, n, batch_size); +} + +PYBIND11_MODULE(MS_EXTENSION_NAME, m) { + m.def("fft", &pyboost_npu_fft, "FFT C2C", pybind11::arg("input"), pybind11::arg("n"), + pybind11::arg("batch_size")); +} +``` + +### 1. 推导算子的输出信息 + +```cpp +ms::Tensor InferFFT1DForward(const ms::Tensor &input) { + ShapeVector out_tensor_shape(input.shape()); + return ms::Tensor(input.data_type(), out_tensor_shape); +} +``` + +对于`FftC2C`算子,输出张量的数据类型和输入的一样。推导出输出形状之后,通过`ms::Tensor`构造函数构造一个空的张量。 + +### 2. 创建并设置算子属性结构体 + +```cpp +ms::pynative::FFTParam param; +param.fftXSize = n; +param.fftYSize = 0; +param.fftType = ms::pynative::asdFftType::ASCEND_FFT_C2C; +param.direction = ms::pynative::asdFftDirection::ASCEND_FFT_FORWARD; +param.batchSize = batch_size; +param.dimType = ms::pynative::asdFft1dDimType::ASCEND_FFT_HORIZONTAL; +``` + +### 3. 调用RunAtbOp接口执行算子 + +```cpp +ms::pynative::PyboostRunner::Call<1>(npu_fft, input, n, batch_size); +``` + +这是一个模板接口,其等效于: + +```cpp +auto runner = std::make_shared("FFTExecC2C"); +runner->Init(fft_param); +runner->Run({input}, {output}); +``` + +传入算子名、属性、输入张量、输出张量几个信息,即可调用相应的ASDSIP算子。此接口支持了动态图的多级流水执行流程。 + +### 4. 通过pybind11将C++函数绑定一个Python函数 + +```cpp +auto pyboost_npu_fft(const ms::Tensor &input, int64_t n, int64_t batch_size) { + return ms::pynative::PyboostRunner::Call<1>(npu_fft, input, n, batch_size); +} + +PYBIND11_MODULE(MS_EXTENSION_NAME, m) { + m.def("fft", &pyboost_npu_fft, "FFT C2C", pybind11::arg("input"), pybind11::arg("n"), + pybind11::arg("batch_size")); +} +``` + +### 5. 使用CustomOpBuilder编译自定义算子 + +将上述C++代码保存成文件`asdsip_fftc2c.cpp`,然后使用Python接口`CustomOpBuilder`编译。 + +```python +input_np = np.random.rand(2, 16) +real_np = input_np.astype(np.float32) +imag_np = input_np.astype(np.float32) +complex_np = real_np + 1j * imag_np +my_ops = CustomOpBuilder("asdsip_fftc2c", "jit_test_files/asdsip_fftc2c.cpp", enable_asdsip=True).load() +output_tensor = my_ops.fft(input_tensor, 16, 2) +print(output_tensor) +``` + +这里向`CustomOpBuilder`传入了`enable_asdsip=True`的参数,MindSpore会自动添加与ASDSIP加速库有关的编译和链接选项。用户需保证正确执行了ASDSIP库的`set_env.sh`脚本,环境中已配置`ASDSIP_HOME_PATH`环境变量。 -- Gitee