THUDM / THUDM/slime

Memory Leak in colocate Mode During Rollout

Open
#1,105 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.5k
Forks
1.3k
Avg merge
5h 36m
Merged PRs (30d)
22

Description

Hi, thanks for the great work on this framework!

I encountered a memory leak issue when using the colocate mode.
Specifically, memory usage in the non-rollout process increases after every rollout step, even though the rollout worker itself completes normally.

Observed Behavior:

  1. Memory leak per step

  2. In each training step, the memory usage of the colocated process grows by 4–5 GB.

This increase is cumulative and eventually leads to OOM after several steps.

destroy_process_groups() always enters the except branch

For every step, cleanup triggers:

logger.warning(
f"Process group already invalid/destroyed; skipping cleanup. Exception: {e}",
exc_info=True,
)

Any insights or pointers on debugging this would be greatly appreciated.
Thanks again for maintaining this project!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the colocate-mode rollout and tracking memory in the non-rollout process across steps. Inspect destroy_process_groups() and its exception path, then verify that cleanup completes without cumulative memory growth or eventual OOM.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.