[feat] Support async_reset_consumption to reuse data#25
Merged
0oshowero0 merged 1 commit intoAscend:mainfrom Feb 3, 2026
Merged
Conversation
0oshowero0
reviewed
Feb 3, 2026
Collaborator
|
Please use |
async_reset_consumption to reuse data
Signed-off-by: yuetian <zhangliujie@xiaohongshu.com>
1a27366 to
810ed3a
Compare
0oshowero0
approved these changes
Feb 3, 2026
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.
Title
Add reset_consumption Interface for Reusing Data in TransferQueue
Description
Overview
This PR adds the
reset_consumptioninterface to TransferQueue, allowing users to reset the consumption status of data samples without clearing the actual data. This is particularly useful for debugging scenarios where the same rollout data needs to be processed multiple times without regenerating it.Changes Made
1. Core Controller Implementation (
transfer_queue/controller.py)reset_consumption()method inDataPartitionStatusclass to reset consumption status for specific tasks or all tasksreset_consumption()method inTransferQueueControllerclass to handle partition-level consumption resetRESET_CONSUMPTIONandRESET_CONSUMPTION_RESPONSEmessage types in the controller's request processing logic2. Client API (
transfer_queue/client.py)async_reset_consumption()async method for resetting consumption status via async operationsreset_consumption()synchronous wrapper method for convenience3. Protocol Extensions (
transfer_queue/utils/zmq_utils.py)RESET_CONSUMPTIONandRESET_CONSUMPTION_RESPONSErequest types toZMQRequestTypeenum4. Comprehensive Testing
In
tests/test_client.py:MockControllersupport forRESET_CONSUMPTIONrequeststest_reset_consumption()- Tests synchronous reset with specific task nametest_reset_consumption_all_tasks()- Tests synchronous reset for all taskstest_async_reset_consumption()- Tests async reset with specific task nametest_async_reset_consumption_all_tasks()- Tests async reset for all tasksIn
tests/test_controller.py:test_controller_reset_consumption()- Comprehensive integration test that verifies:Usage Examples
Synchronous API:
Asynchronous API:
Use Case Example: