MyGit

v2.2.0

PaddlePaddle/Paddle

版本发布时间: 2021-11-10 17:45:49

PaddlePaddle/Paddle最新发布版本:v3.0.0-beta0(2024-06-27 18:00:34)

English Version

1. 重要更新

我们很高兴的发布飞桨框架2.2.0版本,本版本包含如下重要更新。

API

IR(Intermediate Representation)

分布式

推理部署

2. 不兼容升级

2.1 2.2
>>> import paddle
>>> from paddle.autograd import *
>>> x = paddle.ones(shape=[1], dtype='float32')
>>> x.stop_gradient = False
>>> y = x*x
>>> grad(outputs=[y], inputs=[x])
[Tensor(shape=[1], dtype=float32, place=CUDAPlace(0), stop_gradient=True,
        [2.])]
>>> import paddle
>>> from paddle.autograd import *
>>> x = paddle.ones(shape=[1], dtype='float32')
>>> x.stop_gradient = False
>>> y = x*x
>>> grad(outputs=[y], inputs=[x])
NameError: name 'grad' is not defined
>>> paddle.grad(outputs=[y], inputs=[x]) # 改用paddle.grad API
[Tensor(shape=[1], dtype=float32, place=CUDAPlace(0), stop_gradient=True,
       [2.])]
2.1 2.2
>>> import paddle
>>> x = paddle.to_tensor([1, 2, 3, 4])
>>> start = paddle.zeros([1])
>>> stop = paddle.zeros([1]) + 2
>>> step = paddle.ones([1])
>>> x[start:stop:step] = 0 # start,stop,step 支持float类型Tensor
>>> x 
>>> import paddle
>>> x = paddle.to_tensor([1, 2, 3, 4])
>>> start = paddle.zeros([1])
>>> stop = paddle.zeros([1]) + 2
>>> step = paddle.ones([1])
>>> x[start:stop:step] = 0
ValueError: (InvalidArgument) Currently, the type of tensor in slice indices only allows int32 and int64, please check the type of index tensor.

>>> # 须改为如下代码:
>>> start = paddle.zeros([1], dtype='int32')
>>> stop = paddle.zeros([1], dtype='int32') + 2
>>> step = paddle.ones([1], dtype='int32')
>>> x[start:stop:step] = 0 # start,stop,step 必须为integer类型Tensor
>>> x
Tensor(shape=[4], dtype=int64, place=CUDAPlace(0), stop_gradient=True,
       [0, 0, 3, 4])
2.1 2.2
>>> import paddle
>>> class MyLayer(paddle.nn.Layer):
...     def __init__(self):
...         super(MyLayer, self).__init__()
...         self.weight = self.create_parameter(...)
...         self.weight[index] = 1.0
...
>>> import paddle
class MyLayer(paddle.nn.Layer):
...     def __init__(self):
...         super(MyLayer, self).__init__()
...         self.weight = self.create_parameter(...)
...         with paddle.no_grad(): # 关闭梯度计算后可进行赋值
...             self.weight[index] = 1.0
2.1 2.2
>>> import paddle
>>> import numpy as np
>>> np_arr = np.ones((2, 3), dtype='bool')
>>> pd_arr = paddle.to_tensor(np_arr)
>>> pd_sum = pd_arr.sum(0)
>>> pd_sum.dtype
paddle.bool
>>> import paddle
>>> import numpy as np
>>> np_arr = np.ones((2, 3), dtype='bool')
>>> pd_arr = paddle.to_tensor(np_arr)
>>> pd_sum = pd_arr.sum(0)
>>> pd_sum.dtype
paddle.int64
2.1 2.2
>>> import paddle
>>> x = paddle.rand([2,3])
>>> x.stop_gradient = False
>>> y = paddle.to_tensor(x)
>>> print(id(x) == id(y)) # True
>>> print(x.stop_gradient, y.stop_gradient) # True True
>>> import paddle
>>> x = paddle.rand([2,3])
>>> x.stop_gradient = False
>>> y = paddle.to_tensor(x)
>>> print(id(x) == id(y)) # False
>>> print(x.stop_gradient, y.stop_gradient) # False True

3. 训练框架(含分布式)

(1)新功能

API

IR(Intermediate Representation)

混合精度训练

分布式训练

其他

(2)功能优化

API

IR(Intermediate Representation)

分布式训练

其他

(3)性能优化

分布式训练-静态图混合并行

算子优化

策略优化

(4)问题修复

API

IR(Intermediate Representation)

分布式训练

其他

4. 部署方向(Paddle Inference)

(1)新增功能

后端能力增强

(2)功能优化

框架及API更新

后端能力增强

(3)问题修复

框架及API修复

后端能力修复

其他修复

环境适配

编译安装

新硬件适配

Thanks to our Contributors

This release contains contributions from:

0x45f, 123malin, Adam Osewski, Aganlengzi, Aurelius84, Baibaifan, Bo Liu, CheQiXiao, Chen Long, Chen Weihang, CtfGo, Double_V, Ethanzjp, Fan Zhang, Feiyu Chan, Feng Xing, From00, GT-Zhang, Guanghua Yu, Guoxia Wang, Haipeng Wang, Hao Lin, Haohongxiang, Hui Zhang, Huihuang Zheng, HydrogenSulfate, IMMORTAL, JYChen, JZ-LIANG, Jacek Czaja, Jack Zhou, Jackwaterveg, Jeng Bai-Cheng, Jiangxinz, Jiaqi Liu, Jiawei Wang, JingZhuangzhuang, June Weng, Kaipeng Deng, Kqnonrime, LJQ❤️, Leo Chen, Li Min, LielinJiang, Lijunhui, Linjie Chen, Liu-xiandong, LiuWei, Ming-Xu Huang, MissPenguin, PaddlePM, Pei Yang, Peihan, Qi Li, QingshuChen, Ren Wei (任卫), Roc, Shang Zhizhou, ShenLiang, Shibo Tao, Siming Dai, Sing_chan, TCChenLong, TTerror, TeslaZhao, Thomas Young, Thunderbrook, Tongxin Bai, WJJ1995, WangXi, Wangzheee, Wei Shengyu, WeiXin, Weilong Wu, Wenyu, Wilber, XGZhang, XYZ, XYZ916829, XiangGao, Xiaoxu Chen, YUNSHEN XIE, Yanxing Shi, Yiqun Liu, YuanRisheng, Yuang Liu, Yulong Ao, Zeng Jinle, Zhang Ting, Zhang Zheng, Zhanlue Yang, Zhen Wang, Zhong Hui, Zhou Wei, andreazanetti, andyjpaddle, arlesniak, baoachun, cc, ceci3, chajchaj, chenenquan, chenjian, chentianyu03, crystal, cuicheng01, danleifeng, denglin-github, duanboqiang, dyning, feng626, feng_shuai, furnace, gongweibao, heliqi, hlygit66666, hong, hong19860320, houj04, huangjun12, huangxu96, huzhiqiang, iducn, jakpiase, jiangcheng, joanna.wozna.intel, jzhang533, kuizhiqing, levi131, lidanqing, lilong12, limingshu, littletomatodonkey, liu zhengxi, liutiexing, liuyuhui, liym27, lyuwenyu, lzzyzlbb, niuliling123, pangyoki, parap1uie-s, ronnywang, root, seemingwang, shangliang Xu, shiyutang, smallv0221, sunli, sunzhongkai588, taixiurong, tangwei12, tianshuo78520a, veyron95, wangguanqun, wangguanzhong, wanghuancoder, wangna11BD, wangxinxin08, wangzhen38, wangzhuang01, wawltor, wenbin, whs, will-jl944, wuhuachaocoding, wuhuanzhou, xiaoting, xiaoxiaohehe001, xiayanming, xiegegege, xiemoyuan, xiongkun, yaoxuefeng, yeliang2258, yingyibiao, zhangbo9674, zhangchunle, zhangkaihuo, zhaoyingli, zhiboniu, zhoujun, zhouzj, zhulei, zhupengyang, zlsh80826, zmx, zyfncg, 李季, 津, 王明冬, 石晓伟

相关地址:原始地址 下载(tar) 下载(zip)

查看:2021-11-10发行的版本