You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
pcard-84677
model will run error and core dump when meets 2 conditions:
classLarge_model(...... #sub-class of paddle.nn.Layer):def__init__(
self,
......
):
super().__init__()
......
self.layers=nn.LayerList()
foriinrange(num_layers):
# condition 1 : use auto parallel shard parameters, e.g. shard parameters in TransformerBlockself.layers.append(TransformerBlock(......))
defforward(self, x, label):
......
fori, layerinenumerate(self.layers):
# condition 2 : use recompute and set use_reentrant=Falsex=paddle.distributed.fleet.utils.recompute(layer, x, use_reentrant=False)
......
returnlossmodel=Large_model(......)
forstep, inputsinenumerate(dataloader):
# inputs contain data and labelloss=model(inputs)
loss.backward() # error and core dump, this PR will fix this issue
你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册。
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.
jeff41404
changed the title
fix model run error when auto parallel and recompute(use_reentrant=false)
fix model run error when use auto parallel and recompute(use_reentrant=false)
Jun 17, 2024
…t=false) (PaddlePaddle#65188)
* fix model run error when auto parallel and recompute and use_reentrant=false
* solve the defect of TensorWrapper not considering DistTensor
* add unittest
* fix recompute have not support cpu when use_reentrant is false
co63oc
pushed a commit
to co63oc/Paddle
that referenced
this pull request
Jun 25, 2024
…t=false) (PaddlePaddle#65188)
* fix model run error when auto parallel and recompute and use_reentrant=false
* solve the defect of TensorWrapper not considering DistTensor
* add unittest
* fix recompute have not support cpu when use_reentrant is false
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 Category
Auto Parallel
PR Types
Bug fixes
Description
pcard-84677
model will run error and core dump when meets 2 conditions: