Skip to content

feat(protocol): add encoder-output handoff contracts - #35

Open
krishung5 wants to merge 3 commits into
mainfrom
krish/openengine-image-epd-protocol
Open

krishung5 wants to merge 3 commits into
mainfrom
krish/openengine-image-epd-protocol

Conversation

@krishung5

@krishung5 krishung5 commented Nov 4, 2026 •

Copy link
Copy Markdown

Summary

Add encoder-only execution and engine-owned encoder-output handoffs to OpenEngine. A client receives an opaque reference from an encoder and forwards it to a compatible generation engine; tensor contents stay outside the inference RPC payload.

  • Add typed EncoderOptions, EncoderReady, and EncoderCacheRef messages.
  • Negotiate encoder/consumer roles and transfer backends through ModelInfo.encoder.
  • Add Control.TransferEncoderCache; success means transfer completed, and an uncertain single-use handoff must not be replayed.
  • Document capability negotiation, invalid states, terminal events, transfer completion, cancellation, and ownership in the API reference.

Why

Refs #17.

This is a smaller first step toward the encoder-disaggregation use case in #17. It reuses Generate and keeps backend-specific artifact layouts opaque rather than introducing the separate media service and portable tensor descriptors proposed there. That design choice is open for review; this PR does not complete the broader issue or add a new EngineRole enum value.

The reference implementation covers image E+PD and E+P+D at TP/PP/CP=1. E+P+D consumes the encoder reference at P, then uses the existing native KV-session handoff for D; it needs no additional encoder-protocol fields. Video/audio encoder handoff, reusable encoder caches, explicit artifact-release APIs, and portable tensor descriptors remain outside this change.

Validation

  • buf build
  • buf lint
  • Buf formatting and breaking-change checks against main
  • Markdown lint passed for the updated API reference; existing links were preserved
  • Commits include a DCO sign-off

The additions retain existing field numbers and RPCs. Matching TRT-LLM and Dynamo implementations have CPU regression coverage and prior cross-host native gRPC and Dynamo HTTP validation for image E+PD and E+P+D. The dependent PRs record their exact validation scope and runtime prerequisites.

Protocol checklist

  • The canonical schema and API documentation are synchronized
  • Presence, defaults, and invalid states are defined
  • Acceptance, streaming, terminal, and error behavior are defined
  • Discovery and capability impacts are documented
  • Intentional schema rewrites are called out clearly: no existing fields or RPCs are removed or renumbered

Additional context

Dependent implementations: TRT-LLM transport, TRT-LLM serving, and Dynamo integration. They pin this proposal's immutable source revision. This PR can be reviewed independently of the known CUDA IPC shutdown cleanup issue in the TRT-LLM reference implementation.

Signed-off-by: krishung5 <krish@nvidia.com>
Signed-off-by: krishung5 <krish@nvidia.com>
Signed-off-by: Kris Hung <krish@nvidia.com>
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.

1 participant