2.2.2 Release Note
1. 重要更新
我们很高兴的发布飞桨框架2.2.2版本,主要是对2.2.1中一些功能和性能问题的修复,并对部分功能点做了增强。
2. 训练框架(含分布式)
(1)新功能
API
- 新增
paddle.nn.Mish
和paddle.nn.functional.mish
,支持逐元素计算mish激活函数。 (#38803)
其他
paddle.nn.PReLU
、paddle.nn.functional.prelu
、paddle.nn.static.prelu
新增支持data_format
参数,可以设置输入的数据类型。 (#38495)paddle.index_select
新增支持float16
数据类型。(#38751)- 优化
paddle.multiplex
当inputs
中张量size
为 0 时的报错信息。(#38757) paddle.fluid.contrib.slim.quantization.PostTrainingQuantization
新增初始化参数data_loader
,支持传入paddle.io.DataLoader
对象或者Python Generator
。(#38729)
(2)问题修复
API
- 修复
paddle.max
在输入x.ndim > 6 and axis < 0
时运行出错的问题。(#38070) - 修复
paddle.max
、paddle.min
的bug:在CPU设备上,当参数axis是list类型且len(axis) == x.ndim and axis[i] < 0
时,结果出错。(#38478) - 修复
paddle.nn.functional.unfold
在InferShape计算时不区分compile time和runtime的问题。(#38925) - 修复
paddle.nn.functional.cross_entropy
在对labels
进行检查时,存在不必要的GPU与CPU同步的问题。(#38849) - 修复
paddle.distributed.split
在沿列切分FC时,反向计算时得到的输入梯度结果异常的问题。(#38724) - 修复
paddle.nn.Layer.to
不支持paddle.dtype
类型的问题。(#38108) - 修复静态图下
paddle.linalg.svd
当full_matrics=True
时,输出tensor的shape在动态图和静态图下不同的问题。(#37744) - 修复
Tensor
切片索引使用多个None
类型索引时结果维度异常的问题。(#37400) - 修复
Tensor
索引赋值在部分场景下显存泄露的问题。(#38098) - 修复模型使用
save_inference_model
导出后,添加反向 pass 做训练,conv2d
缺失属性报错的问题。 (#38832)
IR(Intermediate Representation)
-
动态图转静态图
-
模型量化
其他
-
自定义OP
-
动态图Inplace策略
-
NHWC 策略
- 修复 batchnorm_op 中,当数据类型为 FP32 ,且数据维度 dims = 2,data_layout = NHWC 时,反向 Op 内中间变量未定义问题。 (#37020)
3. 部署方向(Paddle Inference)
(1)功能优化
框架及API更新
- C API支持对c++ std::string的处理。(#38667)
后端能力增强
- GPU 及 TensorRT 子图引擎相关更新
(2)问题修复
框架及API修复
-
算子修复
-
框架功能修复
后端能力修复
-
TensorRT 子图引擎修复
- 修复pool2d在某些参数组合的情况下运行TensorRT出错的问题。(#37929)
-
MKLDNN引擎修复
- 修复 matmul_v2 的 mkldnn kernel 不支持两个输入的shape长度不同的问题。 (#38733)
其他修复
- 修复ERNIE模型在TRT8下可能出现的hang死问题。(#37839)
2.2.2 Release Note
1. Important Updates
This version fixed some function and performance issues of PaddlePaddle 2.2.1 and optimized some functions.
2. Training Framework (distributed included)
(1)New functions
API
- Add the
paddle.nn.Mish
andpaddle.nn.functional.mish
which support the element-by-element calculation of the mish activation function. (#38803)
Others
- The
paddle.nn.PReLU
,paddle.nn.functional.prelu
, andpaddle.nn.static.prelu
newly support thedata_format
parameter. You can set input data type. (#38495) - The
paddle.index_select
supportsfloat16
data type. (#38751) - Optimize error message of
paddle.multiplex
when tensorsize
ininputs
is 0. (#38757) - Add initialization parameter
data_loader
forpaddle.fluid.contrib.slim.quantization.PostTrainingQuantization
, and support input of thepaddle.io.DataLoader
object or Python Generator. (#38729)
(2)Bug Fixes
API
- Fix operation error of
paddle.max
in input ofx.ndim > 6 and axis < 0
. (#38070) - Fix bug of
paddle.max
andpaddle.min
: Result is incorrect on the CPU device when the parameter axis is the list type andlen(axis) == x.ndim and axis[i] < 0
. (#38478) - Fix bug that
paddle.nn.functional.unfold
does not distinguish between compile time and runtime in InferShape calculation. (#38925) (#38834) - Fix bug where GPU unnecessarily synchronizes with the CPU when
paddle.nn.functional.cross_entropy
checkslabels
. (#38849) - Fix bug of input gradient result error in backward computing when
paddle.distributed.split
slices the FC along columns. (#38724) - Fix bug where
paddle.nn.Layer.to
does not supportpaddle.dtype
type. (#38108) - Fix bug that output tensor's shape is different between dynamic and static graphs when
full_matrics=True
inpaddle.linalg.svd
under static graphs. (#37744) - Fix bug of the result dimension exception when the
Tensor
slice index uses multiple None type indexes. (#37400) - Fix memory leak bug of
Tensor
index assignment in some scenarios. (#38098) - Fix bug of
conv2d
reporting an error with missing attributes after model is exported usingsave_inference_model
and backward pass is added for training. (#38832)
IR(Intermediate Representation)
-
Dynamic Graph to Static Graph
- Fix bug of inconsistency between dynamic and static behaviors of some initialization-related APIs. (#37827)
- Fix bug where
paddle
will be used as a variable when dynamic to static code is transcribed. (#37999) - Fix bug that highlighted code comments lead to an error report when dynamic to static code is transcribed. (#38003)
- Fix endless loop of
for … zip …
statement in dynamic to static graph. (#37846)
-
Model quantization
- Fix problem of redundant nodes in model derived from quantitative training of dynamic graph. (#38122) (#38025)
- To solve the problem that the quantitative model cannot be predicted on Paddle Lite, remove
clip_extra
settings of quantitative export models. (#38343) - Fix
flatten_contiguous_range
quantization settings forflatten_contiguous_range
operator output configuration error in quantization. (#37741)
Others
-
Custom OP
-
Dynamic graph inplace strategy
-
NHWC strategy
- Fix bug of undefined intermediate variables in backward Op in batchnorm_op when data type is FP32, with dims = 2 and data_layout = NHWC. (#37020)
3. Paddle Inference
(1)Function Optimization
Framework and API updates
- C API supports processing of c++ std::string. (#38667)
Back-end capability enhancement
- GPU and TensorRT subgraph engine related updates
- Support invoke of TensorRT inference for relu, relu6, tanh, sigmoid, pool2d, concat, batch_norm, split, gelu, scale, swish, prelu, clip, reduce_sum, and reduce_mean operators in the static shape and 2-dimensional input. (#37773)
- Support invoke of TensorRT inference by mish activation function. (#38866)
(2)Bug Fixes
Framework and API fixing
-
Operator fixing
-
Framework function fixing
- Fix bug of model clipping logic in dynamic-to-static graphs, so operators containing subblock are clipped correctly in dynamic-to-static graphs. (#37579)
- Fix error reporting issue of CreatePredictor interface under multiple threads. Current CreatePredictor interface allows calling in multiple threads without causing inference exceptions. (#37894)
- Support “params file” to pass empty strings for models without weights in config. (#38579)
- Fix problem of not copying GPU data when Paddle-TRT engine directly inputs CPU tensor. (#37427)
Back-end capability fixing
-
TensorRT subgraph engine fixing
- Fix the bug of an error that occurred in the running of TensorRT by pool2d with some of the parameters. (#37929)
-
MKLDNN engine fixing
- Fix the problem that mkldnn kernel of matmul_v2 does not support different lengths of two input shapes. (#38733)
Others
- Fix the possible hang bug of ERNIE model under TRT8. (#37839)