Skip to content

Conversation

markurtz
Copy link
Collaborator

Summary

This PR introduces four new utility modules that provide improved capabilities for transferring information across processes to maximize performance. This is done through encoding.py to best serialize the data into a transferrable format and minimize the size of the data as well as through messaging.py which supports high performance multiprocessing queues and pipes for transfer that works with the encoding.

Details

  • Added encoding.py with the core MessageEncoding.py
  • Added messaging.py with InterProcessMessaging, InterProcessMessagingManagerQueue, InterProcessMessagingPipe, InterProcessMessagingQueue
  • Added unit tests for all of the above classes and common data transfer use cases.

Test Plan

  • Execute new utility module test suites covering smoke, sanity, and regression scenarios

Related Issues


  • [ X] "I certify that all code in this PR is my own, except as noted below."

Use of AI

  • [ X] Includes AI-assisted code completion
  • [ X] Includes code generated by an AI application
  • Includes AI-generated tests (NOTE: AI written tests should have a docstring that includes ## WRITTEN BY AI ##)

@markurtz markurtz self-assigned this Aug 26, 2025
@markurtz markurtz changed the base branch from main to feature/refactor/utils-extended August 26, 2025 16:07
@markurtz markurtz force-pushed the feature/refactor/utils-extended branch from d463e77 to 02f97ff Compare August 26, 2025 16:17
@markurtz markurtz force-pushed the feature/refactor/utils-concurrency branch from 8831554 to da5effc Compare August 26, 2025 16:21
@markurtz markurtz requested a review from Copilot August 26, 2025 16:22
Copy link
Contributor

@Copilot Copilot AI left a comment

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 introduces comprehensive multiprocessing utilities for the scheduler refactor, focusing on encoding and messaging capabilities to optimize data transfer between processes. The implementation provides configurable serialization strategies, binary encoding options, and high-performance interprocess communication mechanisms.

  • Adds robust message encoding system with support for Pydantic models, configurable serialization (dict/sequence), and binary encoding (msgpack/msgspec)
  • Implements abstract messaging framework with concrete implementations for queues, manager queues, and pipes
  • Provides comprehensive test coverage for all new utility modules including smoke, sanity, and regression scenarios

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/utils/test_text.py Fixes spelling error in test docstring (puncutation → punctuation)
tests/unit/utils/test_messaging.py Comprehensive test suite for messaging utilities with multiprocessing scenarios
tests/unit/utils/test_encoding.py Complete test coverage for encoding utilities with various data types and serialization strategies
src/guidellm/utils/messaging.py Core messaging abstractions and implementations for interprocess communication
src/guidellm/utils/encoding.py Message encoding utilities with Pydantic support and configurable serialization/encoding
src/guidellm/utils/init.py Exports new encoding and messaging utilities from utils module

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

@markurtz markurtz force-pushed the feature/refactor/utils-concurrency branch from 7b74f29 to e8300a9 Compare August 26, 2025 17:45
@markurtz markurtz force-pushed the feature/refactor/utils-extended branch from fc47105 to b70ee98 Compare August 26, 2025 19:40
Base automatically changed from feature/refactor/utils-extended to feature/refactor/main August 26, 2025 19:41
@markurtz markurtz force-pushed the feature/refactor/utils-concurrency branch from 1ecc54a to cff8d91 Compare August 26, 2025 19:52
Copy link
Collaborator

@jaredoconnell jaredoconnell left a comment

Choose a reason for hiding this comment

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

Looks good. Just one minor comment.

Comment on lines +242 to +251
async def get(self, timeout: float | None = None) -> ReceiveMessageT:
"""
Retrieve message from receive buffer with optional timeout.

:param timeout: Maximum time to wait for a message
:return: Decoded message from the receive buffer
"""
return await asyncio.wait_for(
self.buffer_receive_queue.async_get(), timeout=timeout
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this function return a TimeoutError when it times out? If so I think it would be beneficial to document that on all of these functions that have a timeout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants