feat: Discard weight when finish generation in the main loop#2495
Conversation
|
/ok to test 5efbbf4 |
|
/ok to test 8253a2a |
Signed-off-by: Guyue Huang <guyueh@login-lyris01.lyris.clusters.nvidia.com>
8253a2a to
6760d81
Compare
|
/ok to test 6760d81 |
|
/ok to test 6760d81 |
|
/claude review |
|
/ok to test 8d80498 |
|
/claude review |
|
CI is green, @terrykong please take a look; @youngeunkwon0405 please approve again |
@terrykong I don't like the implementation in 2523 because it makes a knob visible to user but that knob involves system knowledge and should have been managed by the framework. Also 2523 is kind of wrong because it sets all the sleep to 2, but in grpo.py the calls of |
Signed-off-by: Guyue Huang <guyueh@login-lyris01.lyris.clusters.nvidia.com> Signed-off-by: Guyue Huang <guyueh@nvidia.com> Co-authored-by: Guyue Huang <guyueh@login-lyris01.lyris.clusters.nvidia.com>
#2658) Signed-off-by: Terry Kong <terryk@nvidia.com>
…A-NeMo#2495) (NVIDIA-NeMo#2658) Signed-off-by: Terry Kong <terryk@nvidia.com>
What does this PR do ?
A feature to reduce CPU memory footprint, which allows us to use pinned memory for opt offload in GB systems and helps perf then.
Currently the CPU memory peak happens at the end of finish_generation, which is
inference weights + training weights + training optimizer; with this change we will reduce it totraining weights + training optimizer.With this change, I was able to use TP8 instead of TP16 for inference in DeepSeek V3 GRPO and got ~20% E2E speedup (>30% generation speedup)
Issues
List issues that this PR closes (syntax):
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information