Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

merge with 0912 - #7

Merged
0oshowero0 merged 1 commit into
mainfrom
merge_0912
Sep 12, 2025
Merged

0oshowero0 merged 1 commit into
mainfrom
merge_0912

Conversation

@0oshowero0

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings September 12, 2025 10:02
@0oshowero0
0oshowero0 merged commit 4634c16 into main Sep 12, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the transfer queue codebase by consolidating utility classes and adding new serialization functionality:

  • Moves common enum classes (ExplicitEnum, TransferQueueRole) from zmq_utils.py to a new utils.py module for better organization
  • Adds new ZMQ request types and removes some obsolete ones related to prompt metadata
  • Introduces a comprehensive serialization module (serial_utils.py) with msgpack encoding/decoding for torch tensors and tensordict objects

Reviewed Changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
transfer_queue/utils/zmq_utils.py Refactored to import common enums from utils module, added CLEAR_DATA operations, removed prompt metadata operations and IP utility function
transfer_queue/utils/utils.py New utility module containing shared enum classes and a tensor sampling function
transfer_queue/utils/serial_utils.py New serialization module with msgpack encoding/decoding for torch tensors and tensordict objects
transfer_queue/init.py Updated imports to remove zmq-specific exports and add AsyncTransferQueueClient
tests/test_serial_utils_on_cpu.py Comprehensive test suite for the new serialization functionality
recipe/simple_use_case/sync_demo.py Demo script showing synchronous usage of the transfer queue system
recipe/simple_use_case/async_demo.py Demo script showing asynchronous usage with Ray actors
pyproject.toml Updated mypy configuration to include new module paths
Comments suppressed due to low confidence (1)

transfer_queue/utils/zmq_utils.py:120

  • The list.append() method returns None, so result = result.append(...) will assign None to result. This should be result.append(pickle.loads(d)) without the assignment.
                result = result.append(pickle.loads(d))

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +25 to +27
NOT_PRODUCED = 0
READY_FOR_CONSUME = 1
CONSUMED = 2

Copilot AI Sep 12, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ProductionStatus enum inherits from ExplicitEnum(str, Enum) but assigns integer values instead of string values. This will cause type inconsistency since the enum is expected to be string-based.

Suggested change
NOT_PRODUCED = 0
READY_FOR_CONSUME = 1
CONSUMED = 2
NOT_PRODUCED = "0"
READY_FOR_CONSUME = "1"
CONSUMED = "2"

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +35
ready_for_consume_idx: list[int],
batch_size: int,
get_n_samples: bool,
n_samples_per_prompt: int,
) -> Optional[list[int]]:

Copilot AI Sep 12, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using list[int] syntax requires Python 3.9+. For better compatibility, consider using List[int] from the typing module, which is already imported.

Suggested change
ready_for_consume_idx: list[int],
batch_size: int,
get_n_samples: bool,
n_samples_per_prompt: int,
) -> Optional[list[int]]:
ready_for_consume_idx: List[int],
batch_size: int,
get_n_samples: bool,
n_samples_per_prompt: int,
) -> Optional[List[int]]:

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +35
ready_for_consume_idx: list[int],
batch_size: int,
get_n_samples: bool,
n_samples_per_prompt: int,
) -> Optional[list[int]]:

Copilot AI Sep 12, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using list[int] syntax requires Python 3.9+. For better compatibility, consider using List[int] from the typing module, which is already imported.

Suggested change
ready_for_consume_idx: list[int],
batch_size: int,
get_n_samples: bool,
n_samples_per_prompt: int,
) -> Optional[list[int]]:
ready_for_consume_idx: List[int],
batch_size: int,
get_n_samples: bool,
n_samples_per_prompt: int,
) -> Optional[List[int]]:

Copilot uses AI. Check for mistakes.
@0oshowero0
0oshowero0 deleted the merge_0912 branch September 18, 2025 09:20
jianjunzhong referenced this pull request in jianjunzhong/TransferQueue Oct 25, 2025
…impleStorageManager (#7)

* feat: update tests for SimpleStorageUnit and add new tests for AsyncSimpleStorageManager

Signed-off-by: jianjunzhong <[email protected]>

* refactor: simplify mock operations and adjust performance test parameters for faster execution

Signed-off-by: jianjunzhong <[email protected]>

---------

Signed-off-by: jianjunzhong <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants