mx_driving v26.1.0rc1 for PyTorch 2.1.x on Atlas A2 (Ascend NPU acceleration for autonomous driving)
Project description
mx_driving
Overview
mx_driving is an operator and model acceleration library for autonomous driving, embodied intelligence VLA, and world models, developed on the Ascend NPU platform. It provides a suite of high-performance operators and model migration examples that support the PyTorch framework, enabling developers to leverage the powerful compute capabilities of Ascend AI Processors for autonomous driving workloads.
Ascend is a full-stack AI computing infrastructure for industry applications and services based on Huawei Ascend processors and software. For more information about Ascend, see Ascend Community.
Installation
From Binary
- Install PyTorch and torch-npu
Before installing mx_driving, complete the installation of PyTorch and torch-npu. For torch-npu installation, refer to torch-npu on PyPI.
# Install PyTorch
pip install torch==2.1.0
# Install torch-npu
pip install torch-npu==2.1.0
- Install mx_driving
mx_driving provides two PyPI packages based on hardware platform:
| PyPI Package | Hardware | Install Command |
|---|---|---|
mx-driving |
Atlas A2 (default) | pip install mx-driving |
mx-driving-a5 |
Atlas A5 | pip install mx-driving-a5 |
Both packages provide the same import mx_driving interface. Choose based on your hardware:
# For Atlas A2 (default, most users)
pip install mx-driving
# For Atlas A5
pip install mx-driving-a5
If you need a specific PyTorch version:
# Atlas A2 + PyTorch 2.1.x (this version)
pip install mx-driving==26.1.0rc1.post1
# Atlas A2 + PyTorch 2.6.x/2.7.x/2.8.x
pip install mx-driving==26.1.0rc1.post2
# Atlas A5 + PyTorch 2.6.x/2.7.x/2.8.x
pip install mx-driving-a5==26.1.0rc1.post2
Note:
mx-drivingandmx-driving-a5cannot be installed simultaneously since both provide themx_drivingPython package.
From Source
For source compilation, refer to Deploying Driving SDK Environment.
Getting Started
Prerequisites
Initialize the CANN environment variable:
source /usr/local/Ascend/ascend-toolkit/set_env.sh
Quick Verification
You can quickly verify the installation with a simple example using the scatter_max operator:
import torch
import torch_npu
from mx_driving import scatter_max
updates = torch.tensor([[2, 0, 1, 3, 1, 0, 0, 4],
[0, 2, 1, 3, 0, 3, 4, 2],
[1, 2, 3, 4, 4, 3, 2, 1]], dtype=torch.float32).npu()
indices = torch.tensor([0, 2, 0], dtype=torch.int32).npu()
out = updates.new_zeros((3, 8))
out, argmax = scatter_max(updates, indices, out)
print(out)
print(argmax)
One-Click Patcher
mx_driving provides a one-click Patcher mechanism that automatically replaces GPU-based implementations with NPU-optimized implementations, enabling seamless model migration from GPU to Ascend NPU:
from mx_driving import patcher
patcher.patch_all()
For more details, refer to One-Click Patcher.
High-Performance API
mx_driving provides various categories of high-performance operators optimized for Ascend NPU:
| Category | Operators |
|---|---|
| General | scatter_max, scatter_mean, scatter_add, knn, furthest_point_sampling, group_points, unique_voxel, graph_softmax, ... |
| Sampling | bev_pool_v1, bev_pool_v2, bev_pool_v3, npu_voxel_pooling_train, roiaware_pool3d, border_align, ... |
| Voxelization | voxelization, dynamic_scatter |
| Detection | nms3d, boxes_iou_bev, box_iou_quadri, diff_iou_rotated_2d, points_in_boxes_all, ... |
| Sparse | SparseConv3d, SubMConv3d, SparseInverseConv3d |
| Fusion | multi_scale_deformable_attn, deformable_aggregation, npu_add_relu, npu_fused_bias_leaky_relu, npu_batch_matmul, ... |
For the complete API list, refer to API Reference.
Supported Models
mx_driving provides migration and optimization examples for autonomous driving models on Ascend servers, including perception, planning, end-to-end, and VLA models:
- BEVFusion — Multi-task multi-sensor fusion framework
- BEVFormer — Bird's-eye-view perception from camera images
- Sparse4D — Sparse 4D perception framework
- And more...
For the full model list, refer to Model Support List.
PyTorch and Python Version Compatibility
mx-driving (Atlas A2)
| Version | CPU Architecture | Python Version | PyTorch Version | torch_npu Version |
|---|---|---|---|---|
| 26.1.0rc1.post1 | x86 & aarch64 | 3.8, 3.9, 3.10, 3.11 | 2.1.0 | v2.1.0-26.1.0rc1 |
| 26.1.0rc1.post2 | x86 & aarch64 | 3.9, 3.10, 3.11 | 2.6.0/2.7.1/2.8.0 | v2.7.1-26.1.0rc1 |
mx-driving-a5 (Atlas A5)
| Version | CPU Architecture | Python Version | PyTorch Version | torch_npu Version |
|---|---|---|---|---|
| 26.1.0rc1.post2 | x86 & aarch64 | 3.9, 3.10, 3.11 | 2.6.0/2.7.1/2.8.0 | v2.7.1-26.1.0rc1 |
Hardware Support
| Product Series | Product Model |
|---|---|
| Atlas A2 Training Series | Atlas 800T A2, Atlas 900 A2 PoD, Atlas 200T A2 Box16, Atlas 300T A2 |
| Atlas A3 Training Series | Atlas 800T A3, Atlas 900 A3 SuperPoD |
Branch Maintenance Policies
| Status | Duration | Description |
|---|---|---|
| Planning | 1-3 months | Plan features |
| Development | 3 months | Develop features |
| Maintained | 6-12 months | Incorporate resolved issues and release versions. Regular versions: 6 months; Long-term support versions: 12 months |
| Unmaintained | 0-3 months | Incorporate resolved issues, no dedicated maintainers, no releases |
| End Of Life (EOL) | N/A | No longer accept any modifications |
Version Maintenance
| Version | Maintenance Policy | Status | Release Date | Subsequent Status | EOL Date |
|---|---|---|---|---|---|
| v26.1.0rc1 | Release Candidate | Maintained | 2026/05/30 | Expected unmaintained from 2026/11/30 | |
| v26.0.0 | Regular Release | Maintained | 2026/03/30 | Expected unmaintained from 2026/09/30 | |
| v7.3.0 | Regular Release | Maintained | 2025/12/30 | Expected unmaintained from 2026/06/30 | |
| v7.2.RC1 | Regular Release | Maintained | 2025/09/30 | Unmaintained from 2026/03/30 | |
| v7.1.RC1 | Regular Release | Unmaintained | 2025/06/30 | Unmaintained from 2025/12/30 |
Suggestions and Communication
If you have any questions or suggestions, you can submit Issues. We will reply as soon as possible.
License
- Driving SDK is licensed under the Apache-2.0 License.
- Documentation under the
docsdirectory is licensed under CC-BY 4.0.
Contributing
Before contributing, please sign the Open Source Contributor License Agreement (CLA).
If you encounter a bug, please submit an issue.
If you plan to contribute bug fixes, please submit Pull Requests. See contribution guidelines for details.
If you plan to contribute new features, please create an issue for discussion first.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mx_driving-26.1.0rc1.post1-cp311-cp311-manylinux2014_x86_64.whl.
File metadata
- Download URL: mx_driving-26.1.0rc1.post1-cp311-cp311-manylinux2014_x86_64.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.11
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7a3de4f4070a517326a462957f9ab1cfde718b68aeed46765194fb9beba71d2
|
|
| MD5 |
261f3fad315205ad78003430ef9e2484
|
|
| BLAKE2b-256 |
85dd658e0aae90ed5e8d5ed6873731d7b1e54b8cf2736a7f7269c6f19a7864eb
|
File details
Details for the file mx_driving-26.1.0rc1.post1-cp311-cp311-manylinux2014_aarch64.whl.
File metadata
- Download URL: mx_driving-26.1.0rc1.post1-cp311-cp311-manylinux2014_aarch64.whl
- Upload date:
- Size: 6.9 MB
- Tags: CPython 3.11
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7db5fc63dbedffbf0c4f0d217675d65d946888c0a0c8298b68be55b3d75fbe10
|
|
| MD5 |
005a39b194382f7bba090be76efb3276
|
|
| BLAKE2b-256 |
16800bdab6387ac7131effe509d3c3dbab84bc24fda6fe1b45e83dfd32c129eb
|
File details
Details for the file mx_driving-26.1.0rc1.post1-cp310-cp310-manylinux2014_x86_64.whl.
File metadata
- Download URL: mx_driving-26.1.0rc1.post1-cp310-cp310-manylinux2014_x86_64.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.10
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8636b4b10d3773d178bd221742053a95c582b8b04f96d5c5789f618a172e3b45
|
|
| MD5 |
8983d8c22178a87b5961431050ae7401
|
|
| BLAKE2b-256 |
0eb48972d840599dc8f589d9fbd2d51751df5c6a73861ca05a446a3b43b5b48f
|
File details
Details for the file mx_driving-26.1.0rc1.post1-cp310-cp310-manylinux2014_aarch64.whl.
File metadata
- Download URL: mx_driving-26.1.0rc1.post1-cp310-cp310-manylinux2014_aarch64.whl
- Upload date:
- Size: 6.9 MB
- Tags: CPython 3.10
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfe141b58eb53534fe56b1dceed5aa243144c978814887fe6f0ab5dd7838ad6f
|
|
| MD5 |
5690c27ff6e1b78dffde86121ff5ede9
|
|
| BLAKE2b-256 |
d1dc066881cf6c28ca8a2559cca52c699c425719b2c912baa9ec7b48810cd50a
|
File details
Details for the file mx_driving-26.1.0rc1.post1-cp39-cp39-manylinux2014_x86_64.whl.
File metadata
- Download URL: mx_driving-26.1.0rc1.post1-cp39-cp39-manylinux2014_x86_64.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37fae8cd3db755c7201b2beb183352fd9f0ccce26ed5916cdfc0675c5d0fbae0
|
|
| MD5 |
95371aee71a0574fbee25eac90600897
|
|
| BLAKE2b-256 |
bba23ce6d356d0111a8de0680d2262b9b5eb86e6d6b3ca7a8907a1b9b25d310b
|
File details
Details for the file mx_driving-26.1.0rc1.post1-cp39-cp39-manylinux2014_aarch64.whl.
File metadata
- Download URL: mx_driving-26.1.0rc1.post1-cp39-cp39-manylinux2014_aarch64.whl
- Upload date:
- Size: 6.9 MB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78290382d5a6ad3dea7bb2dea750591b191be99359a6d913904e720fdd60bc95
|
|
| MD5 |
beb102d7e68ab5b68f2176fd5bb6ecdc
|
|
| BLAKE2b-256 |
fef026313552f5bab721b8608003f871b1ad94a6354a1c516deddc48b088a58a
|
File details
Details for the file mx_driving-26.1.0rc1.post1-cp38-cp38-manylinux2014_x86_64.whl.
File metadata
- Download URL: mx_driving-26.1.0rc1.post1-cp38-cp38-manylinux2014_x86_64.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e761b54ff519a330bf42ac11d333a6238ffa7f4c5a1d8f03cce67d4d9f8d3cbc
|
|
| MD5 |
9e4bfb7f10ad4ccae0bd525af4a24e40
|
|
| BLAKE2b-256 |
923c4aa68a3f28625ece70f816f3e60b3d50b4bb25d20c21ce7bd2d5b45242e4
|
File details
Details for the file mx_driving-26.1.0rc1.post1-cp38-cp38-manylinux2014_aarch64.whl.
File metadata
- Download URL: mx_driving-26.1.0rc1.post1-cp38-cp38-manylinux2014_aarch64.whl
- Upload date:
- Size: 6.9 MB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb67d50fe1b0768b7d0307799b5aafb97bacb094fba374696aa0ff512ba68bfa
|
|
| MD5 |
109e7f9a5bb23f87dd4010ea3e943d76
|
|
| BLAKE2b-256 |
9178e3ab3eef9c2ca790c28ba7cbd6f09f71cf0271abe9deb04c05b0c9027916
|