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.
feat(grpc): add TokenSpeed multimodal (VLM) input support #1515
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
feat(grpc): add TokenSpeed multimodal (VLM) input support #1515
Changes from all commits
73e54b5ca040d05cc75bd2b8c04fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
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.
Loading
smg_grpc_servicer.tokenspeed.servicernow eagerly importstokenspeed.runtime.multimodal.inputs(and its transitive deps) at module import time, which breaks the existing stub-based test/tooling scenario where TokenSpeed runtime is intentionally absent and only protobuf/request-conversion paths are exercised. This regresses the module’s previous lazy-import behavior and can fail fast withModuleNotFoundErrorbefore any RPC handling; moving these imports into the multimodal conversion path (similar to_lazy_generate_req_input) keeps non-TokenSpeed environments importable.Useful? React with 👍 / 👎.
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.
@CatherineSue any thoughts?
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.
Reject partial multimodal payloads instead of silently dropping them.
When
mm_inputsis present butpixel_valuesis missing, the request currently falls back to text-only execution. That hides malformed payloads and can produce incorrect results; fail fast withINVALID_ARGUMENTby raisingValueError.Proposed fix
🤖 Prompt for AI Agents
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.
_tensor_from_protodecodes non-bfloat tensors vianp.frombuffer(..., dtype=np.dtype(tensor_data.dtype))and then callstorch.from_numpy(...). In this commit,TensorDataexplicitly allows"uint32", and the gateway can forwarduint32model-specific tensors, buttorch.from_numpydoes not acceptnp.uint32; that path raises aTypeErrorand the RPC is surfaced as INTERNAL instead of successfully building the request. Any multimodal model that includes unsigned tensor metadata will fail at request conversion unlessuint32is converted through a supported torch dtype path.Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.