optimize performance of offload in dygraph sharding stage2 #38064
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
Performance optimization
PR changes
Others
Describe
optimize performance of offload in dygraph sharding stage2
After performance optimization:
1、precision:(PaddleNLP GPT-3 model)
sharding stage2+fp16+gradients accumulation(with offload versus without offload)
2、performance:(PaddleNLP GPT-3 model)
hidden size=1024,layer_num=4,global batch size=16,micro batch size=2,sharding_degree=2
before optimization -- speed: 0.23-0.24 step/s ;ips: 3700-3800 tokens/s
after optimization -- speed: 0.58-0.60 step/s ;ips: 9500-9800 tokens/s
3、peek gpu memory: (PaddleNLP GPT-3 model)
0.31B parameters -- 3137 MiB(no difference made by performance optimization)
1.02B parameters -- 5369 MiB(no difference made by performance optimization)