refactor: refactor async utils#2448
Open
yuki-97 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Contributor
Author
|
/ok to test 17cd7e2 |
mehraakash
reviewed
May 11, 2026
mehraakash
left a comment
There was a problem hiding this comment.
Overall, looks good, added a few nits.
| from typing import Any, Optional | ||
|
|
||
|
|
||
| class ReplayBufferProtocol(ABC): |
There was a problem hiding this comment.
💯
But could we make it typing.Protocol instead? here
Something like:
class ReplayBufferProtocol(Protocol):
def add(...) -> str: ...
def sample(...) -> Optional[dict[str, Any]]: ...
def evict(self) -> None: ...
def size(self) -> int: ...
def clear(self) -> None: ...
|
|
||
|
|
||
| @ray.remote # pragma: no cover | ||
| class ReplayBuffer(ReplayBufferImpl): |
There was a problem hiding this comment.
Could we update the async GRPO docs to point to the new module split? It still describes AsyncTrajectoryCollector and ReplayBuffer as living in async_utils.py, but after this PR they live in trajectory_collector.py and replay_buffer.py.
| "nemo_rl/algorithms/advantage_estimator.py", | ||
| "nemo_rl/algorithms/async_utils/__init__.py", | ||
| "nemo_rl/algorithms/async_utils/interfaces.py", | ||
| "nemo_rl/algorithms/async_utils/replay_buffer.py", |
There was a problem hiding this comment.
Should we also include:
"nemo_rl/algorithms/async_utils/trajectory_collector.py",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of RL-727.
@ray.remote, inheritable) and ReplayBuffer (@ray.remote, unchanged behavior) to allow subclassing without the@ray.remoteinheritance restriction.No functional changes to ReplayBuffer.