pytorch  by Ascend

PyTorch adapter for Ascend AI processors

Created 4 years ago
551 stars

Top 57.2% on SourcePulse

GitHubView on GitHub
Project Summary

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

  • Supports PyTorch 2.10.0 and Python 3.13 (as of the v26.0.0 release).
  • Graph Mode (v2.6.0+) offers substantial acceleration for training and inference through advanced graph capture and optimization techniques.
  • Provides acceleration for distributed training scenarios using FSDP2 and DTensor.
  • Includes integrated profiling and anomaly monitoring tools for debugging and performance tuning.

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.

Health Check
Last Commit

8 hours ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
2
Star History
11 stars in the last 30 days

Explore Similar Projects

Starred by Yaowei Zheng Yaowei Zheng(Author of LLaMA-Factory), Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), and
1 more.

VeOmni by ByteDance-Seed

0%
2k
Framework for scaling multimodal model training across accelerators
Created 1 year ago
Updated 15 hours ago
Starred by George Hotz George Hotz(Author of tinygrad; Founder of the tiny corp, comma.ai) and Carol Willing Carol Willing(Core Contributor to CPython, Jupyter).

ai-performance-engineering by cfregly

0.1%
2k
AI Systems Performance Engineering for modern AI workloads
Created 1 year ago
Updated 3 weeks ago
Feedback? Help us improve.