NVIDIA-NeMo / NVIDIA-NeMo/Curator
RayDataStageActorAdapter never calls teardown() on stages
@vbhavh is already working on this.
Since Mar 20, 2026.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 328
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 30
Description
Problem
RayDataStageActorAdapter calls setup_on_node and setup in __init__ but never calls teardown(). Stages that hold GPU resources (e.g. vLLM EngineCore subprocesses) are never cleaned up, causing GPU memory leaks between pipeline runs.
Fix
Per Ray's actor cleanup docs we might have to have __ray_shutdown__
def __ray_shutdown__(self):
with suppress(Exception):
self.teardown()
RayActorPoolExecutor already does this correctly by calling actor.teardown.remote() before ray.shutdown().
Please make sure to add a unittest for this for instance you can add a test that creates a file on the filesystem and then deletes it in teardown.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.