NVIDIA-NeMo / NVIDIA-NeMo/Curator

RayDataStageActorAdapter never calls teardown() on stages

Open
#1,617 6 comments 0 reactions 1 assignee View on GitHub

@vbhavh is already working on this.

Since Mar 20, 2026.

good first issue
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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.