已合并
Release 2.11.0rc1 #32267
kuhn7创建于 3月24日
Release 2.11.0rc1 #32267
已合并
共 9 个文件变更+144-179
| @@ -19,13 +19,13 @@ Install **PyTorch** through pip. | |||
| 19 | **For Aarch64:** | 19 | **For Aarch64:** |
| 20 | 20 | ||
| 21 | ```bash | 21 | ```bash |
| 22 | -pip3 install torch==2.1.0 | 22 | +pip3 install torch==2.11.0 --index-url https://download.pytorch.org/whl/cpu |
| 23 | ``` | 23 | ``` |
| 24 | 24 | ||
| 25 | **For x86:** | 25 | **For x86:** |
| 26 | 26 | ||
| 27 | ```bash | 27 | ```bash |
| 28 | -pip3 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu | 28 | +pip3 install torch==2.11.0+cpu --index-url https://download.pytorch.org/whl/cpu |
| 29 | ``` | 29 | ``` |
| 30 | 30 | ||
| 31 | 2. **Install torch-npu dependencies** | 31 | 2. **Install torch-npu dependencies** |
| @@ -39,31 +39,29 @@ pip3 install setuptools | |||
| 39 | 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. | 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 | 41 | ||
| 42 | -| OS arch | Python version | link | | 42 | +| OS arch | Python version | link | |
| 43 | -|---------|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 43 | +|---------|----------------|-------------------------------------------| |
| 44 | -| x86 | Python3.8 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp38-cp38-linux_x86_64.whl#sha256=9e5cfd931a65b38d222755a45dabb53b836be31bc620532bc66fee77e3ff67dc) | | 44 | +| x86 | Python3.10 | [link](https://download.pytorch.org/whl/cpu/torch-2.11.0%2Bcpu-cp310-cp310-manylinux_2_28_x86_64.whl) | |
| 45 | -| x86 | Python3.9 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp39-cp39-linux_x86_64.whl#sha256=86cc28df491fa84738affe752f9870791026565342f69e4ab63e5b935f00a495) | | 45 | +| x86 | Python3.11 | [link](https://download.pytorch.org/whl/cpu/torch-2.11.0%2Bcpu-cp311-cp311-manylinux_2_28_x86_64.whl) | |
| 46 | -| x86 | Python3.10 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp310-cp310-linux_x86_64.whl#sha256=5077921fc2b54e69a534f3a9c0b98493c79a5547c49d46f5e77e42da3610e011) | | 46 | +| x86 | Python3.12 | [link](https://download.pytorch.org/whl/cpu/torch-2.11.0%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl) | |
| 47 | -| x86 | Python3.11 | [link](https://download.pytorch.org/whl/cpu/torch-2.1.0%2Bcpu-cp311-cp311-linux_x86_64.whl#sha256=5954924ce74bc7e6a6c811e3fa4bdda9936d9889f6369fd068420c444bfd1cae) | | 47 | +| aarch64 | Python3.10 | [link](https://download.pytorch.org/whl/cpu/torch-2.11.0%2Bcpu-cp310-cp310-manylinux_2_28_aarch64.whl) | |
| 48 | -| 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) | | 48 | +| aarch64 | Python3.11 | [link](https://download.pytorch.org/whl/cpu/torch-2.11.0%2Bcpu-cp311-cp311-manylinux_2_28_aarch64.whl) | |
| 49 | -| 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) | | 49 | +| aarch64 | Python3.12 | [link](https://download.pytorch.org/whl/cpu/torch-2.11.0%2Bcpu-cp312-cp312-manylinux_2_28_aarch64.whl) | |
| 50 | -| 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) | | ||
| 51 | -| 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) | | ||
| 52 | 50 | ||
| 53 | 3. **Install torch-npu** | 51 | 3. **Install torch-npu** |
| 54 | 52 | ||
| 55 | ``` | 53 | ``` |
| 56 | -pip3 install torch-npu==2.1.0.post17 | 54 | +pip3 install torch-npu==2.11.0rc1 |
| 57 | ``` | 55 | ``` |
| 58 | 56 | ||
| 59 | ### From Source | 57 | ### From Source |
| 60 | 58 | ||
| 61 | -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. | 59 | +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. |
| 62 | 60 | ||
| 63 | 1. **Clone torch-npu** | 61 | 1. **Clone torch-npu** |
| 64 | 62 | ||
| 65 | ``` | 63 | ``` |
| 66 | - git clone https://github.com/ascend/pytorch.git -b 2.1.0-7.2.0 --depth 1 | 64 | + git clone https://gitcode.com/ascend/pytorch.git -b v2.11.0 --depth 1 |
| 67 | ``` | 65 | ``` |
| 68 | 66 | ||
| 69 | 2. **Build Docker Image** | 67 | 2. **Build Docker Image** |
| @@ -82,16 +80,16 @@ In some special scenarios, users may need to compile **torch-npu** by themselves | |||
| 82 | 80 | ||
| 83 | 4. **Compile torch-npu** | 81 | 4. **Compile torch-npu** |
| 84 | 82 | ||
| 85 | - Take **Python 3.8** as an example. | 83 | + Take **Python 3.10** as an example. |
| 86 | 84 | ||
| 87 | ``` | 85 | ``` |
| 88 | cd /home/pytorch | 86 | cd /home/pytorch |
| 89 | - bash ci/build.sh --python=3.8 | 87 | + bash ci/build.sh --python=3.10 |
| 90 | ``` | 88 | ``` |
| 91 | 89 | ||
| 92 | **Tips** | 90 | **Tips** |
| 93 | 91 | ||
| 94 | - 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 | 92 | + 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 |
| 95 | 93 | ||
| 96 | ``` | 94 | ``` |
| 97 | export _GLIBCXX_USE_CXX11_ABI=1 | 95 | export _GLIBCXX_USE_CXX11_ABI=1 |
| @@ -100,7 +98,7 @@ In some special scenarios, users may need to compile **torch-npu** by themselves | |||
| 100 | Meanwhile, we support configuring -fabi-version using the following variables,require consistency with the community torch package | 98 | Meanwhile, we support configuring -fabi-version using the following variables,require consistency with the community torch package |
| 101 | 99 | ||
| 102 | ``` | 100 | ``` |
| 103 | - export _ABI_VERSION=16 | 101 | + export _ABI_VERSION=18 |
| 104 | ``` | 102 | ``` |
| 105 | 103 | ||
| 106 | ## Getting Started | 104 | ## Getting Started |
| @@ -146,6 +144,9 @@ Refer to [API of Ascend Extension for PyTorch](docs/api/torch_npu_apis.md) for m | |||
| 146 | | PyTorch2.6.0 | Python3.9.x,Python3.10.x,Python3.11.x | | 144 | | PyTorch2.6.0 | Python3.9.x,Python3.10.x,Python3.11.x | |
| 147 | | PyTorch2.7.1 | Python3.9.x,Python3.10.x,Python3.11.x | | 145 | | PyTorch2.7.1 | Python3.9.x,Python3.10.x,Python3.11.x | |
| 148 | | PyTorch2.8.0 | Python3.9.x,Python3.10.x,Python3.11.x | | 146 | | PyTorch2.8.0 | Python3.9.x,Python3.10.x,Python3.11.x | |
| 147 | +| PyTorch2.9.0 | Python3.10.x,Python3.11.x,Python3.12.x | | ||
| 148 | +| PyTorch2.10.0 | Python3.10.x,Python3.11.x,Python3.12.x | | ||
| 149 | +| PyTorch2.11.0 | Python3.10.x,Python3.11.x,Python3.12.x | | ||
| 149 | 150 | ||
| 150 | ## Ascend Auxiliary Software | 151 | ## Ascend Auxiliary Software |
| 151 | 152 | ||
| @@ -153,7 +154,9 @@ Refer to [API of Ascend Extension for PyTorch](docs/api/torch_npu_apis.md) for m | |||
| 153 | 154 | ||
| 154 | | CANN Version | Supported PyTorch Version | Supported Extension Version | Github Branch | | 155 | | CANN Version | Supported PyTorch Version | Supported Extension Version | Github Branch | |
| 155 | |-----------------------|---------------------------|-----------------------------|-------------------| | 156 | |-----------------------|---------------------------|-----------------------------|-------------------| |
| 156 | -| CANN 8.5.0 | 2.9.0 | 2.9.0 | v2.9.0-7.3.0 | | 157 | +| CANN 8.5.0 | 2.11.0 | 2.11.0rc1 | v2.11.0 | |
| 158 | +| | 2.10.0 | 2.10.0rc2 | v2.10.0 | | ||
| 159 | +| | 2.9.0 | 2.9.0 | v2.9.0-7.3.0 | | ||
| 157 | | | 2.8.0 | 2.8.0.post2 | v2.8.0-7.3.0 | | 160 | | | 2.8.0 | 2.8.0.post2 | v2.8.0-7.3.0 | |
| 158 | | | 2.7.1 | 2.7.1.post2 | v2.7.1-7.3.0 | | 161 | | | 2.7.1 | 2.7.1.post2 | v2.7.1-7.3.0 | |
| 159 | | | 2.6.0 | 2.6.0.post5 | v2.6.0-7.3.0 | | 162 | | | 2.6.0 | 2.6.0.post5 | v2.6.0-7.3.0 | |
| @@ -234,7 +237,7 @@ Due to the asynchronous development mechanism of upstream and downstream, incomp | |||
| 234 | 237 | ||
| 235 | | **OS** | **CANN Version(Docker Image)** | **Upstream Branch** | **Downstream Branch** | **Period** | **Status** | | 238 | | **OS** | **CANN Version(Docker Image)** | **Upstream Branch** | **Downstream Branch** | **Period** | **Status** | |
| 236 | | :---: | :---: | :---: | :---: | :---: | :---: | | 239 | | :---: | :---: | :---: | :---: | :---: | :---: | |
| 237 | -| 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 | [](https://github.com/Ascend/pytorch/actions/workflows/periodic.yml) | | 240 | +| openEuler 24.03 | [CANN 8.5](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 | [](https://github.com/Ascend/pytorch/actions/workflows/periodic.yml) | |
| 238 | 241 | ||
| 239 | ## Suggestions and Communication | 242 | ## Suggestions and Communication |
| 240 | 243 | ||
| @@ -255,6 +258,8 @@ The version branches of AscendPyTorch have the following maintenance phases: | |||
| 255 | 258 | ||
| 256 | | **PyTorch** | **Maintenance Policies** | **Status** | **Launch Date** | **Subsequent Status** | **EOL Date** | | 259 | | **PyTorch** | **Maintenance Policies** | **Status** | **Launch Date** | **Subsequent Status** | **EOL Date** | |
| 257 | |-------------|--------------------------|-------------|-----------------|-------------------------------------------------------------------|--------------| | 260 | |-------------|--------------------------|-------------|-----------------|-------------------------------------------------------------------|--------------| |
| 261 | +| 2.11.0 | Regular Release | Development | 2026/03/23 | Expected to enter maintenance status from September 23, 2026 | - | | ||
| 262 | +| 2.10.0 | Regular Release | Development | 2026/01/22 | Expected to enter maintenance status from July 22, 2026 | - | | ||
| 258 | | 2.9.0 | Regular Release | Development | 2025/10/15 | Expected to enter maintenance status from March 15, 2026 | - | | 263 | | 2.9.0 | Regular Release | Development | 2025/10/15 | Expected to enter maintenance status from March 15, 2026 | - | |
| 259 | | 2.8.0 | Regular Release | Development | 2025/10/15 | Expected to enter maintenance status from March 15, 2026 | - | | 264 | | 2.8.0 | Regular Release | Development | 2025/10/15 | Expected to enter maintenance status from March 15, 2026 | - | |
| 260 | | 2.7.1 | Long Term Support | Development | 2025/10/15 | Expected to enter maintenance status from October 15, 2026 | | | 265 | | 2.7.1 | Long Term Support | Development | 2025/10/15 | Expected to enter maintenance status from October 15, 2026 | | |
| @@ -275,10 +280,11 @@ For more detailed information on installation guides, model migration, training/ | |||
| 275 | 280 | ||
| 276 | | Document Name | Document Link | | 281 | | Document Name | Document Link | |
| 277 | |------------------------------------------|-------------------------------------------------------------------------------------------------------------------------| | 282 | |------------------------------------------|-------------------------------------------------------------------------------------------------------------------------| |
| 278 | -| Installation Guide | [link](https://www.hiascend.com/document/detail/zh/Pytorch/720/configandinstg/instg/insg_0001.html) | | 283 | +| Installation Guide | [link](https://www.hiascend.com/document/detail/zh/Pytorch/730/configandinstg/instg/docs/zh/installation_guide/installation_description.md) | |
| 279 | -| Network Model Migration and Training | [link](https://www.hiascend.com/document/detail/zh/Pytorch/720/ptmoddevg/trainingmigrguide/PT_LMTMOG_0003.html) | | 284 | +| Network Model Migration and Training | [link](https://www.hiascend.com/document/detail/zh/Pytorch/730/ptmoddevg/trainingmigrguide/PT_LMTMOG_0003.html) | |
| 280 | -| Operator Adaptation | [link](https://www.hiascend.com/document/detail/zh/canncommercial/81RC1/operatordev/tbeaicpudevg/atlasopdev_10_0086.html) | | 285 | +| Operator Adaptation | [link](https://www.hiascend.com/document/detail/zh/Pytorch/730/ptmoddevg/Frameworkfeatures/docs/zh/framework_feature_guide_pytorch/adaptation_description_opplugin.md) | |
| 281 | -| API List (PyTorch and Custom Interfaces) | [link](https://www.hiascend.com/document/detail/zh/Pytorch/720/apiref/apilist/ptaoplist_000002.html) | | 286 | +| 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) | |
| 287 | +| Ascend Extension for PyTorch (Custom Interfaces) | [link](https://www.hiascend.com/document/detail/zh/Pytorch/730/apiref/apilist/ptaoplist_000002.html) | | ||
| 282 | 288 | ||
| 283 | ## License | 289 | ## License |
| 284 | 290 | ||
| @@ -6,82 +6,27 @@ | |||
| 6 | 6 | ||
| 7 | 昇腾为基于华为昇腾处理器和软件的行业应用及服务提供全栈AI计算基础设施。您可以通过访问[昇腾社区](https://www.hiascend.com/zh/),了解关于昇腾的更多信息。 | 7 | 昇腾为基于华为昇腾处理器和软件的行业应用及服务提供全栈AI计算基础设施。您可以通过访问[昇腾社区](https://www.hiascend.com/zh/),了解关于昇腾的更多信息。 |
| 8 | 8 | ||
| 9 | +## 目录结构 | ||
| 10 | + | ||
| 11 | +关键目录如下: | ||
| 12 | + | ||
| 13 | +```ColdFusion | ||
| 14 | +├─ci # 持续集成脚本目录 | ||
| 15 | +├─cmake # CMake构建配置目录 | ||
| 16 | +├─torch_npu # 核心适配目录 | ||
| 17 | +│ ├─csrc/ # 底层核心目录 | ||
| 18 | +│ ├─npu/ # NPU接口目录 | ||
| 19 | +│ ├─distributed/ # 分布式训练适配目录 | ||
| 20 | +│ ├─asd/ # Ascend Debug工具目录 | ||
| 21 | +├─docs # 项目文档目录 | ||
| 22 | +├─examples # 示例目录 | ||
| 23 | +├─torchnpugen/ # 代码生成模块目录 | ||
| 24 | +└─test # 测试目录 | ||
| 25 | +``` | ||
| 26 | + | ||
| 9 | ## 版本说明 | 27 | ## 版本说明 |
| 10 | 28 | ||
| 11 | -### PyTorch与Python版本配套表 | 29 | +Ascend Extension for PyTorch的版本说明包含版本配套说明、版本兼容性说明和更新说明等,具体请参见《[Ascend Extension for PyTorch 版本说明](https://gitcode.com/Ascend/pytorch/blob/v2.7.1/docs/zh/release_notes/release_notes.md)》。 |
| 12 | - | ||
| 13 | -| PyTorch版本 | Python版本 | | ||
| 14 | -|---------------|:-------------------------------------------------------------| | ||
| 15 | -| PyTorch1.11.0 | Python3.7.x(>=3.7.5), Python3.8.x, Python3.9.x, Python3.10.x | | ||
| 16 | -| PyTorch2.1.0 | Python3.8.x, Python3.9.x, Python3.10.x, Python 3.11.x | | ||
| 17 | -| PyTorch2.2.0 | Python3.8.x, Python3.9.x, Python3.10.x | | ||
| 18 | -| PyTorch2.3.1 | Python3.8.x, Python3.9.x, Python3.10.x, Python 3.11.x | | ||
| 19 | -| PyTorch2.4.0 | Python3.8.x, Python3.9.x, Python3.10.x, Python 3.11.x | | ||
| 20 | -| PyTorch2.5.1 | Python3.9.x, Python3.10.x, Python 3.11.x | | ||
| 21 | -| PyTorch2.6.0 | Python3.9.x, Python3.10.x, Python 3.11.x | | ||
| 22 | -| PyTorch2.7.1 | Python3.9.x, Python3.10.x, Python 3.11.x | | ||
| 23 | -| PyTorch2.8.0 | Python3.9.x, Python3.10.x, Python 3.11.x | | ||
| 24 | - | ||
| 25 | -### 昇腾辅助软件 | ||
| 26 | - | ||
| 27 | -**Ascend Extension for PyTorch**的分支名称采用`{PyTorch版本}-{昇腾版本}`命名规则,前者为**Ascend Extension for PyTorch**匹配的PyTorch版本,后者为**Ascend Extension for PyTorch**版本号,详细匹配如下: | ||
| 28 | - | ||
| 29 | -| CANN版本 | 支持的PyTorch版本 | 支持的Extension版本 | GitCode分支 | | ||
| 30 | -|-----------------------|--------------|------------------|-------------------| | ||
| 31 | -| CANN 8.5.0 | 2.9.0 | 2.9.0 | v2.9.0-7.3.0 | | ||
| 32 | -| | 2.8.0 | 2.8.0.post2 | v2.8.0-7.3.0 | | ||
| 33 | -| | 2.7.1 | 2.7.1.post2 | v2.7.1-7.3.0 | | ||
| 34 | -| | 2.6.0 | 2.6.0.post5 | v2.6.0-7.3.0 | | ||
| 35 | -| CANN 8.3.RC1 | 2.8.0 | 2.8.0 | v2.8.0-7.2.0 | | ||
| 36 | -| | 2.7.1 | 2.7.1 | v2.7.1-7.2.0 | | ||
| 37 | -| | 2.6.0 | 2.6.0.post3 | v2.6.0-7.2.0 | | ||
| 38 | -| | 2.1.0 | 2.1.0.post17 | v2.1.0-7.2.0 | | ||
| 39 | -| CANN 8.2.RC1 | 2.6.0 | 2.6.0 | v2.6.0-7.1.0 | | ||
| 40 | -| | 2.5.1 | 2.5.1.post1 | v2.5.1-7.1.0 | | ||
| 41 | -| | 2.1.0 | 2.1.0.post13 | v2.1.0-7.1.0 | | ||
| 42 | -| CANN 8.1.RC1 | 2.5.1 | 2.5.1 | v2.5.1-7.0.0 | | ||
| 43 | -| | 2.4.0 | 2.4.0.post4 | v2.4.0-7.0.0 | | ||
| 44 | -| | 2.3.1 | 2.3.1.post6 | v2.3.1-7.0.0 | | ||
| 45 | -| | 2.1.0 | 2.1.0.post12 | v2.1.0-7.0.0 | | ||
| 46 | -| CANN 8.0.0 | 2.4.0 | 2.4.0.post2 | v2.4.0-6.0.0 | | ||
| 47 | -| | 2.3.1 | 2.3.1.post4 | v2.3.1-6.0.0 | | ||
| 48 | -| | 2.1.0 | 2.1.0.post10 | v2.1.0-6.0.0 | | ||
| 49 | -| CANN 8.0.RC3 | 2.4.0 | 2.4.0 | v2.4.0-6.0.rc3 | | ||
| 50 | -| | 2.3.1 | 2.3.1.post2 | v2.3.1-6.0.rc3 | | ||
| 51 | -| | 2.1.0 | 2.1.0.post8 | v2.1.0-6.0.rc3 | | ||
| 52 | -| CANN 8.0.RC2 | 2.3.1 | 2.3.1 | v2.3.1-6.0.rc2 | | ||
| 53 | -| | 2.2.0 | 2.2.0.post2 | v2.2.0-6.0.rc2 | | ||
| 54 | -| | 2.1.0 | 2.1.0.post6 | v2.1.0-6.0.rc2 | | ||
| 55 | -| | 1.11.0 | 1.11.0.post14 | v1.11.0-6.0.rc2 | | ||
| 56 | -| CANN 8.0.RC1 | 2.2.0 | 2.2.0 | v2.2.0-6.0.rc1 | | ||
| 57 | -| | 2.1.0 | 2.1.0.post4 | v2.1.0-6.0.rc1 | | ||
| 58 | -| | 1.11.0 | 1.11.0.post11 | v1.11.0-6.0.rc1 | | ||
| 59 | -| CANN 7.0.0 | 2.1.0 | 2.1.0 | v2.1.0-5.0.0 | | ||
| 60 | -| | 2.0.1 | 2.0.1.post1 | v2.0.1-5.0.0 | | ||
| 61 | -| | 1.11.0 | 1.11.0.post8 | v1.11.0-5.0.0 | | ||
| 62 | -| CANN 7.0.RC1 | 2.1.0 | 2.1.0.rc1 | v2.1.0-5.0.rc3 | | ||
| 63 | -| | 2.0.1 | 2.0.1 | v2.0.1-5.0.rc3 | | ||
| 64 | -| | 1.11.0 | 1.11.0.post4 | v1.11.0-5.0.rc3 | | ||
| 65 | -| CANN 6.3.RC3.1 | 1.11.0 | 1.11.0.post3 | v1.11.0-5.0.rc2.2 | | ||
| 66 | -| CANN 6.3.RC3 | 1.11.0 | 1.11.0.post2 | v1.11.0-5.0.rc2.1 | | ||
| 67 | -| CANN 6.3.RC2 | 2.0.1 | 2.0.1.rc1 | v2.0.1-5.0.rc2 | | ||
| 68 | -| | 1.11.0 | 1.11.0.post1 | v1.11.0-5.0.rc2 | | ||
| 69 | -| | 1.8.1 | 1.8.1.post2 | v1.8.1-5.0.rc2 | | ||
| 70 | -| CANN 6.3.RC1 | 1.11.0 | 1.11.0 | v1.11.0-5.0.rc1 | | ||
| 71 | -| | 1.8.1 | 1.8.1.post1 | v1.8.1-5.0.rc1 | | ||
| 72 | -| CANN 6.0.1 | 1.5.0 | 1.5.0.post8 | v1.5.0-3.0.0 | | ||
| 73 | -| | 1.8.1 | 1.8.1 | v1.8.1-3.0.0 | | ||
| 74 | -| | 1.11.0 | 1.11.0.rc2(beta) | v1.11.0-3.0.0 | | ||
| 75 | -| CANN 6.0.RC1 | 1.5.0 | 1.5.0.post7 | v1.5.0-3.0.rc3 | | ||
| 76 | -| | 1.8.1 | 1.8.1.rc3 | v1.8.1-3.0.rc3 | | ||
| 77 | -| | 1.11.0 | 1.11.0.rc1(beta) | v1.11.0-3.0.rc3 | | ||
| 78 | -| CANN 5.1.RC2 | 1.5.0 | 1.5.0.post6 | v1.5.0-3.0.rc2 | | ||
| 79 | -| | 1.8.1 | 1.8.1.rc2 | v1.8.1-3.0.rc2 | | ||
| 80 | -| CANN 5.1.RC1 | 1.5.0 | 1.5.0.post5 | v1.5.0-3.0.rc1 | | ||
| 81 | -| | 1.8.1 | 1.8.1.rc1 | v1.8.1-3.0.rc1 | | ||
| 82 | -| CANN 5.0.4 | 1.5.0 | 1.5.0.post4 | 2.0.4.tr5 | | ||
| 83 | -| CANN 5.0.3 | 1.8.1 | 1.5.0.post3 | 2.0.3.tr5 | | ||
| 84 | -| CANN 5.0.2 | 1.5.0 | 1.5.0.post2 | 2.0.2.tr5 | | ||
| 85 | 30 | ||
| 86 | 31 | ||
| 87 | ## 环境部署 | 32 | ## 环境部署 |
| @@ -93,18 +38,14 @@ Ascend Extension for PyTorch插件的安装操作,具体请参见《[Ascend Ex | |||
| 93 | 以CNN模型为例,介绍将其迁移至昇腾NPU上进行训练的方法,具体操作请参见《[Ascend Extension for PyTorch 快速入门](https://gitcode.com/Ascend/pytorch/blob/v2.7.1/docs/zh/quick_start/quick_start.md)》。 | 38 | 以CNN模型为例,介绍将其迁移至昇腾NPU上进行训练的方法,具体操作请参见《[Ascend Extension for PyTorch 快速入门](https://gitcode.com/Ascend/pytorch/blob/v2.7.1/docs/zh/quick_start/quick_start.md)》。 |
| 94 | 39 | ||
| 95 | ## 特性介绍 | 40 | ## 特性介绍 |
| 96 | - | 41 | + |
| 97 | Ascend Extension for PyTorch插件从内存资源优化、通信性能优化、计算性能优化、辅助报错定位等方面精心打造了一系列独特的特性,具体特性指导请参见《[PyTorch 框架特性指南](https://gitcode.com/Ascend/pytorch/blob/v2.7.1/docs/zh/framework_feature_guide_pytorch/menu_framework_feature.md)》。 | 42 | Ascend Extension for PyTorch插件从内存资源优化、通信性能优化、计算性能优化、辅助报错定位等方面精心打造了一系列独特的特性,具体特性指导请参见《[PyTorch 框架特性指南](https://gitcode.com/Ascend/pytorch/blob/v2.7.1/docs/zh/framework_feature_guide_pytorch/menu_framework_feature.md)》。 |
| 98 | - | 43 | + |
| 99 | ## API参考 | 44 | ## API参考 |
| 100 | 45 | ||
| 101 | - 原生PyTorch API在昇腾NPU设备上的支持情况请参见《[PyTorch 原生API支持度](https://gitcode.com/Ascend/pytorch/blob/v2.7.1/docs/zh/native_apis/menu_pt_native_apis.md)》。 | 46 | - 原生PyTorch API在昇腾NPU设备上的支持情况请参见《[PyTorch 原生API支持度](https://gitcode.com/Ascend/pytorch/blob/v2.7.1/docs/zh/native_apis/menu_pt_native_apis.md)》。 |
| 102 | - Ascend Extension for PyTorch插件提供了部分自定义API接口,具体使用请参见《[Ascend Extension for PyTorch自定义API](https://gitcode.com/Ascend/op-plugin/blob/master/docs/zh/custom_APIs/menu_Pytorch_API.md)》。 | 47 | - Ascend Extension for PyTorch插件提供了部分自定义API接口,具体使用请参见《[Ascend Extension for PyTorch自定义API](https://gitcode.com/Ascend/op-plugin/blob/master/docs/zh/custom_APIs/menu_Pytorch_API.md)》。 |
| 103 | 48 | ||
| 104 | -## 建议与交流 | ||
| 105 | - | ||
| 106 | -欢迎大家为社区做贡献。如果有任何疑问或建议,请提交[GitCode Issues](https://gitcode.com/Ascend/pytorch/issues),我们会尽快回复。感谢您的支持。 | ||
| 107 | - | ||
| 108 | ## 分支维护策略 | 49 | ## 分支维护策略 |
| 109 | 50 | ||
| 110 | Ascend Extension for PyTorch版本分支的维护阶段如下: | 51 | Ascend Extension for PyTorch版本分支的维护阶段如下: |
| @@ -119,14 +60,16 @@ Ascend Extension for PyTorch版本分支的维护阶段如下: | |||
| 119 | 60 | ||
| 120 | ## PyTorch版本维护策略 | 61 | ## PyTorch版本维护策略 |
| 121 | 62 | ||
| 122 | -| **PyTorch版本** | **维护策略** | **当前状态** | **发布时间** | **后续状态** | **EOL日期** | | 63 | +| **PyTorch版本** | **维护策略** | **当前状态** | **发布时间** | **后续状态** | **EOL日期** | |
| 123 | -|---------------|----------|----------|------------|----------------------|-----------| | 64 | +|---------------|-------------|------------|------------|----------------------------------|------------| |
| 124 | -| 2.9.0 | 常规分支 | 开发 | 2025/10/15| 预计2026/03/15起进入维护状态 | - | | 65 | +| 2.11.0 | 常规分支 | 开发 | 2026/03/23 | 预计2026/09/23起进入维护状态 | - | |
| 125 | -| 2.8.0 | 常规分支 | 开发 | 2025/10/15| 预计2026/03/15起进入维护状态 | - | | 66 | +| 2.10.0 | 常规分支 | 开发 | 2026/01/22 | 预计2026/07/22起进入维护状态 | - | |
| 126 | -| 2.7.1 | 长期分支 | 开发 | 2025/10/15| 预计2026/10/15起进入维护状态 | - | | 67 | +| 2.9.0 | 常规分支 | 开发 | 2025/10/15 | 预计2026/03/15起进入维护状态 | - | |
| 127 | -| 2.6.0 | 常规分支 | 开发 | 2025/07/25 | 预计2026/01/25起进入维护状态 | - | | 68 | +| 2.8.0 | 常规分支 | 开发 | 2025/10/15 | 预计2026/03/15起进入维护状态 | - | |
| 128 | -| 2.5.1 | 常规分支 | 维护 | 2024/11/08 | 预计2026/08/08起进入无维护状态 | - | | 69 | +| 2.7.1 | 长期分支 | 开发 | 2025/10/15 | 预计2026/10/15起进入维护状态 | - | |
| 129 | -| 2.4.0 | 常规分支 | 维护 | 2024/10/15 | 预计2026/06/15起进入无维护状态 | - | | 70 | +| 2.6.0 | 常规分支 | 开发 | 2025/07/25 | 预计2026/01/25起进入维护状态 | - | |
| 71 | +| 2.5.1 | 常规分支 | 维护 | 2024/11/08 | 预计2026/08/08起进入无维护状态 | - | | ||
| 72 | +| 2.4.0 | 常规分支 | 维护 | 2024/10/15 | 预计2026/06/15起进入无维护状态 | - | | ||
| 130 | | 2.3.1 | 常规分支 | 维护 | 2024/06/06 | 预计2026/06/07起进入无维护状态 | | | 73 | | 2.3.1 | 常规分支 | 维护 | 2024/06/06 | 预计2026/06/07起进入无维护状态 | | |
| 131 | | 2.2.0 | 常规分支 | EOL | 2024/04/01 | | 2025/10/14 | | 74 | | 2.2.0 | 常规分支 | EOL | 2024/04/01 | | 2025/10/14 | |
| 132 | | 2.1.0 | 长期支持 | 维护 | 2023/10/15 | 预计2026/12/30起进入无维护状态 | | | 75 | | 2.1.0 | 长期支持 | 维护 | 2023/10/15 | 预计2026/12/30起进入无维护状态 | | |
| @@ -47,7 +47,7 @@ | |||
| 47 | torch_npu内集成性能分析工具profiler: | 47 | torch_npu内集成性能分析工具profiler: |
| 48 | - 集成原因:对标PyTorch原生支持能力,提供NPU PyTorch框架开发性能分析能力,加速性能分析调试过程。 | 48 | - 集成原因:对标PyTorch原生支持能力,提供NPU PyTorch框架开发性能分析能力,加速性能分析调试过程。 |
| 49 | - 使用场景:默认不采集,如用户需要进行性能分析时,可在模型训练脚本中添加Ascend Extension for PyTorch Profiler接口,执行训练的同时采集性能数据,完成训练后直接输出可视化的性能数据文件。 | 49 | - 使用场景:默认不采集,如用户需要进行性能分析时,可在模型训练脚本中添加Ascend Extension for PyTorch Profiler接口,执行训练的同时采集性能数据,完成训练后直接输出可视化的性能数据文件。 |
| 50 | - - 风险提示:使用该功能会在本地生成性能数据,用户需加强对相关性能数据的保护,请在需要模型性能分析时使用,分析完成后及时关闭。Profiler工具具体细节请参考[《PyTorch 性能分析工具介绍》](https://www.hiascend.com/document/detail/zh/Pytorch/710/ptmoddevg/trainingmigrguide/performance_tuning_0014.html)。 | 50 | + - 风险提示:使用该功能会在本地生成性能数据,用户需加强对相关性能数据的保护,请在需要模型性能分析时使用,分析完成后及时关闭。Profiler工具具体细节请参考[《PyTorch 性能分析工具介绍》](https://www.hiascend.com/document/detail/zh/Pytorch/730/ptmoddevg/trainingmigrguide/performance_tuning_0014.html)。 |
| 51 | 51 | ||
| 52 | ## 数据安全声明 | 52 | ## 数据安全声明 |
| 53 | 53 | ||
| @@ -70,39 +70,39 @@ torch_npu支持源码编译安装,在编译时会下载依赖第三方库并 | |||
| 70 | 70 | ||
| 71 | ##### 公网地址 | 71 | ##### 公网地址 |
| 72 | 72 | ||
| 73 | -| 类型 | 开源代码地址 | 文件名 | 公网IP地址/公网URL地址/域名/邮箱地址 | 用途说明 | | 73 | +| 类型 | 开源代码地址 | 文件名 | 公网IP地址/公网URL地址/域名/邮箱地址 | 用途说明 | |
| 74 | -|------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|--------------------------------------------------------------------------------|--------------------------------| | 74 | +|------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|--------------------------------------------------------------------------------|--------------------------------| |
| 75 | -| 自研 | 不涉及 | .gitmodules | https://gitcode.com/ascend/op-plugin.git | 依赖的开源代码仓 | | 75 | +| 自研 | 不涉及 | .gitmodules | https://gitcode.com/ascend/op-plugin.git | 依赖的开源代码仓 | |
| 76 | -| 自研 | 不涉及 | .gitmodules | https://gitee.com/mirrors/googletest.git | 依赖的开源代码仓 | | 76 | +| 自研 | 不涉及 | .gitmodules | https://gitee.com/mirrors/googletest.git | 依赖的开源代码仓 | |
| 77 | -| 自研 | 不涉及 | .gitmodules | https://gitee.com/ascend/torchair.git | 依赖的开源代码仓 | | 77 | +| 自研 | 不涉及 | .gitmodules | https://gitee.com/ascend/torchair.git | 依赖的开源代码仓 | |
| 78 | -| 自研 | 不涉及 | .gitmodules | https://gitcode.com/ascend/Tensorpipe.git | 依赖的开源代码仓 | | 78 | +| 自研 | 不涉及 | .gitmodules | https://gitcode.com/ascend/Tensorpipe.git | 依赖的开源代码仓 | |
| 79 | -| 自研 | 不涉及 | .gitmodules | https://gitee.com/mirrors/fmt.git | 依赖的开源代码仓 | | 79 | +| 自研 | 不涉及 | .gitmodules | https://gitee.com/mirrors/fmt.git | 依赖的开源代码仓 | |
| 80 | -| 自研 | 不涉及 | .gitmodules | https://gitee.com/mirrors/nlohmann-json.git | 依赖的开源代码仓 | | 80 | +| 自研 | 不涉及 | .gitmodules | https://gitee.com/mirrors/nlohmann-json.git | 依赖的开源代码仓 | |
| 81 | | 自研 | 不涉及 | .gitmodules | https://gitee.com/mirrors_llvm/torch-mlir.git | 依赖的开源代码仓 | | | 81 | | 自研 | 不涉及 | .gitmodules | https://gitee.com/mirrors_llvm/torch-mlir.git | 依赖的开源代码仓 | | |
| 82 | -| 自研 | 不涉及 | ci\docker\X86\Dockerfile | https://mirrors.huaweicloud.com/repository/pypi/simple | docker配置文件,用于配置pip源 | | 82 | +| 自研 | 不涉及 | ci\docker\X86\Dockerfile | https://mirrors.huaweicloud.com/repository/pypi/simple | docker配置文件,用于配置pip源 | |
| 83 | -| 自研 | 不涉及 | ci\docker\X86\Dockerfile | https://download.pytorch.org/whl/cpu | docker配置源,用于配置torch下载连接 | | 83 | +| 自研 | 不涉及 | ci\docker\X86\Dockerfile | https://download.pytorch.org/whl/cpu | docker配置源,用于配置torch下载连接 | |
| 84 | -| 自研 | 不涉及 | ci\docker\ARM\Dockerfile | https://mirrors.huaweicloud.com/repository/pypi/simple | docker配置文件,用于配置pip源 | | 84 | +| 自研 | 不涉及 | ci\docker\ARM\Dockerfile | https://mirrors.huaweicloud.com/repository/pypi/simple | docker配置文件,用于配置pip源 | |
| 85 | -| 自研 | 不涉及 | ci\docker\X86\Dockerfile | https://mirrors.wlnmp.com/centos/Centos7-aliyun-altarch.repo | docker配置文件,用于配置yum源 | | 85 | +| 自研 | 不涉及 | ci\docker\X86\Dockerfile | https://mirrors.wlnmp.com/centos/Centos7-aliyun-altarch.repo | docker配置文件,用于配置yum源 | |
| 86 | -| 自研 | 不涉及 | ci\docker\ARM\Dockerfile | https://mirrors.wlnmp.com/centos/Centos7-aliyun-altarch.repo | docker配置文件,用于配置yum源 | | 86 | +| 自研 | 不涉及 | ci\docker\ARM\Dockerfile | https://mirrors.wlnmp.com/centos/Centos7-aliyun-altarch.repo | docker配置文件,用于配置yum源 | |
| 87 | -| 自研 | 不涉及 | .github\workflows\\_build-and-test.yml | https://mirrors.huaweicloud.com/repository/pypi/simple | workflow配置文件,用于配置pip源 | | 87 | +| 自研 | 不涉及 | .github\workflows\\_build-and-test.yml | https://mirrors.huaweicloud.com/repository/pypi/simple | workflow配置文件,用于配置pip源 | |
| 88 | -| 自研 | 不涉及 | setup.cfg | https://gitcode.com/ascend/pytorch | 用于打包whl的url入参 | | 88 | +| 自研 | 不涉及 | setup.cfg | https://gitcode.com/ascend/pytorch | 用于打包whl的url入参 | |
| 89 | -| 自研 | 不涉及 | setup.cfg | https://gitcode.com/ascend/pytorch/tags | 用于打包whl的download_url入参 | | 89 | +| 自研 | 不涉及 | setup.cfg | https://gitcode.com/ascend/pytorch/tags | 用于打包whl的download_url入参 | |
| 90 | -| 自研 | 不涉及 | third_party\op-plugin\ci\build.sh | https://gitcode.com/ascend/pytorch.git | 编译脚本根据torch_npu仓库地址拉取代码进行编译 | | 90 | +| 自研 | 不涉及 | third_party\op-plugin\ci\build.sh | https://gitcode.com/ascend/pytorch.git | 编译脚本根据torch_npu仓库地址拉取代码进行编译 | |
| 91 | -| 自研 | 不涉及 | third_party\op-plugin\ci\exec_ut.sh | https://gitcode.com/ascend/pytorch.git | UT脚本根据torch_npu仓库地址拉取代码进行UT测试 | | 91 | +| 自研 | 不涉及 | third_party\op-plugin\ci\exec_ut.sh | https://gitcode.com/ascend/pytorch.git | UT脚本根据torch_npu仓库地址拉取代码进行UT测试 | |
| 92 | -| 开源引入 | 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文件 | | 92 | +| 开源引入 | https://github.com/pytorch/pytorch/blob/release/2.11/test/nn/test_convolution.py <br> https://github.com/pytorch/pytorch/blob/release/2.11/test/test_mps.py <br> https://github.com/pytorch/pytorch/blob/release/2.11/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/legacy_conv2d.pt | 用于test脚本下载相关pt文件 | |
| 93 | -| 开源引入 | 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文件 | | 93 | +| 开源引入 | https://github.com/pytorch/pytorch/blob/release/2.11/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/legacy_serialized.pt | 用于test脚本下载相关pt文件 | |
| 94 | -| 开源引入 | 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文件 | | 94 | +| 开源引入 | https://github.com/pytorch/pytorch/blob/release/2.11/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/gpu_tensors.pt | 用于test脚本下载相关pt文件 | |
| 95 | -| 开源引入 | 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的链接 | | 95 | +| 开源引入 | https://github.com/pytorch/pytorch/blob/release/2.11/test/onnx/test_utility_funs.py | test\url.ini | https://github.com/pytorch/pytorch/issues/new?template=bug-report.yml | issue的链接 | |
| 96 | -| 开源引入 | 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文件 | | 96 | +| 开源引入 | https://github.com/pytorch/pytorch/blob/release/2.11/test/test_nn.py <br> https://github.com/pytorch/pytorch/blob/release/2.11/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/linear.pt | 用于test脚本下载相关pt文件 | |
| 97 | -| 自研 | 不涉及 | torch_npu\npu\config.yaml | https://raw.githubusercontent.com/brendangregg/FlameGraph/master/flamegraph.pl | 火焰图脚本下载路径 | | 97 | +| 自研 | 不涉及 | torch_npu\npu\config.yaml | https://raw.githubusercontent.com/brendangregg/FlameGraph/master/flamegraph.pl | 火焰图脚本下载路径 | |
| 98 | -| 自研 | 不涉及 | test\requirements.txt | https://download.pytorch.org/whl/nightly/cpu | 下载链接,用于下载torch-cpu版本 | | 98 | +| 自研 | 不涉及 | test\requirements.txt | https://download.pytorch.org/whl/cpu | 下载链接,用于下载torch-cpu版本 | |
| 99 | -| 自研 | 不涉及 | test\requirements.txt | https://data.pyg.org/whl/torch-2.4.0+cpu.html | 下载链接,用于下载torch-scatter的cpu版本 | | 99 | +| 自研 | 不涉及 | test\requirements.txt | https://data.pyg.org/whl/torch-2.10.0+cpu.html | 下载链接,用于下载torch-scatter的cpu版本 | |
| 100 | -| 自研 | 不涉及 | requirements.txt | https://download.pytorch.org/whl/nightly/cpu | 下载链接,用于下载torch-cpu版本 | | 100 | +| 自研 | 不涉及 | requirements.txt | https://download.pytorch.org/whl/cpu | 下载链接,用于下载torch-cpu版本 | |
| 101 | -| 自研 | 不涉及 | test\get_synchronized_files.sh | https://github.com/pytorch/pytorch.git | 下载链接,用于下载PyTorch的测试用例 | | 101 | +| 自研 | 不涉及 | test\get_synchronized_files.sh | https://github.com/pytorch/pytorch.git | 下载链接,用于下载PyTorch的测试用例 | |
| 102 | 102 | ||
| 103 | ## 公开接口声明 | 103 | ## 公开接口声明 |
| 104 | 104 | ||
| 105 | -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)。 | 105 | +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)。 |
| 106 | 106 | ||
| 107 | 参考[PyTorch社区公开接口规范](https://github.com/pytorch/pytorch/wiki/Public-API-definition-and-documentation),Ascend Extension for PyTorch提供了对外的自定义接口。如果一个函数看起来符合公开接口的标准且在文档中有展示,则该接口是公开接口。否则,使用该功能前可以在社区询问该功能是否确实是公开的或意外暴露的接口,因为这些未暴露接口将来可能会被修改或者删除。 | 107 | 参考[PyTorch社区公开接口规范](https://github.com/pytorch/pytorch/wiki/Public-API-definition-and-documentation),Ascend Extension for PyTorch提供了对外的自定义接口。如果一个函数看起来符合公开接口的标准且在文档中有展示,则该接口是公开接口。否则,使用该功能前可以在社区询问该功能是否确实是公开的或意外暴露的接口,因为这些未暴露接口将来可能会被修改或者删除。 |
| 108 | 108 | ||
| @@ -225,7 +225,7 @@ PyTorch提供分布式训练能力,支持在单机和多机场景下进行训 | |||
| 225 | | 所属平面 | 不涉及 | 不涉及 | | 225 | | 所属平面 | 不涉及 | 不涉及 | |
| 226 | | 版本 | 所有版本 | 所有版本 | | 226 | | 版本 | 所有版本 | 所有版本 | |
| 227 | | 特殊场景 | 无 | 无 | | 227 | | 特殊场景 | 无 | 无 | |
| 228 | -| 备注 | 该通信过程由开源软件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” | | 228 | +| 备注 | 该通信过程由开源软件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” | |
| 229 | 229 | ||
| 230 | ## 漏洞机制说明 | 230 | ## 漏洞机制说明 |
| 231 | 231 | ||
| @@ -1,11 +1,19 @@ | |||
| 1 | -FROM quay.io/pypa/manylinux2014_aarch64:2023-10-07-c1e05d1 | 1 | +FROM pytorch/manylinux2_28_aarch64-builder:cpu-aarch64-v2.11.0-rc6 |
| 2 | 2 | ||
| 3 | -# Set pip | 3 | +ENV PATH /usr/local/bin:$PATH |
| 4 | + | ||
| 5 | +RUN echo "alias ll='ls -l --color=auto'" >> /root/.bashrc | ||
| 6 | + | ||
| 7 | +# Set pip&python | ||
| 4 | RUN cd /usr/local/bin \ | 8 | RUN cd /usr/local/bin \ |
| 5 | - && ln -s /opt/_internal/cpython-3.9.18/bin/pip3.9 pip3.9 \ | 9 | + && ln -sf /opt/_internal/cpython-3.10.20/bin/pip3.10 pip3.10 \ |
| 6 | - && ln -s /opt/_internal/cpython-3.10.13/bin/pip3.10 pip3.10 \ | 10 | + && ln -sf /opt/_internal/cpython-3.11.15/bin/pip3.11 pip3.11 \ |
| 7 | - && ln -s /opt/_internal/cpython-3.11.6/bin/pip3.11 pip3.11 \ | 11 | + && ln -sf /opt/_internal/cpython-3.12.13/bin/pip3.12 pip3.12 \ |
| 8 | - && ln -s python3.9 python3 | 12 | + && ln -sf /opt/_internal/cpython-3.10.20/bin/pip3.10 pip3 \ |
| 13 | + && ln -sf /opt/_internal/cpython-3.10.20/bin/python3.10 python3.10 \ | ||
| 14 | + && ln -sf /opt/_internal/cpython-3.11.15/bin/python3.11 python3.11 \ | ||
| 15 | + && ln -sf /opt/_internal/cpython-3.12.13/bin/python3.12 python3.12 \ | ||
| 16 | + && ln -sf /opt/_internal/cpython-3.10.20/bin/python3.10 python3 | ||
| 9 | 17 | ||
| 10 | # Set pip source | 18 | # Set pip source |
| 11 | RUN mkdir /root/.pip \ | 19 | RUN mkdir /root/.pip \ |
| @@ -32,16 +40,16 @@ RUN if [ "$CONFIG_FOR_LCOV" = "1" ]; then \ | |||
| 32 | fi | 40 | fi |
| 33 | 41 | ||
| 34 | # Install pip package(build) | 42 | # Install pip package(build) |
| 35 | -RUN pip3.9 install pyyaml \ | ||
| 36 | - && pip3.9 install torch==2.1.0 \ | ||
| 37 | - && pip3.9 install numpy==1.21.3 | ||
| 38 | - | ||
| 39 | RUN pip3.10 install pyyaml \ | 43 | RUN pip3.10 install pyyaml \ |
| 40 | - && pip3.10 install torch==2.1.0 \ | 44 | + && pip3.10 install torch==2.11.0 --index-url https://download.pytorch.org/whl/cpu \ |
| 41 | - && pip3.10 install numpy==1.21.3 | 45 | + && pip3.10 install numpy==1.23.2 |
| 42 | 46 | ||
| 43 | RUN pip3.11 install pyyaml \ | 47 | RUN pip3.11 install pyyaml \ |
| 44 | - && pip3.11 install torch==2.1.0 \ | 48 | + && pip3.11 install torch==2.11.0 --index-url https://download.pytorch.org/whl/cpu \ |
| 45 | - && pip3.11 install numpy==1.23.2 | 49 | + && pip3.11 install numpy==1.26.2 |
| 50 | + | ||
| 51 | +RUN pip3.12 install pyyaml \ | ||
| 52 | + && pip3.12 install torch==2.11.0 --index-url https://download.pytorch.org/whl/cpu \ | ||
| 53 | + && pip3.12 install numpy==1.26.2 | ||
| 46 | 54 | ||
| 47 | WORKDIR /home | 55 | WORKDIR /home |
| @@ -30,8 +30,8 @@ docker run -it -v /{code_path}/pytorch:/home/pytorch manylinux-builder:v1 bash | |||
| 30 | ``` | 30 | ``` |
| 31 | **Compile torch_npu** | 31 | **Compile torch_npu** |
| 32 | 32 | ||
| 33 | -Take Python 3.9 as an example | 33 | +Take Python 3.10 as an example |
| 34 | ```Shell | 34 | ```Shell |
| 35 | cd /home/pytorch | 35 | cd /home/pytorch |
| 36 | -bash ci/build.sh --python=3.9 | 36 | +bash ci/build.sh --python=3.10 |
| 37 | ``` | 37 | ``` |
| @@ -1,14 +1,19 @@ | |||
| 1 | -FROM pytorch/manylinux-builder:cpu-2.1 | 1 | +FROM pytorch/manylinux2_28-builder:cpu-v2.11.0-rc6 |
| 2 | 2 | ||
| 3 | -# Install python | 3 | +ENV PATH /usr/local/bin:$PATH |
| 4 | + | ||
| 5 | +RUN echo "alias ll='ls -l --color=auto'" >> /root/.bashrc | ||
| 6 | + | ||
| 7 | +# Set pip&python | ||
| 4 | RUN cd /usr/local/bin \ | 8 | RUN cd /usr/local/bin \ |
| 5 | - && ln -s /opt/_internal/cpython-3.9.0/bin/pip3.9 pip3.9 \ | 9 | + && ln -sf /opt/_internal/cpython-3.10.20/bin/pip3.10 pip3.10 \ |
| 6 | - && ln -s /opt/_internal/cpython-3.10.1/bin/pip3.10 pip3.10 \ | 10 | + && ln -sf /opt/_internal/cpython-3.11.15/bin/pip3.11 pip3.11 \ |
| 7 | - && ln -s /opt/_internal/cpython-3.11.0/bin/pip3.11 pip3.11 \ | 11 | + && ln -sf /opt/_internal/cpython-3.12.13/bin/pip3.12 pip3.12 \ |
| 8 | - && ln -s /opt/_internal/cpython-3.9.0/bin/python3.9 python3.9 \ | 12 | + && ln -sf /opt/_internal/cpython-3.10.20/bin/pip3.10 pip3 \ |
| 9 | - && ln -s /opt/_internal/cpython-3.10.1/bin/python3.10 python3.10 \ | 13 | + && ln -sf /opt/_internal/cpython-3.10.20/bin/python3.10 python3.10 \ |
| 10 | - && ln -s /opt/_internal/cpython-3.11.0/bin/python3.11 python3.11 \ | 14 | + && ln -sf /opt/_internal/cpython-3.11.15/bin/python3.11 python3.11 \ |
| 11 | - && ln -s python3.9 python3 | 15 | + && ln -sf /opt/_internal/cpython-3.12.13/bin/python3.12 python3.12 \ |
| 16 | + && ln -sf /opt/_internal/cpython-3.10.20/bin/python3.10 python3 | ||
| 12 | 17 | ||
| 13 | # Set pip source | 18 | # Set pip source |
| 14 | RUN mkdir /root/.pip \ | 19 | RUN mkdir /root/.pip \ |
| @@ -35,16 +40,16 @@ RUN if [ "$CONFIG_FOR_LCOV" = "1" ]; then \ | |||
| 35 | fi | 40 | fi |
| 36 | 41 | ||
| 37 | # Install pip package(build) | 42 | # Install pip package(build) |
| 38 | -RUN pip3.9 install pyyaml \ | ||
| 39 | - && pip3.9 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu \ | ||
| 40 | - && pip3.9 install numpy==1.21.3 | ||
| 41 | - | ||
| 42 | RUN pip3.10 install pyyaml \ | 43 | RUN pip3.10 install pyyaml \ |
| 43 | - && pip3.10 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu \ | 44 | + && pip3.10 install torch==2.11.0+cpu --index-url https://download.pytorch.org/whl/cpu \ |
| 44 | - && pip3.10 install numpy==1.21.3 | 45 | + && pip3.10 install numpy==1.23.2 |
| 45 | 46 | ||
| 46 | RUN pip3.11 install pyyaml \ | 47 | RUN pip3.11 install pyyaml \ |
| 47 | - && pip3.11 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu \ | 48 | + && pip3.11 install torch==2.11.0+cpu --index-url https://download.pytorch.org/whl/cpu \ |
| 48 | - && pip3.11 install numpy==1.23.2 | 49 | + && pip3.11 install numpy==1.26.2 |
| 50 | + | ||
| 51 | +RUN pip3.12 install pyyaml \ | ||
| 52 | + && pip3.12 install torch==2.11.0+cpu --index-url https://download.pytorch.org/whl/cpu \ | ||
| 53 | + && pip3.12 install numpy==1.26.2 | ||
| 49 | 54 | ||
| 50 | WORKDIR /home | 55 | WORKDIR /home |
| @@ -1,4 +1,4 @@ | |||
| 1 | ---extra-index-url https://download.pytorch.org/whl/test/cpu | 1 | +--extra-index-url https://download.pytorch.org/whl/cpu |
| 2 | 2 | ||
| 3 | pyyaml | 3 | pyyaml |
| 4 | setuptools | 4 | setuptools |
| @@ -703,8 +703,10 @@ classifiers = [ | |||
| 703 | "Programming Language :: Python :: 3.9", | 703 | "Programming Language :: Python :: 3.9", |
| 704 | "Programming Language :: Python :: 3.10", | 704 | "Programming Language :: Python :: 3.10", |
| 705 | "Programming Language :: Python :: 3.11", | 705 | "Programming Language :: Python :: 3.11", |
| 706 | + "Programming Language :: Python :: 3.12", | ||
| 706 | ] | 707 | ] |
| 707 | 708 | ||
| 709 | +requirements = ['torch==2.11.0+cpu' if platform.machine() == 'x86_64' else 'torch==2.11.0'] | ||
| 708 | 710 | ||
| 709 | setup( | 711 | setup( |
| 710 | name=os.environ.get('TORCH_NPU_PACKAGE_NAME', 'torch_npu'), | 712 | name=os.environ.get('TORCH_NPU_PACKAGE_NAME', 'torch_npu'), |
| @@ -729,6 +731,7 @@ setup( | |||
| 729 | define_macros=[('_GLIBCXX_USE_CXX11_ABI', '1' if USE_CXX11_ABI else '0'), ('GLIBCXX_USE_CXX11_ABI', '1' if USE_CXX11_ABI else '0')] | 731 | define_macros=[('_GLIBCXX_USE_CXX11_ABI', '1' if USE_CXX11_ABI else '0'), ('GLIBCXX_USE_CXX11_ABI', '1' if USE_CXX11_ABI else '0')] |
| 730 | ), | 732 | ), |
| 731 | ], | 733 | ], |
| 734 | + install_requires=requirements, | ||
| 732 | extras_require={ | 735 | extras_require={ |
| 733 | }, | 736 | }, |
| 734 | package_data={ | 737 | package_data={ |
| @@ -1,4 +1,4 @@ | |||
| 1 | ---extra-index-url https://download.pytorch.org/whl/test/cpu | 1 | +--extra-index-url https://download.pytorch.org/whl/cpu |
| 2 | -f https://data.pyg.org/whl/torch-2.10.0+cpu.html | 2 | -f https://data.pyg.org/whl/torch-2.10.0+cpu.html |
| 3 | 3 | ||
| 4 | coverage | 4 | coverage |