Discover and explore top open-source AI tools and projects—updated daily.
AscendPyTorch adapter for Ascend AI processors
Top 57.2% on SourcePulse
Summary
Ascend TorchNPU is a deep learning adapter plugin designed to enable the PyTorch framework to directly leverage the compute capabilities of Ascend AI processors. It targets developers and researchers seeking to utilize Ascend NPUs within their existing PyTorch workflows, offering a bridge to high-performance AI hardware.
How It Works
TorchNPU provides deep adaptation and optimization for PyTorch on Ascend NPUs, building upon PyTorch's mature capabilities. Its core modules include: Basic Compute for broad PyTorch API support; Distributed training acceleration via FSDP2 and DTensor, supporting collective and point-to-point communication primitives; and Graph Mode (available in v2.6.0+) which significantly accelerates model training and inference through dynamic graph capture, static graph optimization, and efficient code generation via NPUGraph. It also incorporates Debug & Tuning tools like profiling and anomaly monitoring (WatchDog), and TorchNPU Core optimizations such as virtual memory management.
Quick Start & Requirements
Installation requires first setting up the Ascend Compute Architecture (CANN), e.g., version 9.0.0, following the CANN Installation Guide. PyTorch must then be installed (e.g., pip install torch==2.10.0 --index-url https://download.pytorch.org/whl/cpu), followed by TorchNPU (e.g., pip install torch-npu==2.10.0.post2). An environment setup script (e.g., source /usr/local/Ascend/ascend-toolkit/set_env.sh) is typically needed. While explicit import torch_npu is recommended, it's auto-registered from v2.5.1.
Highlighted Details
Maintenance & Community
The project is structured around Special Interest Groups (SIGs) focusing on Core, Distributed, Graph Mode, and Usability. Contributions are encouraged via pull requests, and community support is available through GitHub Issues. Detailed information on SIGs, contribution guidelines, and community engagement can be found via the Ascend for PyTorch community resources.
Licensing & Compatibility
The specific license details for TorchNPU are available in its LICENSE file. A notable disclaimer states that the plugin is provided "for debugging and development purposes only," which may impose restrictions on its use in commercial or closed-source applications.
Limitations & Caveats
The plugin is explicitly designated for "debugging and development purposes only." Users are responsible for ensuring the security of input commands and managing data access during its use. The repository is a mirror of a project hosted on GitCode.
8 hours ago
Inactive
microsoft
Kaixhin
ELS-RD
ByteDance-Seed
cfregly