PaddlePaddle 2.2.2 is a maintenance release focused on refining the training framework and enhancing inference capabilities. The update addresses several performance bottlenecks and functional regressions introduced in the previous version, while adding support for new activation functions and expanding TensorRT integration.
Training Framework Updates
The release introduces several new APIs and enhancements to existing operations:
- Mish Activation: The framework now includes
paddle.nn.Mishandpaddle.nn.functional.mishto support the Mish activation function, which is defined asx * tanh(softplus(x)). - PReLU Enhancements: The
PReLUclass and its functional variants now accept adata_formatparameter to specify the input data layout. - Float16 Support: The
paddle.index_selectoperation has been updated to supportfloat16data types. - Quantization Improvements: The
PostTrainingQuantizationclass now accepts adata_loaderparameter, allowing users to passpaddle.io.DataLoaderobjects or Python generators.
Bug Fixes and Stability
A significant portion of the release notes is dedicated to resolving stability issues across the training pipeline:
- Core Operations: Fixes were applied to
paddle.maxandpaddle.minto correct incorrect results on CPU when theaxisparameter is a list type. Memory leaks associated with tensor index assignment have also been addressed. Dynamic-to-Static Graph:The conversion process has been refined to handle initialization APIs, code comments, and loops (e.g.,for ... zip ...) more accurately.- Quantization: Issues with redundant nodes in quantized dynamic graph models and compatibility problems with Paddle Lite have been resolved.
Paddle Inference Enhancements
For deployment scenarios, the update focuses on backend optimization and bug correction:
- TensorRT Expansion: The TensorRT subgraph engine now supports a wider range of operators, including
relu,gelu,swish,prelu, andmish. This allows for more efficient inference on NVIDIA hardware. - API Improvements: The C API has been updated to handle
std::stringtypes. Additionally, theCreatePredictorinterface is now safe for use in multi-threaded environments. - Model-Specific Fixes: Bugs causing hangs in the ERNIE model on TensorRT 8 and incompatibilities with the
roi_alignoperator have been patched.