Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump paddlepaddle from 2.1.1 to 2.6.0 in /transformer_courses/Transformer_Punctuation_Restoration #927

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Mar 7, 2024

Bumps paddlepaddle from 2.1.1 to 2.6.0.

Release notes

Sourced from paddlepaddle's releases.

PaddlePaddle 2.6.0 Release Note

1. 重要更新

  • 新一代中间表示 PIR:为了进一步提升飞桨框架的可扩展性,研制了新一代中间表示 PIR(Paddle Intermediate Representation)。实现系统性的抽象飞桨框架底层核心概念,如:Operation、Attribute 和 Type 等,为开发者提供了灵活、高效的基础组件。通过引入 Dialect 机制,可以全面、分层次地满足各模块对中间表示的需求,从而极大地提升了框架的扩展性。PIR 严格遵循 SSA(Static Single Assignment)原则,在实现了顶层结构的统一的同时,还确保了“算子顺序性”与“计算图语义”的和谐共存。此外,PIR 提供了更为简洁、低成本的 Pass 开发流程,内置了一系列丰富且功能完备的 Pass 优化策略,为大型模型的极致性能优化提供了技术支撑。
  • 动转静编译优化架构:为了进一步提升框架的模型开发性能,飞桨动转静训练能力全面升级,支持自适应的图构建能力,在 700 多个飞桨产业级模型上验证,一键动转静训练成功率达到 100%。同时,飞桨框架的神经网络编译器 CINN 整合入飞桨主 Repo,使得编译器与飞桨更加融为一体。CINN 完成了架构的梳理和扩展能力的完善,提升系统稳定性。基于 PIR 完成动转静、组合算子、执行器和编译器的紧密联动,为飞桨框架整体性能的提升提供了更大的空间。
  • 增强动态图分布式能力:大模型对框架的分布式训练性能提出了更高的需求。飞桨在通信库、图分析、分布式策略和任务启停等维度进行了全面优化,增强了飞桨动态图的分布式计算能力,为大型模型高效训练提供了支持。在性能方面,通过减少流水线 GPU 显存占用、采用 TensorFusion 技术、实现通信计算 overlap 以及减少非必要的数据同步拷贝等方式,进一步提升了训练性能。同时,通过环境变量控制 Optimizer 等方式提高了混合并行调试的灵活性。此外,通过相关 Bug 的修复,显著提升了系统的稳定性。
  • 动静统一自动并行架构:为了进一步降低大模型编程和优化难度,飞桨对动静统一的半自动并行(Auto Parallel)编程范式进行了全面的优化,简化了开发者的编程复杂度。开发者无需深入了解手动并行编程范式下的复杂概念和 API 接口,如行切分、列切分等,仅需通过少量的张量切分标注即可完成混合并行模型的构建,框架便能够自动推导出所有张量和算子的分布式切分状态,并添加合适的通信算子。同时支持一键动转静进行分布式训练,使开发者能够高效地实现任意混合并行策略,大幅简化了混合并行训练代码的开发过程。
  • 硬件适配方案(CustomDevice):大模型场景下新硬件并行训练需求增加,飞桨新增了对分布式高级策略、自定义算子和自定义融合策略的支持。升级了分布式通信库,新增了对 MP、GroupShared、PP、SP 和 MOE 等多项高级分布式策略的支持。同时,支持厂商灵活接入不同颗粒度的 Transformer 算子库并通过融合 Pass 修改计算图进行性能加速。
  • 安装和开发体验:采用模块化编译的方式优化了 CMake 代码的逻辑,提升了飞桨全量编译和增量编译的效率,提升了 RD 开发效率,同时支持了 Python3.12,CUDA12,Hopper 架构编译,并引入 Clang 等工具全面优化了代码格式。此外,将 C++单测从链接静态库的方式转变为链接动态库,减小编译体积。这些改进措施为用户提供更加流畅、高效的安装和开发体验。

2. 不兼容升级

  • 为了避免误用,去除了 0 维 Tensor 兼容态开关,实现 API 行为和业界主流习惯一致。在上一个版本中,我们已经支持 0 维 Tensor,但是考虑到尽量避免部分模型的报错,添加了兼容态开关。即在一些模型套件使用较多且没有修改完成的场景中还是默认使用只有 1 个元素的 1 维 Tensor 来替代 0 维 Tensor。这个版本去除了兼容态开关,在任何场景中都不会再使用只有 1 个元素的 1 维 Tensor 来替代 0 维 Tensor,应该支持 0 维 Tensor 的 376 个 API 的行为都完成了修正和统一,彻底完成对 0 维 Tensor 的支持。#57036, #54581, #54500
  • 为了提升 API 易用性,将 paddle.nn.functional.diag_embed 精简为 paddle.diag_embed,并支持 Tensor.diag_embed 方式使用。 #58223
  • 为了解决在静态图下 Tensor 索引写(如 tensor[0] = 10)导致的微分计算错误问题,并符合静态图的规范,本版本引入了 paddle.static.setitem API。在静态图环境中,更推荐使用此 API 来支持 tensor 的索引写操作,而非下标运算符。这一变化并不影响动态图环境,其中仍允许使用下标运算符进行索引写操作。#53682
  • 本版本中 paddle.fluid API 全面退出历史舞台。在本次更新中,我们彻底移除了所有 paddle.fluid API,并删除了 fluid 目录。同时,飞桨底层的少量公共组件已被整合至 paddle.base 目录中。使得飞桨用户无需再关注 fluid 相关概念和接口,进一步简化了飞桨 API 体系,提升可读性。#56576, #54424, #54829, #53992, #54806, #55754, #55986, #55345, #56099, #51717, #54152, #55522, #55757, #58521, #54936, #55007, #55661, #55970

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

Python API

升级 Tensor 索引机制

本版本全面优化了 Tensor 的基础索引、高级索引以及联合索引功能,以更好地符合业界标准与用户习惯。具体包括:在基础索引中增加了对 view 的支持,修正了高级索引中的一些错误行为,并实现了联合索引的读取功能。此外,我们还将索引解析下沉到 C++层面,改进了高级索引算子的性能,并移除了 bool 索引中的冗余计算。通过这些优化措施,Tensor 的基础索引、高级索引和联合索引性能得到了全面提升。#56893, #58643, #57986, #56272, #58856, #55211, #57023, #56613, #55602, #59281, #57737

升级 Inplace 机制

在之前的版本中,为了确保反向微分计算的正确性,当某个 API 的反向计算依赖于其前向输入数据时,飞桨会避免使用 Inplace 操作方式,因为这种方法可能会覆盖原始输入数据。虽然这种机制简化了实现过程,但也限制了许多 API 实现 Inplace 功能,从而影响了用户体验。 在本版本中,飞桨对 Inplace 机制进行了全面升级。实现自动检测反向计算对前向输入的依赖关系,并在需要时保存这些输入数据,从而支持更多的 Inplace 操作。这一改进不仅提升了内存使用效率,还增强了 API 的功能性。 此外,我们新增了 109 个支持 Inplace 操作的 API,包括 paddle.abs_、paddle.sin_/cos_/tan_、比较操作如 paddle.greater_than_/less_than_/equal_、逻辑操作如 paddle.logical_and_/logical_or_/logical_not_,以及 paddle.neg_和 paddle.log_等。在丰富飞桨的功能集同时,提升了用户在数值计算和深度学习任务中的效率与便捷性。#54683, #55078, #55576, #56888, #55509, #57093

其他新增 API

  • 新增 paddle.nn.functional.scaled_dot_product_attention,显著提升大模型中注意力(attention)机制的计算效率,更好地满足大规模深度学习模型对高性能计算的需求。。#55242
  • 新增了一系列科学计算相关 API,包括 paddle.cummax 和 paddle.cummin 用于累积最大值和最小值的计算,paddle.index_fill 和 paddle.masked_fill 用于按索引或掩码填充张量,paddle.linalg.pca_lowrank 用于低秩主成分分析,paddle.hypot 用于计算直角三角形的斜边长,以及 paddle.atleast_1d、paddle.atleast_2d 和 paddle.atleast_3d 用于确保张量至少有一维、二维或三维。同时,我们还提供了 paddle.select_scatter 和 paddle.diagonal_scatter 用于更灵活地选择和散列张量数据,以及 paddle.multigammaln 用于计算多伽马函数的自然对数。此外,本版本新增优化器相关 API,包括:paddle.optimizer.lr.LinearLR 和 paddle.optimizer.lr.CosineAnnealingWarmRestarts 学习率调度策略;引入了 paddle.io.SubsetRandomSampler 以支持从数据子集中进行随机采样。这些新增 API 将进一步提升飞桨在各类应用场景中的灵活性和高效性。。 #57416, #53546, #53743, #57295, #57726, #58764, #58323, #57720, #58209, #58214, #57792, #51395, #57724, #57355, #57744, #58244, #57599, #59343, #57879

新一代中间表示(PIR)

PIR(Paddle Intermediate Representation)对底层的核心概念如 Operation、Attribute 和 Type 等进行了系统性的抽象,为开发者构建了一套灵活且强大的基础组件。此外,通过引入 Dialect 这一概念,飞桨框架能够全面且分层次地管理各模块对中间表示(IR)的需求,并支持开发者根据特定需求定制化扩展 Dialect,从而显著提升了框架的扩展性和适应性。在设计上,PIR 严格遵循 SSA(Static Single Assignment)原则,统一了顶层结构,实现了“算子顺序性”与“计算图语义”的兼容表示,为复杂的计算流程提供了清晰且一致的视图。为了进一步优化大模型的性能,PIR 还提供了一套更加简洁、低成本的 Pass 开发流程,包括 DRR(Declarative Rewrite Rule)和模式重写器(Pattern Rewriter)。同时,内置了一系列丰富且功能完备的 Pass 优化策略,这些策略能够针对大模型的特点进行深度优化,从而为大模型的极致性能提供了强有力支撑。通过这些创新设计和优化手段,PIR 为飞桨框架的高效运行和持续扩展奠定了坚实基础。

新功能

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the Security Alerts page.

Bumps [paddlepaddle](https://github.com/paddlepaddle/paddle) from 2.1.1 to 2.6.0.
- [Release notes](https://github.com/paddlepaddle/paddle/releases)
- [Changelog](https://github.com/PaddlePaddle/Paddle/blob/develop/RELEASE.md)
- [Commits](PaddlePaddle/Paddle@v2.1.1...v2.6.0)

---
updated-dependencies:
- dependency-name: paddlepaddle
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Mar 7, 2024
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant