Skip to content

Fix residual GPU memory usage in TrainingWorker in RL workflow#1944

Open
hhaAndroid wants to merge 8 commits into
InternLM:mainfrom
hhaAndroid:fix_act_offload
Open

Fix residual GPU memory usage in TrainingWorker in RL workflow#1944
hhaAndroid wants to merge 8 commits into
InternLM:mainfrom
hhaAndroid:fix_act_offload

Conversation

@hhaAndroid

Copy link
Copy Markdown
Collaborator

No description provided.

@hhaAndroid hhaAndroid changed the title Fix act offload and clear Fix act offload and clear cublas_workspaces Jul 7, 2026
@hhaAndroid

Copy link
Copy Markdown
Collaborator Author

@claude review

Comment thread examples/v1/config/reasoning_rl_qwen3p5vl_mtp_ep.py
Comment thread examples/v1/config/reasoning_rl_qwen3p5vl_mtp_ep.py Outdated
Comment thread xtuner/v1/rl/trainer/worker.py
Comment thread xtuner/v1/utils/activation_offload.py
Comment thread xtuner/v1/utils/activation_offload.py
Comment thread xtuner/v1/rl/trainer/worker.py
@claude

claude Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Claude: ## Summary

This PR fixes activation offload memory leaks by expanding OffloadManager.clear() to also clean may_npu_tensors and getcnt, adds a group-scoped clear mode, and introduces cuBLAS workspace clearing during model offload. It also updates the example config to enable EP=4, FP8, and reduce MTP layers/draft tokens.

Issues

Warning

Nit

Verdict

COMMENT — the core fix is correct and well-structured, but please clarify whether device_item should also be cleared, and whether the silent-discard change is intentional.

@hhaAndroid hhaAndroid changed the title Fix act offload and clear cublas_workspaces Fix residual GPU memory usage in TrainingWorker in RL workflow Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant