--singleop
Description
Converts a single-operator description .json file into an offline model adapted to the Ascend AI Processor for operator functional verification.
See Also
This option works with the following options, of which, --output and --soc_version are required.
Atlas 200/300/500 Inference Product :Atlas Training Series Product :
Argument
Argument: Single-operator description .json file. For details about the format and configuration of the file, see Generating a Single-Operator Model.
Restrictions: The specified single-operator is defined based on Ascend IR. For details about the single-operator definition, see Operator Acceleration Library API Reference.
Suggestions and Benefits
None
Example
The following uses the single-operator Add as an example for illustration. Upload the operator description file add.json to any directory on the ATC server, for example, $HOME/singleop. The following is an example:
--singleop=$HOME/singleop/add.json --output=$HOME/singleop/out/op_model --soc_version=<soc_version>
Applicability
Dependencies and Restrictions
- Restrictions
To convert a single-operator .json file into an offline model and only use TBE operators during the conversion process (errors are reported if TBE operators cannot be found, without searching for AI CPU operators), set the following environment variable:
export ASCEND_ENGINE_PATH=${INSTALL_DIR}/lib64/plugin/opskernel/libfe.so:${INSTALL_DIR}/lib64/plugin/opskernel/libge_local_engine.so:${INSTALL_DIR}/lib64/plugin/opskernel/librts_engine.so
If you want to perform other operations after running the preceding command, run the unset ASCEND_ENGINE_PATH command to disable the environment variable.
- API Usage:
When using an .om model file converted from a single-operator description file in an application project for model inference, call the AscendCL API (for example, aclopSetModelDir) to load the operator model, and then call the AscendCL API (for example, aclopExecuteV2) to execute the operators.
For details about the APIs, see Single-Operator Model Execution.