Compare commits

...
11 Commits
Author SHA1 Message Date
yinzijun 4146762193 !68 update docs/zh/RELEASENOTE/RELEASENOTE.md.
Merge pull request !68 from liuquan/N/A
2021-10-09 08:42:49 +00:00
刘全 c24a2a26f2 update docs/zh/RELEASENOTE/RELEASENOTE.md. 2021-10-09 07:10:10 +00:00
yinzijun 99baa47bac !66 add releasenote
Merge pull request !66 from yinzijun/2.0.3.tr5
2021-10-09 07:03:02 +00:00
ZijunYin 3aad7226de add RELEASENOTE.md 2021-10-09 09:54:56 +08:00
weili10 2c1766a041 update README.zh.md. 2021-10-08 02:46:19 +00:00
yinzijun 58402d67d2 !64 update docs 2.0.3.B090
Merge pull request !64 from yinzijun/2.0.3.tr5
2021-09-30 07:26:33 +00:00
ZijunYin 22a5bf8eba update docs 2.0.3.B090 2021-09-30 15:14:19 +08:00
AtlasAccount 7ec3a5a42a 同步1.5.0 2c2f79aaccfa455fb24553f77cca62d838b75bdf
!2559 【BugFix】修复输入shape不一致,算子侧未broadcast,导致不支持
    Merge pull request !2559 from 姚斌/2.0.3.tr5
--
    !2558 modify:del test_cases of 1 dim and NZ format in UT files
    Merge pull request !2558 from 郭夏/2.0.3.tr5
--
    !2556 修复IOU输出数据类型转换
    Merge pull request !2556 from 李攀/2.0.3.tr5
同步1.8.1 7afd57f35ebc3b81dd4c3f642e3f8ba81c1f07f0
2021-09-28 22:05:02 +08:00
AtlasAccount 8611e0e3d5 同步1.5.0 a3c3eef54ba99da98fcfb1f47315ab0aaecb6f54
!2553 修复load模式时conv2d反向dump结果ir_name被覆盖的问题,合入商发
    Merge pull request !2553 from gaokai21/2.0.3.tr5
同步1.8.1 7afd57f35ebc3b81dd4c3f642e3f8ba81c1f07f0
2021-09-27 21:00:32 +08:00
AtlasAccount a2ed4eb074 同步1.5.0 55e1c5be4b9ce8cf007fdf7848d3e933c7dba800
!2548 [contrib/npu/optimized_lib/] merge master to 2.0.3.tr5
    Merge pull request !2548 from 王姜奔/2.0.3.tr5
同步1.8.1 7afd57f35ebc3b81dd4c3f642e3f8ba81c1f07f0
2021-09-27 14:33:37 +08:00
AtlasAccount c6d5d99656 同步1.5.0 210593a373ef600735b60946c7edeccefa97e5eb
!2546 修复maxunpool2dbackward执行报错
    Merge pull request !2546 from 李攀/bugfix
同步1.8.1 7afd57f35ebc3b81dd4c3f642e3f8ba81c1f07f0
2021-09-27 11:01:57 +08:00
27 changed files with 5348 additions and 4831 deletions
+1
View File
@@ -29,6 +29,7 @@ apt-get install -y gcc g++ make build-essential libssl-dev zlib1g-dev libbz2-dev
| AscendPyTorch版本 | CANN版本 |
| :------------ | :----------- |
| 2.0.2 | CANN 5.0.2 |
| 2.0.3 | CANN 5.0.3 |
# 使用方式 --生成全量代码并编译
File diff suppressed because it is too large Load Diff
@@ -5,19 +5,18 @@
- [安装PyTorch框架](#安装PyTorch框架md)
- [配置环境变量](#配置环境变量md)
- [安装混合精度模块](#安装混合精度模块md)
- [使用Ascend Hub镜像](#使用Ascend-Hub镜像md)
- [Ascend Hub获取PyTorch镜像](#Ascend-Hub获取PyTorch镜像md)
- [配置环境变量](#配置环境变量-0md)
- [参考信息](#参考信息md)
- [CMake安装方法](#CMake安装方法md)
- [安装7.3.0版本gcc](#安装7-3-0版本gccmd)
- [安装“torch-\*.whl ”提示“torch 1.5.0xxxx”与“torchvision”所依赖的版本不匹配](#安装-torch--whl-提示-torch-1-5-0xxxx-与-torchvision-所依赖的版本不匹配md)
<h2 id="简介md">简介</h2>
用户在准备相关环境进行基于PyTorch框架模型的开发、运行时,可以选择在服务器中手动编译安装PyTorch框架相关模块,或直接获取Ascend Hub镜像中心提供的基础镜像(镜像中已安装PyTorch模块和混合精度模块),进行模型的开发、运行。
用户在准备相关环境进行基于PyTorch框架模型的开发、运行时,可以选择在服务器中手动编译安装PyTorch框架相关模块。
**图 1** 环境准备流程图<a name="zh-cn_topic_0000001119176876_fig1938918396117"></a>
![](figures/环境准备流程图.png "环境准备流程图")
![](figures/210926103326800.png)
<h2 id="手动编译安装md">手动编译安装</h2>
@@ -37,6 +36,7 @@
- 需完成CANN开发或运行环境的安装,具体操作请参考《CANN 软件安装指南》。
- 需安装3.12.0以上版本的CMake,安装方法请参考[CMake安装方法](#CMake安装方法md)。
- 需确保已安装7.3.0以上版本的gcc,7.3.0版本gcc具体安装及使用方式请参考[安装7.3.0版本gcc](#安装7-3-0版本gccmd)。
- 需安装python版本为3.7.5或3.8。
- 需确保环境中已安装patch、git工具,以Ubuntu和CentOS系统为例,命令如下:
- Ubuntu系统
@@ -79,36 +79,32 @@
下载的源码主要目录结构如下所示:
```
pytorch
│ ├─patch # 昇腾AI处理器适配补丁目录
│ ├─npu.patch
│ ├─scripts # 编译构建目录
│ ├─gen.sh
│ ├─src # 源码目录
│ ├─test # 测试用例存放目录
│ ├─README.md
├── patch # 昇腾AI处理器适配补丁目录
│ ├── pytorch1.5.0_npu.patch # pytorch1.5.0版本补丁
│ └── pytorch1.8.1_npu.patch # pytorch1.8.1版本补丁
├── pytorch1.5.0 # pytorch1.5.0源码及测试目录
│ ├── access_control_test.py
│ ├── src # 源码目录
│ └── test # 测试用例存放目录
├── pytorch1.8.1 # pytorch1.8.1源码及测试目录
│ ├── access_control_test.py
│ ├── src # 源码目录
│ └── test # 测试用例存放目录
└── scripts # 编译构建目录
```
2. 运行如下命令,进入“pytorch“目录,并获取原生PyTorch源代码。
2. 在当前仓根目录“/pytorch“下获取原生PyTorch源代码。
- 若安装pytorch1.5.0版本,执行如下命令。
```
cd pytorch
git clone -b v1.5.0 --depth=1 https://github.com/pytorch/pytorch.git
```
```
git clone -b v1.5.0 --depth=1 https://github.com/pytorch/pytorch.git
```
下载原生pytorch源码后,代码主要目录结构如下所示:
- 若安装pytorch1.8.1版本,执行如下命令。
```
pytorch
│ ├─patch # 昇腾AI处理器适配补丁目录
│ ├─npu.patch
│ ├─pytorch # 原生pytorch代码目录
│ ├─scripts # 编译构建目录
│ ├─gen.sh
│ ├─src # 源码目录
│ ├─test # 测试用例存放目录
│ ├─README.md
```
```
git clone -b v1.8.1 --depth=1 https://github.com/pytorch/pytorch.git
```
3. 运行如下命令,进入原生pytorch代码目录“pytorch“,并获取PyTorch被动依赖代码。
@@ -126,26 +122,37 @@
```
cd ../scripts
# 若安装1.5.0版本
bash gen.sh
# 若安装1.8.1版本
bash gen.sh -v 1.8.1
```
将在"pytorch/pytorch"目录中生成适配昇腾AI处理器的全量代码。
2. 进入适配后的全量代码目录,即“pytorch/pytorch“目录,编译生成pytorch的二进制安装包。
2. 进入到“pytorch/pytorch/“目录,依赖库安装。
```
cd ../pytorch
bash build.sh
pip3 install -r requirements.txt
```
生成的二进制包在当前的dist目录下,即“pytorch/pytorch/dist”文件夹目录下。
3. 编译生成pytorch的二进制安装包。
```
bash build.sh --python=3.7
或
bash build.sh --python=3.8
```
请指定环境中python版本进行编译。生成的二进制包在当前的dist目录下,即“pytorch/pytorch/dist”文件夹目录下。
5. <a name="zh-cn_topic_0000001152776301_li49671667141"></a>安装PyTorch。
进入“pytorch/pytorch/dist“文件夹目录,执行如下命令安装。
```
pip3 install --upgrade torch-1.5.0+ascend-cp37-cp37m-linux_{arch}.whl
pip3 install --upgrade torch-1.5.0+ascend.post3-cp37-cp37m-linux_{arch}.whl
```
**\{arch\}**表示架构信息,为aarch64或x86\_64。
@@ -178,7 +185,7 @@
3. (可选)NPU场景下配置功能或性能环境变量。默认为不开启。
```
export DYNAMIC_COMPILE_ENABLE=1 # 动态shape特性功能,针对shape变化场景,可选,开启设置为1
export DYNAMIC_COMPILE_ENABLE=1 # 动态shape特性功能,针对shape变化场景,可选,开启设置为1(PyTorch1.8.1不支持该环境变量)
export COMBINED_ENABLE=1 # 非连续两个算子组合类场景优化,可选,开启设置为1
export TRI_COMBINED_ENABLE=1 # 非连续三个算子组合类场景优化,可选,开启设置为1
export ACL_DUMP_DATA=1 # 算子数据dump功能,调试时使用,可选,开启设置为1
@@ -276,22 +283,22 @@
</tr>
<tr id="row17878184693015"><td class="cellrowborder" valign="top" width="55.48%" headers="mcps1.2.3.1.1 "><p id="p1878194683016"><a name="p1878194683016"></a><a name="p1878194683016"></a>DYNAMIC_COMPILE_ENABLE</p>
</td>
<td class="cellrowborder" valign="top" width="44.519999999999996%" headers="mcps1.2.3.1.2 "><p id="p1887894620304"><a name="p1887894620304"></a><a name="p1887894620304"></a>(可选)动态shape特性功能,针对shape变化场景,开启设置为1</p>
<td class="cellrowborder" valign="top" width="44.519999999999996%" headers="mcps1.2.3.1.2 "><p id="p1887894620304"><a name="p1887894620304"></a><a name="p1887894620304"></a>(可选)动态shape特性功能,针对shape变化场景,开启设置为1(PyTorch1.8.1不支持该环境变量)。</p>
</td>
</tr>
<tr id="row78312162301"><td class="cellrowborder" valign="top" width="55.48%" headers="mcps1.2.3.1.1 "><p id="p1832171673019"><a name="p1832171673019"></a><a name="p1832171673019"></a>COMBINED_ENABLE</p>
</td>
<td class="cellrowborder" valign="top" width="44.519999999999996%" headers="mcps1.2.3.1.2 "><p id="p583261643014"><a name="p583261643014"></a><a name="p583261643014"></a>(可选)非连续两个算子组合类场景优化,开启设置为1</p>
<td class="cellrowborder" valign="top" width="44.519999999999996%" headers="mcps1.2.3.1.2 "><p id="p583261643014"><a name="p583261643014"></a><a name="p583261643014"></a>(可选)非连续两个算子组合类场景优化,开启设置为1。</p>
</td>
</tr>
<tr id="row17630155212342"><td class="cellrowborder" valign="top" width="55.48%" headers="mcps1.2.3.1.1 "><p id="p66309527341"><a name="p66309527341"></a><a name="p66309527341"></a>RI_COMBINED_ENABLE</p>
</td>
<td class="cellrowborder" valign="top" width="44.519999999999996%" headers="mcps1.2.3.1.2 "><p id="p19630185220345"><a name="p19630185220345"></a><a name="p19630185220345"></a>(可选)非连续三个算子组合类场景优化,开启设置为1</p>
<td class="cellrowborder" valign="top" width="44.519999999999996%" headers="mcps1.2.3.1.2 "><p id="p19630185220345"><a name="p19630185220345"></a><a name="p19630185220345"></a>(可选)非连续三个算子组合类场景优化,开启设置为1。</p>
</td>
</tr>
<tr id="row183041355123411"><td class="cellrowborder" valign="top" width="55.48%" headers="mcps1.2.3.1.1 "><p id="p730435533415"><a name="p730435533415"></a><a name="p730435533415"></a>ACL_DUMP_DATA</p>
</td>
<td class="cellrowborder" valign="top" width="44.519999999999996%" headers="mcps1.2.3.1.2 "><p id="p16304105533412"><a name="p16304105533412"></a><a name="p16304105533412"></a>(可选)算子数据dump功能,调试时使用,开启设置为1</p>
<td class="cellrowborder" valign="top" width="44.519999999999996%" headers="mcps1.2.3.1.2 "><p id="p16304105533412"><a name="p16304105533412"></a><a name="p16304105533412"></a>(可选)算子数据dump功能,调试时使用,开启设置为1。</p>
</td>
</tr>
<tr id="row27481914203518"><td class="cellrowborder" valign="top" width="55.48%" headers="mcps1.2.3.1.1 "><p id="p674813144357"><a name="p674813144357"></a><a name="p674813144357"></a>DYNAMIC_OP</p>
@@ -335,7 +342,6 @@
│ ├─gen.sh
│ ├─src # 源码目录
│ ├─tests # 测试用例存放目录
│ ├─README.md
```
2. 运行如下命令,进入“apex“目录,并获取原生apex源代码。
@@ -356,7 +362,6 @@
│ ├─gen.sh
│ ├─src # 源码目录
│ ├─tests # 测试用例存放目录
│ ├─README.md
```
3. 进入原生apex代码目录,即“apex/apex“目录。切换至commitid为4ef930c1c884fdca5f472ab2ce7cb9b505d26c1a的代码分支。
@@ -364,7 +369,6 @@
```
cd apex
git checkout 4ef930c1c884fdca5f472ab2ce7cb9b505d26c1a
cd ..
```
>![](public_sys-resources/icon-note.gif) **说明:**
@@ -387,14 +391,14 @@
python3 setup.py --cpp_ext --npu_float_status bdist_wheel
```
生成的二进制包在当前的dist目录下,即“apex/apex/dist”文件夹目录下。
Python版本需与PyTorch使用的Python一致,生成的二进制包在当前的dist目录下,即“apex/apex/dist”文件夹目录下。
4. <a name="zh-cn_topic_0000001106176190_li425495374416"></a>安装apex。
进入“apex/apex/dist“文件夹目录,执行如下命令安装。
```
pip3.7 install --upgrade apex-0.1+ascend-cp37-cp37m-linux_{arch}.whl
pip3 install --upgrade apex-0.1+ascend-cp37-cp37m-linux_{arch}.whl
```
**\{arch\}**表示架构信息,为aarch64或x86\_64。
@@ -404,51 +408,6 @@
>**pip3 list | grep apex**
<h2 id="使用Ascend-Hub镜像md">使用Ascend Hub镜像</h2>
- **[Ascend Hub获取PyTorch镜像](#Ascend-Hub获取PyTorch镜像md)**
- **[配置环境变量](#配置环境变量-0md)**
<h3 id="Ascend-Hub获取PyTorch镜像md">Ascend Hub获取PyTorch镜像</h3>
#### 前提条件<a name="zh-cn_topic_0000001118701830_zh-cn_topic_0275872734_section108914373254"></a>
- 已准备好相应硬件环境驱动和固件的安装,请参见各硬件产品[“驱动和固件安装升级指南”](https://support.huawei.com/enterprise/zh/category/ai-computing-platform-pid-1557196528909)。需要在硬件设备上安装与CANN版本配套的固件与驱动。
- 宿主机上已安装Docker。
#### 获取并使用镜像<a name="zh-cn_topic_0000001118701830_section108941734162613"></a>
用户可登录[Ascend Hub](https://ascendhub.huawei.com/#/home)获取相应镜像(首次申请需要激活账号)。
当前支持的镜像列表如[表1](#zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_table1519011227314)所示。用户可根据实际选择所需的镜像进行下载并使用。
**表 1** 镜像列表
<a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_table1519011227314"></a>
<table><thead align="left"><tr id="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_row0190152218319"><th class="cellrowborder" valign="top" width="55.00000000000001%" id="mcps1.2.4.1.1"><p id="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p1419132211315"><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p1419132211315"></a><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p1419132211315"></a>镜像名称</p>
</th>
<th class="cellrowborder" valign="top" width="20%" id="mcps1.2.4.1.2"><p id="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p75071327115313"><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p75071327115313"></a><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p75071327115313"></a>镜像版本</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.4.1.3"><p id="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p1024411406234"><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p1024411406234"></a><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p1024411406234"></a>配套CANN版本</p>
</th>
</tr>
</thead>
<tbody><tr id="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_row71915221134"><td class="cellrowborder" valign="top" width="55.00000000000001%" headers="mcps1.2.4.1.1 "><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_ul81691515131910"></a><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_ul81691515131910"></a><ul id="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_ul81691515131910"><li>ARM架构:<a href="https://ascendhub.huawei.com/#/detail?name=ascend-pytorch-arm" target="_blank" rel="noopener noreferrer">ascend-pytorch-arm</a></li><li>x86架构:<a href="https://ascendhub.huawei.com/#/detail?name=ascend-pytorch-x86" target="_blank" rel="noopener noreferrer">ascend-pytorch-x86</a></li></ul>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.2.4.1.2 "><p id="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p14648161414516"><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p14648161414516"></a><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p14648161414516"></a>21.0.2</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.4.1.3 "><p id="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p1264815147514"><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p1264815147514"></a><a name="zh-cn_topic_0000001118701830_zh-cn_topic_0000001074498056_p1264815147514"></a><a href="https://support.huawei.com/enterprise/zh/ascend-computing/cann-pid-251168373" target="_blank" rel="noopener noreferrer">5.0.2</a></p>
</td>
</tr>
</tbody>
</table>
<h3 id="配置环境变量-0md">配置环境变量</h3>
启动并进入镜像容器后,请参见[配置环境变量](#配置环境变量md)配置模型训练依赖的环境变量。
<h2 id="参考信息md">参考信息</h2>
- **[CMake安装方法](#CMake安装方法md)**
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

@@ -8,10 +8,13 @@
- [前提条件](#前提条件md)
- [获取PyTorch源码](#获取PyTorch源码md)
- [注册算子开发](#注册算子开发md)
- [概述](#概述md)
- [PyTorch1.5.0 注册算子开发](#PyTorch1-5-0-注册算子开发md)
- [PyTorch1.8.1 注册算子开发](#PyTorch1-8-1-注册算子开发md)
- [算子适配插件开发](#算子适配插件开发md)
- [编译和安装PyTorch框架](#编译和安装PyTorch框架md)
- [算子功能验证](#算子功能验证md)
- [概述](#概述md)
- [概述](#概述-0md)
- [实现过程](#实现过程md)
- [FAQ](#FAQmd)
- [Pillow==5.3.0安装失败](#Pillow-5-3-0安装失败md)
@@ -33,7 +36,7 @@
<h2 id="算子开发流程md">算子开发流程</h2>
Pytorch算子开发包含TBE算子开发和PyTorch框架下的算子适配。
PyTorch算子开发包含TBE算子开发和PyTorch框架下的算子适配。
1. TBE算子开发:昇腾AI软件栈中不包含相应的算子,需要先完成TBE算子的开发,再进行PyTorch框架下的算子适配。
@@ -128,39 +131,27 @@ Pytorch算子开发包含TBE算子开发和PyTorch框架下的算子适配。
<h3 id="环境准备md">环境准备</h3>
#### 前提条件<a name="zh-cn_topic_0000001125736787_section12464163765320"></a>
- 需完成CANN开发或运行环境的安装,具体操作请参考《CANN 软件安装指南》。
- 需安装python版本为3.7.5或3.8。
- 需安装3.12.0及以上版本的CMake,安装方法请参考[CMake安装方法](#CMake安装方法md)。
- 需确保已安装7.3.0以上版本的gcc,7.3.0版本gcc具体安装及使用方式请参见《CANN 软件安装指南》中的“安装7.3.0版本gcc”章节。
- 需确保环境中已安装git工具,以Ubuntu和CentOS系统为例,命令如下:
- Ubuntu系统
```
apt-get install patch
apt-get install git
```
- CentOS系统
```
yum install patch
yum install git
```
#### 安装PyTorch依赖环境<a name="zh-cn_topic_0000001125736787_section18699192116550"></a>
如果使用非root用户安装Python及其依赖,用户需要在每句命令末尾加上**--user**,保证安装的正常进行。命令示例为:**pip3.7 install pyyaml --user**
```
pip3.7 install pyyaml
pip3.7 install wheel
pip3.7 install Pillow==5.3.0
```
>![](public_sys-resources/icon-note.gif) **说明:**
>若以上过程出错,请参考[FAQ](#FAQmd)尝试解决问题。
<h3 id="算子速查md">算子速查</h3>
进行算子开发时,您可以查询当前昇腾AI处理器中支持的算子列表和当前PyTorch适配的算子列表。根据查询结果进行算子开发或PyTorch算子适配。
@@ -197,24 +188,24 @@ pip3.7 install Pillow==5.3.0
<h3 id="获取PyTorch源码md">获取PyTorch源码</h3>
从gitee上获取适配昇腾AI处理器的PyTorch源代码,获取地址为: [https://gitee.com/ascend/pytorch-develop](https://gitee.com/ascend/pytorch-develop) 。用户可以通过执行下面git命令行下载源代码。
```
git clone https://gitee.com/ascend/pytorch-develop.git --deepth=1
```
下载成功后,得到pytorch文件目录。
>![](public_sys-resources/icon-note.gif) **说明:**
>如无权限获取代码,请联系华为技术支持申请加入“Ascend”组织。
目前只支持PyTorch1.5.0和1.8.1版本,PyTorch源码获取请参见《PyTorch安装指南》中“安装PyTorch框架”章节,完成在"pytorch/pytorch"目录生成适配昇腾AI处理器的全量代码步骤。将在pytorch/pytorch目录中进行PyTorch 算子适配开发。
<h3 id="注册算子开发md">注册算子开发</h3>
#### 概述<a name="zh-cn_topic_0000001125315887_section693616257599"></a>
- **[概述](#概述md)**
- **[PyTorch1.5.0 注册算子开发](#PyTorch1-5-0-注册算子开发md)**
- **[PyTorch1.8.1 注册算子开发](#PyTorch1-8-1-注册算子开发md)**
<h4 id="概述md">概述</h4>
当前制定的NPU适配派发原则是NPU算子的派发不经过框架公共函数,直接派发成NPU适配的函数,即算子执行调用栈中只包含NPU适配的函数调用,不包含框架公共函数。PyTorch框架在编译时,会根据 native\_functions.yaml 的定义,按框架中定义的类型和设备分发原则,生成相应的新算子的中间层的调用说明。对于NPU,会生成在 build/aten/src/ATen/NPUType.cpp。
#### 注册算子开发方法<a name="zh-cn_topic_0000001125315887_section16610942811"></a>
<h4 id="PyTorch1-5-0-注册算子开发md">PyTorch1.5.0 注册算子开发</h4>
##### 注册算子开发方法<a name="section575212111125"></a>
1. 打开native\_functions.yaml文件。
@@ -227,7 +218,7 @@ git clone https://gitee.com/ascend/pytorch-develop.git --deepth=1
- yaml中未存在的自定义算子
由于yaml中没有相关算子的信息,需要手动添加相关函数,包括函数名,参数信息,返回类型信息。
由于yaml中没有相关算子的信息,需要手动添加相关函数,包括函数名,参数信息,返回类型信息。添加规则及方法请参见“pytorch/aten/src/ATen/native/README.md“。
```
- func:适配算子名称(输入参数信息) -> 返回类型
@@ -258,7 +249,7 @@ git clone https://gitee.com/ascend/pytorch-develop.git --deepth=1
>该格式供参考,算子适配开发过程中的函数名需与NPU\_Adapt\_Fun\_Name保持一致。
#### 示例<a name="zh-cn_topic_0000001125315887_section3651235962"></a>
##### 示例<a name="section434031421219"></a>
以torch.add\(\)算子为例介绍注册算子开发过程。
@@ -344,6 +335,94 @@ git clone https://gitee.com/ascend/pytorch-develop.git --deepth=1
<h4 id="PyTorch1-8-1-注册算子开发md">PyTorch1.8.1 注册算子开发</h4>
##### 注册算子开发方法<a name="section575212111125"></a>
1. 打开native\_functions.yaml文件。
native\_functions.yaml 文件中,定义了所有算子函数原型,包括函数名称和参数等信息,每个算子函数支持不同硬件平台的派发信息。该文件所在路径为pytorch/aten/src/ATen/native/native\_functions.yaml。
2. 确定需要派发函数。
- yaml 中已存在的算子
将所有与待适配算子相关的函数进行派发。
- yaml中未存在的自定义算子
由于yaml中没有相关算子的信息,需要手动添加相关函数,包括函数名,参数信息,返回类型信息。添加规则及方法请参见“pytorch/aten/src/ATen/native/README.md“。
```
- func:适配算子名称(输入参数信息) -> 返回类型
```
##### 示例<a name="section434031421219"></a>
以torch.add\(\)算子为例介绍注册算子开发过程。
1. 打开native\_functions.yaml文件。
2. 搜索相关函数。
在yaml中搜索add,找到与add算子相关的函数描述func。由于add是PyTorch内置算子,不需要手动添加func。若是自定义算子,需要手动添加func。
3. 确定算子相关函数名称及其类型的func描述。
- add.Tensor 的函数分发描述。
```
- func: add.Tensor(Tensor self, Tensor other, *, Scalar alpha=1) -> Tensor
structured_delegate: add.out
variants: function, method
dispatch:
SparseCPU, SparseCUDA: add_sparse
MkldnnCPU: mkldnn_add
```
- add.Scalar 的函数分发描述。
```
- func: add.Scalar(Tensor self, Scalar other, Scalar alpha=1) -> Tensor
variants: function, method
dispatch:
DefaultBackend: add
```
- add\_.Tensor 的函数分发描述。
```
- func: add_.Tensor(Tensor(a!) self, Tensor other, *, Scalar alpha=1) -> Tensor(a!)
variants: method
structured_delegate: add.out
dispatch:
SparseCPU, SparseCUDA: add_sparse_
MkldnnCPU: mkldnn_add_
```
- add\_.Scalar 的函数分发描述。
```
- func: add_.Scalar(Tensor(a!) self, Scalar other, Scalar alpha=1) -> Tensor(a!)
variants: method
dispatch:
DefaultBackend: add_
```
- add.out 的函数分发描述。
```
- func: add.out(Tensor self, Tensor other, *, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
structured: True
structured_inherits: TensorIteratorBase
dispatch:
CPU, CUDA: add_out
SparseCPU: add_out_sparse_cpu
SparseCUDA: add_out_sparse_cuda
MkldnnCPU: mkldnn_add_out
```
<h3 id="算子适配插件开发md">算子适配插件开发</h3>
#### 简介<a name="zh-cn_topic_0000001125315877_section16410139174517"></a>
@@ -371,6 +450,21 @@ git clone https://gitee.com/ascend/pytorch-develop.git --deepth=1
实现算子适配主题函数,根据TBE算子原型构造得到对应的input、output、attr。
5. (仅1.8.1版本需要操作该步骤)使用TORCH\_LIBRARY\_IMPL宏关联注册算子开发中native\_functions.yaml文件的算子描述func。
TORCH\_LIBRARY\_IMPL是PyTorch提供的用于注册算子分发的宏,使用方法如下。
```
Torch_LIBRARY_IMPL(aten, PrivateUse1, m){
m.impl("yaml中算子func方法名1", TORCH_FN("对应的适配主体函数名1"))
m.impl("yaml中算子func方法名2", TORCH_FN("对应的适配主体函数名2"))
}
```
- aten为命名空间,可以根据实现文件命名空间自行定义。
- PrivateUse1为dispatchKey, 固定设置NPU。
- m为固定字段。
#### 示例<a name="zh-cn_topic_0000001125315877_section18021337113012"></a>
@@ -524,6 +618,14 @@ git clone https://gitee.com/ascend/pytorch-develop.git --deepth=1
}
```
5. (仅1.8.1版本需要操作该步骤)使用TORCH\_LIBRARY\_IMPL宏关联注册算子。
```
TORCH_LIBRARY_IMPL(aten, NPU, m) {
m.impl("add.Tensor", TORCH_FN(add_npu));
m.impl("add_.Tensor", TORCH_FN(add_npu_));
m.impl("add.out", TORCH_FN(add_out_npu));}
```
>![](public_sys-resources/icon-note.gif) **说明:**
@@ -533,50 +635,48 @@ git clone https://gitee.com/ascend/pytorch-develop.git --deepth=1
#### 编译PyTorch框架<a name="zh-cn_topic_0000001125736777_section470105143317"></a>
1. 进入PyTorch工作目录 :“pytorch“。
2. 给脚本文件赋权限:
1. 进入PyTorch工作目录 :“pytorch/pytorch“。
2. 依赖库安装。
**chmod +x build.sh**
```
pip3 install -r requirements.txt
```
3. 执行如下命令进行编译:
3. 编译生成pytorch的二进制安装包。
**./build.sh**
```
bash build.sh --python=3.7
或
bash build.sh --python=3.8
```
>![](public_sys-resources/icon-note.gif) **说明:**
>首次编译持续的时间较长,可能超过30分钟,建议:若无必要,无需执行"make clean"。
请指定环境中python版本进行编译。编译成功后,会在pytorch/pytorch/dist”文件夹目录下生成二进制包 torch-\*.whl ,例如:torch-1.5.0+ascend.post3-cp37-cp37m-linux\_x86.whl或者torch-1.8.1+ascend-cp37-cp37m-linux\_x86.whl。
4. 编译成功后,会在“**pytorch/dist**” 下生成 torch-\*.whl 包,例如:torch-1.5.0a0-cp37-cp37m-linux\_x86.whl。
#### 安装PyTorch框架<a name="zh-cn_topic_0000001125736777_section119821419153412"></a>
1. 将[编译和安装PyTorch框架](#编译和安装PyTorch框架md)生成的torch-\*.whl包上传到服务器任一路径。
2. 进入torch-\*.whl 所在的目录,使用pip命令完成torch安装。
进入“pytorch/pytorch/dist“文件夹目录,执行如下命令安装。
当前登录用户为root用户时,执行:
```
pip3.7 install torch-*.whl
```
当前登录用户为非root用户时,执行:
```
pip3.7 install torch-*.whl --user
```
```
pip3 install --upgrade torch-1.5.0+ascend.post3-cp37-cp37m-linux_{arch}.whl
```
**\{arch\}**表示架构信息,为aarch64或x86\_64。
>![](public_sys-resources/icon-note.gif) **说明:**
>- 修改代码之后,需要重新执行“编译”和“安装”PyTorch过程。
>- 安装过程中,可能会出现错误提示"torchvision 0.6.0" 版本不匹配,此问题无影响,忽略即可。
>若环境中已安装PyTorch时,需要先卸载环境中已安装的PyTorch软件包再执行,可以通过执行如下命令查询环境上是否已安装PyTorch。
>**pip3 list | grep torch**
修改代码之后,需要重新执行“编译”和“安装”PyTorch过程。
<h2 id="算子功能验证md">算子功能验证</h2>
- **[概述](#概述md)**
- **[概述](#概述-0md)**
- **[实现过程](#实现过程md)**
<h3 id="概述md">概述</h3>
<h3 id="概述-0md">概述</h3>
#### 简介<a name="zh-cn_topic_0000001117556616_section29881459155718"></a>
@@ -588,7 +688,7 @@ git clone https://gitee.com/ascend/pytorch-develop.git --deepth=1
进行自定义算子功能验证,通过PyTorch前端构造自定义算子的函数并运行验证。
在https://gitee.com/ascend/pytorch-develop中 "pytorch/test/test\_npu/test\_network\_ops"目录下提供了测试用例及测试工具,供用户参考。
在https://gitee.com/ascend/pytorch中 "pytorch/test/test\_npu"目录下提供了测试用例及测试工具,供用户参考。
<h3 id="实现过程md">实现过程</h3>
@@ -633,7 +733,7 @@ git clone https://gitee.com/ascend/pytorch-develop.git --deepth=1
output = output.numpy()
return output
# 定义add对应场景通用函数,该函数中负责场景对应输入数据和对比CPU和NPU返回结果
# 定义add对应场景通用函数,该函数负责输入数据并对比CPU和NPU的计算结果
def add_result(self, shape_format):
for item in shape_format:
cpu_input1, npu_input1 = create_common_tensor(item, 0, 100)
@@ -656,7 +756,6 @@ git clone https://gitee.com/ascend/pytorch-develop.git --deepth=1
instantiate_device_type_tests(TestAdd, globals(), except_for="cpu")
if __name__ == "__main__":
torch.npu.set_device("npu:0")
run_tests()
```
@@ -14,26 +14,26 @@
- [多P训练模型迁移](#多P训练模型迁移md)
- [PyTorch接口替换](#PyTorch接口替换md)
- [混合精度](#混合精度md)
- [性能优化](#性能优化md)
- [概述](#概述-0md)
- [修改CPU性能模式(X86服务器)](#修改CPU性能模式X86服务器md)
- [修改CPU性能模式(ARM服务器)](#修改CPU性能模式ARM服务器md)
- [安装高性能pillow库(X86服务器)](#安装高性能pillow库X86服务器md)
- [(可选)安装指定版本OpenCV库](#可选安装指定版本OpenCV库md)
- [模型训练](#模型训练md)
- [性能调优和分析](#性能调优和分析md)
- [前提条件](#前提条件md)
- [调测过程](#调测过程md)
- [总体思路](#总体思路md)
- [采集训练过程相关数据](#采集训练过程相关数据md)
- [性能优化](#性能优化-1md)
- [host侧性能优化](#host侧性能优化md)
- [概述](#概述-0md)
- [修改CPU性能模式(X86服务器)](#修改CPU性能模式X86服务器md)
- [修改CPU性能模式(ARM服务器)](#修改CPU性能模式ARM服务器md)
- [安装高性能pillow库(X86服务器)](#安装高性能pillow库X86服务器md)
- [(可选)安装指定版本OpenCV库](#可选安装指定版本OpenCV库md)
- [训练过程性能优化](#训练过程性能优化md)
- [亲和库](#亲和库md)
- [来源介绍](#来源介绍md)
- [功能介绍](#功能介绍-2md)
- [功能介绍](#功能介绍-1md)
- [精度调测](#精度调测md)
- [前提条件](#前提条件-3md)
- [调测过程](#调测过程-4md)
- [总体思路](#总体思路-5md)
- [前提条件](#前提条件-2md)
- [调测过程](#调测过程-3md)
- [总体思路](#总体思路-4md)
- [精度调优方法](#精度调优方法md)
- [单算子溢出检测](#单算子溢出检测md)
- [整网调测](#整网调测md)
@@ -49,7 +49,7 @@
- [分布式训练修改](#分布式训练修改md)
- [脚本执行](#脚本执行md)
- [ShuffleNet模型调优示例](#ShuffleNet模型调优示例md)
- [样例获取](#样例获取-6md)
- [样例获取](#样例获取-5md)
- [模型评估](#模型评估md)
- [网络迁移](#网络迁移md)
- [网络调测](#网络调测md)
@@ -68,11 +68,12 @@
- [在模型运行或者算子运行时遇到报错“RuntimeError: ExchangeDevice:”](#在模型运行或者算子运行时遇到报错-RuntimeError-ExchangeDevicemd)
- [在模型运行或者算子运行时遇到报错“Error in atexit.\_run\_exitfuncs:”](#在模型运行或者算子运行时遇到报错-Error-in-atexit-_run_exitfuncsmd)
- [在模型运行时遇到报错“terminate called after throwing an instance of 'c10::Error' what\(\): HelpACLExecute:”](#在模型运行时遇到报错-terminate-called-after-throwing-an-instance-of-c10-Error-what-HelpACLExecutemd)
- [在模型运行时遇到报错“terminate called after throwing an instance of 'c10::Error' what\(\): 0 INTERNAL ASSERT”](#在模型运行时遇到报错-terminate-called-after-throwing-an-instance-of-c10-Error-what-0-INTERNAL-ASSERTmd)
- [在模型运行时遇到报错“ImportError: libhccl.so.”](#在模型运行时遇到报错-ImportError-libhccl-somd)
- [在模型运行时遇到报错“RuntimeError: Initialize.”](#在模型运行时遇到报错-RuntimeError-Initializemd)
- [在模型运行时遇到报错“TVM/te/cce error.”](#在模型运行时遇到报错-TVM-te-cce-errormd)
- [在模型运行时遇到报错“MemCopySync:drvMemcpy failed.”](#在模型运行时遇到报错-MemCopySync-drvMemcpy-failedmd)
- [在模型运行时遇到报错“MemCopySync:drvMemcpy failed.”](#在模型运行时遇到报错-MemCopySync-drvMemcpy-failed-7md)
- [在模型运行时遇到报错“MemCopySync:drvMemcpy failed.”](#在模型运行时遇到报错-MemCopySync-drvMemcpy-failed-6md)
- [在模型运行时将多任务下发关闭\(export TASK\_QUEUE\_ENABLE=0\)后仍然遇到报错“HelpACLExecute.”](#在模型运行时将多任务下发关闭export-TASK_QUEUE_ENABLE-0后仍然遇到报错-HelpACLExecutemd)
- [在模型运行时遇到报错“55056 GetInputConstDataOut: ErrorNo: -1\(failed\)”](#在模型运行时遇到报错-55056-GetInputConstDataOut-ErrorNo--1failedmd)
- [模型调测常见问题](#模型调测常见问题md)
@@ -226,8 +227,6 @@
- **[混合精度](#混合精度md)**
- **[性能优化](#性能优化md)**
<h3 id="工具迁移md">工具迁移</h3>
@@ -803,7 +802,7 @@ def main():
# 需屏蔽掉初始化方式
dist.init_process_group(backend='hccl',# init_method=args.dist_url,
world_size=args.world_size, rank=args.rank)
model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[args.gpu])
model = torch.nn.parallel.DistributedDataParallel(model, device_ids=[args.gpu]) # model需要下发到npu上
train_loader = torch.utils.data.DataLoader(
train_dataset, batch_size=args.batch_size, shuffle=(train_sampler is None),
num_workers=args.workers, pin_memory=True, sampler=train_sampler)
@@ -1104,7 +1103,171 @@ def main():
```
<h3 id="性能优化md">性能优化</h3>
<h2 id="模型训练md">模型训练</h2>
训练脚本迁移完成后,需要参见[配置环境变量](#zh-cn_topic_0000001144082004md)设置环境变量,然后执行**python3** _xxx_进行模型训练。具体样例请参考[脚本执行](#脚本执行md)。
>![](public_sys-resources/icon-note.gif) **说明:**
>执行“python3 xxx“命令时,须将python3软链接到与当前pytorch适配版本的python安装路径。
<h2 id="性能调优和分析md">性能调优和分析</h2>
- **[前提条件](#前提条件md)**
- **[调测过程](#调测过程md)**
- **[亲和库](#亲和库md)**
<h3 id="前提条件md">前提条件</h3>
1. 参见[样例说明](#样例说明md)改造开源代码,使模型能够正常运行,包括数据预处理,前向计算,loss计算,混合精度,反向计算,参数更新等。
2. 模型迁移阶段优先关注模型是否能跑通,现有算子是否能满足,如果遇到不满足的算子需参见《PyTorch算子开发指南》进行算子适配开发。
3. 优先打通单卡功能,再打通多卡功能。
<h3 id="调测过程md">调测过程</h3>
- **[总体思路](#总体思路md)**
- **[采集训练过程相关数据](#采集训练过程相关数据md)**
- **[host侧性能优化](#host侧性能优化md)**
- **[训练过程性能优化](#训练过程性能优化md)**
<h4 id="总体思路md">总体思路</h4>
1. 通过训练执行结果,判断吞吐量指标是否达到预期要求。
2. 当吞吐量指标不达标时,需要找出制约性能瓶颈的原因,主要为以下几个方面:
- 算子瓶颈,在某个算子上执行过慢。
- copy瓶颈,非连续转连续时进行copy带来的瓶颈。
- 框架瓶颈,由于算子格式转换带来了额外操作。
- 编译瓶颈,由于shape或属性来回变化造成反复编译。
3. 针对以上制约性能瓶颈的原因进行分析与优化。
<h4 id="采集训练过程相关数据md">采集训练过程相关数据</h4>
##### Profiling数据采集<a name="section141471611314"></a>
当模型训练过程中吞吐量指标不达标时,可以通过采集训练过程中的profiling数据,分析哪个环节、哪个算子导致的性能消耗。Profiling数据采集分为PyTorch层面和CANN层面的采集,PyTorch层面采集的是PyTorch API的数据,CANN层面采集的是TBE算子的数据。
请参见以下方式进行profiling数据的获取,并根据实际情况选择需要的数据采集方式。
- PyTorch层面Profiling数据采集。
1. 获取chrome\_trace文件。
使用profile接口对原始代码的loss计算和优化过程进行改造。
```
# 使用ascend-pytorch适配的profile接口,即可获得,推荐只运行一个step
with torch.autograd.profiler.profile(use_npu=True) as prof:
out = model(input_tensor)
loss=loss_func(out)
loss.backward()
optimizer.zero_grad()
optimizer.step()
# 导出chrome_trace文件到指定路径
output_path = '/home/HwHiAiUser/profile_data.json'
prof.export_chrome_trace(output_path)
```
2. 查看chrome\_trace文件。
chrome\_trace文件可以通过以下方式打开查看:在Chrome浏览器中输入“chrome://tracing“地址,然后将落盘文件拖到空白处即可打开文件内容,通过键盘W、A、S、D键,可以对profiler的结果进行缩放和移动。
- CANN层面Profiling数据采集。
1. 获取性能数据文件。
```
profiler_result_path = "/home/profiling_data" # profiling 数据保存的文件夹,需提前手动创建,请根据实际指定。
with torch.npu.profile(profiler_result_path):
out = model(input_tensor)
loss=loss_func(out,target)
loss.backward()
optimizer.zero_grad()
optimizer.step()
```
>![](public_sys-resources/icon-note.gif) **说明:**
>获取性能数据文件时,model、input\_tensor、target需要下发到npu上。
2. 解析性能数据文件。
请参见《CANN 开发辅助工具指南》中“Profiling工具使用指南(训练)”章节。
##### 获取算子信息OP\_INFO<a name="section15654162853114"></a>
网络模型最终是以OP执行的,通过OPInfo日志,我们可以获取实际执行时的算子及其属性。通过get\_ascend\_op\_info.py脚本获取。
1. 编写get\_ascend\_op\_info.py脚本获取算子信息,脚本内容如下。
```
# -*- coding: utf-8 -*-
"""用于导出OPINFO
"""
import os
import sys
import argparse
def func(host_log_folder):
"""
:param host_log_folder: where host_log_folder addr is.
:return:
"""
host_log_files = os.listdir(host_log_folder)
result = {}
for host_log in host_log_files:
if not host_log.endswith('.log') or host_log.endswith('.out'):
continue
with open(os.path.join(host_log_folder, host_log), 'r')as f:
host_log_lines = f.readlines()
for line in host_log_lines:
if line.startswith('[INFO] ASCENDCL') and "aclopCompile::aclOp" in line:
op_info = line.split('OpType: ')[1][:-2]
op_type = op_info.split(',')[0]
op_param = op_info[len(op_type) + 2:]
if op_type not in result.keys():
result[op_type] = [op_param]
else:
result[op_type].append(op_param)
with open('ascend_op_info_summary.txt', 'w')as f:
for k, v in result.items():
v_set = set(v)
for info in v_set:
f.write(k + " " + info + "\n")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='trans the log')
parser.add_argument('--host_log_folder', default="./",
help="input the dir name, trans the current dir with default")
ags = parser.parse_args()
func(ags.host_log_folder)
```
2. 设置环境变量,将host日志打屏。
```
export ASCEND_SLOG_PRINT_TO_STDOUT=1
```
3. 设置日志级别为info,参考《CANN 日志参考》设置日志级别。
4. 执行训练脚本,进行模型训练,训练完成后获取host侧日志,默认位置为$HOME/ascend/log/plog目录下,$HOME表示Host侧用户根目录。
5. 解析host侧日志会在当前目录下得到OPInfo信息ascend\_op\_info\_summary.txt。
```
python3 get_ascend_op_info.py --host_log_folder $HOME/ascend/log/plog
```
6. 分析TaskInfo中额外的task,尤其关注transdata。
<h4 id="host侧性能优化md">host侧性能优化</h4>
- **[概述](#概述-0md)**
@@ -1117,16 +1280,17 @@ def main():
- **[(可选)安装指定版本OpenCV库](#可选安装指定版本OpenCV库md)**
<h4 id="概述-0md">概述</h4>
<h5 id="概述-0md">概述</h5>
在进行PyTorch模型迁移训练时,部分网络模型会出现1秒内识别的图像数(fps)较低、性能不达标的情况。此时需要针对服务器进行以下优化。
在进行PyTorch模型迁移训练时,部分网络模型会出现FPS较低、性能不达标的情况。可以考虑对服务器进行以下优化尝试提高训练性能。
- 修改CPU性能模式。
- 安装高性能pillow库。
- (可选)安装指定版本OpenCV库。
<h4 id="修改CPU性能模式(X86服务器)md">修改CPU性能模式(X86服务器)</h4>
<h5 id="修改CPU性能模式(X86服务器)md">修改CPU性能模式(X86服务器)</h5>
##### 设置电源策略为高性能模式<a name="section18832114453814"></a>
###### 设置电源策略为高性能模式<a name="section18832114453814"></a>
提升网络性能需要在X86服务器BIOS设置中将电源策略设为高性能模式,具体操作如下。
@@ -1153,7 +1317,7 @@ def main():
6. 按下“F10”保存配置并重启服务器。
##### 将CPU设置为performance模式<a name="section20155620469"></a>
###### 将CPU设置为performance模式<a name="section20155620469"></a>
请使用root用户执行如下操作。
@@ -1231,9 +1395,9 @@ def main():
4. 再次执行[步骤1](#li158435131344)查看当前CPU模式是否已设置为performance模式。
<h4 id="修改CPU性能模式(ARM服务器)md">修改CPU性能模式(ARM服务器)</h4>
<h5 id="修改CPU性能模式(ARM服务器)md">修改CPU性能模式(ARM服务器)</h5>
##### 设置电源策略为高性能模式<a name="section18832114453814"></a>
###### 设置电源策略为高性能模式<a name="section18832114453814"></a>
在某些对Host侧CPU要求较高的模型中,例如目标检测类模型,需要进行较为复杂的图像预处理,开启电源高性能模式能一定程度上提高性能和稳定性。ARM服务器提升网络性能需要在BIOS设置中将电源策略设为高性能模式,具体操作如下。
@@ -1260,7 +1424,7 @@ def main():
6. 按下“F10”保存配置并重启服务器。
<h4 id="安装高性能pillow库(X86服务器)md">安装高性能pillow库(X86服务器)</h4>
<h5 id="安装高性能pillow库(X86服务器)md">安装高性能pillow库(X86服务器)</h5>
1. 安装高性能pillow库相关依赖,命令如下。
@@ -1311,173 +1475,14 @@ def main():
```
<h4 id="(可选)安装指定版本OpenCV库md">(可选)安装指定版本OpenCV库</h4>
<h5 id="(可选)安装指定版本OpenCV库md">(可选)安装指定版本OpenCV库</h5>
如模型依赖OpenCV,基于训练性能考虑,建议安装OpenCV-3.4.10版本。
1. 获取源码:[获取地址](https://opencv.org/releases/)。
2. 安装指导:[获取地址](https://docs.opencv.org/3.4.10/d7/d9f/tutorial_linux_install.html)。
<h2 id="模型训练md">模型训练</h2>
训练脚本迁移完成后,需要参见[配置环境变量](#zh-cn_topic_0000001144082004)设置环境变量,然后执行**python3** _xxx_进行模型训练。具体样例请参考[脚本执行](#脚本执行md)。
>![](public_sys-resources/icon-note.gif) **说明:**
>执行“python3 xxx“命令时,须将python3软链接到与当前pytorch适配版本的python安装路径。
<h2 id="性能调优和分析md">性能调优和分析</h2>
- **[前提条件](#前提条件md)**
- **[调测过程](#调测过程md)**
- **[亲和库](#亲和库md)**
<h3 id="前提条件md">前提条件</h3>
1. 参见[样例说明](#样例说明md)改造开源代码,使模型能够正常运行,包括数据预处理,前向计算,loss计算,混合精度,反向计算,参数更新等。
2. 模型迁移阶段优先关注模型是否能跑通,现有算子是否能满足,如果遇到不满足的算子需参见《PyTorch算子开发指南》进行算子适配开发。
3. 优先打通单卡功能,再打通多卡功能。
<h3 id="调测过程md">调测过程</h3>
- **[总体思路](#总体思路md)**
- **[采集训练过程相关数据](#采集训练过程相关数据md)**
- **[性能优化](#性能优化-1md)**
<h4 id="总体思路md">总体思路</h4>
1. 通过训练执行结果,判断吞吐量指标是否达到预期要求。
2. 当吞吐量指标不达标时,需要找出制约性能瓶颈的原因,主要为以下几个方面:
- 算子瓶颈,在某个算子上执行过慢。
- copy瓶颈,非连续转连续时进行copy带来的瓶颈。
- 框架瓶颈,由于算子格式转换带来了额外操作。
- 编译瓶颈,由于shape或属性来回变化造成反复编译。
3. 针对以上制约性能瓶颈的原因进行分析与优化。
<h4 id="采集训练过程相关数据md">采集训练过程相关数据</h4>
##### Profiling数据采集<a name="section141471611314"></a>
当模型训练过程中吞吐量指标不达标时,可以通过采集训练过程中的profiling数据,分析哪个环节、哪个算子导致的性能消耗。Profiling数据采集分为PyTorch层面和CANN层面的采集,PyTorch层面采集的是PyTorch API的数据,CANN层面采集的是TBE算子的数据。
请参见以下方式进行profiling数据的获取,并根据实际情况选择需要的数据采集方式。
- PyTorch层面Profiling数据采集。
1. 获取chrome\_trace文件。
使用profile接口对原始代码的loss计算和优化过程进行改造。
```
# 使用ascend-pytorch适配的profile接口,即可获得,推荐只运行一个step
with torch.autograd.profiler.profile(use_npu=True) as prof:
out = model(input_tensor)
loss=loss_func(out)
loss.backward()
optimizer.zero_grad()
optimizer.step()
# 导出chrome_trace文件到指定路径
output_path = '/home/HwHiAiUser/profile_data.json'
prof.export_chrome_trace(output_path)
```
2. 查看chrome\_trace文件。
chrome\_trace文件可以通过以下方式打开查看:在Chrome浏览器中输入“chrome://tracing“地址,然后将落盘文件拖到空白处即可打开文件内容,通过键盘W、A、S、D键,可以对profiler的结果进行缩放和移动。
- CANN层面Profiling数据采集。
1. 获取性能数据文件。
```
profiler_result_path = "/home/profiling_data" # profiling 数据保存的文件夹,需提前手动创建,请根据实际指定。
with torch.npu.profile(profiler_result_path) as prof:
out = model(input_tensor)
loss=loss_func(out)
loss.backward()
optimizer.zero_grad()
optimizer.step()
```
2. 解析性能数据文件。
请参见《CANN 开发辅助工具指南》中“Profiling工具使用指南(训练)”章节。
##### 获取算子信息OP\_INFO<a name="section15654162853114"></a>
网络模型最终是以OP执行的,通过OPInfo日志,我们可以获取实际执行时的算子及其属性。通过get\_ascend\_op\_info.py脚本获取。
1. 编写get\_ascend\_op\_info.py脚本获取算子信息,脚本内容如下。
```
# -*- coding: utf-8 -*-
"""用于导出OPINFO
"""
import os
import sys
import argparse
def func(host_log_folder):
"""
:param host_log_folder: where host_log_folder addr is.
:return:
"""
host_log_files = os.listdir(host_log_folder)
result = {}
for host_log in host_log_files:
if not host_log.endswith('.log') or host_log.endswith('.out'):
continue
with open(os.path.join(host_log_folder, host_log), 'r')as f:
host_log_lines = f.readlines()
for line in host_log_lines:
if line.startswith('[INFO] ASCENDCL') and "aclopCompile::aclOp" in line:
op_info = line.split('OpType: ')[1][:-2]
op_type = op_info.split(',')[0]
op_param = op_info[len(op_type) + 2:]
if op_type not in result.keys():
result[op_type] = [op_param]
else:
result[op_type].append(op_param)
with open('ascend_op_info_summary.txt', 'w')as f:
for k, v in result.items():
v_set = set(v)
for info in v_set:
f.write(k + " " + info + "\n")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='trans the log')
parser.add_argument('--host_log_folder', default="./",
help="input the dir name, trans the current dir with default")
ags = parser.parse_args()
func(ags.host_log_folder)
```
2. 设置环境变量,将host日志打屏。
```
export ASCEND_SLOG_PRINT_TO_STDOUT=1
```
3. 设置日志级别为info,参考《CANN 日志参考》设置日志级别。
4. 执行训练脚本,进行模型训练,训练完成后获取host侧日志,默认位置为$HOME/ascend/log/plog目录下,$HOME表示Host侧用户根目录。
5. 解析host侧日志会在当前目录下得到OPInfo信息ascend\_op\_info\_summary.txt。
```
python3 get_ascend_op_info.py --host_log_folder $HOME/ascend/log/plog
```
6. 分析TaskInfo中额外的task,尤其关注transdata。
<h4 id="性能优化-1md">性能优化</h4>
<h4 id="训练过程性能优化md">训练过程性能优化</h4>
##### 算子瓶颈优化<a name="section8727652134111"></a>
@@ -1526,14 +1531,14 @@ def main():
- **[来源介绍](#来源介绍md)**
- **[功能介绍](#功能介绍-2md)**
- **[功能介绍](#功能介绍-1md)**
<h4 id="来源介绍md">来源介绍</h4>
针对公版模型中常见的网络结构和函数,我们针对性地对其进行了优化,使得运算性能大幅度提升,同时,将其集成到Pytorch框架中,便于模型性能调优中使用。
<h4 id="功能介绍-2md">功能介绍</h4>
<h4 id="功能介绍-1md">功能介绍</h4>
<a name="table348133010119"></a>
<table><thead align="left"><tr id="row1348193013113"><th class="cellrowborder" valign="top" width="46.21462146214622%" id="mcps1.1.4.1.1"><p id="p98051838191114"><a name="p98051838191114"></a><a name="p98051838191114"></a>函数名</p>
@@ -1580,23 +1585,23 @@ def main():
<h2 id="精度调测md">精度调测</h2>
- **[前提条件](#前提条件-3md)**
- **[前提条件](#前提条件-2md)**
- **[调测过程](#调测过程-4md)**
- **[调测过程](#调测过程-3md)**
<h3 id="前提条件-3md">前提条件</h3>
<h3 id="前提条件-2md">前提条件</h3>
优先在同等语义和超参下,跑一定的epoch(推荐完整epoch数的20%),使精度,loss等对齐GPU相应水平,完成后再对齐最终精度。
<h3 id="调测过程-4md">调测过程</h3>
<h3 id="调测过程-3md">调测过程</h3>
- **[总体思路](#总体思路-5md)**
- **[总体思路](#总体思路-4md)**
- **[精度调优方法](#精度调优方法md)**
<h4 id="总体思路-5md">总体思路</h4>
<h4 id="总体思路-4md">总体思路</h4>
精度问题排查需要找出是哪一步出现的问题,主要以下几个方面:
@@ -1641,12 +1646,12 @@ def main():
<h5 id="单算子溢出检测md">单算子溢出检测</h5>
用户通过采集训练过程中各算子的运算结果(即Dump数据),然后查看算子是否产生溢出,从而帮助开发人员快速定位并解决算子精度问题。
用户通过算子溢出检测功能检测算子是否有溢出,然后采集溢出算子的数据,从而帮助开发人员快速定位并解决算子精度问题。
###### 约束说明<a name="section52762019181510"></a>
- 需要安装hdf5工具以支持算子dump功能,安装详情请参见[编译安装hdf5](#编译安装hdf5md);
- 本功能只提供IR级别的算子溢出检测,且只支持AICORE的溢出检测,不支持Atomic溢出检测;
- 本功能只提供IR级别的算子溢出检测,且只支持AICORE,不支持Atomic;
- 须在PyTorch源代码“build.sh“文件中添加“USE\_DUMP=1”字段。
```
@@ -1658,13 +1663,13 @@ def main():
- 使用单算子溢出检测功能时,请不要同时开启apex的动态loss scale模式和使用tensor融合功能。
###### 采集算子Dump数据<a name="section121407268191"></a>
###### 采集溢出算子数据<a name="section121407268191"></a>
```
# check_overflow为溢出检测控制开关
# dump_path为dump文件保存路径
with torch.utils.dumper(check_overflow=check_overflow, dump_path=dump_path, load_file_path='') as dump:
# 需要算子采集的代码片段
# 需要检测算子溢出的代码片段
```
模型运行过程中,如果有算子溢出,会打印出相应IR的名字。
@@ -2491,7 +2496,7 @@ if __name__ == "__main__":
##### 配置环境变量<a name="section13239217203"></a>
请参考[配置环境变量](#zh-cn_topic_0000001144082004)配置环境变量。
请参考[配置环境变量](#zh-cn_topic_0000001144082004md)配置环境变量。
##### 执行命令<a name="section624019171308"></a>
@@ -2536,7 +2541,7 @@ python3 main.py /home/data/resnet50/imagenet --addr='1.1.1.1' \ #
<h3 id="ShuffleNet模型调优示例md">ShuffleNet模型调优示例</h3>
- **[样例获取](#样例获取-6md)**
- **[样例获取](#样例获取-5md)**
- **[模型评估](#模型评估md)**
@@ -2545,7 +2550,7 @@ python3 main.py /home/data/resnet50/imagenet --addr='1.1.1.1' \ #
- **[网络调测](#网络调测md)**
<h4 id="样例获取-6md">样例获取</h4>
<h4 id="样例获取-5md">样例获取</h4>
##### 样例获取<a name="section1155115015182"></a>
@@ -2647,10 +2652,10 @@ python3 main.py /home/data/resnet50/imagenet --addr='1.1.1.1' \ #
详细说明如下:
- 由于原生实现的torch.transpose\(x, 1, 2\).contiguous\(\)是使用了View类框架算子transpose,造成了非连续场景,如[copy瓶颈优化](#性能优化-1md)所描述Copy瓶颈,使用channel\_shuffle\_index\_select,在语义相同的情况下使用计算类算子替换框架类算子,从而减少耗时。
- 由于shufflenetv2中含有大量的chunk操作,而chunk操作在Pytorch中为框架类算子,其结果会将一个tensor分割为几个等长的非连续的tensor,而非连续转连续这个操作目前耗时较长,故使用计算类算子消除非连续,如[copy瓶颈优化](#性能优化-1md)所描述Copy瓶颈。
- 由于原生实现的torch.transpose\(x, 1, 2\).contiguous\(\)是使用了View类框架算子transpose,造成了非连续场景,如[copy瓶颈优化](#训练过程性能优化md)所描述Copy瓶颈,使用channel\_shuffle\_index\_select,在语义相同的情况下使用计算类算子替换框架类算子,从而减少耗时。
- 由于shufflenetv2中含有大量的chunk操作,而chunk操作在Pytorch中为框架类算子,其结果会将一个tensor分割为几个等长的非连续的tensor,而非连续转连续这个操作目前耗时较长,故使用计算类算子消除非连续,如[copy瓶颈优化](#训练过程性能优化md)所描述Copy瓶颈。
- 适配层在适配算子时默认指定输出格式为输入格式,但是concat不支持C轴非16整数倍的5HD的格式,会转为4D进行处理,又由于concat后面接的是gatherv2算子,也是仅支持4D格式的算子,所以导致数据格式转换过程为5HD-\>4D-\>concat-\>5HD-\>4D-\>gatherv2-\>5HD,解决方法是修改concat输出格式,当非16整数倍时指定输出格式为4D,优化后数据格式转换过程为5HD-\>4D-\>concat-\>gatherv2-\>5HD,当前针对ShuffleNet的做法具体可参考pytorch/aten/src/ATen/native/npu/CatKernelNpu.cpp 第121行。
- 设置weight初始化格式避免计算过程中反复的transdata,如[copy瓶颈优化](#性能优化-1md)所描述框架瓶颈。
- 设置weight初始化格式避免计算过程中反复的transdata,如[copy瓶颈优化](#训练过程性能优化md)所描述框架瓶颈。
- 修复了DWCONV weight输出格式指定,避免一些不必要5HD-\>4D。
##### 整网排查<a name="section1261194410241"></a>
@@ -3108,6 +3113,7 @@ for group in [2, 4, 8]:
def cpu_op_exec(self, input1):
# 调用算子
output = torch.max(input1)
output = output.to('cpu')
output = output.numpy()
return output
@@ -3303,15 +3309,38 @@ torch.npu.finalize_dump()
2. 开启重定向日志到stdout,用于导出host日志到屏幕。
**export ASCEND\_SLOG\_PRINT\_TO\_STDOUT=1**
**export ASCEND\_SLOG\_PRINT\_TO\_STDOUT=0**
3. 设置日志级别,日志级别设置,信息从多到少分别是 debug --\> info --\> warning --\> error --\> null,一般设置为error,调试时使用info。请参考《CANN 日志参考》设置日志级别。
**export ASCEND\_GLOBAL\_LOG\_LEVEL=3**
4. dump图,主要用于查看图结构。
**export DUMP\_GE\_GRAPH=2**
**export DUMP\_GRAPH\_LEVEL=3**
5. 设置Event日志开启标志。
**export ASCEND\_GLOBAL\_EVENT\_ENABLE=0**
6. 设置是否开启PTCopy。
**export PTCOPY\_ENABLE=1**
7. 设置是否开启combined标志。
**export COMBINED\_ENABLE=1**
8. 设置特殊场景是否需要重新编译,不需要修改。
**export DYNAMIC\_OP="ADD\#MUL"**
9. HCCL白名单开关。
**export HCCL\_WHITELIST\_DISABLE=1**
<h3 id="dump-op方法md">dump op方法</h3>
@@ -3341,15 +3370,17 @@ torch.npu.set_option(option) # 以dict方式进行设置
ACL_OP_SELECT_IMPL_MODE, //选择算子是高精度实现还是高性能实现
ACL_OPTYPELIST_FOR_IMPLMODE, //列举算子类型的列表,该列表中的算子使用ACL_OP_SELECT_IMPL_MODE指定的模式
ACL_OP_DEBUG_LEVEL, //TBE算子编译debug功能开关
ACL_DEBUG_DIR, //保存模型转换、网络迁移过程中算子编译生成的调试相关过程文件的路径,包括算子.o/.json/.cce等文件。
ACL_DEBUG_DIR, //保存模型转换、网络迁移过程中算子编译生成的调试相关过程文件的路径,包括算子.o/.json/.cce等文件。路径必须已经存在。
ACL_OP_COMPILER_CACHE_MODE, //算子编译磁盘缓存模式
ACL_OP_COMPILER_CACHE_DIR, //算子编译磁盘缓存的目录
ACL_OP_COMPILER_CACHE_DIR, //算子编译磁盘缓存的路径,路径必须已经存在。
key对应的val值解释和可设置值如下:
ACL_OPTYPELIST_FOR_IMPLMODE: 用于选择算子是高精度实现还是高性能实现。如果不配置该编译选项,默认采用high_precision。
ACL_OP_SELECT_IMPL_MODE: 用于选择算子是高精度实现还是高性能实现。如果不配置该编译选项,默认采用high_precision。
high_precision:表示网络模型中所有算子选择高精度实现。
high_performance:表示网络模型中所有算子选择高性能实现。
ACL_OPTYPELIST_FOR_IMPLMODE:设置optype列表中算子的实现方式,该参数当前仅支持设置某个具体算子的实现方式,不支持设置多个算子。当前仅支持配置的算子为Pooling、SoftmaxV2、LRN、ROIAlign。算子类型的列表中的算子使用ACL_OP_SELECT_IMPL_MODE指定的模式。
ACL_OP_DEBUG_LEVEL:用于配置TBE算子编译debug功能开关。
0:不开启算子debug功能。在执行atc命令当前路径算子编译生成的kernel_meta文件夹中不保留.o(算子二进制文件)和.json文件(算子描述文件)。
1:开启算子debug功能,在执行atc命令当前路径算子编译生成的kernel_meta文件夹中生成TBE指令映射文件(算子cce文件*.cce和python-cce映射文件*_loc.json),用于后续工具进行AICore Error问题定位。
@@ -3533,7 +3564,9 @@ pip3.7 install pillow==5.3.0安装失败。
- **[在模型运行或者算子运行时遇到报错“Error in atexit.\_run\_exitfuncs:”](#在模型运行或者算子运行时遇到报错-Error-in-atexit-_run_exitfuncsmd)**
- **[在模型运行时遇到报错“terminate called after throwing an instance of 'c10::Error' what\(\): HelpACLExecute:”](#在模型运行时遇到报错-terminate-called-after-throwing-an-instance-of-c10-Error-what()-HelpACLExecutemd)**
- **[在模型运行时遇到报错“terminate called after throwing an instance of 'c10::Error' what\(\): HelpACLExecute:”](#在模型运行时遇到报错-terminate-called-after-throwing-an-instance-of-c10-Error-what-HelpACLExecutemd)**
- **[在模型运行时遇到报错“terminate called after throwing an instance of 'c10::Error' what\(\): 0 INTERNAL ASSERT”](#在模型运行时遇到报错-terminate-called-after-throwing-an-instance-of-c10-Error-what-0-INTERNAL-ASSERTmd)**
- **[在模型运行时遇到报错“ImportError: libhccl.so.”](#在模型运行时遇到报错-ImportError-libhccl-somd)**
@@ -3543,11 +3576,11 @@ pip3.7 install pillow==5.3.0安装失败。
- **[在模型运行时遇到报错“MemCopySync:drvMemcpy failed.”](#在模型运行时遇到报错-MemCopySync-drvMemcpy-failedmd)**
- **[在模型运行时遇到报错“MemCopySync:drvMemcpy failed.”](#在模型运行时遇到报错-MemCopySync-drvMemcpy-failed-7md)**
- **[在模型运行时遇到报错“MemCopySync:drvMemcpy failed.”](#在模型运行时遇到报错-MemCopySync-drvMemcpy-failed-6md)**
- **[在模型运行时将多任务下发关闭\(export TASK\_QUEUE\_ENABLE=0\)后仍然遇到报错“HelpACLExecute.”](#在模型运行时将多任务下发关闭(export-TASK_QUEUE_ENABLE-0)后仍然遇到报错-HelpACLExecutemd)**
- **[在模型运行时将多任务下发关闭\(export TASK\_QUEUE\_ENABLE=0\)后仍然遇到报错“HelpACLExecute.”](#在模型运行时将多任务下发关闭export-TASK_QUEUE_ENABLE-0后仍然遇到报错-HelpACLExecutemd)**
- **[在模型运行时遇到报错“55056 GetInputConstDataOut: ErrorNo: -1\(failed\)”](#在模型运行时遇到报错-55056-GetInputConstDataOut-ErrorNo--1(failed)md)**
- **[在模型运行时遇到报错“55056 GetInputConstDataOut: ErrorNo: -1\(failed\)”](#在模型运行时遇到报错-55056-GetInputConstDataOut-ErrorNo--1failedmd)**
<h4 id="在模型运行或者算子运行时遇到报错-RuntimeError-ExchangeDevicemd">在模型运行或者算子运行时遇到报错“RuntimeError: ExchangeDevice:”</h4>
@@ -3595,6 +3628,50 @@ pip3.7 install pillow==5.3.0安装失败。
- 查看具体的host报错日志信息。日志默认路径为/var/log/npu/slog/host-0/,根据时间标识查找以host-0为前缀的日志文件,打开日志文件,搜索“ERROR”,查询具体的报错信息。
- 关闭多线程下发\(export TASK\_QUEUE\_ENABLE=0\),再次运行代码,一般可根据终端报错信息定位错误原因。
<h4 id="在模型运行时遇到报错-terminate-called-after-throwing-an-instance-of-c10-Error-what()-0-INTERNAL-ASSERTmd">在模型运行时遇到报错“terminate called after throwing an instance of 'c10::Error' what\(\): 0 INTERNAL ASSERT”</h4>
##### 现象描述<a name="section5498445105118"></a>
```
import torch
npu = "npu"
def test_cpu():
input = torch.randn(2000, 1000).detach().requires_grad_()
output = torch.sum(input)
output.backward(torch.ones_like(output))
def test_npu():
input = torch.randn(2000, 1000).detach().requires_grad_().npu()
output = torch.sum(input)
output.backward(torch.ones_like(output))
if __name__ == "__main__":
test_cpu()
torch.npu.set_device(f"{npu}:1")
test_npu()
```
执行代码后出现如下报错。
![](figures/zh-cn_image_0000001208897433.png)
##### 可能原因<a name="section440935995113"></a>
在运行backward运算后,通过set\_decice\(\)方法手动设置device设备,导致报错。在运行backward运算时,若没有设置device,程序会自动默认初始化device为0,相当于执行了set\_device\("npu:0"\)。由于目前不支持切换device进行计算,若再通过set\_decice\(\)方法手动设置device设备,则可能出现该错误。
##### 处理方法<a name="section1828321115218"></a>
在运行backward运算前,通过set\_decice\(\)方法手动设置device。修改如下。
```
if __name__ == "__main__":
torch.npu.set_device(f"{npu}:1")
test_cpu()
test_npu()
```
<h4 id="在模型运行时遇到报错-ImportError-libhccl-somd">在模型运行时遇到报错“ImportError: libhccl.so.”</h4>
##### 现象描述<a name="section1785905019184"></a>
@@ -3732,7 +3809,7 @@ shell报错是在同步操作中和AI CPU错误,而日志报错信息却是在
4. 打印stack所有参数的shape、dtype、npu\_format,通过构造单算子用例复现问题。定位到问题原因为减法计算输入参数数据类型不同,导致a-b和b-a结果的数据类型不一致,最终在stack算子中报错。
5. 将stack入参数据类型转换为一致即可临时规避问题。
<h4 id="在模型运行时遇到报错-MemCopySync-drvMemcpy-failed-7md">在模型运行时遇到报错“MemCopySync:drvMemcpy failed.”</h4>
<h4 id="在模型运行时遇到报错-MemCopySync-drvMemcpy-failed-6md">在模型运行时遇到报错“MemCopySync:drvMemcpy failed.”</h4>
##### 现象描述<a name="section1785905019184"></a>
Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

File diff suppressed because it is too large Load Diff
+242
View File
@@ -0,0 +1,242 @@
# FrameworkPTAdapter 2.0.3 版本说明书
- [用户须知](#用户须知md)
- [新增特性](#新增特性md)
- [特性修改](#特性修改md)
- [已修复问题](#已修复问题md)
- [已知问题](#已知问题md)
- [兼容性](#兼容性md)
<h2 id='用户须知md'>用户须知</h2>
本框架基于Facebook主导的开源PyTorch1.5.0进行修改,延续原生的PyTorch特性,使用NPU进行动态图训练;以算子粒度进行模型适配,代码重用性好,支持现有的网络只修改设备类型或数据类型,即可迁移到NPU上使用。
从此版本开始,PyTorch1.8.1版本提供支持,此版本延续PyTorch1.5.0特性,功能保持一致(profiling工具除外)。除此之外,对后端算子适配提供较好开发体验。当期1.8.1版本仅支持Resent50网络模型。
<h2 id='新增特性md'>新增特性</h2>
**表 1** PyTorch支持的版本特性列表
<a name="t76c34275cbb74753970f7c5a9eb594fa"></a>
<table><thead align="left"><tr id="r0c10e7163bf54fe8816ab5ca2d77ccc4"><th class="cellrowborder" valign="top" width="10.459999999999999%" id="mcps1.2.4.1.1"><p id="a7888762cf8294977b7d114b1c898d1bd"><a name="a7888762cf8294977b7d114b1c898d1bd"></a><a name="a7888762cf8294977b7d114b1c898d1bd"></a>一级特性</p>
</th>
<th class="cellrowborder" valign="top" width="26.27%" id="mcps1.2.4.1.2"><p id="a4581ffde4a5f455faadfba144243a9d4"><a name="a4581ffde4a5f455faadfba144243a9d4"></a><a name="a4581ffde4a5f455faadfba144243a9d4"></a>二级特性</p>
</th>
<th class="cellrowborder" valign="top" width="63.27%" id="mcps1.2.4.1.3"><p id="a2a1562364b09433a83133fa10b3cf2b3"><a name="a2a1562364b09433a83133fa10b3cf2b3"></a><a name="a2a1562364b09433a83133fa10b3cf2b3"></a>说明</p>
</th>
</tr>
</thead>
<tbody><tr id="row7979351559"><td class="cellrowborder" rowspan="5" valign="top" width="10.459999999999999%" headers="mcps1.2.4.1.1 "><p id="p69836331553"><a name="p69836331553"></a><a name="p69836331553"></a>适配NPU的PyTorch特性</p>
</td>
<td class="cellrowborder" valign="top" width="26.27%" headers="mcps1.2.4.1.2 "><p id="p149831333357"><a name="p149831333357"></a><a name="p149831333357"></a>支持PyTorch1.8.1版本</p>
</td>
<td class="cellrowborder" valign="top" width="63.27%" headers="mcps1.2.4.1.3 "><p id="p1398313336511"><a name="p1398313336511"></a><a name="p1398313336511"></a>增加PyTorch1.8.1版本, 当前仅支持resnet50网络,包括其DDP分布式训练场景。</p>
</td>
</tr>
<tr id="row109719353511"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p18983183315515"><a name="p18983183315515"></a><a name="p18983183315515"></a>支持python3.8</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p836221112812"><a name="p836221112812"></a><a name="p836221112812"></a>支持python3.8环境编译及使用。</p>
</td>
</tr>
<tr id="row13971435754"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p79831331353"><a name="p79831331353"></a><a name="p79831331353"></a>提供算子溢出检测工具</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p109832331055"><a name="p109832331055"></a><a name="p109832331055"></a>支持框架IR级别算子溢出检测,在发生AICORE算子溢出时,提示溢出的IR信息。</p>
</td>
</tr>
<tr id="row185381431133610"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p953883153611"><a name="p953883153611"></a><a name="p953883153611"></a>OS兼容性</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p13538203153618"><a name="p13538203153618"></a><a name="p13538203153618"></a>新增支持UOS 20 1020e arm系统</p>
</td>
</tr>
<tr id="row91681125173610"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p2168172519364"><a name="p2168172519364"></a><a name="p2168172519364"></a>框架基础功能</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p1416815259367"><a name="p1416815259367"></a><a name="p1416815259367"></a>新增适配算子开发(详见算子清单)</p>
</td>
</tr>
<tr id="row11970351050"><td class="cellrowborder" rowspan="26" valign="top" width="10.459999999999999%" headers="mcps1.2.4.1.1 "><p id="p298314333514"><a name="p298314333514"></a><a name="p298314333514"></a>训练模型</p>
</td>
<td class="cellrowborder" valign="top" width="26.27%" headers="mcps1.2.4.1.2 "><p id="p19984193312511"><a name="p19984193312511"></a><a name="p19984193312511"></a>CenterFace</p>
</td>
<td class="cellrowborder" valign="top" width="63.27%" headers="mcps1.2.4.1.3 "><p id="p7517351258"><a name="p7517351258"></a><a name="p7517351258"></a>-</p>
</td>
</tr>
<tr id="row9965351254"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p1984033458"><a name="p1984033458"></a><a name="p1984033458"></a>PCBU</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p298411338513"><a name="p298411338513"></a><a name="p298411338513"></a>-</p>
</td>
</tr>
<tr id="row14966351959"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p198414331957"><a name="p198414331957"></a><a name="p198414331957"></a>Net++</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p1798413331756"><a name="p1798413331756"></a><a name="p1798413331756"></a>-</p>
</td>
</tr>
<tr id="row20966351454"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p4984183317518"><a name="p4984183317518"></a><a name="p4984183317518"></a>FCN8S</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p1698453311519"><a name="p1698453311519"></a><a name="p1698453311519"></a>-</p>
</td>
</tr>
<tr id="row19653517518"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p1298483319512"><a name="p1298483319512"></a><a name="p1298483319512"></a>OSNetRetinaFace</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p1798423312519"><a name="p1798423312519"></a><a name="p1798423312519"></a>-</p>
</td>
</tr>
<tr id="row39619351751"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p1298414331513"><a name="p1298414331513"></a><a name="p1298414331513"></a>PSPnet</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p10984633254"><a name="p10984633254"></a><a name="p10984633254"></a>-</p>
</td>
</tr>
<tr id="row496335654"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p19984433351"><a name="p19984433351"></a><a name="p19984433351"></a>EDSR</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p898473314517"><a name="p898473314517"></a><a name="p898473314517"></a>-</p>
</td>
</tr>
<tr id="row17953357517"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p14984123312515"><a name="p14984123312515"></a><a name="p14984123312515"></a>Tsm</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p159841033855"><a name="p159841033855"></a><a name="p159841033855"></a>-</p>
</td>
</tr>
<tr id="row16951435551"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p19984933457"><a name="p19984933457"></a><a name="p19984933457"></a>pnasnet5large</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p89846335512"><a name="p89846335512"></a><a name="p89846335512"></a>-</p>
</td>
</tr>
<tr id="row2095113520514"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p1798416331952"><a name="p1798416331952"></a><a name="p1798416331952"></a>Gaitset</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p098417336516"><a name="p098417336516"></a><a name="p098417336516"></a>-</p>
</td>
</tr>
<tr id="row89516351511"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p11985153312516"><a name="p11985153312516"></a><a name="p11985153312516"></a>fcn</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p169858331155"><a name="p169858331155"></a><a name="p169858331155"></a>-</p>
</td>
</tr>
<tr id="row5953353513"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p18985103311514"><a name="p18985103311514"></a><a name="p18985103311514"></a>Albert</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p2098513334519"><a name="p2098513334519"></a><a name="p2098513334519"></a>-</p>
</td>
</tr>
<tr id="row119533516513"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p598511336511"><a name="p598511336511"></a><a name="p598511336511"></a>AdvancedEast</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p119850331513"><a name="p119850331513"></a><a name="p119850331513"></a>-</p>
</td>
</tr>
<tr id="row39511356512"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p698553311512"><a name="p698553311512"></a><a name="p698553311512"></a>ReidStrongBaseline</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p1198514331659"><a name="p1198514331659"></a><a name="p1198514331659"></a>-</p>
</td>
</tr>
<tr id="row129463518517"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p99851633158"><a name="p99851633158"></a><a name="p99851633158"></a>Fast-scnn</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p1298514331359"><a name="p1298514331359"></a><a name="p1298514331359"></a>-</p>
</td>
</tr>
<tr id="row9942035757"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p109854331151"><a name="p109854331151"></a><a name="p109854331151"></a>RDN</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p1198583317511"><a name="p1198583317511"></a><a name="p1198583317511"></a>-</p>
</td>
</tr>
<tr id="row79415357517"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p6985833351"><a name="p6985833351"></a><a name="p6985833351"></a>SRFlow</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p29851033350"><a name="p29851033350"></a><a name="p29851033350"></a>-</p>
</td>
</tr>
<tr id="row12947357514"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p149859334518"><a name="p149859334518"></a><a name="p149859334518"></a>MGN</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p19851833850"><a name="p19851833850"></a><a name="p19851833850"></a>-</p>
</td>
</tr>
<tr id="row3941735855"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p898533316518"><a name="p898533316518"></a><a name="p898533316518"></a>Roberta</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p998553318518"><a name="p998553318518"></a><a name="p998553318518"></a>-</p>
</td>
</tr>
<tr id="row1093335856"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p1985533451"><a name="p1985533451"></a><a name="p1985533451"></a>RegNetY</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p59851033355"><a name="p59851033355"></a><a name="p59851033355"></a>-</p>
</td>
</tr>
<tr id="row49373518516"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p19986173311512"><a name="p19986173311512"></a><a name="p19986173311512"></a>VoVNet-39</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p798683310515"><a name="p798683310515"></a><a name="p798683310515"></a>-</p>
</td>
</tr>
<tr id="row5930351357"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p189862336515"><a name="p189862336515"></a><a name="p189862336515"></a>RegNetX</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p1398618331651"><a name="p1398618331651"></a><a name="p1398618331651"></a>-</p>
</td>
</tr>
<tr id="row169312351655"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p149863337513"><a name="p149863337513"></a><a name="p149863337513"></a>RefineNet</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p2098615331959"><a name="p2098615331959"></a><a name="p2098615331959"></a>-</p>
</td>
</tr>
<tr id="row11931235957"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p1198616331657"><a name="p1198616331657"></a><a name="p1198616331657"></a>RefineDet</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p1698611332518"><a name="p1698611332518"></a><a name="p1698611332518"></a>-</p>
</td>
</tr>
<tr id="row189215359511"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p16986183319512"><a name="p16986183319512"></a><a name="p16986183319512"></a>AlignedReID</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p1898715331055"><a name="p1898715331055"></a><a name="p1898715331055"></a>-</p>
</td>
</tr>
<tr id="row89213351858"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p119878330511"><a name="p119878330511"></a><a name="p119878330511"></a>FaceBoxes</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.4.1.2 "><p id="p129878331158"><a name="p129878331158"></a><a name="p129878331158"></a>-</p>
</td>
</tr>
</tbody>
</table>
<h2 id="特性修改md">特性修改</h2>
不涉及
<h2 id="已修复问题md">已修复问题</h2>
不涉及
<h2 id="已知问题md">已知问题</h2>
<a name="table1969972073016"></a>
<table><thead align="left"><tr id="row3699162017307"><th class="cellrowborder" valign="top" width="18.22%" id="mcps1.1.3.1.1"><p id="p16992020153010"><a name="p16992020153010"></a><a name="p16992020153010"></a>已知问题</p>
</th>
<th class="cellrowborder" valign="top" width="81.78%" id="mcps1.1.3.1.2"><p id="p269919203308"><a name="p269919203308"></a><a name="p269919203308"></a>问题描述</p>
</th>
</tr>
</thead>
<tbody><tr id="row9699142003011"><td class="cellrowborder" valign="top" width="18.22%" headers="mcps1.1.3.1.1 "><p id="p1769932017300"><a name="p1769932017300"></a><a name="p1769932017300"></a>数据类型支持</p>
</td>
<td class="cellrowborder" valign="top" width="81.78%" headers="mcps1.1.3.1.2 "><p id="p13699152010301"><a name="p13699152010301"></a><a name="p13699152010301"></a>NPU不支持float16类型的inf/nan数据输入输出。</p>
</td>
</tr>
<tr id="row146991520153016"><td class="cellrowborder" valign="top" width="18.22%" headers="mcps1.1.3.1.1 "><p id="p156997200308"><a name="p156997200308"></a><a name="p156997200308"></a>数据Format</p>
</td>
<td class="cellrowborder" valign="top" width="81.78%" headers="mcps1.1.3.1.2 "><p id="p10699182020308"><a name="p10699182020308"></a><a name="p10699182020308"></a>出现4D以上的format时不能降维。</p>
</td>
</tr>
<tr id="row11121205610549"><td class="cellrowborder" rowspan="3" valign="top" width="18.22%" headers="mcps1.1.3.1.1 "><p id="p1647216219558"><a name="p1647216219558"></a><a name="p1647216219558"></a>集合通信约束</p>
<p id="p0465121912402"><a name="p0465121912402"></a><a name="p0465121912402"></a></p>
</td>
<td class="cellrowborder" valign="top" width="81.78%" headers="mcps1.1.3.1.2 "><p id="p3116115695415"><a name="p3116115695415"></a><a name="p3116115695415"></a>要求一次训练任务中不同device上执行的图相同。</p>
</td>
</tr>
<tr id="row51211656105411"><td class="cellrowborder" valign="top" headers="mcps1.1.3.1.1 "><p id="p1311616560541"><a name="p1311616560541"></a><a name="p1311616560541"></a>当前只支持1/2/4/8P粒度的分配。</p>
</td>
</tr>
<tr id="row8647195765419"><td class="cellrowborder" valign="top" headers="mcps1.1.3.1.1 "><p id="p2064225716544"><a name="p2064225716544"></a><a name="p2064225716544"></a>只支持int8,int32,float16和float32数据类型。</p>
</td>
</tr>
<tr id="row4646195719548"><td class="cellrowborder" valign="top" width="18.22%" headers="mcps1.1.3.1.1 "><p id="p4642195718541"><a name="p4642195718541"></a><a name="p4642195718541"></a>Apex功能支持</p>
</td>
<td class="cellrowborder" valign="top" width="81.78%" headers="mcps1.1.3.1.2 "><p id="p864205725412"><a name="p864205725412"></a><a name="p864205725412"></a>Apex当前版本的实现方式主要为python实现,不支持APEX中的自定义优化CUDA Kernel。</p>
</td>
</tr>
</tbody>
</table>
<h2 id="兼容性md">兼容性</h2>
A800-9010:CentOS 7.6/Ubuntu 18.04/BC-Linux 7.6/Debian 9.9/Debian 10/OpenEuler 20.03 LTS
A800-9000:CentOS 7.6/Euler 2.8/Kylin v10/BC-Linux 7.6/OpenEuler 20.03 LTS/UOS 20 1020e
Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

@@ -422,7 +422,7 @@ keep\_dim:可选,keep\_dim默认为1,支持1或0。
【约束】
算子不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时fp32类型输入
算子不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时float32类型输入
### 支持的ONNX版本<a name="section13311501226"></a>
@@ -454,7 +454,7 @@ axis:数据类型为int,含义:指定计算轴;取值范围:\[-r, r-1\
【约束】
算子不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时fp32类型输入
算子不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时float32类型输入
### 支持的ONNX版本<a name="section13311501226"></a>
@@ -820,7 +820,7 @@ kernel\_shape\_H或kernel\_shape\_W取值超过\[1,255\],或者kernel\_shape\_
ceil\_mode参数仅在auto\_pad='NOTSET'时生效;
不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时fp32类型输入;
不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时float32类型输入;
auto\_pad属性值SAME\_UPPER, SAME\_LOWER统一使用的TBE的SAME属性,即TBE算子没有根据这个属性区分pad的填充位置,可能会带来精度问题
@@ -1170,7 +1170,7 @@ dilations只支持1
output\_shape支持限制:实现部分功能。现在支持output shape的大小,小于原始输入大小,但是不支持大于原始输入大小
算子不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时fp32,fp64的输入
算子不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时float32,float64的输入
属性auto\_pad不支持 "SAME\_UPPER","SAME\_LOWER"
@@ -1252,7 +1252,7 @@ strides:4个整数的列表,指定沿高度H和宽度W的卷积步长。H和
当输出张量的W = 1,H != 1时,算子不支持
不支持atc工具--precision\_mode=must\_keep\_origin\_dtype参数时输入类型为fp32和fp64
不支持atc工具--precision\_mode=must\_keep\_origin\_dtype参数时输入类型为float32和float64
### 支持的ONNX版本<a name="section13311501226"></a>
@@ -1440,7 +1440,7 @@ modulated:bool,指定DeformableConv2D版本,true表示v2版本,false表
权重张量,W维度取值范围为\[1, 63\],H取值范围为\[1, 63\]
不支持atc工具--precision\_mode=must\_keep\_origin\_dtype参数时输入类型为fp32和fp64
不支持atc工具--precision\_mode=must\_keep\_origin\_dtype参数时输入类型为float32和float64
### 支持的ONNX版本<a name="section19647924181413"></a>
@@ -1950,7 +1950,7 @@ beta:float,该参数暂不支持
【约束】
v8/v9/v10版本不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时fp32类型输入
v8/v9/v10版本不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时float32类型输入
### 支持的ONNX版本<a name="section13311501226"></a>
@@ -2438,7 +2438,7 @@ y:tensor,数据类型:float16
【属性】
auto\_pad:string,默认为NOTSET,支持:NOTSET, SAME\_UPPER, SAME\_LOWER 或者 VALID
auto\_pad:string,默认为NOTSET,支持:NOTSET, SAME\_UPPER或者 VALID
kernel\_shape:必选,int列表,kernel每个轴上的尺寸
@@ -2448,10 +2448,6 @@ pads:int列表
strides:int列表
【约束】
auto\_pad属性值SAME\_UPPER, SAME\_LOWER统一使用的TBE的SAME属性,即TBE算子没有根据这个属性区分pad的填充位置,可能会带来精度问题
### 支持的ONNX版本<a name="section13311501226"></a>
Opset v11/v12/v13
@@ -2655,7 +2651,7 @@ kernel\_shape\_H或kernel\_shape\_W取值超过\[1,255\],或者kernel\_shape\_
auto\_pad属性是VALID时,ceil\_mode属性值必须为0
不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时fp32类型输入
不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时float32类型输入
pads属性和auto\_pad属性不可同时使用
@@ -2689,7 +2685,7 @@ spatial\_scale: float,默认值:1.0
【约束】
不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时fp32类型输入
不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时float32类型输入
### 支持的ONNX版本<a name="section13311501226"></a>
@@ -3691,7 +3687,7 @@ spatial\_scale:float,默认为1.0,含义:相对于输入图像的空间
batch\_indices数据类型只能写int32不能写int64
不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时fp32,fp64的输入
不支持atc工具参数--precision\_mode=must\_keep\_origin\_dtype时float32,float64的输入
### 支持的ONNX版本<a name="section13311501226"></a>
@@ -3885,7 +3881,7 @@ Opset v9/v10/v11/ v12/v13
一个输入
x:fp16,fp32,double类型的tensor
x:float16,float32,double类型的tensor
两个属性
@@ -4531,19 +4527,25 @@ x:数据类型支持float16、float32、int32
pads:数据类型支持int32 、int64
constant\_value:可选。默认情况下为0、空字符串或False,如果选择的模式为\`constant\`,则要使用的标量值。
【输出】
一个输出
y:数据类型和输入x一致
【属性】
mode:str类型,支持模式有:constant,reflect,edge
【约束】
当mode值为constant时,目前仅支持constant\_value=0
### 支持的ONNX版本<a name="section13311501226"></a>
Opset v8/v9/v10/v11/v12/v13
Opset v11
<h2 id="Powmd">Pow</h2>
+126 -125
View File
@@ -1,6 +1,6 @@
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/CMakeLists.txt pytorch-develop-150/aten/CMakeLists.txt
--- pytorch-v1.5.0/aten/CMakeLists.txt 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/CMakeLists.txt 2021-09-26 18:06:03.829615385 +0800
+++ pytorch-develop-150/aten/CMakeLists.txt 2021-09-28 22:04:53.115558278 +0800
@@ -22,8 +22,10 @@
set(ATen_CPU_INCLUDE)
set(ATen_THIRD_PARTY_INCLUDE)
@@ -51,7 +51,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
set(ATen_CPU_DEPENDENCY_LIBS ${ATen_CPU_DEPENDENCY_LIBS} PARENT_SCOPE)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/CMakeLists.txt pytorch-develop-150/aten/src/ATen/CMakeLists.txt
--- pytorch-v1.5.0/aten/src/ATen/CMakeLists.txt 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/CMakeLists.txt 2021-09-26 18:06:03.829615385 +0800
+++ pytorch-develop-150/aten/src/ATen/CMakeLists.txt 2021-09-28 22:04:53.115558278 +0800
@@ -67,6 +67,9 @@
FILE(GLOB native_quantized_h "native/quantized/*.h" "native/quantized/cpu/*.h")
FILE(GLOB native_cpu_h "native/cpu/*.h")
@@ -129,7 +129,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
set(ATen_QUANTIZED_SRCS ${ATen_QUANTIZED_SRCS} PARENT_SCOPE)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/core/dispatch/DispatchTable.h pytorch-develop-150/aten/src/ATen/core/dispatch/DispatchTable.h
--- pytorch-v1.5.0/aten/src/ATen/core/dispatch/DispatchTable.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/core/dispatch/DispatchTable.h 2021-09-26 18:06:03.833615373 +0800
+++ pytorch-develop-150/aten/src/ATen/core/dispatch/DispatchTable.h 2021-09-28 22:04:53.119558300 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -170,7 +170,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/function_wrapper.py pytorch-develop-150/aten/src/ATen/function_wrapper.py
--- pytorch-v1.5.0/aten/src/ATen/function_wrapper.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/function_wrapper.py 2021-09-26 18:06:03.837615362 +0800
+++ pytorch-develop-150/aten/src/ATen/function_wrapper.py 2021-09-28 22:04:53.123558321 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -354,7 +354,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
for option in declaration['options']:
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/gen.py pytorch-develop-150/aten/src/ATen/gen.py
--- pytorch-v1.5.0/aten/src/ATen/gen.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/gen.py 2021-09-26 18:06:03.837615362 +0800
+++ pytorch-develop-150/aten/src/ATen/gen.py 2021-09-28 22:04:53.123558321 +0800
@@ -1,3 +1,18 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -512,7 +512,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
generate_outputs()
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/native/BatchLinearAlgebra.cpp pytorch-develop-150/aten/src/ATen/native/BatchLinearAlgebra.cpp
--- pytorch-v1.5.0/aten/src/ATen/native/BatchLinearAlgebra.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/native/BatchLinearAlgebra.cpp 2021-09-26 18:06:03.837615362 +0800
+++ pytorch-develop-150/aten/src/ATen/native/BatchLinearAlgebra.cpp 2021-09-28 22:04:53.123558321 +0800
@@ -680,7 +680,7 @@
std::tuple<Tensor&, Tensor&> triangular_solve_out(Tensor& result, Tensor& clone_A, const Tensor& self, const Tensor& A,
bool upper, bool transpose, bool unitriangular) {
@@ -524,7 +524,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return std::tuple<Tensor&, Tensor&>(result, clone_A);
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/native/cpu/Activation.cpp pytorch-develop-150/aten/src/ATen/native/cpu/Activation.cpp
--- pytorch-v1.5.0/aten/src/ATen/native/cpu/Activation.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/native/cpu/Activation.cpp 2021-09-26 18:06:03.841615350 +0800
+++ pytorch-develop-150/aten/src/ATen/native/cpu/Activation.cpp 2021-09-28 22:04:53.127558343 +0800
@@ -339,20 +339,20 @@
void hardsigmoid_backward_kernel(TensorIterator& iter) {
@@ -552,7 +552,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
});
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/native/Memory.cpp pytorch-develop-150/aten/src/ATen/native/Memory.cpp
--- pytorch-v1.5.0/aten/src/ATen/native/Memory.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/native/Memory.cpp 2021-09-26 18:06:03.837615362 +0800
+++ pytorch-develop-150/aten/src/ATen/native/Memory.cpp 2021-09-28 22:04:53.123558321 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -607,7 +607,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
detail::computeStorageSize(self.sizes(), self.strides()),
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/native/native_functions.yaml pytorch-develop-150/aten/src/ATen/native/native_functions.yaml
--- pytorch-v1.5.0/aten/src/ATen/native/native_functions.yaml 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/native/native_functions.yaml 2021-09-26 18:06:03.845615338 +0800
+++ pytorch-develop-150/aten/src/ATen/native/native_functions.yaml 2021-09-28 22:04:53.131558365 +0800
@@ -1,6 +1,5 @@
# See README.md in this directory for more guidance
@@ -7064,7 +7064,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
\ No newline at end of file
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/native/quantized/cpu/qnnpack/src/q8gemm/8x8-dq-aarch64-neon.S pytorch-develop-150/aten/src/ATen/native/quantized/cpu/qnnpack/src/q8gemm/8x8-dq-aarch64-neon.S
--- pytorch-v1.5.0/aten/src/ATen/native/quantized/cpu/qnnpack/src/q8gemm/8x8-dq-aarch64-neon.S 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/native/quantized/cpu/qnnpack/src/q8gemm/8x8-dq-aarch64-neon.S 2021-09-26 18:06:03.861615293 +0800
+++ pytorch-develop-150/aten/src/ATen/native/quantized/cpu/qnnpack/src/q8gemm/8x8-dq-aarch64-neon.S 2021-09-28 22:04:53.143558430 +0800
@@ -659,14 +659,14 @@
SUB x1, x1, 4
@@ -7090,7 +7090,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
CMP x1, 2
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/native/TensorCompare.cpp pytorch-develop-150/aten/src/ATen/native/TensorCompare.cpp
--- pytorch-v1.5.0/aten/src/ATen/native/TensorCompare.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/native/TensorCompare.cpp 2021-09-26 18:06:03.841615350 +0800
+++ pytorch-develop-150/aten/src/ATen/native/TensorCompare.cpp 2021-09-28 22:04:53.127558343 +0800
@@ -64,7 +64,7 @@
Tensor isinf(const Tensor &self) {
@@ -7102,7 +7102,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return AT_DISPATCH_FLOATING_TYPES_AND_HALF(self.scalar_type(), "isinf", [&]() {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/native/TensorFactories.cpp pytorch-develop-150/aten/src/ATen/native/TensorFactories.cpp
--- pytorch-v1.5.0/aten/src/ATen/native/TensorFactories.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/native/TensorFactories.cpp 2021-09-26 18:06:03.841615350 +0800
+++ pytorch-develop-150/aten/src/ATen/native/TensorFactories.cpp 2021-09-28 22:04:53.127558343 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7147,7 +7147,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/native/TensorProperties.cpp pytorch-develop-150/aten/src/ATen/native/TensorProperties.cpp
--- pytorch-v1.5.0/aten/src/ATen/native/TensorProperties.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/native/TensorProperties.cpp 2021-09-26 18:06:03.841615350 +0800
+++ pytorch-develop-150/aten/src/ATen/native/TensorProperties.cpp 2021-09-28 22:04:53.127558343 +0800
@@ -87,6 +87,7 @@
if (self.is_contiguous(memory_format)) {
return self;
@@ -7158,7 +7158,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
"preserve memory format is unsupported by the contiguous operator");
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/native/UpSampleBicubic2d.cpp pytorch-develop-150/aten/src/ATen/native/UpSampleBicubic2d.cpp
--- pytorch-v1.5.0/aten/src/ATen/native/UpSampleBicubic2d.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/native/UpSampleBicubic2d.cpp 2021-09-26 18:06:03.841615350 +0800
+++ pytorch-develop-150/aten/src/ATen/native/UpSampleBicubic2d.cpp 2021-09-28 22:04:53.127558343 +0800
@@ -26,7 +26,7 @@
const scalar_t* in = &idata[output_y * input_width + output_x];
scalar_t* out = &odata[output_y * output_width + output_x];
@@ -7170,7 +7170,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
out += output_width * output_height;
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/native_parse.py pytorch-develop-150/aten/src/ATen/native_parse.py
--- pytorch-v1.5.0/aten/src/ATen/native_parse.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/native_parse.py 2021-09-26 18:06:03.865615282 +0800
+++ pytorch-develop-150/aten/src/ATen/native_parse.py 2021-09-28 22:04:53.151558473 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -7208,7 +7208,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
msg = '''Exception raised in processing function:
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/preprocess_declarations.py pytorch-develop-150/aten/src/ATen/preprocess_declarations.py
--- pytorch-v1.5.0/aten/src/ATen/preprocess_declarations.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/preprocess_declarations.py 2021-09-26 18:06:03.865615282 +0800
+++ pytorch-develop-150/aten/src/ATen/preprocess_declarations.py 2021-09-28 22:04:53.151558473 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -7240,7 +7240,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/templates/TensorBody.h pytorch-develop-150/aten/src/ATen/templates/TensorBody.h
--- pytorch-v1.5.0/aten/src/ATen/templates/TensorBody.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/templates/TensorBody.h 2021-09-26 18:06:03.865615282 +0800
+++ pytorch-develop-150/aten/src/ATen/templates/TensorBody.h 2021-09-28 22:04:53.151558473 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7273,7 +7273,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/ATen/templates/TensorMethods.h pytorch-develop-150/aten/src/ATen/templates/TensorMethods.h
--- pytorch-v1.5.0/aten/src/ATen/templates/TensorMethods.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/ATen/templates/TensorMethods.h 2021-09-26 18:06:03.865615282 +0800
+++ pytorch-develop-150/aten/src/ATen/templates/TensorMethods.h 2021-09-28 22:04:53.151558473 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7307,7 +7307,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/TH/CMakeLists.txt pytorch-develop-150/aten/src/TH/CMakeLists.txt
--- pytorch-v1.5.0/aten/src/TH/CMakeLists.txt 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/TH/CMakeLists.txt 2021-09-26 18:06:03.869615270 +0800
+++ pytorch-develop-150/aten/src/TH/CMakeLists.txt 2021-09-28 22:04:53.155558495 +0800
@@ -48,6 +48,11 @@
${CMAKE_CURRENT_SOURCE_DIR}
PARENT_SCOPE)
@@ -7322,7 +7322,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/TH/generic/THStorage.cpp pytorch-develop-150/aten/src/TH/generic/THStorage.cpp
--- pytorch-v1.5.0/aten/src/TH/generic/THStorage.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/TH/generic/THStorage.cpp 2021-09-26 18:06:03.869615270 +0800
+++ pytorch-develop-150/aten/src/TH/generic/THStorage.cpp 2021-09-28 22:04:53.155558495 +0800
@@ -1,9 +1,32 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7431,7 +7431,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/aten/src/TH/generic/THStorage.h pytorch-develop-150/aten/src/TH/generic/THStorage.h
--- pytorch-v1.5.0/aten/src/TH/generic/THStorage.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/aten/src/TH/generic/THStorage.h 2021-09-26 18:06:03.869615270 +0800
+++ pytorch-develop-150/aten/src/TH/generic/THStorage.h 2021-09-28 22:04:53.155558495 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7470,7 +7470,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/CMakeLists.txt pytorch-develop-150/c10/CMakeLists.txt
--- pytorch-v1.5.0/c10/CMakeLists.txt 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/CMakeLists.txt 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/CMakeLists.txt 2021-09-28 22:04:53.163558540 +0800
@@ -63,6 +63,14 @@
message(STATUS "don't use NUMA")
endif()
@@ -7499,7 +7499,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
# not checked in
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/Backend.h pytorch-develop-150/c10/core/Backend.h
--- pytorch-v1.5.0/c10/core/Backend.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/Backend.h 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/Backend.h 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7596,7 +7596,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
case Backend::CUDA:
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/Device.cpp pytorch-develop-150/c10/core/Device.cpp
--- pytorch-v1.5.0/c10/core/Device.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/Device.cpp 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/Device.cpp 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7636,7 +7636,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
types.begin(),
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/Device.h pytorch-develop-150/c10/core/Device.h
--- pytorch-v1.5.0/c10/core/Device.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/Device.h 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/Device.h 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7671,7 +7671,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return type_ == DeviceType::CPU;
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/DeviceType.cpp pytorch-develop-150/c10/core/DeviceType.cpp
--- pytorch-v1.5.0/c10/core/DeviceType.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/DeviceType.cpp 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/DeviceType.cpp 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7711,7 +7711,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return false;
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/DeviceType.h pytorch-develop-150/c10/core/DeviceType.h
--- pytorch-v1.5.0/c10/core/DeviceType.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/DeviceType.h 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/DeviceType.h 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7754,7 +7754,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
constexpr DeviceType kXLA = DeviceType::XLA;
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/DispatchKey.cpp pytorch-develop-150/c10/core/DispatchKey.cpp
--- pytorch-v1.5.0/c10/core/DispatchKey.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/DispatchKey.cpp 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/DispatchKey.cpp 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7786,7 +7786,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
case DispatchKey::SparseCPUTensorId:
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/DispatchKey.h pytorch-develop-150/c10/core/DispatchKey.h
--- pytorch-v1.5.0/c10/core/DispatchKey.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/DispatchKey.h 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/DispatchKey.h 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7818,7 +7818,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/Storage.h pytorch-develop-150/c10/core/Storage.h
--- pytorch-v1.5.0/c10/core/Storage.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/Storage.h 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/Storage.h 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7852,7 +7852,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
};
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/StorageImpl.h pytorch-develop-150/c10/core/StorageImpl.h
--- pytorch-v1.5.0/c10/core/StorageImpl.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/StorageImpl.h 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/StorageImpl.h 2021-09-28 22:04:53.163558540 +0800
@@ -1,12 +1,39 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7909,7 +7909,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/TensorImpl.h pytorch-develop-150/c10/core/TensorImpl.h
--- pytorch-v1.5.0/c10/core/TensorImpl.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/TensorImpl.h 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/TensorImpl.h 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -7977,7 +7977,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/core/TensorOptions.h pytorch-develop-150/c10/core/TensorOptions.h
--- pytorch-v1.5.0/c10/core/TensorOptions.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/core/TensorOptions.h 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/core/TensorOptions.h 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -8018,7 +8018,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
} else if (tid == DispatchKey::HIPTensorId) {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/c10/macros/Export.h pytorch-develop-150/c10/macros/Export.h
--- pytorch-v1.5.0/c10/macros/Export.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/c10/macros/Export.h 2021-09-26 18:06:03.877615247 +0800
+++ pytorch-develop-150/c10/macros/Export.h 2021-09-28 22:04:53.163558540 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -8145,7 +8145,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
-...
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/caffe2/CMakeLists.txt pytorch-develop-150/caffe2/CMakeLists.txt
--- pytorch-v1.5.0/caffe2/CMakeLists.txt 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/caffe2/CMakeLists.txt 2021-09-26 18:06:03.881615235 +0800
+++ pytorch-develop-150/caffe2/CMakeLists.txt 2021-09-28 22:04:53.167558561 +0800
@@ -32,6 +32,7 @@
# Add source, includes, and libs to lists
list(APPEND Caffe2_CPU_SRCS ${ATen_CPU_SRCS})
@@ -8300,7 +8300,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
# Call again since Caffe2_HIP_INCLUDE is extended with ATen include dirs.
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/.clang-format pytorch-develop-150/.clang-format
--- pytorch-v1.5.0/.clang-format 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/.clang-format 2021-09-26 18:06:03.825615396 +0800
+++ pytorch-develop-150/.clang-format 2021-09-28 22:04:53.111558256 +0800
@@ -84,5 +84,4 @@
SpacesInSquareBrackets: false
Standard: Cpp11
@@ -8311,7 +8311,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
\ No newline at end of file
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/cmake/BuildVariables.cmake pytorch-develop-150/cmake/BuildVariables.cmake
--- pytorch-v1.5.0/cmake/BuildVariables.cmake 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/cmake/BuildVariables.cmake 2021-09-26 18:06:03.941615064 +0800
+++ pytorch-develop-150/cmake/BuildVariables.cmake 2021-09-28 22:04:53.223558866 +0800
@@ -11,6 +11,7 @@
# CMakeLists.txt files under each folder respectively.
set(Caffe2_CPU_SRCS)
@@ -8338,7 +8338,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
# symbols. However, if the lib is whole linked in caffe2 lib, we don't want
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/cmake/Codegen.cmake pytorch-develop-150/cmake/Codegen.cmake
--- pytorch-v1.5.0/cmake/Codegen.cmake 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/cmake/Codegen.cmake 2021-09-26 18:06:03.941615064 +0800
+++ pytorch-develop-150/cmake/Codegen.cmake 2021-09-28 22:04:53.223558866 +0800
@@ -191,13 +191,14 @@
file(READ ${CMAKE_BINARY_DIR}/aten/src/ATen/generated_cpp.txt generated_cpp)
file(READ ${CMAKE_BINARY_DIR}/aten/src/ATen/generated_cpp.txt-cuda cuda_generated_cpp)
@@ -8369,7 +8369,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
endif()
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/cmake/Dependencies.cmake pytorch-develop-150/cmake/Dependencies.cmake
--- pytorch-v1.5.0/cmake/Dependencies.cmake 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/cmake/Dependencies.cmake 2021-09-26 18:06:03.941615064 +0800
+++ pytorch-develop-150/cmake/Dependencies.cmake 2021-09-28 22:04:53.223558866 +0800
@@ -1509,6 +1509,13 @@
ENDIF(NOT C_HAS_THREAD)
endif()
@@ -8386,7 +8386,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
#
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/cmake/Summary.cmake pytorch-develop-150/cmake/Summary.cmake
--- pytorch-v1.5.0/cmake/Summary.cmake 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/cmake/Summary.cmake 2021-09-26 18:06:03.941615064 +0800
+++ pytorch-develop-150/cmake/Summary.cmake 2021-09-28 22:04:53.223558866 +0800
@@ -134,6 +134,7 @@
if(NOT "${SELECTED_OP_LIST}" STREQUAL "")
message(STATUS " SELECTED_OP_LIST : ${SELECTED_OP_LIST}")
@@ -8397,7 +8397,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
endfunction()
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/cmake/TorchConfig.cmake.in pytorch-develop-150/cmake/TorchConfig.cmake.in
--- pytorch-v1.5.0/cmake/TorchConfig.cmake.in 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/cmake/TorchConfig.cmake.in 2021-09-26 18:06:03.941615064 +0800
+++ pytorch-develop-150/cmake/TorchConfig.cmake.in 2021-09-28 22:04:53.223558866 +0800
@@ -112,6 +112,11 @@
list(APPEND TORCH_LIBRARIES ${TORCH_CUDA_LIBRARIES})
endif()
@@ -8412,7 +8412,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
set(TORCH_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=@GLIBCXX_USE_CXX11_ABI@")
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/CMakeLists.txt pytorch-develop-150/CMakeLists.txt
--- pytorch-v1.5.0/CMakeLists.txt 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/CMakeLists.txt 2021-09-26 18:06:03.829615385 +0800
+++ pytorch-develop-150/CMakeLists.txt 2021-09-28 22:04:53.115558278 +0800
@@ -205,6 +205,10 @@
option(USE_TBB "Use TBB" OFF)
option(ONNX_ML "Enable traditional ONNX ML API." ON)
@@ -8479,7 +8479,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-braces")
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/.dockerignore pytorch-develop-150/.dockerignore
--- pytorch-v1.5.0/.dockerignore 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/.dockerignore 2021-09-26 18:06:03.825615396 +0800
+++ pytorch-develop-150/.dockerignore 2021-09-28 22:04:53.111558256 +0800
@@ -1,257 +1 @@
-# READ THIS BEFORE YOU REFACTOR ME
-#
@@ -8755,7 +8755,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
\ No newline at end of file
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/requirements.txt pytorch-develop-150/requirements.txt
--- pytorch-v1.5.0/requirements.txt 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/requirements.txt 2021-09-26 18:06:03.873615259 +0800
+++ pytorch-develop-150/requirements.txt 2021-09-28 22:04:53.159558517 +0800
@@ -4,4 +4,12 @@
requests
setuptools
@@ -8774,7 +8774,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
\ No newline at end of file
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/setup.py pytorch-develop-150/setup.py
--- pytorch-v1.5.0/setup.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/setup.py 2021-09-26 18:06:03.873615259 +0800
+++ pytorch-develop-150/setup.py 2021-09-28 22:04:53.159558517 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -8873,7 +8873,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
'python/serialized_test/data/operator_test/*.zip',
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/autograd/derivatives.yaml pytorch-develop-150/tools/autograd/derivatives.yaml
--- pytorch-v1.5.0/tools/autograd/derivatives.yaml 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/tools/autograd/derivatives.yaml 2021-09-26 18:06:04.545613339 +0800
+++ pytorch-develop-150/tools/autograd/derivatives.yaml 2021-09-28 22:04:53.815562090 +0800
@@ -107,6 +107,10 @@
#
# NB: The parameter names here MUST be consistent with the parameter names
@@ -8992,8 +8992,8 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
\ No newline at end of file
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/autograd/dump_utils.py pytorch-develop-150/tools/autograd/dump_utils.py
--- pytorch-v1.5.0/tools/autograd/dump_utils.py 1970-01-01 08:00:00.000000000 +0800
+++ pytorch-develop-150/tools/autograd/dump_utils.py 2021-09-26 18:06:04.545613339 +0800
@@ -0,0 +1,273 @@
+++ pytorch-develop-150/tools/autograd/dump_utils.py 2021-09-28 22:04:53.815562090 +0800
@@ -0,0 +1,277 @@
+# Copyright (c) 2021 Huawei Technologies Co., Ltd
+# All rights reserved.
+#
@@ -9076,7 +9076,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
+#endif
+""")
+
+LOAD_OR_DUMP_CONV2D = CodeTemplate("""\
+LOAD_OR_DUMP_CONV2D_BACK = CodeTemplate("""\
+#ifdef USE_DUMP
+${define_args_des}
+if (load_flag) {
@@ -9087,12 +9087,16 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
+ int64_t groups = ${groups_des}.GetValue();
+
+ if (in_channel == groups && groups > 1 && out_channel % in_channel == 0) {
+ ir_name = "ThnnConvDepthwise2DBackward";
+ string map_name = "ThnnConvDepthwise2DBackward";
+ LoadUtil::GetInstance()->LoadInputs(map_name, ${args_des});
+ ${scalar_args_copy}
+ seq_id = LoadUtil::GetInstance()->GetMatchedSeqId();
+ } else {
+ LoadUtil::GetInstance()->LoadInputs(ir_name, ${args_des});
+ ${scalar_args_copy}
+ seq_id = LoadUtil::GetInstance()->GetMatchedSeqId();
+ }
+ std::cout << "IR: " << ir_name << " load inputs" << std::endl;
+ LoadUtil::GetInstance()->LoadInputs(ir_name, ${args_des});
+ ${scalar_args_copy}
+ seq_id = LoadUtil::GetInstance()->GetMatchedSeqId();
+
+} else if (dump_flag) {
+ seq_id = DumpUtil::GetInstance()->DumpSeqIdAddOne();
+ std::cout << "IR: " << ir_name << " SeqId: " << seq_id << " dump inputs" << std::endl;
@@ -9204,7 +9208,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
+
+OVERFLOW_EXTRA_BLACKLIST = []
+
+def get_load_or_dump_inputs(args_name_type, is_conv2d=False):
+def get_load_or_dump_inputs(args_name_type, op_name=None):
+ args_des = []
+ define_args_des = []
+ scalar_args_copy = []
@@ -9219,13 +9223,13 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
+
+ load_or_dump_inputs = ''
+ if len(args_des):
+ if not is_conv2d:
+ load_or_dump_inputs = LOAD_OR_DUMP_INPUTS.substitute(
+ define_args_des=define_args_des,
+ scalar_args_copy=scalar_args_copy,
+ args_des=args_des)
+ else:
+ load_or_dump_inputs = LOAD_OR_DUMP_CONV2D.substitute(
+ load_or_dump_inputs = LOAD_OR_DUMP_INPUTS.substitute(
+ define_args_des=define_args_des,
+ scalar_args_copy=scalar_args_copy,
+ args_des=args_des)
+
+ if op_name == "NpuConvolutionBackward":
+ load_or_dump_inputs = LOAD_OR_DUMP_CONV2D_BACK.substitute(
+ define_args_des=define_args_des,
+ scalar_args_copy=scalar_args_copy,
+ args_des=args_des,
@@ -9269,7 +9273,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
+ return prepare_to_check_overflow, overflow_dump_inputs
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/autograd/gen_autograd_functions.py pytorch-develop-150/tools/autograd/gen_autograd_functions.py
--- pytorch-v1.5.0/tools/autograd/gen_autograd_functions.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/tools/autograd/gen_autograd_functions.py 2021-09-26 18:06:04.545613339 +0800
+++ pytorch-develop-150/tools/autograd/gen_autograd_functions.py 2021-09-28 22:04:53.815562090 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2021 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -9405,7 +9409,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
env['saved_list_sizes'] = saved_list_sizes
env['asserts'] = asserts
@@ -177,10 +222,47 @@
@@ -177,10 +222,44 @@
else:
env['will_release_variables'] = ''
@@ -9426,11 +9430,8 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
+ define_ir_name = DEFINE_IR_NAME.substitute(func)
+ env['dump_define_vars'] = DUMP_DEFINE_VARS.substitute(
+ define_ir_name=define_ir_name)
+ is_conv2d = False
+ if func['op'] == "NpuConvolutionBackward":
+ is_conv2d = True
+
+ env['load_or_dump_inputs'] = get_load_or_dump_inputs(args_name_type, is_conv2d)
+ env['load_or_dump_inputs'] = get_load_or_dump_inputs(args_name_type, func['op'])
+ env['start_acl_dump'] = START_ACL_DUMP.substitute()
+ env['finalize_acl_dump'] = FINALIZE_ACL_DUMP.substitute()
+
@@ -9455,7 +9456,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
def emit_derivative(derivative):
formula = derivative['formula']
@@ -202,11 +284,12 @@
@@ -202,11 +281,12 @@
derivative=formula,
grad_input_mask=grad_input_mask)
@@ -9471,14 +9472,14 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
if func['name'] in UNTRACEABLE_FUNCTIONS:
env['superclass'] = 'Node'
else:
@@ -230,3 +313,4 @@
@@ -230,3 +310,4 @@
def uses_single_grad(func):
return uses_ident(func, 'grad')
+
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/autograd/gen_python_functions.py pytorch-develop-150/tools/autograd/gen_python_functions.py
--- pytorch-v1.5.0/tools/autograd/gen_python_functions.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/tools/autograd/gen_python_functions.py 2021-09-26 18:06:04.545613339 +0800
+++ pytorch-develop-150/tools/autograd/gen_python_functions.py 2021-09-28 22:04:53.815562090 +0800
@@ -1,3 +1,20 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -9520,7 +9521,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
'value': argname,
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/autograd/gen_variable_type.py pytorch-develop-150/tools/autograd/gen_variable_type.py
--- pytorch-v1.5.0/tools/autograd/gen_variable_type.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/tools/autograd/gen_variable_type.py 2021-09-26 18:06:04.545613339 +0800
+++ pytorch-develop-150/tools/autograd/gen_variable_type.py 2021-09-28 22:04:53.815562090 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2021 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -9688,7 +9689,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/autograd/templates/Functions.cpp pytorch-develop-150/tools/autograd/templates/Functions.cpp
--- pytorch-v1.5.0/tools/autograd/templates/Functions.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/tools/autograd/templates/Functions.cpp 2021-09-26 18:06:04.545613339 +0800
+++ pytorch-develop-150/tools/autograd/templates/Functions.cpp 2021-09-28 22:04:53.815562090 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2021 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -9769,7 +9770,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
auto sparse = sparse_.coalesce();
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/autograd/templates/python_torch_functions.cpp pytorch-develop-150/tools/autograd/templates/python_torch_functions.cpp
--- pytorch-v1.5.0/tools/autograd/templates/python_torch_functions.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/tools/autograd/templates/python_torch_functions.cpp 2021-09-26 18:06:04.545613339 +0800
+++ pytorch-develop-150/tools/autograd/templates/python_torch_functions.cpp 2021-09-28 22:04:53.815562090 +0800
@@ -22,7 +22,7 @@
#include "torch/csrc/autograd/generated/variable_factories.h"
#include "torch/csrc/utils/structseq.h"
@@ -9853,7 +9854,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/autograd/templates/python_variable_methods.cpp pytorch-develop-150/tools/autograd/templates/python_variable_methods.cpp
--- pytorch-v1.5.0/tools/autograd/templates/python_variable_methods.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/tools/autograd/templates/python_variable_methods.cpp 2021-09-26 18:06:04.545613339 +0800
+++ pytorch-develop-150/tools/autograd/templates/python_variable_methods.cpp 2021-09-28 22:04:53.815562090 +0800
@@ -15,7 +15,13 @@
#include "torch/csrc/cuda/Stream.h"
#include "torch/csrc/cuda/Event.h"
@@ -9940,7 +9941,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
{"has_names", (PyCFunction)THPVariable_has_names, METH_NOARGS, NULL},
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/autograd/templates/VariableType.cpp pytorch-develop-150/tools/autograd/templates/VariableType.cpp
--- pytorch-v1.5.0/tools/autograd/templates/VariableType.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/tools/autograd/templates/VariableType.cpp 2021-09-26 18:06:04.545613339 +0800
+++ pytorch-develop-150/tools/autograd/templates/VariableType.cpp 2021-09-28 22:04:53.815562090 +0800
@@ -1,7 +1,28 @@
+// Copyright (c) 2021 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -9972,7 +9973,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/autograd/templates/VariableType.h pytorch-develop-150/tools/autograd/templates/VariableType.h
--- pytorch-v1.5.0/tools/autograd/templates/VariableType.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/tools/autograd/templates/VariableType.h 2021-09-26 18:06:04.545613339 +0800
+++ pytorch-develop-150/tools/autograd/templates/VariableType.h 2021-09-28 22:04:53.815562090 +0800
@@ -1,3 +1,20 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -10004,7 +10005,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
const at::Tensor & unpack(const Tensor & t, const char * name, int pos);
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/tools/build_variables.bzl pytorch-develop-150/tools/build_variables.bzl
--- pytorch-v1.5.0/tools/build_variables.bzl 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/tools/build_variables.bzl 2021-09-26 18:06:04.545613339 +0800
+++ pytorch-develop-150/tools/build_variables.bzl 2021-09-28 22:04:53.815562090 +0800
@@ -46,6 +46,7 @@
"torch/csrc/autograd/functions/utils.cpp",
"torch/csrc/autograd/input_buffer.cpp",
@@ -10090,7 +10091,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
-def grad(outputs: _TensorOrTensors, inputs: _TensorOrTensors, grad_outputs: Optional[_TensorOrTensors]=..., retain_graph: Optional[bool]=..., create_graph: bool=..., only_inputs: bool=..., allow_unused: bool=...) -> Tuple[Tensor, ...]: ...
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/autograd/profiler.py pytorch-develop-150/torch/autograd/profiler.py
--- pytorch-v1.5.0/torch/autograd/profiler.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/autograd/profiler.py 2021-09-26 18:06:04.549613328 +0800
+++ pytorch-develop-150/torch/autograd/profiler.py 2021-09-28 22:04:53.819562112 +0800
@@ -1,8 +1,25 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -10563,7 +10564,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return ''.join(result)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/CMakeLists.txt pytorch-develop-150/torch/CMakeLists.txt
--- pytorch-v1.5.0/torch/CMakeLists.txt 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/CMakeLists.txt 2021-09-26 18:06:04.549613328 +0800
+++ pytorch-develop-150/torch/CMakeLists.txt 2021-09-28 22:04:53.819562112 +0800
@@ -97,6 +97,7 @@
${TORCH_SRC_DIR}/csrc/tensor/python_tensor.cpp
${TORCH_SRC_DIR}/csrc/utils.cpp
@@ -10595,7 +10596,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
endif()
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/autograd/engine.cpp pytorch-develop-150/torch/csrc/autograd/engine.cpp
--- pytorch-v1.5.0/torch/csrc/autograd/engine.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/autograd/engine.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/autograd/engine.cpp 2021-09-28 22:04:53.823562134 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -10747,7 +10748,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
auto event = c10::Event{c10::DeviceType::CUDA};
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/autograd/functions/tensor.cpp pytorch-develop-150/torch/csrc/autograd/functions/tensor.cpp
--- pytorch-v1.5.0/torch/csrc/autograd/functions/tensor.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/autograd/functions/tensor.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/autograd/functions/tensor.cpp 2021-09-28 22:04:53.823562134 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -10779,7 +10780,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
/*non_blocking=*/false,
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/autograd/init.cpp pytorch-develop-150/torch/csrc/autograd/init.cpp
--- pytorch-v1.5.0/torch/csrc/autograd/init.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/autograd/init.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/autograd/init.cpp 2021-09-28 22:04:53.823562134 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -10822,7 +10823,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
m.def("_enable_profiler", enableProfiler);
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/autograd/input_buffer.cpp pytorch-develop-150/torch/csrc/autograd/input_buffer.cpp
--- pytorch-v1.5.0/torch/csrc/autograd/input_buffer.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/autograd/input_buffer.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/autograd/input_buffer.cpp 2021-09-28 22:04:53.823562134 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -10874,7 +10875,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
auto& old_var = buffer[pos];
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/autograd/profiler.cpp pytorch-develop-150/torch/csrc/autograd/profiler.cpp
--- pytorch-v1.5.0/torch/csrc/autograd/profiler.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/autograd/profiler.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/autograd/profiler.cpp 2021-09-28 22:04:53.823562134 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11070,7 +11071,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
CUDAStubs::~CUDAStubs() = default;
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/autograd/profiler.h pytorch-develop-150/torch/csrc/autograd/profiler.h
--- pytorch-v1.5.0/torch/csrc/autograd/profiler.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/autograd/profiler.h 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/autograd/profiler.h 2021-09-28 22:04:53.823562134 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11195,7 +11196,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/autograd/python_variable.cpp pytorch-develop-150/torch/csrc/autograd/python_variable.cpp
--- pytorch-v1.5.0/torch/csrc/autograd/python_variable.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/autograd/python_variable.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/autograd/python_variable.cpp 2021-09-28 22:04:53.827562155 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11249,7 +11250,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
{"is_complex", (getter)THPVariable_is_complex, nullptr, nullptr, nullptr},
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/autograd/python_variable_indexing.cpp pytorch-develop-150/torch/csrc/autograd/python_variable_indexing.cpp
--- pytorch-v1.5.0/torch/csrc/autograd/python_variable_indexing.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/autograd/python_variable_indexing.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/autograd/python_variable_indexing.cpp 2021-09-28 22:04:53.827562155 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11290,7 +11291,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/autograd/utils/wrap_outputs.h pytorch-develop-150/torch/csrc/autograd/utils/wrap_outputs.h
--- pytorch-v1.5.0/torch/csrc/autograd/utils/wrap_outputs.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/autograd/utils/wrap_outputs.h 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/autograd/utils/wrap_outputs.h 2021-09-28 22:04:53.827562155 +0800
@@ -168,6 +168,45 @@
return r.release();
}
@@ -11339,7 +11340,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
if (!r) throw python_error();
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/autograd/VariableTypeManual.cpp pytorch-develop-150/torch/csrc/autograd/VariableTypeManual.cpp
--- pytorch-v1.5.0/torch/csrc/autograd/VariableTypeManual.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/autograd/VariableTypeManual.cpp 2021-09-26 18:06:04.553613316 +0800
+++ pytorch-develop-150/torch/csrc/autograd/VariableTypeManual.cpp 2021-09-28 22:04:53.823562134 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11373,7 +11374,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
if (!t.defined()) {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/distributed/c10d/comm.cpp pytorch-develop-150/torch/csrc/distributed/c10d/comm.cpp
--- pytorch-v1.5.0/torch/csrc/distributed/c10d/comm.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/distributed/c10d/comm.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/distributed/c10d/comm.cpp 2021-09-28 22:04:53.827562155 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11479,7 +11480,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
while (!in_flight.empty()) {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/distributed/c10d/init.cpp pytorch-develop-150/torch/csrc/distributed/c10d/init.cpp
--- pytorch-v1.5.0/torch/csrc/distributed/c10d/init.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/distributed/c10d/init.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/distributed/c10d/init.cpp 2021-09-28 22:04:53.827562155 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11536,7 +11537,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
.def("is_success", &::c10d::ProcessGroup::Work::isSuccess)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/distributed/c10d/reducer.cpp pytorch-develop-150/torch/csrc/distributed/c10d/reducer.cpp
--- pytorch-v1.5.0/torch/csrc/distributed/c10d/reducer.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/distributed/c10d/reducer.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/distributed/c10d/reducer.cpp 2021-09-28 22:04:53.827562155 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11667,7 +11668,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/DynamicTypes.cpp pytorch-develop-150/torch/csrc/DynamicTypes.cpp
--- pytorch-v1.5.0/torch/csrc/DynamicTypes.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/DynamicTypes.cpp 2021-09-26 18:06:04.549613328 +0800
+++ pytorch-develop-150/torch/csrc/DynamicTypes.cpp 2021-09-28 22:04:53.819562112 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11716,7 +11717,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return it->second;
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/Generator.cpp pytorch-develop-150/torch/csrc/Generator.cpp
--- pytorch-v1.5.0/torch/csrc/Generator.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/Generator.cpp 2021-09-26 18:06:04.549613328 +0800
+++ pytorch-develop-150/torch/csrc/Generator.cpp 2021-09-28 22:04:53.819562112 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11784,7 +11785,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
#endif
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/generic/serialization.cpp pytorch-develop-150/torch/csrc/generic/serialization.cpp
--- pytorch-v1.5.0/torch/csrc/generic/serialization.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/generic/serialization.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/generic/serialization.cpp 2021-09-28 22:04:53.827562155 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11884,7 +11885,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/generic/Storage.cpp pytorch-develop-150/torch/csrc/generic/Storage.cpp
--- pytorch-v1.5.0/torch/csrc/generic/Storage.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/generic/Storage.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/generic/Storage.cpp 2021-09-28 22:04:53.827562155 +0800
@@ -1,7 +1,25 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -11963,7 +11964,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
for (Py_ssize_t i = 0; i < length; i++) {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/generic/StorageMethods.cpp pytorch-develop-150/torch/csrc/generic/StorageMethods.cpp
--- pytorch-v1.5.0/torch/csrc/generic/StorageMethods.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/generic/StorageMethods.cpp 2021-09-26 18:06:04.557613304 +0800
+++ pytorch-develop-150/torch/csrc/generic/StorageMethods.cpp 2021-09-28 22:04:53.827562155 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -12011,7 +12012,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
{"_write_file", (PyCFunction)THPStorage_(writeFile), METH_VARARGS, nullptr},
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/Module.cpp pytorch-develop-150/torch/csrc/Module.cpp
--- pytorch-v1.5.0/torch/csrc/Module.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/Module.cpp 2021-09-26 18:06:04.549613328 +0800
+++ pytorch-develop-150/torch/csrc/Module.cpp 2021-09-28 22:04:53.819562112 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -12155,7 +12156,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
auto set_module_attr = [&](const char* name, PyObject* v, bool incref = true) {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/tensor/python_tensor.cpp pytorch-develop-150/torch/csrc/tensor/python_tensor.cpp
--- pytorch-v1.5.0/torch/csrc/tensor/python_tensor.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/tensor/python_tensor.cpp 2021-09-26 18:06:04.569613270 +0800
+++ pytorch-develop-150/torch/csrc/tensor/python_tensor.cpp 2021-09-28 22:04:53.839562221 +0800
@@ -1,18 +1,35 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -12532,7 +12533,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
+} // namespace torch
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/utils/init.cpp pytorch-develop-150/torch/csrc/utils/init.cpp
--- pytorch-v1.5.0/torch/csrc/utils/init.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/utils/init.cpp 2021-09-26 18:06:04.569613270 +0800
+++ pytorch-develop-150/torch/csrc/utils/init.cpp 2021-09-28 22:04:53.839562221 +0800
@@ -1,7 +1,13 @@
#include <ATen/core/ivalue.h>
#include <torch/csrc/utils/init.h>
@@ -12691,7 +12692,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
} // namespace torch
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/utils/init.h pytorch-develop-150/torch/csrc/utils/init.h
--- pytorch-v1.5.0/torch/csrc/utils/init.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/utils/init.h 2021-09-26 18:06:04.569613270 +0800
+++ pytorch-develop-150/torch/csrc/utils/init.h 2021-09-28 22:04:53.839562221 +0800
@@ -8,4 +8,7 @@
void initThroughputBenchmarkBindings(PyObject* module);
@@ -12702,7 +12703,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
} // namespace torch
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/utils/python_arg_parser.h pytorch-develop-150/torch/csrc/utils/python_arg_parser.h
--- pytorch-v1.5.0/torch/csrc/utils/python_arg_parser.h 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/utils/python_arg_parser.h 2021-09-26 18:06:04.569613270 +0800
+++ pytorch-develop-150/torch/csrc/utils/python_arg_parser.h 2021-09-28 22:04:53.839562221 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -12737,7 +12738,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return at::Device(device_str);
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/utils/tensor_layouts.cpp pytorch-develop-150/torch/csrc/utils/tensor_layouts.cpp
--- pytorch-v1.5.0/torch/csrc/utils/tensor_layouts.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/utils/tensor_layouts.cpp 2021-09-26 18:06:04.569613270 +0800
+++ pytorch-develop-150/torch/csrc/utils/tensor_layouts.cpp 2021-09-28 22:04:53.839562221 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -12768,7 +12769,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
registerLayoutObject((THPLayout*)strided_layout, at::Backend::QuantizedCPU);
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/utils/tensor_new.cpp pytorch-develop-150/torch/csrc/utils/tensor_new.cpp
--- pytorch-v1.5.0/torch/csrc/utils/tensor_new.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/utils/tensor_new.cpp 2021-09-26 18:06:04.569613270 +0800
+++ pytorch-develop-150/torch/csrc/utils/tensor_new.cpp 2021-09-28 22:04:53.839562221 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -12904,7 +12905,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
" or ", c10::DispatchKey::XLATensorId,
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/csrc/utils/tensor_types.cpp pytorch-develop-150/torch/csrc/utils/tensor_types.cpp
--- pytorch-v1.5.0/torch/csrc/utils/tensor_types.cpp 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/csrc/utils/tensor_types.cpp 2021-09-26 18:06:04.569613270 +0800
+++ pytorch-develop-150/torch/csrc/utils/tensor_types.cpp 2021-09-28 22:04:53.839562221 +0800
@@ -1,58 +1,91 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -13117,7 +13118,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
-def get_rng_state(): ...
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/distributed/distributed_c10d.py pytorch-develop-150/torch/distributed/distributed_c10d.py
--- pytorch-v1.5.0/torch/distributed/distributed_c10d.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/distributed/distributed_c10d.py 2021-09-26 18:06:04.569613270 +0800
+++ pytorch-develop-150/torch/distributed/distributed_c10d.py 2021-09-28 22:04:53.839562221 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -13198,7 +13199,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/__init__.py pytorch-develop-150/torch/__init__.py
--- pytorch-v1.5.0/torch/__init__.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/__init__.py 2021-09-26 18:06:04.549613328 +0800
+++ pytorch-develop-150/torch/__init__.py 2021-09-28 22:04:53.819562112 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -13241,7 +13242,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
\ No newline at end of file
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/lib/c10d/CMakeLists.txt pytorch-develop-150/torch/lib/c10d/CMakeLists.txt
--- pytorch-v1.5.0/torch/lib/c10d/CMakeLists.txt 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/lib/c10d/CMakeLists.txt 2021-09-26 18:06:04.573613259 +0800
+++ pytorch-develop-150/torch/lib/c10d/CMakeLists.txt 2021-09-28 22:04:53.839562221 +0800
@@ -28,6 +28,10 @@
option(USE_C10D_NCCL "USE C10D NCCL" ON)
endif()
@@ -13294,7 +13295,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
copy_header(ProcessGroupMPI.hpp)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/lib/libshm/CMakeLists.txt pytorch-develop-150/torch/lib/libshm/CMakeLists.txt
--- pytorch-v1.5.0/torch/lib/libshm/CMakeLists.txt 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/lib/libshm/CMakeLists.txt 2021-09-26 18:06:04.573613259 +0800
+++ pytorch-develop-150/torch/lib/libshm/CMakeLists.txt 2021-09-28 22:04:53.843562242 +0800
@@ -37,8 +37,11 @@
SET_TARGET_PROPERTIES(shm PROPERTIES
PREFIX "lib"
@@ -13351,7 +13352,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
-_maybe_indices_t = _scalar_or_tuple_2_t[Tensor]
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/nn/functional.py pytorch-develop-150/torch/nn/functional.py
--- pytorch-v1.5.0/torch/nn/functional.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/nn/functional.py 2021-09-26 18:06:04.573613259 +0800
+++ pytorch-develop-150/torch/nn/functional.py 2021-09-28 22:04:53.843562242 +0800
@@ -1611,7 +1611,7 @@
else:
output = input.matmul(weight.t())
@@ -13374,7 +13375,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
-from . import parallel as parallel
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/nn/modules/batchnorm.py pytorch-develop-150/torch/nn/modules/batchnorm.py
--- pytorch-v1.5.0/torch/nn/modules/batchnorm.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/nn/modules/batchnorm.py 2021-09-26 18:06:04.573613259 +0800
+++ pytorch-develop-150/torch/nn/modules/batchnorm.py 2021-09-28 22:04:53.843562242 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -13406,7 +13407,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
self.register_parameter('running_var', None)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/nn/modules/module.py pytorch-develop-150/torch/nn/modules/module.py
--- pytorch-v1.5.0/torch/nn/modules/module.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/nn/modules/module.py 2021-09-26 18:06:04.573613259 +0800
+++ pytorch-develop-150/torch/nn/modules/module.py 2021-09-28 22:04:53.843562242 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -13550,7 +13551,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return t.to(device, dtype if t.is_floating_point() else None, non_blocking, memory_format=convert_to_format)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/nn/modules/normalization.py pytorch-develop-150/torch/nn/modules/normalization.py
--- pytorch-v1.5.0/torch/nn/modules/normalization.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/nn/modules/normalization.py 2021-09-26 18:06:04.573613259 +0800
+++ pytorch-develop-150/torch/nn/modules/normalization.py 2021-09-28 22:04:53.843562242 +0800
@@ -128,13 +128,14 @@
"""
__constants__ = ['normalized_shape', 'eps', 'elementwise_affine']
@@ -13619,7 +13620,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
- module_kwargs: Optional[Any] = ...) -> Tensor: ...
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/nn/parallel/distributed.py pytorch-develop-150/torch/nn/parallel/distributed.py
--- pytorch-v1.5.0/torch/nn/parallel/distributed.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/nn/parallel/distributed.py 2021-09-26 18:06:04.573613259 +0800
+++ pytorch-develop-150/torch/nn/parallel/distributed.py 2021-09-28 22:04:53.843562242 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -13974,7 +13975,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
-def remove_weight_norm(module: T_module, name: str = ...) -> T_module: ...
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/onnx/symbolic_opset9.py pytorch-develop-150/torch/onnx/symbolic_opset9.py
--- pytorch-v1.5.0/torch/onnx/symbolic_opset9.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/onnx/symbolic_opset9.py 2021-09-26 18:06:04.577613248 +0800
+++ pytorch-develop-150/torch/onnx/symbolic_opset9.py 2021-09-28 22:04:53.847562264 +0800
@@ -1621,14 +1621,23 @@
slices = [sym_help._slice_helper(g, w, axes=[0], starts=[x * n], ends=[y * n]) for x, y in intervals]
return g.op('Concat', *slices, axis_i=0)
@@ -14052,7 +14053,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
- def __init__(self, params: _params_t, lr: float=..., lr_decay: float=..., weight_decay: float=..., initial_accumulator_value: float=..., eps: float=...) -> None: ...
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/optim/adamax.py pytorch-develop-150/torch/optim/adamax.py
--- pytorch-v1.5.0/torch/optim/adamax.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/optim/adamax.py 2021-09-26 18:06:04.577613248 +0800
+++ pytorch-develop-150/torch/optim/adamax.py 2021-09-28 22:04:53.847562264 +0800
@@ -80,8 +80,8 @@
exp_inf.mul_(beta2).unsqueeze(0),
grad.abs().add_(eps).unsqueeze_(0)
@@ -14229,7 +14230,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
- def __init__(self, params: _params_t, lr: float=..., betas: Tuple[float, float]=..., eps: float=...) -> None: ...
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/serialization.py pytorch-develop-150/torch/serialization.py
--- pytorch-v1.5.0/torch/serialization.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/serialization.py 2021-09-26 18:06:04.577613248 +0800
+++ pytorch-develop-150/torch/serialization.py 2021-09-28 22:04:53.847562264 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -14313,7 +14314,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
def location_tag(storage):
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/storage.py pytorch-develop-150/torch/storage.py
--- pytorch-v1.5.0/torch/storage.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/storage.py 2021-09-26 18:06:04.577613248 +0800
+++ pytorch-develop-150/torch/storage.py 2021-09-28 22:04:53.847562264 +0800
@@ -7,6 +7,7 @@
class _StorageBase(object):
@@ -14333,7 +14334,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
else:
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/tensor.py pytorch-develop-150/torch/tensor.py
--- pytorch-v1.5.0/torch/tensor.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/tensor.py 2021-09-26 18:06:04.577613248 +0800
+++ pytorch-develop-150/torch/tensor.py 2021-09-28 22:04:53.847562264 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -14395,7 +14396,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
def __reversed__(self):
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/_tensor_str.py pytorch-develop-150/torch/_tensor_str.py
--- pytorch-v1.5.0/torch/_tensor_str.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/_tensor_str.py 2021-09-26 18:06:04.549613328 +0800
+++ pytorch-develop-150/torch/_tensor_str.py 2021-09-28 22:04:53.819562112 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -14449,7 +14450,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
has_default_dtype = self.dtype in (torch.get_default_dtype(), torch.int64, torch.bool)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/utils/data/dataloader.py pytorch-develop-150/torch/utils/data/dataloader.py
--- pytorch-v1.5.0/torch/utils/data/dataloader.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/utils/data/dataloader.py 2021-09-26 18:06:04.577613248 +0800
+++ pytorch-develop-150/torch/utils/data/dataloader.py 2021-09-28 22:04:53.847562264 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -14658,7 +14659,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
- def __init__(self, sampler: Sampler[int], batch_size: int, drop_last: bool) -> None: ...
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/utils/data/_utils/pin_memory.py pytorch-develop-150/torch/utils/data/_utils/pin_memory.py
--- pytorch-v1.5.0/torch/utils/data/_utils/pin_memory.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/utils/data/_utils/pin_memory.py 2021-09-26 18:06:04.577613248 +0800
+++ pytorch-develop-150/torch/utils/data/_utils/pin_memory.py 2021-09-28 22:04:53.847562264 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -14719,7 +14720,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
-
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/utils/__init__.py pytorch-develop-150/torch/utils/__init__.py
--- pytorch-v1.5.0/torch/utils/__init__.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/utils/__init__.py 2021-09-26 18:06:04.577613248 +0800
+++ pytorch-develop-150/torch/utils/__init__.py 2021-09-28 22:04:53.847562264 +0800
@@ -1,6 +1,9 @@
from __future__ import absolute_import, division, print_function, unicode_literals
@@ -14732,7 +14733,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
def set_module(obj, mod):
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.5.0/torch/_utils.py pytorch-develop-150/torch/_utils.py
--- pytorch-v1.5.0/torch/_utils.py 2021-04-10 18:39:32.000000000 +0800
+++ pytorch-develop-150/torch/_utils.py 2021-09-26 18:06:04.549613328 +0800
+++ pytorch-develop-150/torch/_utils.py 2021-09-28 22:04:53.819562112 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
+82 -82
View File
@@ -1,6 +1,6 @@
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/CMakeLists.txt pytorch-develop-181/aten/CMakeLists.txt
--- pytorch-v1.8.1/aten/CMakeLists.txt 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/CMakeLists.txt 2021-09-26 18:06:08.617601807 +0800
+++ pytorch-develop-181/aten/CMakeLists.txt 2021-09-28 22:05:00.555598805 +0800
@@ -22,9 +22,11 @@
set(ATen_CPU_INCLUDE)
set(ATen_THIRD_PARTY_INCLUDE)
@@ -52,7 +52,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
set(ATen_CPU_DEPENDENCY_LIBS ${ATen_CPU_DEPENDENCY_LIBS} PARENT_SCOPE)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/CMakeLists.txt pytorch-develop-181/aten/src/ATen/CMakeLists.txt
--- pytorch-v1.8.1/aten/src/ATen/CMakeLists.txt 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/CMakeLists.txt 2021-09-26 18:06:08.617601807 +0800
+++ pytorch-develop-181/aten/src/ATen/CMakeLists.txt 2021-09-28 22:05:00.555598805 +0800
@@ -85,6 +85,10 @@
file(GLOB native_quantized_h "native/quantized/*.h" "native/quantized/cpu/*.h")
file(GLOB native_cpu_h "native/cpu/*.h")
@@ -103,7 +103,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
set(ATen_HIP_SRCS ${ATen_HIP_SRCS} PARENT_SCOPE)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/core/VariableFallbackKernel.cpp pytorch-develop-181/aten/src/ATen/core/VariableFallbackKernel.cpp
--- pytorch-v1.8.1/aten/src/ATen/core/VariableFallbackKernel.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/core/VariableFallbackKernel.cpp 2021-09-26 18:06:08.625601784 +0800
+++ pytorch-develop-181/aten/src/ATen/core/VariableFallbackKernel.cpp 2021-09-28 22:05:00.559598827 +0800
@@ -48,4 +48,8 @@
m.fallback(torch::CppFunction::makeFallthrough());
}
@@ -115,7 +115,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/native/Convolution.cpp pytorch-develop-181/aten/src/ATen/native/Convolution.cpp
--- pytorch-v1.8.1/aten/src/ATen/native/Convolution.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/native/Convolution.cpp 2021-09-26 18:06:08.637601750 +0800
+++ pytorch-develop-181/aten/src/ATen/native/Convolution.cpp 2021-09-28 22:05:00.571598892 +0800
@@ -603,7 +603,9 @@
const Tensor& input, const Tensor& weight, const Tensor& bias,
IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation,
@@ -129,7 +129,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
at::Tensor _convolution(
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/native/Memory.cpp pytorch-develop-181/aten/src/ATen/native/Memory.cpp
--- pytorch-v1.8.1/aten/src/ATen/native/Memory.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/native/Memory.cpp 2021-09-26 18:06:08.641601739 +0800
+++ pytorch-develop-181/aten/src/ATen/native/Memory.cpp 2021-09-28 22:05:00.575598914 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -180,7 +180,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
detail::computeStorageNbytes(
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/native/native_functions.yaml pytorch-develop-181/aten/src/ATen/native/native_functions.yaml
--- pytorch-v1.8.1/aten/src/ATen/native/native_functions.yaml 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/native/native_functions.yaml 2021-09-26 18:06:08.673601649 +0800
+++ pytorch-develop-181/aten/src/ATen/native/native_functions.yaml 2021-09-28 22:05:00.611599110 +0800
@@ -2073,6 +2073,8 @@
dispatch:
CPU, CUDA: isnan
@@ -486,7 +486,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
+ NPU: bmm_v2_npu
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/native/NPUVariableMethodStubs.cpp pytorch-develop-181/aten/src/ATen/native/NPUVariableMethodStubs.cpp
--- pytorch-v1.8.1/aten/src/ATen/native/NPUVariableMethodStubs.cpp 1970-01-01 08:00:00.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/native/NPUVariableMethodStubs.cpp 2021-09-26 18:06:08.641601739 +0800
+++ pytorch-develop-181/aten/src/ATen/native/NPUVariableMethodStubs.cpp 2021-09-28 22:05:00.575598914 +0800
@@ -0,0 +1,247 @@
+#include "ATen/native/npu/common/FormatCastHelper.h"
+#include "ATen/native/npu/frame/FormatHelper.h"
@@ -1653,7 +1653,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
-}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/native/TensorFactories.cpp pytorch-develop-181/aten/src/ATen/native/TensorFactories.cpp
--- pytorch-v1.8.1/aten/src/ATen/native/TensorFactories.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/native/TensorFactories.cpp 2021-09-26 18:06:08.657601694 +0800
+++ pytorch-develop-181/aten/src/ATen/native/TensorFactories.cpp 2021-09-28 22:05:00.591599001 +0800
@@ -1,3 +1,20 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -1686,7 +1686,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
namespace {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/native/vulkan/api/vk_mem_alloc.h pytorch-develop-181/aten/src/ATen/native/vulkan/api/vk_mem_alloc.h
--- pytorch-v1.8.1/aten/src/ATen/native/vulkan/api/vk_mem_alloc.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/native/vulkan/api/vk_mem_alloc.h 2021-09-26 18:06:08.705601559 +0800
+++ pytorch-develop-181/aten/src/ATen/native/vulkan/api/vk_mem_alloc.h 2021-09-28 22:05:00.639599262 +0800
@@ -1,19229 +1,19229 @@
-//
-// Copyright (c) 2017-2020 Advanced Micro Devices, Inc. All rights reserved.
@@ -40148,7 +40148,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
+#endif // #ifdef VMA_IMPLEMENTATION
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/templates/TensorBody.h pytorch-develop-181/aten/src/ATen/templates/TensorBody.h
--- pytorch-v1.8.1/aten/src/ATen/templates/TensorBody.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/templates/TensorBody.h 2021-09-26 18:06:08.709601548 +0800
+++ pytorch-develop-181/aten/src/ATen/templates/TensorBody.h 2021-09-28 22:05:00.643599285 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40181,7 +40181,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
bool is_xpu() const;
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/templates/TensorMethods.cpp pytorch-develop-181/aten/src/ATen/templates/TensorMethods.cpp
--- pytorch-v1.8.1/aten/src/ATen/templates/TensorMethods.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/templates/TensorMethods.cpp 2021-09-26 18:06:08.709601548 +0800
+++ pytorch-develop-181/aten/src/ATen/templates/TensorMethods.cpp 2021-09-28 22:05:00.643599285 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40226,7 +40226,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/ATen/Utils.cpp pytorch-develop-181/aten/src/ATen/Utils.cpp
--- pytorch-v1.8.1/aten/src/ATen/Utils.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/ATen/Utils.cpp 2021-09-26 18:06:08.621601795 +0800
+++ pytorch-develop-181/aten/src/ATen/Utils.cpp 2021-09-28 22:05:00.559598827 +0800
@@ -1,3 +1,18 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40270,7 +40270,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/TH/generic/THStorage.cpp pytorch-develop-181/aten/src/TH/generic/THStorage.cpp
--- pytorch-v1.8.1/aten/src/TH/generic/THStorage.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/TH/generic/THStorage.cpp 2021-09-26 18:06:08.713601537 +0800
+++ pytorch-develop-181/aten/src/TH/generic/THStorage.cpp 2021-09-28 22:05:00.647599306 +0800
@@ -1,9 +1,32 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40383,7 +40383,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/aten/src/TH/generic/THStorage.h pytorch-develop-181/aten/src/TH/generic/THStorage.h
--- pytorch-v1.8.1/aten/src/TH/generic/THStorage.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/aten/src/TH/generic/THStorage.h 2021-09-26 18:06:08.713601537 +0800
+++ pytorch-develop-181/aten/src/TH/generic/THStorage.h 2021-09-28 22:05:00.647599306 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40422,7 +40422,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/CMakeLists.txt pytorch-develop-181/c10/CMakeLists.txt
--- pytorch-v1.8.1/c10/CMakeLists.txt 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/CMakeLists.txt 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/CMakeLists.txt 2021-09-28 22:05:00.663599393 +0800
@@ -79,6 +79,14 @@
message(STATUS "don't use NUMA")
endif()
@@ -40451,7 +40451,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
# not checked in
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/Backend.h pytorch-develop-181/c10/core/Backend.h
--- pytorch-v1.8.1/c10/core/Backend.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/Backend.h 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/Backend.h 2021-09-28 22:05:00.663599393 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40545,7 +40545,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/Device.cpp pytorch-develop-181/c10/core/Device.cpp
--- pytorch-v1.8.1/c10/core/Device.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/Device.cpp 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/Device.cpp 2021-09-28 22:05:00.663599393 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40576,7 +40576,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
types.begin(),
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/Device.h pytorch-develop-181/c10/core/Device.h
--- pytorch-v1.8.1/c10/core/Device.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/Device.h 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/Device.h 2021-09-28 22:05:00.663599393 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40611,7 +40611,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
bool is_cpu() const noexcept {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/DeviceType.cpp pytorch-develop-181/c10/core/DeviceType.cpp
--- pytorch-v1.8.1/c10/core/DeviceType.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/DeviceType.cpp 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/DeviceType.cpp 2021-09-28 22:05:00.663599393 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40651,7 +40651,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return false;
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/DeviceType.h pytorch-develop-181/c10/core/DeviceType.h
--- pytorch-v1.8.1/c10/core/DeviceType.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/DeviceType.h 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/DeviceType.h 2021-09-28 22:05:00.663599393 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40693,7 +40693,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
constexpr DeviceType kMSNPU = DeviceType::MSNPU;
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/DispatchKey.cpp pytorch-develop-181/c10/core/DispatchKey.cpp
--- pytorch-v1.8.1/c10/core/DispatchKey.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/DispatchKey.cpp 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/DispatchKey.cpp 2021-09-28 22:05:00.663599393 +0800
@@ -1,3 +1,18 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40742,7 +40742,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
case DispatchKey::PrivateUse1:
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/DispatchKey.h pytorch-develop-181/c10/core/DispatchKey.h
--- pytorch-v1.8.1/c10/core/DispatchKey.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/DispatchKey.h 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/DispatchKey.h 2021-09-28 22:05:00.663599393 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40789,7 +40789,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
PrivateUse3_PreAutograd = AutogradPrivateUse3,
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/DispatchKeySet.cpp pytorch-develop-181/c10/core/DispatchKeySet.cpp
--- pytorch-v1.8.1/c10/core/DispatchKeySet.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/DispatchKeySet.cpp 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/DispatchKeySet.cpp 2021-09-28 22:05:00.663599393 +0800
@@ -11,6 +11,7 @@
DispatchKey::XLA,
DispatchKey::NestedTensor,
@@ -40809,7 +40809,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
case DispatchKey::AutogradXPU:
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/DispatchKeySet.h pytorch-develop-181/c10/core/DispatchKeySet.h
--- pytorch-v1.8.1/c10/core/DispatchKeySet.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/DispatchKeySet.h 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/DispatchKeySet.h 2021-09-28 22:05:00.663599393 +0800
@@ -193,6 +193,7 @@
DispatchKey::AutogradCPU,
DispatchKey::AutogradCUDA,
@@ -40820,7 +40820,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
DispatchKey::AutogradPrivateUse1,
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/Storage.h pytorch-develop-181/c10/core/Storage.h
--- pytorch-v1.8.1/c10/core/Storage.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/Storage.h 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/Storage.h 2021-09-28 22:05:00.663599393 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40854,7 +40854,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
};
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/StorageImpl.h pytorch-develop-181/c10/core/StorageImpl.h
--- pytorch-v1.8.1/c10/core/StorageImpl.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/StorageImpl.h 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/StorageImpl.h 2021-09-28 22:05:00.663599393 +0800
@@ -1,12 +1,42 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40914,7 +40914,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/TensorImpl.h pytorch-develop-181/c10/core/TensorImpl.h
--- pytorch-v1.8.1/c10/core/TensorImpl.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/TensorImpl.h 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/TensorImpl.h 2021-09-28 22:05:00.663599393 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40957,7 +40957,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return ts.has(DispatchKey::SparseCPU) ||
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/core/TensorOptions.h pytorch-develop-181/c10/core/TensorOptions.h
--- pytorch-v1.8.1/c10/core/TensorOptions.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/core/TensorOptions.h 2021-09-26 18:06:08.725601503 +0800
+++ pytorch-develop-181/c10/core/TensorOptions.h 2021-09-28 22:05:00.663599393 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -40998,7 +40998,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
} else if (tid == DispatchKey::QuantizedXPU) {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/c10/macros/Export.h pytorch-develop-181/c10/macros/Export.h
--- pytorch-v1.8.1/c10/macros/Export.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/c10/macros/Export.h 2021-09-26 18:06:08.729601492 +0800
+++ pytorch-develop-181/c10/macros/Export.h 2021-09-28 22:05:00.667599415 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -41067,7 +41067,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
#define C10_API_ENUM C10_API
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/caffe2/CMakeLists.txt pytorch-develop-181/caffe2/CMakeLists.txt
--- pytorch-v1.8.1/caffe2/CMakeLists.txt 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/caffe2/CMakeLists.txt 2021-09-26 18:06:08.733601480 +0800
+++ pytorch-develop-181/caffe2/CMakeLists.txt 2021-09-28 22:05:00.671599437 +0800
@@ -76,6 +76,7 @@
# Add source, includes, and libs to lists
list(APPEND Caffe2_CPU_SRCS ${ATen_CPU_SRCS})
@@ -41179,7 +41179,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
# Call again since Caffe2_HIP_INCLUDE is extended with ATen include dirs.
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/cmake/BuildVariables.cmake pytorch-develop-181/cmake/BuildVariables.cmake
--- pytorch-v1.8.1/cmake/BuildVariables.cmake 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/cmake/BuildVariables.cmake 2021-09-26 18:06:08.809601267 +0800
+++ pytorch-develop-181/cmake/BuildVariables.cmake 2021-09-28 22:05:00.747599851 +0800
@@ -11,6 +11,7 @@
# CMakeLists.txt files under each folder respectively.
set(Caffe2_CPU_SRCS)
@@ -41203,7 +41203,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
# symbols. However, if the lib is whole linked in caffe2 lib, we don't want
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/cmake/Codegen.cmake pytorch-develop-181/cmake/Codegen.cmake
--- pytorch-v1.8.1/cmake/Codegen.cmake 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/cmake/Codegen.cmake 2021-09-26 18:06:08.809601267 +0800
+++ pytorch-develop-181/cmake/Codegen.cmake 2021-09-28 22:05:00.747599851 +0800
@@ -208,13 +208,14 @@
file(READ ${CMAKE_BINARY_DIR}/aten/src/ATen/generated_cpp.txt generated_cpp)
file(READ ${CMAKE_BINARY_DIR}/aten/src/ATen/generated_cpp.txt-cuda cuda_generated_cpp)
@@ -41236,7 +41236,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
function(append_filelist name outputvar)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/cmake/Dependencies.cmake pytorch-develop-181/cmake/Dependencies.cmake
--- pytorch-v1.8.1/cmake/Dependencies.cmake 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/cmake/Dependencies.cmake 2021-09-26 18:06:08.809601267 +0800
+++ pytorch-develop-181/cmake/Dependencies.cmake 2021-09-28 22:05:00.751599873 +0800
@@ -1771,6 +1771,13 @@
endif(NOT C_HAS_THREAD)
endif()
@@ -41253,7 +41253,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
#
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/cmake/Summary.cmake pytorch-develop-181/cmake/Summary.cmake
--- pytorch-v1.8.1/cmake/Summary.cmake 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/cmake/Summary.cmake 2021-09-26 18:06:08.809601267 +0800
+++ pytorch-develop-181/cmake/Summary.cmake 2021-09-28 22:05:00.751599873 +0800
@@ -127,6 +127,7 @@
message(STATUS " USE_MKLDNN_CBLAS : ${USE_MKLDNN_CBLAS}")
endif()
@@ -41272,7 +41272,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
message(STATUS " Private Dependencies : ${Caffe2_DEPENDENCY_LIBS}")
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/cmake/TorchConfig.cmake.in pytorch-develop-181/cmake/TorchConfig.cmake.in
--- pytorch-v1.8.1/cmake/TorchConfig.cmake.in 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/cmake/TorchConfig.cmake.in 2021-09-26 18:06:08.809601267 +0800
+++ pytorch-develop-181/cmake/TorchConfig.cmake.in 2021-09-28 22:05:00.751599873 +0800
@@ -158,6 +158,11 @@
list(APPEND TORCH_LIBRARIES ${TORCH_CUDA_LIBRARIES})
endif()
@@ -41287,7 +41287,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
set(TORCH_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=@GLIBCXX_USE_CXX11_ABI@")
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/CMakeLists.txt pytorch-develop-181/CMakeLists.txt
--- pytorch-v1.8.1/CMakeLists.txt 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/CMakeLists.txt 2021-09-26 18:06:08.609601829 +0800
+++ pytorch-develop-181/CMakeLists.txt 2021-09-28 22:05:00.543598739 +0800
@@ -261,6 +261,10 @@
"USE_DISTRIBUTED" OFF)
option(USE_TBB "Use TBB" OFF)
@@ -41331,7 +41331,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
if(APPLE)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/setup.py pytorch-develop-181/setup.py
--- pytorch-v1.8.1/setup.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/setup.py 2021-09-26 18:06:08.821601233 +0800
+++ pytorch-develop-181/setup.py 2021-09-28 22:05:00.763599938 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -41400,7 +41400,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
'utils/benchmark/utils/valgrind_wrapper/*.h',
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/tools/autograd/derivatives.yaml pytorch-develop-181/tools/autograd/derivatives.yaml
--- pytorch-v1.8.1/tools/autograd/derivatives.yaml 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/tools/autograd/derivatives.yaml 2021-09-26 18:06:09.277599954 +0800
+++ pytorch-develop-181/tools/autograd/derivatives.yaml 2021-09-28 22:05:01.219602422 +0800
@@ -1976,3 +1976,10 @@
- name: nonzero(Tensor self) -> Tensor
@@ -41414,7 +41414,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
+ mat2: npu_bmm_v2_mat2_backward(grad, self, mat2, mat2.sizes())
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/tools/autograd/gen_python_functions.py pytorch-develop-181/tools/autograd/gen_python_functions.py
--- pytorch-v1.8.1/tools/autograd/gen_python_functions.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/tools/autograd/gen_python_functions.py 2021-09-26 18:06:09.277599954 +0800
+++ pytorch-develop-181/tools/autograd/gen_python_functions.py 2021-09-28 22:05:01.219602422 +0800
@@ -1,3 +1,20 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -41438,7 +41438,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
# The bindings are generated as methods on python_variable or functions on the
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/tools/autograd/templates/Functions.cpp pytorch-develop-181/tools/autograd/templates/Functions.cpp
--- pytorch-v1.8.1/tools/autograd/templates/Functions.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/tools/autograd/templates/Functions.cpp 2021-09-26 18:06:09.277599954 +0800
+++ pytorch-develop-181/tools/autograd/templates/Functions.cpp 2021-09-28 22:05:01.219602422 +0800
@@ -14,6 +14,35 @@
namespace torch { namespace autograd { namespace generated {
@@ -41477,7 +41477,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}}} // namespace torch::autograd::generated
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/tools/autograd/templates/python_torch_functions.cpp pytorch-develop-181/tools/autograd/templates/python_torch_functions.cpp
--- pytorch-v1.8.1/tools/autograd/templates/python_torch_functions.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/tools/autograd/templates/python_torch_functions.cpp 2021-09-26 18:06:09.277599954 +0800
+++ pytorch-develop-181/tools/autograd/templates/python_torch_functions.cpp 2021-09-28 22:05:01.223602445 +0800
@@ -30,7 +30,7 @@
#include "torch/csrc/autograd/generated/variable_factories.h"
#include "torch/csrc/utils/structseq.h"
@@ -41513,7 +41513,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return torch::range(start, end, step, options);
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/tools/autograd/templates/python_variable_methods.cpp pytorch-develop-181/tools/autograd/templates/python_variable_methods.cpp
--- pytorch-v1.8.1/tools/autograd/templates/python_variable_methods.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/tools/autograd/templates/python_variable_methods.cpp 2021-09-26 18:06:09.277599954 +0800
+++ pytorch-develop-181/tools/autograd/templates/python_variable_methods.cpp 2021-09-28 22:05:01.223602445 +0800
@@ -20,7 +20,13 @@
#ifdef USE_CUDA
#include "torch/csrc/cuda/Event.h"
@@ -41581,7 +41581,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
{"has_names", THPVariable_has_names, METH_NOARGS, NULL},
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/tools/build_variables.bzl pytorch-develop-181/tools/build_variables.bzl
--- pytorch-v1.8.1/tools/build_variables.bzl 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/tools/build_variables.bzl 2021-09-26 18:06:09.277599954 +0800
+++ pytorch-develop-181/tools/build_variables.bzl 2021-09-28 22:05:01.223602445 +0800
@@ -362,6 +362,7 @@
libtorch_cuda_core_sources = [
"torch/csrc/CudaIPCTypes.cpp",
@@ -41600,7 +41600,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
"torch/csrc/utils/python_arg_parser.cpp",
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/tools/codegen/gen.py pytorch-develop-181/tools/codegen/gen.py
--- pytorch-v1.8.1/tools/codegen/gen.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/tools/codegen/gen.py 2021-09-26 18:06:09.281599943 +0800
+++ pytorch-develop-181/tools/codegen/gen.py 2021-09-28 22:05:01.223602445 +0800
@@ -815,7 +815,7 @@
core_fm = make_file_manager(core_install_dir)
cpu_fm = make_file_manager(options.install_dir)
@@ -41648,7 +41648,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
main()
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/tools/codegen/model.py pytorch-develop-181/tools/codegen/model.py
--- pytorch-v1.8.1/tools/codegen/model.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/tools/codegen/model.py 2021-09-26 18:06:09.281599943 +0800
+++ pytorch-develop-181/tools/codegen/model.py 2021-09-28 22:05:01.227602466 +0800
@@ -79,6 +79,7 @@
SparseHIP = auto()
SparseXPU = auto()
@@ -41790,7 +41790,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
-)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/autograd/profiler.py pytorch-develop-181/torch/autograd/profiler.py
--- pytorch-v1.8.1/torch/autograd/profiler.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/autograd/profiler.py 2021-09-26 18:06:09.285599931 +0800
+++ pytorch-develop-181/torch/autograd/profiler.py 2021-09-28 22:05:01.231602488 +0800
@@ -351,6 +351,9 @@
use_cuda (bool, optional): Enables timing of CUDA events as well using the cudaEvent API.
@@ -42022,7 +42022,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return ''.join(result)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/_C/_autograd.pyi pytorch-develop-181/torch/_C/_autograd.pyi
--- pytorch-v1.8.1/torch/_C/_autograd.pyi 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/_C/_autograd.pyi 2021-09-26 18:06:09.281599943 +0800
+++ pytorch-develop-181/torch/_C/_autograd.pyi 2021-09-28 22:05:01.227602466 +0800
@@ -9,14 +9,17 @@
CUDA = ...
NVTX = ...
@@ -42043,7 +42043,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
class ProfilerConfig:
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/CMakeLists.txt pytorch-develop-181/torch/CMakeLists.txt
--- pytorch-v1.8.1/torch/CMakeLists.txt 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/CMakeLists.txt 2021-09-26 18:06:09.281599943 +0800
+++ pytorch-develop-181/torch/CMakeLists.txt 2021-09-28 22:05:01.227602466 +0800
@@ -131,6 +131,20 @@
endif()
@@ -42067,7 +42067,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
list(APPEND TORCH_PYTHON_SRCS ${GENERATED_THNN_CXX_CUDA})
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/autograd/engine.cpp pytorch-develop-181/torch/csrc/autograd/engine.cpp
--- pytorch-v1.8.1/torch/csrc/autograd/engine.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/autograd/engine.cpp 2021-09-26 18:06:09.289599920 +0800
+++ pytorch-develop-181/torch/csrc/autograd/engine.cpp 2021-09-28 22:05:01.235602510 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42164,7 +42164,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
auto outputs = call_function(graph_task, func, inputs);
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/autograd/functions/tensor.cpp pytorch-develop-181/torch/csrc/autograd/functions/tensor.cpp
--- pytorch-v1.8.1/torch/csrc/autograd/functions/tensor.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/autograd/functions/tensor.cpp 2021-09-26 18:06:09.289599920 +0800
+++ pytorch-develop-181/torch/csrc/autograd/functions/tensor.cpp 2021-09-28 22:05:01.235602510 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42196,7 +42196,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
/*non_blocking=*/false,
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/autograd/input_buffer.cpp pytorch-develop-181/torch/csrc/autograd/input_buffer.cpp
--- pytorch-v1.8.1/torch/csrc/autograd/input_buffer.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/autograd/input_buffer.cpp 2021-09-26 18:06:09.289599920 +0800
+++ pytorch-develop-181/torch/csrc/autograd/input_buffer.cpp 2021-09-28 22:05:01.235602510 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42248,7 +42248,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
auto& old_var = buffer[pos];
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/autograd/python_variable.cpp pytorch-develop-181/torch/csrc/autograd/python_variable.cpp
--- pytorch-v1.8.1/torch/csrc/autograd/python_variable.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/autograd/python_variable.cpp 2021-09-26 18:06:09.293599909 +0800
+++ pytorch-develop-181/torch/csrc/autograd/python_variable.cpp 2021-09-28 22:05:01.239602531 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42302,7 +42302,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
{"is_mkldnn", (getter)THPVariable_is_mkldnn, nullptr, nullptr, nullptr},
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/autograd/python_variable_indexing.cpp pytorch-develop-181/torch/csrc/autograd/python_variable_indexing.cpp
--- pytorch-v1.8.1/torch/csrc/autograd/python_variable_indexing.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/autograd/python_variable_indexing.cpp 2021-09-26 18:06:09.293599909 +0800
+++ pytorch-develop-181/torch/csrc/autograd/python_variable_indexing.cpp 2021-09-28 22:05:01.239602531 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42335,7 +42335,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/distributed/c10d/init.cpp pytorch-develop-181/torch/csrc/distributed/c10d/init.cpp
--- pytorch-v1.8.1/torch/csrc/distributed/c10d/init.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/distributed/c10d/init.cpp 2021-09-26 18:06:09.293599909 +0800
+++ pytorch-develop-181/torch/csrc/distributed/c10d/init.cpp 2021-09-28 22:05:01.243602554 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42502,7 +42502,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
torch::class_<::c10d::DistributedC10d>("dist_c10d", "frontend")
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/DynamicTypes.cpp pytorch-develop-181/torch/csrc/DynamicTypes.cpp
--- pytorch-v1.8.1/torch/csrc/DynamicTypes.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/DynamicTypes.cpp 2021-09-26 18:06:09.285599931 +0800
+++ pytorch-develop-181/torch/csrc/DynamicTypes.cpp 2021-09-28 22:05:01.231602488 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42551,7 +42551,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return it->second;
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/Generator.cpp pytorch-develop-181/torch/csrc/Generator.cpp
--- pytorch-v1.8.1/torch/csrc/Generator.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/Generator.cpp 2021-09-26 18:06:09.285599931 +0800
+++ pytorch-develop-181/torch/csrc/Generator.cpp 2021-09-28 22:05:01.231602488 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42598,7 +42598,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
" is not supported for torch.Generator() api.");
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/generic/serialization.cpp pytorch-develop-181/torch/csrc/generic/serialization.cpp
--- pytorch-v1.8.1/torch/csrc/generic/serialization.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/generic/serialization.cpp 2021-09-26 18:06:09.297599898 +0800
+++ pytorch-develop-181/torch/csrc/generic/serialization.cpp 2021-09-28 22:05:01.243602554 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42696,7 +42696,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/generic/Storage.cpp pytorch-develop-181/torch/csrc/generic/Storage.cpp
--- pytorch-v1.8.1/torch/csrc/generic/Storage.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/generic/Storage.cpp 2021-09-26 18:06:09.297599898 +0800
+++ pytorch-develop-181/torch/csrc/generic/Storage.cpp 2021-09-28 22:05:01.243602554 +0800
@@ -1,7 +1,25 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42776,7 +42776,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
for (Py_ssize_t i = 0; i < length; i++) {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/generic/StorageMethods.cpp pytorch-develop-181/torch/csrc/generic/StorageMethods.cpp
--- pytorch-v1.8.1/torch/csrc/generic/StorageMethods.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/generic/StorageMethods.cpp 2021-09-26 18:06:09.297599898 +0800
+++ pytorch-develop-181/torch/csrc/generic/StorageMethods.cpp 2021-09-28 22:05:01.243602554 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42856,7 +42856,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
};
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/Module.cpp pytorch-develop-181/torch/csrc/Module.cpp
--- pytorch-v1.8.1/torch/csrc/Module.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/Module.cpp 2021-09-26 18:06:09.285599931 +0800
+++ pytorch-develop-181/torch/csrc/Module.cpp 2021-09-28 22:05:01.231602488 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -42982,7 +42982,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
if (incref) {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/tensor/python_tensor.cpp pytorch-develop-181/torch/csrc/tensor/python_tensor.cpp
--- pytorch-v1.8.1/torch/csrc/tensor/python_tensor.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/tensor/python_tensor.cpp 2021-09-26 18:06:09.321599831 +0800
+++ pytorch-develop-181/torch/csrc/tensor/python_tensor.cpp 2021-09-28 22:05:01.271602706 +0800
@@ -1,3 +1,18 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -43020,7 +43020,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/utils/python_arg_parser.h pytorch-develop-181/torch/csrc/utils/python_arg_parser.h
--- pytorch-v1.8.1/torch/csrc/utils/python_arg_parser.h 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/utils/python_arg_parser.h 2021-09-26 18:06:09.325599819 +0800
+++ pytorch-develop-181/torch/csrc/utils/python_arg_parser.h 2021-09-28 22:05:01.271602706 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -43055,7 +43055,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return at::Device(device_str);
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/utils/tensor_layouts.cpp pytorch-develop-181/torch/csrc/utils/tensor_layouts.cpp
--- pytorch-v1.8.1/torch/csrc/utils/tensor_layouts.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/utils/tensor_layouts.cpp 2021-09-26 18:06:09.325599819 +0800
+++ pytorch-develop-181/torch/csrc/utils/tensor_layouts.cpp 2021-09-28 22:05:01.271602706 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -43086,7 +43086,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
PyObject *sparse_coo_layout = THPLayout_New(at::Layout::Sparse, "torch.sparse_coo");
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/utils/tensor_new.cpp pytorch-develop-181/torch/csrc/utils/tensor_new.cpp
--- pytorch-v1.8.1/torch/csrc/utils/tensor_new.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/utils/tensor_new.cpp 2021-09-26 18:06:09.325599819 +0800
+++ pytorch-develop-181/torch/csrc/utils/tensor_new.cpp 2021-09-28 22:05:01.271602706 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -43218,7 +43218,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
dispatch_key);
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/csrc/utils/tensor_types.cpp pytorch-develop-181/torch/csrc/utils/tensor_types.cpp
--- pytorch-v1.8.1/torch/csrc/utils/tensor_types.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/csrc/utils/tensor_types.cpp 2021-09-26 18:06:09.325599819 +0800
+++ pytorch-develop-181/torch/csrc/utils/tensor_types.cpp 2021-09-28 22:05:01.271602706 +0800
@@ -1,3 +1,19 @@
+// Copyright (c) 2020 Huawei Technologies Co., Ltd
+// Copyright (c) 2019, Facebook CORPORATION.
@@ -43268,7 +43268,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
}
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/distributed/distributed_c10d.py pytorch-develop-181/torch/distributed/distributed_c10d.py
--- pytorch-v1.8.1/torch/distributed/distributed_c10d.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/distributed/distributed_c10d.py 2021-09-26 18:06:09.325599819 +0800
+++ pytorch-develop-181/torch/distributed/distributed_c10d.py 2021-09-28 22:05:01.275602728 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -43359,7 +43359,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
prefix_store,
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/__init__.py pytorch-develop-181/torch/__init__.py
--- pytorch-v1.8.1/torch/__init__.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/__init__.py 2021-09-26 18:06:09.281599943 +0800
+++ pytorch-develop-181/torch/__init__.py 2021-09-28 22:05:01.227602466 +0800
@@ -675,3 +675,11 @@
# class usage. We add these lines here to preserve backward compatibility.
quantized_lstm = torch.ops.aten.quantized_lstm
@@ -43375,7 +43375,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
\ No newline at end of file
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/lib/c10d/CMakeLists.txt pytorch-develop-181/torch/lib/c10d/CMakeLists.txt
--- pytorch-v1.8.1/torch/lib/c10d/CMakeLists.txt 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/lib/c10d/CMakeLists.txt 2021-09-26 18:06:09.333599797 +0800
+++ pytorch-develop-181/torch/lib/c10d/CMakeLists.txt 2021-09-28 22:05:01.279602749 +0800
@@ -27,6 +27,10 @@
option(USE_C10D_NCCL "USE C10D NCCL" ON)
endif()
@@ -43428,7 +43428,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
copy_header(ProcessGroupMPI.hpp)
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/lib/c10d/comm.cpp pytorch-develop-181/torch/lib/c10d/comm.cpp
--- pytorch-v1.8.1/torch/lib/c10d/comm.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/lib/c10d/comm.cpp 2021-09-26 18:06:09.333599797 +0800
+++ pytorch-develop-181/torch/lib/c10d/comm.cpp 2021-09-28 22:05:01.283602771 +0800
@@ -12,6 +12,26 @@
class BroadcastWork {
@@ -43517,7 +43517,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
while (!in_flight.empty()) {
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/lib/c10d/reducer.cpp pytorch-develop-181/torch/lib/c10d/reducer.cpp
--- pytorch-v1.8.1/torch/lib/c10d/reducer.cpp 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/lib/c10d/reducer.cpp 2021-09-26 18:06:09.333599797 +0800
+++ pytorch-develop-181/torch/lib/c10d/reducer.cpp 2021-09-28 22:05:01.283602771 +0800
@@ -18,6 +18,18 @@
namespace c10d {
namespace {
@@ -43693,7 +43693,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
// A bucket with one or more dense tensors needs to be unflattened.
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/lib/libshm/CMakeLists.txt pytorch-develop-181/torch/lib/libshm/CMakeLists.txt
--- pytorch-v1.8.1/torch/lib/libshm/CMakeLists.txt 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/lib/libshm/CMakeLists.txt 2021-09-26 18:06:09.333599797 +0800
+++ pytorch-develop-181/torch/lib/libshm/CMakeLists.txt 2021-09-28 22:05:01.283602771 +0800
@@ -41,8 +41,11 @@
set_target_properties(shm PROPERTIES
PREFIX "lib"
@@ -43709,7 +43709,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
# https://github.com/libgit2/libgit2/issues/2128#issuecomment-35649830
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/nn/modules/batchnorm.py pytorch-develop-181/torch/nn/modules/batchnorm.py
--- pytorch-v1.8.1/torch/nn/modules/batchnorm.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/nn/modules/batchnorm.py 2021-09-26 18:06:09.337599786 +0800
+++ pytorch-develop-181/torch/nn/modules/batchnorm.py 2021-09-28 22:05:01.287602793 +0800
@@ -1,3 +1,18 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -43731,7 +43731,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
from ._functions import SyncBatchNorm as sync_batch_norm
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/nn/modules/module.py pytorch-develop-181/torch/nn/modules/module.py
--- pytorch-v1.8.1/torch/nn/modules/module.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/nn/modules/module.py 2021-09-26 18:06:09.337599786 +0800
+++ pytorch-develop-181/torch/nn/modules/module.py 2021-09-28 22:05:01.287602793 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -43857,7 +43857,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
if convert_to_format is not None and t.dim() == 4:
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/nn/modules/normalization.py pytorch-develop-181/torch/nn/modules/normalization.py
--- pytorch-v1.8.1/torch/nn/modules/normalization.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/nn/modules/normalization.py 2021-09-26 18:06:09.337599786 +0800
+++ pytorch-develop-181/torch/nn/modules/normalization.py 2021-09-28 22:05:01.287602793 +0800
@@ -167,8 +167,11 @@
init.zeros_(self.bias)
@@ -43874,7 +43874,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
return '{normalized_shape}, eps={eps}, ' \
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/nn/parallel/distributed.py pytorch-develop-181/torch/nn/parallel/distributed.py
--- pytorch-v1.8.1/torch/nn/parallel/distributed.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/nn/parallel/distributed.py 2021-09-26 18:06:09.337599786 +0800
+++ pytorch-develop-181/torch/nn/parallel/distributed.py 2021-09-28 22:05:01.287602793 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -43906,7 +43906,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
output = self.module(*inputs[0], **kwargs[0])
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/serialization.py pytorch-develop-181/torch/serialization.py
--- pytorch-v1.8.1/torch/serialization.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/serialization.py 2021-09-26 18:06:09.345599763 +0800
+++ pytorch-develop-181/torch/serialization.py 2021-09-28 22:05:01.295602836 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -43995,7 +43995,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
See also: `saving-loading-tensors`
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/storage.py pytorch-develop-181/torch/storage.py
--- pytorch-v1.8.1/torch/storage.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/storage.py 2021-09-26 18:06:09.345599763 +0800
+++ pytorch-develop-181/torch/storage.py 2021-09-28 22:05:01.295602836 +0800
@@ -8,6 +8,7 @@
class _StorageBase(object):
_cdata: Any
@@ -44015,7 +44015,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
else:
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/tensor.py pytorch-develop-181/torch/tensor.py
--- pytorch-v1.8.1/torch/tensor.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/tensor.py 2021-09-26 18:06:09.345599763 +0800
+++ pytorch-develop-181/torch/tensor.py 2021-09-28 22:05:01.295602836 +0800
@@ -1,3 +1,18 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -44077,7 +44077,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
def __reversed__(self):
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/_tensor_str.py pytorch-develop-181/torch/_tensor_str.py
--- pytorch-v1.8.1/torch/_tensor_str.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/_tensor_str.py 2021-09-26 18:06:09.285599931 +0800
+++ pytorch-develop-181/torch/_tensor_str.py 2021-09-28 22:05:01.227602466 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -44121,7 +44121,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
# TODO: add an API to map real -> complex dtypes
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/utils/data/dataloader.py pytorch-develop-181/torch/utils/data/dataloader.py
--- pytorch-v1.8.1/torch/utils/data/dataloader.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/utils/data/dataloader.py 2021-09-26 18:06:09.353599741 +0800
+++ pytorch-develop-181/torch/utils/data/dataloader.py 2021-09-28 22:05:01.299602858 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -44182,7 +44182,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
pin_memory_thread.start()
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/utils/data/_utils/pin_memory.py pytorch-develop-181/torch/utils/data/_utils/pin_memory.py
--- pytorch-v1.8.1/torch/utils/data/_utils/pin_memory.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/utils/data/_utils/pin_memory.py 2021-09-26 18:06:05.521610559 +0800
+++ pytorch-develop-181/torch/utils/data/_utils/pin_memory.py 2021-09-28 22:04:54.787567384 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -44228,7 +44228,7 @@ diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=
# logic of this function.
diff -Nur '--exclude=.git*' '--exclude=.jenkins' '--exclude=android' '--exclude=OWNERS' '--exclude=third_party' '--exclude=README*' -Nur pytorch-v1.8.1/torch/_utils.py pytorch-develop-181/torch/_utils.py
--- pytorch-v1.8.1/torch/_utils.py 2021-03-24 10:28:21.000000000 +0800
+++ pytorch-develop-181/torch/_utils.py 2021-09-26 18:06:09.285599931 +0800
+++ pytorch-develop-181/torch/_utils.py 2021-09-28 22:05:01.227602466 +0800
@@ -1,3 +1,19 @@
+# Copyright (c) 2020 Huawei Technologies Co., Ltd
+# Copyright (c) 2019, Facebook CORPORATION.
@@ -15,6 +15,7 @@
// limitations under the License.
#include "ATen/native/npu/utils/OpAdapter.h"
#include "ATen/native/npu/utils/CalcuOpUtil.h"
namespace at {
namespace native {
@@ -34,7 +35,7 @@ Tensor iou_npu(
}
auto outputSize = {gtboxes.size(0), bboxes.size(0)};
Tensor overlap = OpPreparation::ApplyTensor(bboxes, outputSize);
Tensor overlap = OpPreparation::ApplyTensorWithFormat(bboxesFP16, outputSize, CalcuOpUtil::get_tensor_npu_format(bboxes));
string modeStr = "iou";
if (mode == 1) {
modeStr = "iof";
@@ -24,10 +24,12 @@ Tensor& __ilshift___out_npu(
Tensor& result,
Tensor& self,
Scalar other) {
// TODO: The op does not support the inconsistent shape of the two input
Tensor otherBroadcast = at::empty(self.sizes(), self.options()).fill_(other);
OpCommand cmd;
cmd.Name("LeftShift")
.Input(self)
.Input(other,self.scalar_type())
.Input(otherBroadcast)
.Output(result)
.Run();
@@ -38,10 +40,12 @@ Tensor& __ilshift___out_npu(
Tensor& result,
Tensor& self,
const Tensor& other) {
// TODO: The op does not support the inconsistent shape of the two input
Tensor otherBroadcast = other.expand(self.sizes());
OpCommand cmd;
cmd.Name("LeftShift")
.Input(self)
.Input(other)
.Input(otherBroadcast)
.Output(result)
.Run();
@@ -57,6 +57,7 @@ Tensor& max_unpool2d_backward_out_npu(
indicesContiguous = indicesContiguous.reshape({n, c, h * w});
gradInput.resize_as_(self);
gradInput.zero_();
gradInput = gradInput.reshape({n, c, h * w});
const int dim = 2;
gradInput = at::native::gather_out_npu(gradInput, gradOutputContiguous, dim, indicesContiguous);
@@ -62,7 +62,10 @@ def npu_bbox_coder_encode_yolo(bboxes, gt_bboxes, stride):
def npu_bbox_coder_encode_xyxy2xywh(bboxes,
gt_bboxes,
means=[0., 0., 0., 0.],
stds=[1., 1., 1., 1.]):
stds=[1., 1., 1., 1.],
is_normalized=False,
normalized_scale=10000.,
):
""" Applies an NPU based bboxes's format-encode operation from xyxy to xywh.
Following the practice in `R-CNN <https://arxiv.org/abs/1311.2524>`.
@@ -70,11 +73,18 @@ def npu_bbox_coder_encode_xyxy2xywh(bboxes,
Reference implementation link:
https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/coder/delta_xywh_bbox_coder.py#L98
.. note::
Because this interface on the NPU is provided for conventional coordinate values,
if the coordinate values have been regularized,
they need to be restored to the conventional coordinate values.
Args:
bboxes (Tensor): Boxes to be transformed, shape (N, 4). Support dtype: float, half.
gt_bboxes (Tensor): Gt bboxes to be used as base, shape (N, 4). Support dtype: float, half.
means (List[float]): Denormalizing means of target for delta coordinates.
stds (List[float]): Denormalizing standard deviation of target for delta coordinates.
is_normalized (Bool): Whether the value of coordinates has been normalized.
normalized_scale (Float): Sets the normalization scale for restoring coordinates.
Returns:
torch.Tensor: Box transformation deltas
@@ -86,6 +96,10 @@ def npu_bbox_coder_encode_xyxy2xywh(bboxes,
bboxes = box_dtype_check(bboxes)
gt_bboxes = box_dtype_check(gt_bboxes)
if is_normalized:
bboxes = bboxes * normalized_scale
gt_bboxes = gt_bboxes * normalized_scale
bboxes_encoded = torch.npu_bounding_box_encode(
bboxes, gt_bboxes, means[0], means[1], means[2],
means[3], stds[0], stds[1], stds[2], stds[3])
@@ -165,6 +179,7 @@ def _npu_bbox_coder_encode_xyxy2xywh():
gt_bboxes = gt_bboxes.npu()
out = npu_bbox_coder_encode_xyxy2xywh(bboxes, gt_bboxes)
out = npu_bbox_coder_encode_xyxy2xywh(bboxes/512., gt_bboxes/512., is_normalized=True, normalized_scale=512.)
torch.npu.synchronize()
print('_npu_bbox_coder_encode_xyxy2xywh done. output shape is ', out.shape)
@@ -19,7 +19,12 @@ def box_dtype_check(box):
return box.float()
def npu_ptiou(boxes1, boxes2):
def npu_iou(boxes1,
boxes2,
mode="ptiou",
is_normalized=False,
normalized_scale=100.,
):
""" Applies an NPU based IOU operation.
Given two lists of boxes of size N and M,
@@ -27,78 +32,76 @@ def npu_ptiou(boxes1, boxes2):
between __all__ N x M pairs of boxes.
The box order must be (xmin, ymin, xmax, ymax).
Compute Function: insect_area / (union_area + 0.001)
Compute Function:
iou: (insect_area + 0.001) / (union_area + 0.001)
ptiou: insect_area / (union_area + 0.001)
.. note::
This function is commonly used when bbox and anchor match.
Until now, this function has no corresponding backward operator,
so it cannot be used in IOU_Loss.
Since 0.001 is added to the denominator in the calculation formula to avoid dividing by 0,
when the input boxes are normalized data, the component of 0.001 will be too heavy.
At this time, it is necessary to enlarge the input value to avoid excessive influence of 0.001.
Args:
boxes1(N,4),boxes2(M,4): two `Boxes`. Contains N & M boxes, respectively. Support dtype: float, half.
mode (String): Select the calculation mode of iou. Default ptiou.
is_normalized (Bool): Whether the value of coordinates has been normalized. Default False.
normalized_scale (Float): Sets the normalization scale for restoring coordinates. Default 100.
Returns:
Tensor: IoU, sized [N,M].
"""
boxes1 = box_dtype_check(boxes1)
boxes2 = box_dtype_check(boxes2)
out = torch.npu_ptiou(boxes2, boxes1)
return out
def npu_iou(boxes1, boxes2):
""" Applies an NPU based IOU operation.
Given two lists of boxes of size N and M,
compute the IoU (intersection over union)
between __all__ N x M pairs of boxes.
The box order must be (xmin, ymin, xmax, ymax).
Compute Function: (insect_area + 0.001) / (union_area + 0.001)
.. note::
This function is commonly used when bbox and anchor match.
Until now, this function has no corresponding backward operator,
so it cannot be used in IOU_Loss.
Args:
boxes1(N,4),boxes2(M,4): two `Boxes`. Contains N & M boxes, respectively. Support dtype: float, half.
Returns:
Tensor: IoU, sized [N,M].
"""
assert mode in ["iou", "ptiou"]
boxes1 = box_dtype_check(boxes1)
boxes2 = box_dtype_check(boxes2)
out = torch.npu_iou(boxes2, boxes1)
if is_normalized:
boxes1 = boxes1 * normalized_scale
boxes2 = boxes2 * normalized_scale
if mode == "iou":
out = torch.npu_iou(boxes2, boxes1)
elif mode == "ptiou":
out = torch.npu_ptiou(boxes2, boxes1)
return out
npu_ptiou = npu_iou
if __name__ == "__main__":
torch.npu.set_device(0)
boxes1 = torch.FloatTensor([[10,55,85,160]])
boxes2 = torch.FloatTensor([[18,45,80,130], [38,85,70,230]])
boxes1 = boxes1.float().npu()
boxes2 = boxes2.float().npu()
iou1 = npu_iou(boxes1, boxes2)
iou2 = npu_ptiou(boxes1, boxes2)
box1 = torch.FloatTensor([[10, 55, 85, 160]])
box2 = torch.FloatTensor([[18, 45, 80, 130], [38, 85, 70, 230]])
box1 = box1.float().npu()
box2 = box2.float().npu()
iou1 = npu_iou(box1, box2, mode="iou")
iou2 = npu_iou(box1, box2)
print(iou1.shape, iou1.max(), iou1.min())
print(iou2.shape, iou2.max(), iou2.min())
box1 = torch.FloatTensor([[10, 55, 85, 160]])
box2 = torch.FloatTensor([[18, 45, 80, 130], [38, 85, 70, 230]])
box1 = box1.float().npu() / 100.
box2 = box2.float().npu() / 100.
iou1 = npu_iou(box1, box2, mode="iou", is_normalized=True, normalized_scale=100.)
iou2 = npu_iou(box1, box2, is_normalized=True, normalized_scale=100.)
print(iou1.shape, iou1.max(), iou1.min())
print(iou2.shape, iou2.max(), iou2.min())
N = 32
M = 32 * 32
boxes1 = torch.randint(0, 256, size=(N, 4))
boxes2 = torch.randint(0, 256, size=(M, 4))
boxes1 = boxes1.float().npu()
boxes2 = boxes2.float().npu()
iou1 = npu_iou(boxes1, boxes2)
iou2 = npu_ptiou(boxes1, boxes2)
box1 = torch.randint(0, 256, size=(N, 4))
box2 = torch.randint(0, 256, size=(M, 4))
box1 = box1.float().npu()
box2 = box2.float().npu()
iou1 = npu_iou(box1, box2, mode="iou")
iou2 = npu_iou(box1, box2)
print(iou1.shape, iou1.max(), iou1.min())
print(iou2.shape, iou2.max(), iou2.min())
@@ -324,14 +324,14 @@ class TestMax(TestCase):
# ---------------------------------------dim
def test_max_dim_shape_format_fp16_1d(self, device):
format_list = [0, 3, 4, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float16, i, [18]], np.random.randint(0, 1), j] for i in format_list for j in keepdim_list
]
self.max_result_dim(shape_format)
def test_max_dim_shape_format_fp32_1d(self, device):
format_list = [0, 3, 4, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float32, i, [18]], np.random.randint(0, 1), j] for i in format_list for j in
keepdim_list
@@ -387,14 +387,14 @@ class TestMax(TestCase):
self.max_result_dim(shape_format)
def test_max_dim_shape_format_fp16_1d_(self, device):
format_list = [0, 3, 4, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float16, i, [18]], np.random.randint(0, 1), j] for i in format_list for j in keepdim_list
]
self._max_result_dim(shape_format)
def test_max_dim_shape_format_fp32_1d_(self, device):
format_list = [0, 3, 4, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float32, i, [18]], np.random.randint(0, 1), j] for i in format_list for j in
keepdim_list
@@ -329,14 +329,14 @@ class TestMin(TestCase):
# ---------------------------------------dim
def test_min_dim_shape_format_fp16_1d(self, device):
format_list = [0, 3, 4, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float16, i, [18]], np.random.randint(0, 1), j] for i in format_list for j in keepdim_list
]
self.min_result_dim(shape_format)
def test_min_dim_shape_format_fp32_1d(self, device):
format_list = [0, 3, 4, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float32, i, [18]], np.random.randint(0, 1), j] for i in format_list for j in
keepdim_list
@@ -394,14 +394,14 @@ class TestMin(TestCase):
self.min_result_dim(shape_format)
def test_min_dim_shape_format_fp16_1d_(self, device):
format_list = [0, 3, 4, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float16, i, [18]], np.random.randint(0, 1), j] for i in format_list for j in keepdim_list
]
self._min_result_dim(shape_format)
def test_min_dim_shape_format_fp32_1d_(self, device):
format_list = [0, 3, 4, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float32, i, [18]], np.random.randint(0, 1), j] for i in format_list for j in
keepdim_list
@@ -259,7 +259,7 @@ class TestProd(TestCase):
# dim-------------------------------------------------------------
def test_prod_dim_shape_format_fp16_1d(self, device):
format_list = [0, 3, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float16, i, [18]], np.random.randint(0, 1), j] for i in format_list
for j in keepdim_list
@@ -267,7 +267,7 @@ class TestProd(TestCase):
self.prod_dim_result(shape_format)
def test_prod_dim_shape_format_fp32_1d(self, device):
format_list = [0, 3, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float32, i, [18]], np.random.randint(0, 1), j] for i in format_list
for j in keepdim_list
@@ -325,7 +325,7 @@ class TestProd(TestCase):
#prod.int_out
def test_prod_dim_out_shape_format_fp16_1d(self, device):
format_list = [0, 3, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float16, i, [18]], np.random.randint(0, 1), j] for i in format_list
for j in keepdim_list
@@ -333,7 +333,7 @@ class TestProd(TestCase):
self.prod_dim_out_result(shape_format)
def test_prod_dim_out_shape_format_fp32_1d(self, device):
format_list = [0, 3, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float32, i, [18]], np.random.randint(0, 1), j] for i in format_list
for j in keepdim_list
@@ -389,7 +389,7 @@ class TestProd(TestCase):
self.prod_dim_out_result(shape_format)
def test_prod_dim_name_shape_format_fp32_1d(self, device):
format_list = [0, 3, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float32, i, [18], ('N',)], np.random.randint(0, 1), j]
for i in format_list for j in keepdim_list
@@ -421,7 +421,7 @@ class TestProd(TestCase):
self.prod_dim_name_result(shape_format)
def test_prod_dim_name_out_shape_format_fp32_1d(self, device):
format_list = [0, 3, 29]
format_list = [0, 3, 4]
keepdim_list = [True, False]
shape_format = [[[np.float32, i, [18], ('N',)], np.random.randint(0, 1), j]
for i in format_list for j in keepdim_list