docs/en/integrations/ascend.md
Deploying computer vision models on Huawei Ascend AI Processors requires compiling them into the .om offline model format executed by the Ascend AI Core. Exporting Ultralytics YOLO models to Ascend lets you run fast, low-power inference on Atlas developer boards and OrangePi AIPro devices used across robotics, industrial inspection, and smart camera deployments.
Huawei Ascend is a family of AI Processors paired with CANN (Compute Architecture for Neural Networks), Huawei's heterogeneous computing stack. CANN ships the ATC (Ascend Tensor Compiler), a host-side tool that converts a standard ONNX graph into a hardware-specific .om offline model targeting the Ascend AI Core.
Because ATC runs entirely on the host, you can compile models on a regular x86-64 or ARM64 Linux machine without any Ascend hardware attached, then copy the resulting .om to the target device for inference.
The Ultralytics exporter first writes an intermediate ONNX graph, then invokes ATC to compile it for the SoC you target with the name argument. The result is a self-contained model directory holding the .om binary and its Ultralytics metadata.
.om at compile time, removing runtime shape negotiation overhead.name.Ascend export supports all seven Ultralytics tasks. Detection, instance segmentation, pose, OBB, and classification cover the YOLO26, YOLO11, and YOLOv8 families; semantic segmentation and depth estimation are YOLO26-only.
| Task | Supported |
|---|---|
| Object Detection | ✅ |
| Instance Segmentation | ✅ |
| Semantic Segmentation | ✅ |
| Pose Estimation | ✅ |
| OBB Detection | ✅ |
| Classification | ✅ |
| Depth Estimation | ✅ |
Pass the target SoC with name; ATC bakes it into the .om as --soc_version, so it must match the board you deploy to. Locally you can compile for any SoC your CANN installation provides kernels for. On Ultralytics Platform, the 310B targets are listed as coming soon while their operator kernels are added to the build image.
name | Devices | Local export | Platform |
|---|---|---|---|
Ascend310P3 | Atlas 300I Pro, Atlas 300V Pro | ✅ | ✅ |
Ascend310P1 | Atlas 300I | ✅ | ✅ |
Ascend310B4 | OrangePi AIPro 20T, Atlas 200I A2 | ✅ | Coming soon |
Ascend310B1 | OrangePi AIPro 8T | ✅ | Coming soon |
!!! note
Ascend export requires the CANN toolkit, which is Linux-only. The `atc` compiler must be on your `PATH` — source the CANN environment script before exporting, e.g. `source /usr/local/Ascend/ascend-toolkit/set_env.sh`.
Install Ultralytics, then install CANN separately from Huawei.
!!! tip "Installation"
=== "CLI"
```bash
# Install the required package for YOLO
pip install ultralytics
```
The CANN toolkit is distributed by Huawei and is not installed automatically. Download it from the Ascend community download page, or use one of the official ascendai/cann container images, which bundle ATC and its dependencies.
!!! warning "Match the toolkit to your target SoC"
ATC can only compile for SoC families whose operator kernels are installed. A toolkit carrying only `ascend310p` kernels fails with `No supported Ops kernel and engine are found for ... Conv2D` when asked for an `Ascend310B4` target. Install the matching `Ascend-cann-kernels-<soc>` package for the device you deploy to.
The Ascend format supports the Export, Predict, and Validate modes. Inference and validation run on Ascend hardware. Export your model, then load the exported model to run inference or validate its accuracy.
!!! example "Export"
=== "Python"
```python
from ultralytics import YOLO
# Load a YOLO26 model
model = YOLO("yolo26n.pt")
# Export the model to Ascend format for an Atlas 200I / OrangePi AIPro board
model.export(format="ascend", name="Ascend310B4")
# Load the exported Ascend model and run inference on the device
ascend_model = YOLO("yolo26n_ascend_model")
results = ascend_model("https://ultralytics.com/images/bus.jpg")
```
=== "CLI"
```bash
# Export a YOLO26n PyTorch model to Ascend format
yolo export model=yolo26n.pt format=ascend name=Ascend310B4
# Run inference with the exported model on the device
yolo predict model=yolo26n_ascend_model source='https://ultralytics.com/images/bus.jpg'
```
| Argument | Type | Default | Description |
|---|---|---|---|
format | str | 'ascend' | Target format for the exported model, defining compatibility with Ascend AI Processors. |
name | str | 'Ascend310B4' | Target SoC passed to ATC as --soc_version, e.g. Ascend310P3. Any SoC your CANN install has kernels for is valid; see Supported Devices. Must match your deployment device. |
imgsz | int or tuple | 640 | Desired image size for the model input, baked into the .om as a static shape. |
batch | int | 1 | Static batch size compiled into the offline model. |
quantize | int | 16 | Quantization precision. Ascend export is FP16-only and auto-enables 16 if not specified. Replaces the deprecated half/int8 flags. |
opset | int | 17 | ONNX opset for the intermediate graph. Capped at 17, the highest version the CANN ONNX parser accepts. |
simplify | bool | True | Simplifies the intermediate ONNX graph with onnxslim. |
nms | bool | False | Adds Non-Maximum Suppression to supported detection, segmentation, pose, and OBB models. |
!!! note "Why is FP32 unavailable?"
The Ascend AI Core accepts only `DT_FLOAT16` and `DT_INT8` inputs for convolutions, so an FP32 offline model cannot execute on the hardware. Requesting `quantize=32` raises an error rather than silently producing a model that will not run.
For more details about the export process, visit the Ultralytics documentation page on exporting.
After a successful export, a model directory is created with the following layout:
yolo26n_ascend_model/
├── yolo26n_Ascend310B4.om # Compiled Ascend offline model (AI Core executable)
└── metadata.yaml # Model metadata (classes, image size, task, etc.)
The .om file is the compiled offline model that the CANN runtime loads on the device. Its name carries the target SoC so the artifact is self-describing; keep one .om per directory, since the loader picks the single model it finds there. The metadata.yaml contains class names, image size, and other information used by the Ultralytics inference pipeline.
Once you've successfully exported your Ultralytics YOLO model to Ascend format, the next step is deploying it on Ascend hardware.
Inference requires the CANN runtime on the device plus the ais_bench Python package, which wraps CANN's pyACL bindings. Build and install it from the Huawei Ascend tools repository:
# On the Ascend device, with CANN installed and sourced
source /usr/local/Ascend/ascend-toolkit/set_env.sh
# Build and install the ais_bench inference wheel
git clone https://gitee.com/ascend/tools.git
cd tools/ais-bench_workload/tool/ais_bench
pip3 wheel ./backend -v
pip3 install ./aclruntime-*.whl
pip3 wheel ./ -v
pip3 install ./ais_bench-*.whl
Copy the exported yolo26n_ascend_model directory to the device, then run inference exactly as you would with any other Ultralytics format.
name that matches your target SoC.ais_bench for on-device inference.YOLO models running on Ascend hardware suit a wide range of embedded and industrial vision applications:
In this guide, you have learned how to export Ultralytics YOLO models to the Huawei Ascend .om format using the CANN ATC compiler. The export runs entirely on the host, produces a self-contained model directory, and targets any supported Ascend SoC through a single name argument — giving you a direct path from a trained .pt checkpoint to accelerated FP16 inference on Ascend AI Processors.
For more details on usage, visit the official CANN documentation.
Also, if you'd like to know more about other Ultralytics YOLO integrations, visit our integration guide page to find plenty of helpful resources.
Install Ultralytics and the CANN toolkit, source the CANN environment so atc is on your PATH, then export with model.export(format="ascend", name="Ascend310B4") in Python or yolo export model=yolo26n.pt format=ascend name=Ascend310B4 from the CLI. Set name to the SoC of your deployment device.
No. The ATC compiler runs entirely on the host, so compilation works on a standard x86-64 or ARM64 Linux machine with no NPU attached. You only need Ascend hardware to run inference on the exported .om.
Your CANN installation does not carry operator kernels for the SoC you requested. Each toolkit bundles kernels for specific SoC families, so install the Ascend-cann-kernels-<soc> package matching your target, or use a container image built for that device family.
Ascend AI Core convolutions accept only DT_FLOAT16 and DT_INT8 tensors. An FP32 offline model would fail to execute on the hardware, so the exporter compiles with --precision_mode=force_fp16 and rejects an explicit quantize=32 request.
Any SoC that your installed CANN toolkit provides kernels for, selected through the name argument. See Supported Devices for the four validated targets and their availability on Ultralytics Platform.