Distributed Automatic SParsity with Fleet#33558
Merged
Xreki merged 25 commits intoPaddlePaddle:developfrom Jul 8, 2021
Merged
Conversation
1. Added sparse mask generating functions, including 1D and 2Ds. 2. Added sparse pattern checking functions, including 1D and 2Ds.
1. Added model pruning functions. 2. Added optimizer decorator and sparse minimization functions.
… automatic_sparsity_utils
1. Added model pruning functions. 2. Added optimizer decorator and sparse minimization functions.
1. Added ASPOptimizer into Fleet metaoptimizer. 2. Added asp attribute into Fleet DistributedStrategy. 3. Added related test cases.
… automatic_sparsity_with_fleet
|
Thanks for your contribution! |
Contributor
|
@mingxu1067 Do you have plan to support dygraph and inference? |
Collaborator
Author
We do not have determined plan on DyGraph supporting so far. |
Xreki
reviewed
Jun 18, 2021
| place = fluid.CUDAPlace(0) | ||
|
|
||
|
|
||
|
|
Collaborator
Author
There was a problem hiding this comment.
Ok, 分散式那邊有沒有甚麼comment? 我一起修改後再commit一次
| optimizer = fluid.contrib.mixed_precision.decorator.decorate(optimizer ) | ||
| # Calling sparsity.decorate() to wrap minimize() in optimizer, which | ||
| # will insert necessary masking operations for ASP workflow. | ||
| optimizer = sparsity.decorate(optimizer ) |
Contributor
There was a problem hiding this comment.
现在是amp和asp一起用有问题?那这个示例里面先不要加amp吧?
Collaborator
Author
There was a problem hiding this comment.
ASP與AMP一起使用沒有問題,有成功使用PaddleNLP/bert的AMP + ASP做過sparse finetuning
|
Sorry to inform you that b6f90d4's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
sandyhouse
reviewed
Jul 5, 2021
|
|
||
| return False | ||
|
|
||
| def _disable_strategy(self, dist_strategy): |
| return | ||
|
|
||
| def _enable_strategy(self, dist_strategy, context): | ||
| return |
1. Added enable/disable policy controlling in asp_optimizer. 2. Changed unittests.
Xreki
approved these changes
Jul 8, 2021
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
New featuresPR changes
APIs
Describe
Code example: