Compare commits

...
2 Commits
Author SHA1 Message Date
kuhn7 00b182dd89 Release 2.10.0rc2
Co-authored-by: chenkun<chenkun82@huawei.com>



# message auto-generated for no-merge-commit merge:
!29940 merge v2.10.0rc2 into v2.10.0

Release 2.10.0rc2

Created-by: kuhn7
Commit-by: chenkun
Merged-by: ascend-robot
Description: **What type of PR is this?**
bug

**What does this PR do / why do we need it**:
- Align installation/dependency docs with the new release

**Which issue(s) this PR fixes**:
- Fix torch_npu-2.10.0rc1 undefined symbol error caused by torch-2.10.0 package update


**Special notes for your reviewers**:
https://github.com/pytorch/pytorch/pull/171821



See merge request: Ascend/pytorch!29940
2026-01-22 21:03:47 +08:00
kuhn7 7e7336e3db Release 2.10.0rc1
Co-authored-by: chenkun<chenkun82@huawei.com>



# message auto-generated for no-merge-commit merge:
!29905 merge v2.10.0rc1 into v2.10.0

Release 2.10.0rc1

Created-by: kuhn7
Commit-by: chenkun
Merged-by: ascend-robot
Description: **What type of PR is this?**
task

**What does this PR do / why do we need it**:
Release 2.10.0rc1
- Bump version to 2.10.0rc1
- Update release notes / build metadata






See merge request: Ascend/pytorch!29905
2026-01-22 16:40:01 +08:00
7 changed files with 123 additions and 104 deletions
+27 -24
View File
@@ -19,13 +19,13 @@ Install **PyTorch** through pip.
**For Aarch64:**
```bash
pip3 install torch==2.1.0
pip3 install torch==2.10.0
```
**For x86:**
```bash
pip3 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu
pip3 install torch==2.10.0+cpu --index-url https://download.pytorch.org/whl/cpu
```
2. **Install torch-npu dependencies**
@@ -39,31 +39,29 @@ pip3 install setuptools
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.
| OS arch | Python version | link |
|---------|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| x86 | Python3.8 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp38-cp38-linux_x86_64.whl#sha256=9e5cfd931a65b38d222755a45dabb53b836be31bc620532bc66fee77e3ff67dc) |
| x86 | Python3.9 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp39-cp39-linux_x86_64.whl#sha256=86cc28df491fa84738affe752f9870791026565342f69e4ab63e5b935f00a495) |
| x86 | Python3.10 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp310-cp310-linux_x86_64.whl#sha256=5077921fc2b54e69a534f3a9c0b98493c79a5547c49d46f5e77e42da3610e011) |
| x86 | Python3.11 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp311-cp311-linux_x86_64.whl#sha256=5954924ce74bc7e6a6c811e3fa4bdda9936d9889f6369fd068420c444bfd1cae) |
| aarch64 | Python3.8 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=761822761fffaa1c18a62c5deb13abaa780862577d3eadc428f1daa632536905) |
| aarch64 | Python3.9 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=de7d63c6ecece118684415a3dbd4805af4a4c1ee1490cccf7405d8c240a481b4) |
| aarch64 | Python3.10 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=a04a0296d47f28960f51c18c5489a8c3472f624ec3b5bcc8e2096314df8c3342) |
| aarch64 | Python3.11 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=8132efb782cd181cc2dcca5e58effbe4217cdb2581206ac71466d535bf778867) |
| OS arch | Python version | link |
|---------|----------------|-------------------------------------------|
| x86 | Python3.10 | [link](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp310-cp310-manylinux_2_28_x86_64.whl) |
| x86 | Python3.11 | [link](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl) |
| x86 | Python3.12 | [link](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl) |
| aarch64 | Python3.10 | [link](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp310-cp310-manylinux_2_28_aarch64.whl) |
| aarch64 | Python3.11 | [link](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp311-cp311-manylinux_2_28_aarch64.whl) |
| aarch64 | Python3.12 | [link](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp312-cp312-manylinux_2_28_aarch64.whl) |
3. **Install torch-npu**
```
pip3 install torch-npu==2.1.0.post17
pip3 install torch-npu==2.10.0rc2
```
### From Source
In some special scenarios, users may need to compile **torch-npu** 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 torch-npu 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 10.2 for ARM and gcc 9.3.1 for X86.
In some special scenarios, users may need to compile **torch-npu** 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 torch-npu 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 13.3 for both ARM and X86.
1. **Clone torch-npu**
```
git clone https://github.com/ascend/pytorch.git -b 2.1.0-7.2.0 --depth 1
git clone https://gitcode.com/ascend/pytorch.git -b v2.10.0 --depth 1
```
2. **Build Docker Image**
@@ -82,16 +80,16 @@ In some special scenarios, users may need to compile **torch-npu** by themselves
4. **Compile torch-npu**
Take **Python 3.8** as an example.
Take **Python 3.10** as an example.
```
cd /home/pytorch
bash ci/build.sh --python=3.8
bash ci/build.sh --python=3.10
```
**Tips**
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
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 13.3
```
export _GLIBCXX_USE_CXX11_ABI=1
@@ -100,7 +98,7 @@ In some special scenarios, users may need to compile **torch-npu** by themselves
Meanwhile, we support configuring -fabi-version using the following variables,require consistency with the community torch package
```
export _ABI_VERSION=16
export _ABI_VERSION=18
```
## Getting Started
@@ -146,6 +144,8 @@ Refer to [API of Ascend Extension for PyTorch](docs/api/torch_npu_apis.md) for m
| PyTorch2.6.0 | Python3.9.x,Python3.10.x,Python3.11.x |
| PyTorch2.7.1 | Python3.9.x,Python3.10.x,Python3.11.x |
| PyTorch2.8.0 | Python3.9.x,Python3.10.x,Python3.11.x |
| PyTorch2.9.0 | Python3.10.x,Python3.11.x,Python3.12.x |
| PyTorch2.10.0 | Python3.10.x,Python3.11.x,Python3.12.x |
## Ascend Auxiliary Software
@@ -153,7 +153,8 @@ Refer to [API of Ascend Extension for PyTorch](docs/api/torch_npu_apis.md) for m
| CANN Version | Supported PyTorch Version | Supported Extension Version | Github Branch |
|-----------------------|---------------------------|-----------------------------|-------------------|
| CANN 8.5.0 | 2.9.0 | 2.9.0 | v2.9.0-7.3.0 |
| CANN 8.5.0 | 2.10.0 | 2.10.0rc2 | v2.10.0 |
| | 2.9.0 | 2.9.0 | v2.9.0-7.3.0 |
| | 2.8.0 | 2.8.0.post2 | v2.8.0-7.3.0 |
| | 2.7.1 | 2.7.1.post2 | v2.7.1-7.3.0 |
| | 2.6.0 | 2.6.0.post5 | v2.6.0-7.3.0 |
@@ -255,6 +256,7 @@ The version branches of AscendPyTorch have the following maintenance phases:
| **PyTorch** | **Maintenance Policies** | **Status** | **Launch Date** | **Subsequent Status** | **EOL Date** |
|-------------|--------------------------|-------------|-----------------|-------------------------------------------------------------------|--------------|
| 2.10.0 | Regular Release | Development | 2026/01/22 | Expected to enter maintenance status from July 22, 2026 | - |
| 2.9.0 | Regular Release | Development | 2025/10/15 | Expected to enter maintenance status from March 15, 2026 | - |
| 2.8.0 | Regular Release | Development | 2025/10/15 | Expected to enter maintenance status from March 15, 2026 | - |
| 2.7.1 | Long Term Support | Development | 2025/10/15 | Expected to enter maintenance status from October 15, 2026 | |
@@ -275,10 +277,11 @@ For more detailed information on installation guides, model migration, training/
| Document Name | Document Link |
|------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
| Installation Guide | [link](https://www.hiascend.com/document/detail/zh/Pytorch/720/configandinstg/instg/insg_0001.html) |
| Network Model Migration and Training | [link](https://www.hiascend.com/document/detail/zh/Pytorch/720/ptmoddevg/trainingmigrguide/PT_LMTMOG_0003.html) |
| Operator Adaptation | [link](https://www.hiascend.com/document/detail/zh/canncommercial/81RC1/operatordev/tbeaicpudevg/atlasopdev_10_0086.html) |
| API List (PyTorch and Custom Interfaces) | [link](https://www.hiascend.com/document/detail/zh/Pytorch/720/apiref/apilist/ptaoplist_000002.html) |
| Installation Guide | [link](https://www.hiascend.com/document/detail/zh/Pytorch/730/configandinstg/instg/docs/zh/installation_guide/installation_description.md) |
| Network Model Migration and Training | [link](https://www.hiascend.com/document/detail/zh/Pytorch/730/ptmoddevg/trainingmigrguide/PT_LMTMOG_0003.html) |
| Operator Adaptation | [link](https://www.hiascend.com/document/detail/zh/Pytorch/730/ptmoddevg/Frameworkfeatures/docs/zh/framework_feature_guide_pytorch/adaptation_description_opplugin.md) |
| PyTorch Native API | [link](https://www.hiascend.com/document/detail/zh/Pytorch/730/apiref/PyTorchNativeapi/docs/zh/native_apis/pytorch_2-9-0/overview.md) |
| Ascend Extension for PyTorch (Custom Interfaces) | [link](https://www.hiascend.com/document/detail/zh/Pytorch/730/apiref/apilist/ptaoplist_000002.html) |
## License
+40 -40
View File
@@ -11,7 +11,7 @@
### PyTorch与Python版本配套表
| PyTorch版本 | Python版本 |
| PyTorch版本 | Python版本 |
|---------------|:-------------------------------------------------------------|
| PyTorch1.11.0 | Python3.7.x(>=3.7.5), Python3.8.x, Python3.9.x, Python3.10.x |
| PyTorch2.1.0 | Python3.8.x, Python3.9.x, Python3.10.x, Python 3.11.x |
@@ -22,6 +22,8 @@
| PyTorch2.6.0 | Python3.9.x, Python3.10.x, Python 3.11.x |
| PyTorch2.7.1 | Python3.9.x, Python3.10.x, Python 3.11.x |
| PyTorch2.8.0 | Python3.9.x, Python3.10.x, Python 3.11.x |
| PyTorch2.9.0 | Python3.10.x, Python3.11.x, Python3.12.x |
| PyTorch2.10.0 | Python3.10.x, Python3.11.x, Python3.12.x |
### 昇腾辅助软件
@@ -30,7 +32,8 @@
| CANN版本 | 支持的PyTorch版本 | 支持的Extension版本 | GitCode分支 |
|-----------------------|--------------|------------------|-------------------|
| CANN 8.5.0 | 2.9.0 | 2.9.0 | v2.9.0-7.3.0 |
| CANN 8.5.0 | 2.10.0 | 2.10.0rc2 | v2.10.0 |
| | 2.9.0 | 2.9.0 | v2.9.0-7.3.0 |
| | 2.8.0 | 2.8.0.post2 | v2.8.0-7.3.0 |
| | 2.7.1 | 2.7.1.post2 | v2.7.1-7.3.0 |
| | 2.6.0 | 2.6.0.post5 | v2.6.0-7.3.0 |
@@ -103,27 +106,25 @@
**aarch64:**
```bash
pip3 install torch==2.1.0
pip3 install torch==2.10.0
```
**x86:**
```bash
pip3 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu
pip3 install torch==2.10.0+cpu --index-url https://download.pytorch.org/whl/cpu
```
若使用pip命令安装失败,请使用下载链接或进入[PyTorch官方网站](https://pytorch.org/)进行查询下载对应版本。
| 架构 | Python版本 | 下载链接 |
|---------|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| x86 | Python3.8 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp38-cp38-linux_x86_64.whl#sha256=9e5cfd931a65b38d222755a45dabb53b836be31bc620532bc66fee77e3ff67dc) |
| x86 | Python3.9 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp39-cp39-linux_x86_64.whl#sha256=86cc28df491fa84738affe752f9870791026565342f69e4ab63e5b935f00a495) |
| x86 | Python3.10 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp310-cp310-linux_x86_64.whl#sha256=5077921fc2b54e69a534f3a9c0b98493c79a5547c49d46f5e77e42da3610e011) |
| x86 | Python3.11 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp311-cp311-linux_x86_64.whl#sha256=5954924ce74bc7e6a6c811e3fa4bdda9936d9889f6369fd068420c444bfd1cae) |
| aarch64 | Python3.8 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=761822761fffaa1c18a62c5deb13abaa780862577d3eadc428f1daa632536905) |
| aarch64 | Python3.9 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=de7d63c6ecece118684415a3dbd4805af4a4c1ee1490cccf7405d8c240a481b4) |
| aarch64 | Python3.10 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=a04a0296d47f28960f51c18c5489a8c3472f624ec3b5bcc8e2096314df8c3342) |
| aarch64 | Python3.11 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl#sha256=8132efb782cd181cc2dcca5e58effbe4217cdb2581206ac71466d535bf778867) |
| 架构 | Python版本 | 下载链接 |
|---------|------------|-----------------------------------------------------------------------------------------------------------|
| x86 | Python3.10 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp310-cp310-manylinux_2_28_x86_64.whl) |
| x86 | Python3.11 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl) |
| x86 | Python3.12 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl) |
| aarch64 | Python3.10 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp310-cp310-manylinux_2_28_aarch64.whl) |
| aarch64 | Python3.11 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp311-cp311-manylinux_2_28_aarch64.whl) |
| aarch64 | Python3.12 | [下载链接](https://download.pytorch.org/whl/cpu/torch-2.10.0%2Bcpu-cp312-cp312-manylinux_2_28_aarch64.whl) |
2. **安装torch_npu依赖**
@@ -137,7 +138,7 @@
3. **安装torch_npu**
```bash
pip3 install torch-npu==2.1.0.post17
pip3 install torch-npu==2.10.0rc2
```
如需要保存安装日志,可在pip3 install命令后面加上参数 `--log <PATH>`,并对您指定的目录`<PATH>`做好权限管控。
@@ -148,14 +149,12 @@
推荐使用Docker镜像编译**torch_npu**,可以通过以下步骤获取(建议只挂载工作路径,并避开系统路径,以降低安全风险), 生成的.whl文件路径为./dist/。
>**须知:**<br>
>如果不使用镜像,编译时请注意gcc版本遵循如下约束。
> - ARM架构下推荐使用gcc 10.2版本
> - X86架构下推荐使用gcc 9.3.1
>如果不使用镜像,编译时请注意gcc版本需要为13.3
1. **克隆torch_npu代码仓**
```
git clone https://gitcode.com/ascend/pytorch.git -b v2.1.0-7.2.0 --depth 1
git clone https://gitcode.com/ascend/pytorch.git -b v2.10.0 --depth 1
```
2. **构建镜像**
@@ -174,16 +173,16 @@
4. **编译torch_npu**
以**Python 3.8** 为例。
以**Python 3.10** 为例。
```
cd /home/pytorch
bash ci/build.sh --python=3.8
bash ci/build.sh --python=3.10
```
**提示**
如果想使用新的C++ ABI编译,请首先运行如下命令,此时推荐和社区torch包相同的编译环境:glibc 2.28, gcc 11.2.1。
如果想使用新的C++ ABI编译,请首先运行如下命令,此时推荐和社区torch包相同的编译环境:glibc 2.28, gcc 13.3。
```
export _GLIBCXX_USE_CXX11_ABI=1
@@ -192,7 +191,7 @@
同时,我们支持使用如下变量配置-fabi-version,要求和社区torch包ABI版本一致
```
export _ABI_VERSION=16
export _ABI_VERSION=18
```
### 安装后验证
@@ -273,21 +272,22 @@ Ascend Extension for PyTorch版本分支的维护阶段如下:
## PyTorch版本维护策略
| **PyTorch版本** | **维护策略** | **当前状态** | **发布时间** | **后续状态** | **EOL日期** |
|---------------|----------|----------|------------|----------------------|-----------|
| 2.9.0 | 常规分支 | 开发 | 2025/10/15| 预计2026/03/15起进入维护状态 | - |
| 2.8.0 | 常规分支 | 开发 | 2025/10/15| 预计2026/03/15起进入维护状态 | - |
| 2.7.1 | 长期分支 | 开发 | 2025/10/15| 预计2026/10/15起进入维护状态 | - |
| 2.6.0 | 常规分支 | 开发 | 2025/07/25 | 预计2026/01/25起进入维护状态 | - |
| 2.5.1 | 常规分支 | 维护 | 2024/11/08 | 预计2026/08/08起进入无维护状态 | - |
| 2.4.0 | 常规分支 | 维护 | 2024/10/15 | 预计2026/06/15起进入无维护状态 | - |
| **PyTorch版本** | **维护策略** | **当前状态** | **发布时间** | **后续状态** | **EOL日期** |
|---------------|-------------|------------|------------|----------------------------------|------------|
| 2.10.0 | 常规分支 | 开发 | 2026/01/22 | 预计2026/07/22起进入维护状态 | - |
| 2.9.0 | 常规分支 | 开发 | 2025/10/15 | 预计2026/03/15起进入维护状态 | - |
| 2.8.0 | 常规分支 | 开发 | 2025/10/15 | 预计2026/03/15起进入维护状态 | - |
| 2.7.1 | 长期分支 | 开发 | 2025/10/15 | 预计2026/10/15起进入维护状态 | - |
| 2.6.0 | 常规分支 | 开发 | 2025/07/25 | 预计2026/01/25起进入维护状态 | - |
| 2.5.1 | 常规分支 | 维护 | 2024/11/08 | 预计2026/08/08起进入无维护状态 | - |
| 2.4.0 | 常规分支 | 维护 | 2024/10/15 | 预计2026/06/15起进入无维护状态 | - |
| 2.3.1 | 常规分支 | 维护 | 2024/06/06 | 预计2026/06/07起进入无维护状态 | |
| 2.2.0 | 常规分支 | EOL | 2024/04/01 | | 2025/10/14 |
| 2.1.0 | 长期支持 | 维护 | 2023/10/15 | 预计2026/12/30起进入无维护状态 | |
| 2.0.1 | 常规分支 | EOL | 2023/7/19 | | 2024/3/14 |
| 1.11.0 | 长期支持 | EOL | 2023/4/19 | | 2025/10/25 |
| 1.8.1 | 长期支持 | EOL | 2022/4/10 | | 2023/4/10 |
| 1.5.0 | 长期支持 | EOL | 2021/7/29 | | 2022/7/29 |
| 2.0.1 | 常规分支 | EOL | 2023/07/19 | | 2024/03/14 |
| 1.11.0 | 长期支持 | EOL | 2023/04/19 | | 2025/10/25 |
| 1.8.1 | 长期支持 | EOL | 2022/04/10 | | 2023/04/10 |
| 1.5.0 | 长期支持 | EOL | 2021/07/29 | | 2022/07/29 |
## 安全声明
@@ -299,11 +299,11 @@ Ascend Extension for PyTorch版本分支的维护阶段如下:
| 文档名称 | 文档链接 |
| -------------------------- | ------------------------------------------------------------ |
| 软件安装指南 | [参考链接](https://www.hiascend.com/document/detail/zh/Pytorch/720/configandinstg/instg/insg_0001.html) |
| 网络模型迁移和训练 | [参考链接](https://www.hiascend.com/document/detail/zh/Pytorch/720/ptmoddevg/trainingmigrguide/PT_LMTMOG_0002.html) |
| 算子适配 | [参考链接](https://www.hiascend.com/document/detail/zh/Pytorch/720/ptmoddevg/Frameworkfeatures/featuresguide_00021.html) |
| PyTorch原生接口清单 | [参考链接](https://www.hiascend.com/document/detail/zh/Pytorch/720/apiref/PyTorchNativeapi/ptaoplist_000003.html) |
| Ascend Extension for PyTorch自定义API参考 | [参考链接](https://www.hiascend.com/document/detail/zh/Pytorch/720/apiref/torchnpuCustomsapi/context/%E6%A6%82%E8%BF%B0.md) |
| 软件安装指南 | [参考链接](https://www.hiascend.com/document/detail/zh/Pytorch/730/configandinstg/instg/docs/zh/installation_guide/installation_description.md) |
| 网络模型迁移和训练 | [参考链接](https://www.hiascend.com/document/detail/zh/Pytorch/730/ptmoddevg/trainingmigrguide/PT_LMTMOG_0003.html) |
| 算子适配 | [参考链接](https://www.hiascend.com/document/detail/zh/Pytorch/730/ptmoddevg/Frameworkfeatures/docs/zh/framework_feature_guide_pytorch/adaptation_description_opplugin.mdl) |
| PyTorch原生接口清单 | [参考链接](https://www.hiascend.com/document/detail/zh/Pytorch/730/apiref/PyTorchNativeapi/docs/zh/native_apis/pytorch_2-9-0/overview.md) |
| Ascend Extension for PyTorch自定义API参考 | [参考链接](https://www.hiascend.com/document/detail/zh/Pytorch/730/apiref/torchnpuCustomsapi/docs/context/overview.md) |
## 许可证
+8 -8
View File
@@ -89,20 +89,20 @@ torch_npu支持源码编译安装,在编译时会下载依赖第三方库并
| 自研 | 不涉及 | setup.cfg | https://gitcode.com/ascend/pytorch/tags | 用于打包whl的download_url入参 |
| 自研 | 不涉及 | third_party\op-plugin\ci\build.sh | https://gitcode.com/ascend/pytorch.git | 编译脚本根据torch_npu仓库地址拉取代码进行编译 |
| 自研 | 不涉及 | third_party\op-plugin\ci\exec_ut.sh | https://gitcode.com/ascend/pytorch.git | UT脚本根据torch_npu仓库地址拉取代码进行UT测试 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/main/test/nn/test_convolution.py <br> https://github.com/pytorch/pytorch/blob/main/test/test_mps.py <br> https://github.com/pytorch/pytorch/blob/main/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/legacy_conv2d.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/main/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/legacy_serialized.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/main/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/gpu_tensors.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/main/test/onnx/test_utility_funs.py | test\url.ini | https://github.com/pytorch/pytorch/issues/new?template=bug-report.yml | issue的链接 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/main/test/test_nn.py <br> https://github.com/pytorch/pytorch/blob/main/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/linear.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.10.0/test/nn/test_convolution.py <br> https://github.com/pytorch/pytorch/blob/v2.10.0/test/test_mps.py <br> https://github.com/pytorch/pytorch/blob/v2.10.0/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/legacy_conv2d.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.10.0/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/legacy_serialized.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.10.0/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/gpu_tensors.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.10.0/test/onnx/test_utility_funs.py | test\url.ini | https://github.com/pytorch/pytorch/issues/new?template=bug-report.yml | issue的链接 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.10.0/test/test_nn.py <br> https://github.com/pytorch/pytorch/blob/v2.10.0/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/linear.pt | 用于test脚本下载相关pt文件 |
| 自研 | 不涉及 | torch_npu\npu\config.yaml | https://raw.githubusercontent.com/brendangregg/FlameGraph/master/flamegraph.pl | 火焰图脚本下载路径 |
| 自研 | 不涉及 | test\requirements.txt | https://download.pytorch.org/whl/nightly/cpu | 下载链接,用于下载torch-cpu版本 |
| 自研 | 不涉及 | test\requirements.txt | https://data.pyg.org/whl/torch-2.4.0+cpu.html | 下载链接,用于下载torch-scatter的cpu版本 |
| 自研 | 不涉及 | test\requirements.txt | https://data.pyg.org/whl/torch-2.8.0+cpu.html | 下载链接,用于下载torch-scatter的cpu版本 |
| 自研 | 不涉及 | requirements.txt | https://download.pytorch.org/whl/nightly/cpu | 下载链接,用于下载torch-cpu版本 |
| 自研 | 不涉及 | test\get_synchronized_files.sh | https://github.com/pytorch/pytorch.git | 下载链接,用于下载PyTorch的测试用例 |
## 公开接口声明
Ascend Extension for PyTorch是PyTorch适配插件,支持用户使用PyTorch在昇腾设备上进行训练和推理。Ascend Extension for PyTorch适配后支持用户使用PyTorch原生接口。除了原生PyTorch接口外,Ascend Extension for PyTorch提供了部分自定义接口,包括自定义算子、亲和库和其他接口,支持PyTorch接口和自定义接口连接,具体可参见[《Ascend Extension for PyTorch自定义API参考》](https://www.hiascend.com/document/detail/zh/Pytorch/710/apiref/torchnpuCustomsapi/context/%E6%A6%82%E8%BF%B0.md)以及[《PyTorch原生接口清单》](https://www.hiascend.com/document/detail/zh/Pytorch/710/apiref/PyTorchNativeapi/ptaoplist_000003.html)。
Ascend Extension for PyTorch是PyTorch适配插件,支持用户使用PyTorch在昇腾设备上进行训练和推理。Ascend Extension for PyTorch适配后支持用户使用PyTorch原生接口。除了原生PyTorch接口外,Ascend Extension for PyTorch提供了部分自定义接口,包括自定义算子、亲和库和其他接口,支持PyTorch接口和自定义接口连接,具体可参见[《Ascend Extension for PyTorch自定义API参考》](https://www.hiascend.com/document/detail/zh/Pytorch/730/apiref/torchnpuCustomsapi/docs/context/overview.md)以及[《PyTorch原生接口清单》](https://www.hiascend.com/document/detail/zh/Pytorch/730/apiref/PyTorchNativeapi/docs/zh/native_apis/pytorch_2-9-0/overview.md)。
参考[PyTorch社区公开接口规范](https://github.com/pytorch/pytorch/wiki/Public-API-definition-and-documentation),Ascend Extension for PyTorch提供了对外的自定义接口。如果一个函数看起来符合公开接口的标准且在文档中有展示,则该接口是公开接口。否则,使用该功能前可以在社区询问该功能是否确实是公开的或意外暴露的接口,因为这些未暴露接口将来可能会被修改或者删除。
@@ -225,7 +225,7 @@ PyTorch提供分布式训练能力,支持在单机和多机场景下进行训
| 所属平面 | 不涉及 | 不涉及 |
| 版本 | 所有版本 | 所有版本 |
| 特殊场景 | 无 | 无 |
| 备注 | 该通信过程由开源软件PyTorch控制,配置为PyTorch原生设置,可参考[PyTorch文档](https://pytorch.org/docs/stable/distributed.html#launch-utility)。源端口由操作系统自动分配,分配范围由操作系统的配置决定,例如ubuntu:采用/proc/sys/net/ipv4/ipv4_local_port_range文件指定,可通过cat /proc/sys/net/ipv4/ipv4_local_port_range或sysctl net.ipv4.ip_local_port_range查看 | 该通信过程由CANN中HCCL组件控制,torch_npu不进行控制,端口范围可参考[《环境变量参考》](https://www.hiascend.com/document/detail/zh/canncommercial/82RC1/maintenref/envvar/envref_07_0001.html)的“执行相关 > 集合通信 >HCCL_IF_BASE_PORT” |
| 备注 | 该通信过程由开源软件PyTorch控制,配置为PyTorch原生设置,可参考[PyTorch文档](https://pytorch.org/docs/stable/distributed.html#launch-utility)。源端口由操作系统自动分配,分配范围由操作系统的配置决定,例如ubuntu:采用/proc/sys/net/ipv4/ipv4_local_port_range文件指定,可通过cat /proc/sys/net/ipv4/ipv4_local_port_range或sysctl net.ipv4.ip_local_port_range查看 | 该通信过程由CANN中HCCL组件控制,torch_npu不进行控制,端口范围可参考[《环境变量参考》](https://www.hiascend.com/document/detail/zh/canncommercial/850/maintenref/envvar/envref_07_0001.html)的“执行相关 > 集合通信 >HCCL_IF_BASE_PORT” |
## 漏洞机制说明
+22 -14
View File
@@ -1,11 +1,19 @@
FROM quay.io/pypa/manylinux2014_aarch64:2023-10-07-c1e05d1
FROM pytorch/manylinux2_28_aarch64-builder:cpu-aarch64-66ed646875945a78e9671d054c763b71d55c742a
# Set pip
ENV PATH /usr/local/bin:$PATH
RUN echo "alias ll='ls -l --color=auto'" >> /root/.bashrc
# Set pip&python
RUN cd /usr/local/bin \
&& ln -s /opt/_internal/cpython-3.9.18/bin/pip3.9 pip3.9 \
&& ln -s /opt/_internal/cpython-3.10.13/bin/pip3.10 pip3.10 \
&& ln -s /opt/_internal/cpython-3.11.6/bin/pip3.11 pip3.11 \
&& ln -s python3.9 python3
&& ln -sf /opt/_internal/cpython-3.10.18/bin/pip3.10 pip3.10 \
&& ln -sf /opt/_internal/cpython-3.11.13/bin/pip3.11 pip3.11 \
&& ln -sf /opt/_internal/cpython-3.12.11/bin/pip3.12 pip3.12 \
&& ln -sf /opt/_internal/cpython-3.10.18/bin/pip3.10 pip3 \
&& ln -sf /opt/_internal/cpython-3.10.18/bin/python3.10 python3.10 \
&& ln -sf /opt/_internal/cpython-3.11.13/bin/python3.11 python3.11 \
&& ln -sf /opt/_internal/cpython-3.12.11/bin/python3.12 python3.12 \
&& ln -sf /opt/_internal/cpython-3.10.18/bin/python3.10 python3
# Set pip source
RUN mkdir /root/.pip \
@@ -32,16 +40,16 @@ RUN if [ "$CONFIG_FOR_LCOV" = "1" ]; then \
fi
# Install pip package(build)
RUN pip3.9 install pyyaml \
&& pip3.9 install torch==2.1.0 \
&& pip3.9 install numpy==1.21.3
RUN pip3.10 install pyyaml \
&& pip3.10 install torch==2.1.0 \
&& pip3.10 install numpy==1.21.3
&& pip3.10 install torch==2.10.0 \
&& pip3.10 install numpy==1.25.2
RUN pip3.11 install pyyaml \
&& pip3.11 install torch==2.1.0 \
&& pip3.11 install numpy==1.23.2
&& pip3.11 install torch==2.10.0 \
&& pip3.11 install numpy==1.25.2
RUN pip3.12 install pyyaml \
&& pip3.12 install torch==2.10.0 \
&& pip3.12 install numpy==1.25.2
WORKDIR /home
+22 -17
View File
@@ -1,14 +1,19 @@
FROM pytorch/manylinux-builder:cpu-2.1
FROM pytorch/manylinux2_28-builder:cpu-66ed646875945a78e9671d054c763b71d55c742a
# Install python
ENV PATH /usr/local/bin:$PATH
RUN echo "alias ll='ls -l --color=auto'" >> /root/.bashrc
# Set pip&python
RUN cd /usr/local/bin \
&& ln -s /opt/_internal/cpython-3.9.0/bin/pip3.9 pip3.9 \
&& ln -s /opt/_internal/cpython-3.10.1/bin/pip3.10 pip3.10 \
&& ln -s /opt/_internal/cpython-3.11.0/bin/pip3.11 pip3.11 \
&& ln -s /opt/_internal/cpython-3.9.0/bin/python3.9 python3.9 \
&& ln -s /opt/_internal/cpython-3.10.1/bin/python3.10 python3.10 \
&& ln -s /opt/_internal/cpython-3.11.0/bin/python3.11 python3.11 \
&& ln -s python3.9 python3
&& ln -sf /opt/_internal/cpython-3.10.18/bin/pip3.10 pip3.10 \
&& ln -sf /opt/_internal/cpython-3.11.13/bin/pip3.11 pip3.11 \
&& ln -sf /opt/_internal/cpython-3.12.11/bin/pip3.12 pip3.12 \
&& ln -sf /opt/_internal/cpython-3.10.18/bin/pip3.10 pip3 \
&& ln -sf /opt/_internal/cpython-3.10.18/bin/python3.10 python3.10 \
&& ln -sf /opt/_internal/cpython-3.11.13/bin/python3.11 python3.11 \
&& ln -sf /opt/_internal/cpython-3.12.11/bin/python3.12 python3.12 \
&& ln -sf /opt/_internal/cpython-3.10.18/bin/python3.10 python3
# Set pip source
RUN mkdir /root/.pip \
@@ -35,16 +40,16 @@ RUN if [ "$CONFIG_FOR_LCOV" = "1" ]; then \
fi
# Install pip package(build)
RUN pip3.9 install pyyaml \
&& pip3.9 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu \
&& pip3.9 install numpy==1.21.3
RUN pip3.10 install pyyaml \
&& pip3.10 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu \
&& pip3.10 install numpy==1.21.3
&& pip3.10 install torch==2.10.0+cpu --index-url https://download.pytorch.org/whl/cpu \
&& pip3.10 install numpy==1.25.2
RUN pip3.11 install pyyaml \
&& pip3.11 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu \
&& pip3.11 install numpy==1.23.2
&& pip3.11 install torch==2.10.0+cpu --index-url https://download.pytorch.org/whl/cpu \
&& pip3.11 install numpy==1.25.2
RUN pip3.12 install pyyaml \
&& pip3.12 install torch==2.10.0+cpu --index-url https://download.pytorch.org/whl/cpu \
&& pip3.12 install numpy==1.25.2
WORKDIR /home
+1 -1
View File
@@ -1,4 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/test/cpu
--extra-index-url https://download.pytorch.org/whl/cpu
pyyaml
setuptools
+3
View File
@@ -643,8 +643,10 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requirements = ['torch==2.10.0+cpu' if platform.machine() == 'x86_64' else 'torch==2.10.0']
setup(
name=os.environ.get('TORCH_NPU_PACKAGE_NAME', 'torch_npu'),
@@ -669,6 +671,7 @@ setup(
define_macros=[('_GLIBCXX_USE_CXX11_ABI', '1' if USE_CXX11_ABI else '0'), ('GLIBCXX_USE_CXX11_ABI', '1' if USE_CXX11_ABI else '0')]
),
],
install_requires=requirements,
extras_require={
},
package_data={