Optimize the implementation of ReplayBuffer#1512
Open
YanhuiDua wants to merge 1 commit intoInternLM:rl_designfrom
Open
Optimize the implementation of ReplayBuffer#1512YanhuiDua wants to merge 1 commit intoInternLM:rl_designfrom
YanhuiDua wants to merge 1 commit intoInternLM:rl_designfrom
Conversation
Collaborator
YanhuiDua
commented
Mar 2, 2026
- Use StorageItem and QueryItem to replace StorageIndices and add DSLRule for QueryItem
- Split ReplayBuffer to StorageBackend and ReplayPolicy
- Add SyncReplayBufferConfig and AsyncReplayBufferConfig
…LRule for QueryItem; 2. split ReplayBuffer to StorageBackend and ReplayPolicy
YanhuiDua
commented
Mar 2, 2026
|
|
||
| async def get(self, batch_size: int, task_name: str, group_status: Status, **kwargs) -> list[list[RolloutState]]: | ||
| indices = StorageIndices(task_name=task_name, group_status=group_status, tags=kwargs) | ||
| async def get(self, batch_size: int, task_name: str, group_status: Status) -> list[list[RolloutState]]: |
Collaborator
Author
There was a problem hiding this comment.
ReplayBuffer的get接口我想目前还是使用task_name和group_status,等后续有了其他的查询需求,再使用QueryItem
jayhenry
reviewed
Mar 2, 2026
| from xtuner.v1.utils.logger import get_logger | ||
|
|
||
|
|
||
| DSLOp: TypeAlias = Literal["$eq", "$ne", "$gt", "$gte", "$lt", "$lte", "$in", "$not_in", "$between"] |
Collaborator
There was a problem hiding this comment.
可以参考 https://www.notion.so/AST-Spike-16c9d117bcaf80cc8c28dff1a2853910?source=copy_link 的设计做些调整:
- 将支持的Op定义成更完备的类,参考上面“抽象语法树”一节中的 Ast 节点类
- 不同后端做具体查询的过程,应该各不相同,不能复用下面DSLRue.match的逻辑。这个过程应该参考上面“语法制导翻译” 一节的 NodeVisitor,为每种存储后端定义各自的NodeVisitor
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.