已合并
【docs】README renamed #45042
【docs】README renamed #45042
已合并
lyx324521创建于 23 天前
3 个文件变更+60-253
MREADME.md+55-252
@@ -1,287 +1,90 @@
1# TorchNPU1# TorchNPU
2 2 
3-## Overview3+<p>
4+ English | <a href="./README.zh.md">简体中文</a>
5+</p>
4 6 
5-**TorchNPU** is a PyTorch adapter plugin that brings **Ascend NPU** support into the **PyTorch** ecosystem, enabling developers to harness the high-performance computing power of Ascend AI processors.7+## Brief Introduction
6 8 
7-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](https://www.hiascend.com/en/).9+As a core component of the Ascend for PyTorch community, TorchNPU is a deep learning adaptation plug-in developed by Ascend for PyTorch. It enables the PyTorch framework to directly invoke the Ascend NPU and provide developers with the powerful computing power of the Ascend AI processor.
8 10 
9-## Installation11+Ascend provides full-stack AI computing infrastructure for industry applications and services based on Huawei Ascend processors and software. You can visit the [Ascend Community](https://www.hiascend.com/en/) to learn more about Ascend.
10 12 
11-### From Binary13+## Directory structure
12 14 
13-Provide users with wheel package to quickly install **TorchNPU**. Before installing **TorchNPU**, complete the installation of **CANN** according to [Ascend Auxiliary Software](#ascend-auxiliary-software). To obtain the **CANN** installation package, refer to the [CANN Installation](https://www.hiascend.com/cann).15+The key directories are as follows:
14 16 
15-1. **Install PyTorch**17+```text
16- 18+├─ci #Continuous integration script directory
17- Install **PyTorch** through pip.19+├─cmake #CMake build configuration directory
18- 20+├─torch_npu #Core Adaptation Directory
19- **For Aarch64:**21+│ ├─csrc/ #Bottom Core Directory
20- 22+│ ├─npu/ #NPU Interface Directory
21- ```bash23+│ ├─distributed/ #Distributed training adaptation directory
22- pip3 install torch==2.7.124+│ ├─asd/ #Ascend debug tool directory
23- ```25+├─docs #Project Document Directory
24- 26+├─examples #Sample Directory
25- **For x86:**27+├─torchnpugen/ #Code generation module directory.
26- 28+└─test #Test Directory
27- ```bash
28- pip3 install torch==2.7.1+cpu --index-url https://download.pytorch.org/whl/cpu
29- ```
30- 
31-2. **Install TorchNPU dependencies**
32- 
33- Run the following command to install dependencies.
34- 
35- ```bash
36- pip3 install pyyaml
37- pip3 install setuptools
38- ```
39- 
40- If the installation fails, use the download link or visit the [PyTorch official website](https://pytorch.org/) to download the installation package of the corresponding version.
41- 
42- | OS arch | Python version | link |
43- |---------|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
44- | x86 | Python3.9 | [link](https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp39-cp39-manylinux_2_28_x86_64.whl#sha256=d205cac087d60bc176bdc0b63a1d00dc7a4ee5ac76fd20a2ca318ac65674167e) |
45- | x86 | Python3.10 | [link](https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp310-cp310-manylinux_2_28_x86_64.whl#sha256=1f04a373a3f643821f721da9898ef77dce73b5b6bfc64486f0976f7fb5f90e83) |
46- | x86 | Python3.11 | [link](https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl#sha256=a1684793e352f03fa14f78857e55d65de4ada8405ded1da2bf4f452179c4b779) |
47- | aarch64 | Python3.9 | [link](https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp39-cp39-manylinux_2_28_aarch64.whl#sha256=a4551cb97b83df5f93fc0d7538332535828581e1db2f179afc287027afbdd6e8) |
48- | aarch64 | Python3.10 | [link](https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp310-cp310-manylinux_2_28_aarch64.whl#sha256=c0df17cee97653d09a4e84488a33d21217f9b24208583c55cf28f0045aab0766) |
49- | aarch64 | Python3.11 | [link](https://download.pytorch.org/whl/cpu/torch-2.7.1%2Bcpu-cp311-cp311-manylinux_2_28_aarch64.whl#sha256=5fe6045b8f426bf2d0426e4fe009f1667a954ec2aeb82f1bd0bf60c6d7a85445) |
50- 
51-3. **Install TorchNPU**
52- 
53- ```shell
54- pip3 install torch-npu==2.7.1
55- 
56- ```
57- 
58-### From Source
59- 
60-In some special scenarios, users may need to compile **TorchNPU** by themselves.Select a branch in table [Ascend Auxiliary Software](#ascend-auxiliary-software) and a Python version in table [PyTorch and Python Version Matching Table](#pytorch-and-python-version-matching-table) first. The docker image is recommended for compiling TorchNPU through the following steps(It is recommended to mount the working path only and avoid the system path to reduce security risks.), the generated .whl file path is ./dist/. Note that gcc version has the following constraints if you try to compile without using docker image: we recommend to use gcc 11.2 for both ARM and X86.
61- 
62-1. **Clone TorchNPU**
63- 
64- ```shell
65- git clone https://github.com/ascend/pytorch.git -b 2.7.1-7.2.0 --depth 1
66- ```
67- 
68-2. **Build Docker Image**
69- 
70- ```shell
71- cd pytorch/ci/docker/{arch} # {arch} for X86 or ARM
72- docker build -t manylinux-builder:v1 .
73- ```
74- 
75-3. **Enter Docker Container**
76- 
77- ```shell
78- docker run -it -v /{code_path}/pytorch:/home/pytorch manylinux-builder:v1 bash
79- # {code_path} is the torch_npu source code path
80- ```
81- 
82-4. **Compile TorchNPU**
83- 
84- Take **Python 3.9** as an example.
85- 
86- ```bash
87- cd /home/pytorch
88- bash ci/build.sh --python=3.9
89- ```
90- 
91-**Tips**
92- 
93- If you would like to compile with new C++ ABI, then first run this command, at this point, the recommended compilation environment is same to community torch package: glibc 2.28, gcc 11.2.1
94-
95- ```shell
96- export _GLIBCXX_USE_CXX11_ABI=1
97- ```
98- 
99- Meanwhile, we support configuring -fabi-version using the following variables,require consistency with the community torch package
100- 
101- ```shell
102- export _ABI_VERSION=16
103- ```
104- 
105-## Getting Started
106- 
107-### Prerequisites
108- 
109-Initialize **CANN** environment variable by running the command as shown below.
110- 
111-```Shell
112-# Default path, change it if needed.
113-source /usr/local/Ascend/ascend-toolkit/set_env.sh
114```29```
115 30 
116-### Quick Verification31+## Version Description
117 32 
118-You can quickly experience **Ascend NPU** by the following simple examples.33+The version description of the TorchNPU includes version mapping, version compatibility, and updates. For details, see the[Version Description](docs/en/release_notes/release_notes.md).
119 34 
120-```diff35+## Environment Deployment
121-import torch
122-- import torch_npu # No longer needed in torch_npu 2.5.1 and later versions
123 36 
124-x = torch.randn(2, 2).npu()37+For details about how to install the TorchNPU plug-in, see the [Install the software.](docs/en/installation_guide/menu_installation_guide.md)".
125-y = torch.randn(2, 2).npu()
126-z = x.mm(y)
127 38 
128-print(z)39+## Quick Start
129-```
130 40 
131-## User Manual41+This section uses the CNN model as an example to describe how to migrate it to the Ascend NPU for training. For details, see [Quick Start](docs/en/quick_start/quick_start.md).
132 42 
133-Refer to [API of TorchNPU](docs/zh/native_apis/menu_pt_native_apis.md) for more detailed information.43+## Feature Description
134 44 
135-## PyTorch and Python Version Matching Table45+The TorchNPU plug-in provides a series of unique features in terms of memory resource optimization, communication performance optimization, computing performance optimization, and error locating assistance. For details, see the [Framework Features](docs/en/framework_feature_guide_pytorch/menu_framework_feature.md).
136 46 
137-| PyTorch Version | Python Version |47+## API Reference
138-|-----------------|:----------------------------------------------------------|
139-| PyTorch1.11.0 | Python3.7.x(>=3.7.5),Python3.8.x,Python3.9.x,Python3.10.x |
140-| PyTorch2.1.0 | Python3.8.x,Python3.9.x,Python3.10.x,Python3.11.x |
141-| PyTorch2.2.0 | Python3.8.x,Python3.9.x,Python3.10.x |
142-| PyTorch2.3.1 | Python3.8.x,Python3.9.x,Python3.10.x,Python3.11.x |
143-| PyTorch2.4.0 | Python3.8.x,Python3.9.x,Python3.10.x,Python3.11.x |
144-| PyTorch2.5.1 | Python3.9.x,Python3.10.x,Python3.11.x |
145-| PyTorch2.6.0 | Python3.9.x,Python3.10.x,Python3.11.x |
146-| PyTorch2.7.1 | Python3.9.x,Python3.10.x,Python3.11.x |
147-| PyTorch2.8.0 | Python3.9.x,Python3.10.x,Python3.11.x |
148 48 
149-## Ascend Auxiliary Software49+- For details about the native PyTorch APIs supported by Ascend NPUs, see the Native API.
50+- The TorchNPU plug-in provides some customized APIs. For details, see the [Custom API](https://gitcode.com/Ascend/op-plugin/blob/26.1.0/docs/en/custom_APIs/menu_Pytorch_API.md).
150 51 
151-**PyTorch Extension** versions follow the naming convention `{PyTorch version}-{Ascend version}`, where the former represents the PyTorch version compatible with the **PyTorch Extension**, and the latter is used to match the CANN version. The detailed matching is as follows:52+## Branch Maintenance Policy
152 53 
153-| CANN Version | Supported PyTorch Version | Supported Extension Version | Github Branch |54+For details about the maintenance policies of the TorchNPU version, see the [Maintenance Intervals for the TorchNPU](https://gitcode.com/Ascend/pytorch/blob/master/SUPPORT.md#torchnpu%E7%BB%B4%E6%8A%A4%E5%91%A8%E6%9C%9F%E8%AF%B4%E6%98%8E).
154-|-----------------------|---------------------------|-----------------------------|-------------------|
155-| CANN 8.5.0 | 2.9.0 | 2.9.0 | v2.9.0-7.3.0 |
156-| | 2.8.0 | 2.8.0.post2 | v2.8.0-7.3.0 |
157-| | 2.7.1 | 2.7.1.post2 | v2.7.1-7.3.0 |
158-| | 2.6.0 | 2.6.0.post5 | v2.6.0-7.3.0 |
159-| CANN 8.3.RC1 | 2.8.0 | 2.8.0 | v2.8.0-7.2.0 |
160-| | 2.7.1 | 2.7.1 | v2.7.1-7.2.0 |
161-| | 2.6.0 | 2.6.0.post3 | v2.6.0-7.2.0 |
162-| | 2.1.0 | 2.1.0.post17 | v2.1.0-7.2.0 |
163-| CANN 8.2.RC1 | 2.6.0 | 2.6.0 | v2.6.0-7.1.0 |
164-| | 2.5.1 | 2.5.1.post1 | v2.5.1-7.1.0 |
165-| | 2.1.0 | 2.1.0.post13 | v2.1.0-7.1.0 |
166-| CANN 8.1.RC1 | 2.5.1 | 2.5.1 | v2.5.1-7.0.0 |
167-| | 2.4.0 | 2.4.0.post4 | v2.4.0-7.0.0 |
168-| | 2.3.1 | 2.3.1.post6 | v2.3.1-7.0.0 |
169-| | 2.1.0 | 2.1.0.post12 | v2.1.0-7.0.0 |
170-| CANN 8.1.RC1.alpha002 | 2.6.0 | 2.6.0rc1 | v2.6.0 |
171-| CANN 8.0.0 | 2.4.0 | 2.4.0.post2 | v2.4.0-6.0.0 |
172-| | 2.3.1 | 2.3.1.post4 | v2.3.1-6.0.0 |
173-| | 2.1.0 | 2.1.0.post10 | v2.1.0-6.0.0 |
174-| CANN 8.0.RC3 | 2.4.0 | 2.4.0 | v2.4.0-6.0.rc3 |
175-| | 2.3.1 | 2.3.1.post2 | v2.3.1-6.0.rc3 |
176-| | 2.1.0 | 2.1.0.post8 | v2.1.0-6.0.rc3 |
177-| CANN 8.0.RC2 | 2.3.1 | 2.3.1 | v2.3.1-6.0.rc2 |
178-| | 2.2.0 | 2.2.0.post2 | v2.2.0-6.0.rc2 |
179-| | 2.1.0 | 2.1.0.post6 | v2.1.0-6.0.rc2 |
180-| | 1.11.0 | 1.11.0.post14 | v1.11.0-6.0.rc2 |
181-| CANN 8.0.RC1 | 2.2.0 | 2.2.0 | v2.2.0-6.0.rc1 |
182-| | 2.1.0 | 2.1.0.post4 | v2.1.0-6.0.rc1 |
183-| | 1.11.0 | 1.11.0.post11 | v1.11.0-6.0.rc1 |
184-| CANN 7.0.0 | 2.1.0 | 2.1.0 | v2.1.0-5.0.0 |
185-| | 2.0.1 | 2.0.1.post1 | v2.0.1-5.0.0 |
186-| | 1.11.0 | 1.11.0.post8 | v1.11.0-5.0.0 |
187-| CANN 7.0.RC1 | 2.1.0 | 2.1.0.rc1 | v2.1.0-5.0.rc3 |
188-| | 2.0.1 | 2.0.1 | v2.0.1-5.0.rc3 |
189-| | 1.11.0 | 1.11.0.post4 | v1.11.0-5.0.rc3 |
190-| CANN 6.3.RC3.1 | 1.11.0 | 1.11.0.post3 | v1.11.0-5.0.rc2.2 |
191-| CANN 6.3.RC3 | 1.11.0 | 1.11.0.post2 | v1.11.0-5.0.rc2.1 |
192-| CANN 6.3.RC2 | 2.0.1 | 2.0.1.rc1 | v2.0.1-5.0.rc2 |
193-| | 1.11.0 | 1.11.0.post1 | v1.11.0-5.0.rc2 |
194-| | 1.8.1 | 1.8.1.post2 | v1.8.1-5.0.rc2 |
195-| CANN 6.3.RC1 | 1.11.0 | 1.11.0 | v1.11.0-5.0.rc1 |
196-| | 1.8.1 | 1.8.1.post1 | v1.8.1-5.0.rc1 |
197-| CANN 6.0.1 | 1.5.0 | 1.5.0.post8 | v1.5.0-3.0.0 |
198-| | 1.8.1 | 1.8.1 | v1.8.1-3.0.0 |
199-| | 1.11.0 | 1.11.0.rc2(beta) | v1.11.0-3.0.0 |
200-| CANN 6.0.RC1 | 1.5.0 | 1.5.0.post7 | v1.5.0-3.0.rc3 |
201-| | 1.8.1 | 1.8.1.rc3 | v1.8.1-3.0.rc3 |
202-| | 1.11.0 | 1.11.0.rc1(beta) | v1.11.0-3.0.rc3 |
203-| CANN 5.1.RC2 | 1.5.0 | 1.5.0.post6 | v1.5.0-3.0.rc2 |
204-| | 1.8.1 | 1.8.1.rc2 | v1.8.1-3.0.rc2 |
205-| CANN 5.1.RC1 | 1.5.0 | 1.5.0.post5 | v1.5.0-3.0.rc1 |
206-| | 1.8.1 | 1.8.1.rc1 | v1.8.1-3.0.rc1 |
207-| CANN 5.0.4 | 1.5.0 | 1.5.0.post4 | 2.0.4.tr5 |
208-| CANN 5.0.3 | 1.8.1 | 1.5.0.post3 | 2.0.3.tr5 |
209-| CANN 5.0.2 | 1.5.0 | 1.5.0.post2 | 2.0.2.tr5 |
210 55 
211-## Hardware support56+## PyTorch Version Maintenance Policy
212 57 
213-The Ascend training device includes the following models, all of which can be used as training environments for PyTorch models58+For details about the version maintenance policy of the TorchNPU, see the [Branch Support Matrix](https://gitcode.com/Ascend/pytorch/blob/master/SUPPORT.md#%E5%88%86%E6%94%AF%E6%94%AF%E6%8C%81%E7%9F%A9%E9%98%B5).
214 59 
215-| Product series | Product model |60+## Contribution guidance
216-|-----------------------|----------------------------------|
217-| Atlas Training series products | Atlas 800(model: 9000) |
218-| | Atlas 800(model:9010) |
219-| | Atlas 900 PoD(model:9000) |
220-| | Atlas 300T(model:9000) |
221-| | Atlas 300T Pro(model:9000) |
222-| Atlas A2 Training series products | Atlas 800T A2 |
223-| | Atlas 900 A2 PoD |
224-| | Atlas 200T A2 Box16 |
225-| | Atlas 300T A2 |
226 61 
227-The Ascend inference device includes the following models, all of which can be used as inference environments for large models62+Describes how to contribute code to the Torch NPU plug-in library, as described in [Contribution Guide](docs/en/CONTRIBUTING.md).
228 63 
229-| Product series | Product model |64+## Contact us
230-|-----------------------|----------------------------------|
231-| Atlas 800I A2 Inference product | Atlas 800I A2 |
232 65 
233-## Pipeline Status66+You are welcome to contribute to the community. If you have any questions or suggestions, please submit [GitCode Issues](https://gitcode.com/Ascend/pytorch/issues) We'll get back to you as soon as we can. Thank you for your support.
234 67 
235-Due to the asynchronous development mechanism of upstream and downstream, incompatible modifications in upstream may cause some functions of **TorchNPU** to be unavailable (only upstream and downstream development branches are involved, excluding stable branches). Therefore, we built a set of daily tasks that make it easy to detect relevant issues in time and fix them within 48 hours (under normal circumstances), providing users with the latest features and stable quality.68+## Safety Statement
236 69 
237-| **OS** | **CANN Version(Docker Image)** | **Upstream Branch** | **Downstream Branch** | **Period** | **Status** |70+For details about system security hardening, user suggestions, and file permission control for the TorchNPU, see the [Safety Statement](docs/en/SECURITYNOTE.md).
238-| :---: | :---: | :---: | :---: | :---: | :---: |
239-| openEuler 22.03 SP2 | [CANN 7.1](https://hub.docker.com/r/ascendai/cann/tags) | [main](https://github.com/pytorch/pytorch/tree/main) | [master](https://github.com/Ascend/pytorch/tree/master) | UTC 1200 daily | [![Ascend NPU](https://github.com/Ascend/pytorch/actions/workflows/periodic.yml/badge.svg)](https://github.com/Ascend/pytorch/actions/workflows/periodic.yml) |
240 71 
241-## Suggestions and Communication72+## Disclaimer
242 73 
243-Everyone is welcome to contribute to the community. If you have any questions or suggestions, you can submit [Github Issues](https://github.com/Ascend/pytorch/issues). We will reply to you as soon as possible. Thank you very much.74+To TorchNPU plug-in users
244 75 
245-## Branch Maintenance Policies76+- This plug-in is for debugging and development only. You must bear the risks and understand the following:
246- 77+
247-The version branches of AscendPyTorch have the following maintenance phases:78+ - Data processing and deletion: The data generated during the use of this plug-in is the user's responsibility. You are advised to delete related data in a timely manner after using the data to prevent information leakage.
248- 79+ - Data confidentiality and dissemination: Users understand and agree not to send or disseminate the data generated through this plug-in at will. This plug-in and its developers are not responsible for any information leakage, data leakage, or other adverse consequences arising therefrom.
249-| **Status** | **Duration** | **Description** |80+ - User input security: Users must ensure the security of the entered command lines and bear any security risks or losses caused by improper input. This plug-in and its developers are not responsible for any problems caused by improper command line input.
250-|-------------------|--------------|--------------------------------------------------------------------------------------------------------------------------------|81+- Scope of Disclaimer: This disclaimer applies to all individuals or entities using this plug-in. By using this plug-in, you agree to and accept the content of this statement and are willing to bear the risks and responsibilities arising from the use of this function. If you have any objection, please stop using this plug-in.
251-| Planning | 1-3 months | Plan features. |82+- Read and understand the disclaimer before using this tool. For any questions or questions arising from the use of this plug-in, please contact the developer.
252-| Development | 6-12 months | Develop new features and fix issues, regularly release new versions. Different strategies are adopted for different versions of PyTorch, with a regular branch development cycle of 6 months and a long-term support branch development cycle of 12 months. |
253-| Maintained | 1 year/3.5 years | Regular Release branch for 1 year, Long Term Support branch maintenance for 3.5 years. Fix major issues, do not incorporate new features, and release patch versions based on the impact of fixed bugs. |
254-| End Of Life (EOL) | N/A | Do not accept any modification to a branch. |
255- 
256-## PyTorch Maintenance Policies
257- 
258-| **PyTorch** | **Maintenance Policies** | **Status** | **Launch Date** | **Subsequent Status** | **EOL Date** |
259-|-------------|--------------------------|-------------|-----------------|-------------------------------------------------------------------|--------------|
260-| 2.9.0 | Regular Release | Development | 2026/01/15 | Expected to enter maintenance status from July 15, 2026 | - |
261-| 2.8.0 | Regular Release | Development | 2025/10/15 | Expected to enter maintenance status from March 15, 2026 | - |
262-| 2.7.1 | Long Term Support | Development | 2025/10/15 | Expected to enter maintenance status from October 15, 2026 | |
263-| 2.6.0 | Regular Release | Development | 2025/07/25 | Expected to enter maintenance status from January 15, 2026 | - |
264-| 2.5.1 | Regular Release | Maintained | 2024/11/08 | Expected to enter maintenance free status from August 8, 2026 | |
265-| 2.4.0 | Regular Release | Maintained | 2024/10/15 | Expected to enter maintenance free status from June 15, 2026 | |
266-| 2.3.1 | Regular Release | Maintained | 2024/06/06 | Expected to enter maintenance free status from June 7, 2026 | |
267-| 2.2.0 | Regular Release | EOL | 2024/04/01 | | 2025/10/14 |
268-| 2.1.0 | Long Term Support | Maintained | 2023/10/15 | Expected to enter maintenance free status from December 30, 2026 | |
269-| 2.0.1 | Regular Release | EOL | 2023/7/19 | | 2024/3/14 |
270-| 1.11.0 | Long Term Support | EOL | 2023/4/19 | | 2025/10/25 |
271-| 1.8.1 | Long Term Support | EOL | 2022/4/10 | | 2023/4/10 |
272-| 1.5.0 | Long Term Support | EOL | 2021/7/29 | | 2022/7/29 |
273- 
274-## Reference Documents
275- 
276-For more detailed information on installation guides, model migration, training/inference tutorials, and API lists, please refer to the [TorchNPU on the HiAI Community](https://www.hiascend.com/software/ai-frameworks?framework=pytorch).
277- 
278-| Document Name | Document Link |
279-|------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
280-| Installation Guide | [link](https://www.hiascend.com/document/detail/zh/Pytorch/720/configandinstg/instg/insg_0001.html) |
281-| Network Model Migration and Training | [link](https://www.hiascend.com/document/detail/zh/Pytorch/720/ptmoddevg/trainingmigrguide/PT_LMTMOG_0003.html) |
282-| Operator Adaptation | [link](https://www.hiascend.com/document/detail/zh/canncommercial/81RC1/operatordev/tbeaicpudevg/atlasopdev_10_0086.html) |
283-| API List (PyTorch and Custom Interfaces) | [link](https://www.hiascend.com/document/detail/zh/Pytorch/720/apiref/apilist/ptaoplist_000002.html) |
284 83 
285## License84## License
286 85 
287-TorchNPU has a BSD-style license, as found in the [LICENSE](LICENSE) file.86+License for the TorchNPU plug-in. For details, see.LICENSEFile.
87+ 
88+## Acknowledgment
89+ 
90+Thank you for every PR from the community, welcome to contribute TorchNPU plug-in!
@@ -1,5 +1,9 @@
1# TorchNPU插件1# TorchNPU插件
2 2 
3+<p>
4+ 简体中文 | <a href="./README.md">English</a>
5+</p>
6+ 
3## 简介7## 简介
4 8 
5作为Ascend for PyTorch社区的核心组件,TorchNPU是昇腾专为PyTorch打造的深度学习适配插件,使PyTorch框架能够直接调用昇腾NPU,为开发者提供昇腾AI处理器的超强算力。9作为Ascend for PyTorch社区的核心组件,TorchNPU是昇腾专为PyTorch打造的深度学习适配插件,使PyTorch框架能够直接调用昇腾NPU,为开发者提供昇腾AI处理器的超强算力。
@@ -15,7 +15,7 @@ Inductor后端支持三种算子编译器,可根据场景选择:
15> [!NOTICE]15> [!NOTICE]
16>16>
17> Inductor后端需安装最新版本的Triton-Ascend依赖包,具体可参见[Triton-Ascend说明文档](https://gitcode.com/Ascend/triton-ascend/blob/master/docs/sources/getting-started/installation.md)。<br>17> Inductor后端需安装最新版本的Triton-Ascend依赖包,具体可参见[Triton-Ascend说明文档](https://gitcode.com/Ascend/triton-ascend/blob/master/docs/sources/getting-started/installation.md)。<br>
18-> Inductor后端使用MLIR模式/DVM模式时需额外安装Torch-MLIR依赖包,可以在[Torch-MLIR归档地址](https://repo.oepkgs.net/ascend/pytorch/vllm/torch/)下载。<br>18+> Inductor后端使用MLIR模式时需额外安装Torch-MLIR依赖包,可以在[Torch-MLIR归档地址](https://repo.oepkgs.net/ascend/pytorch/vllm/torch/)下载。<br>
19> 在import torch前,也可通过TORCHINDUCTOR_NPU_BACKEND环境变量选择编译器模式,具体可参见[TORCHINDUCTOR_NPU_BACKEND](../environment_variable_reference/TORCHINDUCTOR_NPU_BACKEND.md)。19> 在import torch前,也可通过TORCHINDUCTOR_NPU_BACKEND环境变量选择编译器模式,具体可参见[TORCHINDUCTOR_NPU_BACKEND](../environment_variable_reference/TORCHINDUCTOR_NPU_BACKEND.md)。
20 20 
21## 编译器21## 编译器