[XPU] support unified ckpt function#9312
Merged
Merged
Conversation
|
Thanks for your contribution! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #9312 +/- ##
===========================================
+ Coverage 52.80% 52.92% +0.11%
===========================================
Files 660 660
Lines 106869 106875 +6
===========================================
+ Hits 56434 56564 +130
+ Misses 50435 50311 -124 ☔ View full report in Codecov by Sentry. |
DesmonDay
reviewed
Oct 24, 2024
| if paddle.is_compiled_with_xpu(): | ||
| # XPU does not support all_reduce prod now, in XPU, bool is treated as int8, | ||
| # so temporarily use reduce_min instead | ||
| dist.all_reduce(local_resume, op=dist.ReduceOp.MIN) |
Contributor
There was a problem hiding this comment.
那就统一改成dist.all_reduce(local_resume, op=dist.ReduceOp.MIN)吧,不需要特地区分XPU和GPU
DesmonDay
reviewed
Oct 24, 2024
| if paddle.is_compiled_with_xpu(): | ||
| # XPU does not support all_reduce prod now, in XPU, bool is treated as int8, | ||
| # so temporarily use reduce_min instead | ||
| dist.all_reduce(local_resume, op=dist.ReduceOp.MIN) |
ZHUI
reviewed
Oct 25, 2024
| if not len(checkpoint_rng_state["cuda"]) == core.get_xpu_device_count(): | ||
| raise ValueError("Length of xpu state list shoule be equal to the xpu device count") | ||
| for i in range(core.get_xpu_device_count()): | ||
| core.default_xpu_generator(i).set_state(checkpoint_rng_state["cuda"][i]) |
Contributor
There was a problem hiding this comment.
这里 xpu 很下面 custom device 处理会有不同吗?更适合框架测修改吧。
Contributor
Author
There was a problem hiding this comment.
在框架侧的device上XPU和GPU、CPU是同一级别的,custom device(如海光、昇腾等)是放在一起的
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR types
Function optimization
PR changes
Others
Description
Support unified ckpt function on XPU