-
-
Notifications
You must be signed in to change notification settings - Fork 9k
[Misc] Support more collective_rpc return types #21845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Nick Hill <[email protected]>
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds support for more complex return types from collective_rpc
by introducing a UtilityResult
wrapper and custom serialization/deserialization logic. This allows msgspec
to handle types it doesn't support natively by encoding type information alongside the data.
The overall approach is sound. I've identified one potential issue in the serialization logic where using cls is not list
is too specific and could lead to incorrect behavior with subclasses of list
. I've suggested a more robust implementation using isinstance
.
Signed-off-by: Nick Hill <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
V1 test passes, let's merge this |
Signed-off-by: Nick Hill <[email protected]>
Because of how msgspec is used for the front-end <-> engine IPC message encoding, only "simple" native python data types/structures will correctly roundtrip when returned in the
UtilityOutput
struct from thecall_utility(_async)
method.This change allows arbitrary msgspec-supported types to be returned, as well as tensors/numpy-arrays which will use the existing zero-copy optimizations. It also checks for lists of such types. Such cases will require
VLLM_ALLOW_INSECURE_SERIALIZATION
to be set since arbitrary types are materialized from strings when decoding.This in particular is needed for #18465.