Skip to content

[None][feat] Add image routing metadata to OpenEngine KV events - #21125

Merged
BowenFu merged 59 commits into
NVIDIA:mainfrom
krishung5:openengine-image-routing
Oct 31, 2026
Merged

BowenFu merged 59 commits into
NVIDIA:mainfrom
krishung5:openengine-image-routing

Conversation

@krishung5

@krishung5 krishung5 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Expose optional image routing identities alongside the native KV cache content digests so external routers can compute request-compatible image-prefix hashes. The engine continues to hash image content and caller UUIDs; a routing hint does not replace content-sensitive cache identity.

The image-input prerequisite #20446 is merged into main. This PR is independent of the image performance follow-up #21037 and the video/audio PRs, so review and validation can proceed in parallel. The companion Dynamo implementation is ai-dynamo/dynamo#17437, stacked on image passthrough ai-dynamo/dynamo#16613. End-to-end deployment requires those Dynamo changes and an official TRT-LLM runtime containing this routing implementation.

This PR targets main. The prerequisite image implementation is already on main; after the branch refresh is pushed, the Files changed view will show the routing follow-up and its processor-default regression fix.

  • Expose the existing native request UUID vector through a read-only binding.
  • Retain a bounded per-publisher digest-to-UUID mapping and include optional UUIDs in streaming KV events. Missing/evicted mappings allow consumers to ignore the affected image stores without dropping subsequent removals.
  • Add versioned optional trtllm_image_routing event metadata. Text-only stores omit this extension. The publisher does not interpret client-specific UUID prefixes.
  • Advertise ModelInfo.extra.trtllm_image_routing_version = 1 only for aggregated Qwen3-VL with explicit KV cache V2, block reuse, and ZMQ events. Disaggregated routing remains disabled.

Additive API change; a repository maintainer needs to add api-compatible because the author account cannot apply repository labels. No OpenEngine proto changes or new dependencies. Routing identities must refer to stable media content.

Test Coverage

  • 62 focused CPU cases passed for capability gating, event metadata, bounded mapping, and content-sensitive identities.
  • Real-weight Qwen3-VL-2B GPU conformance passed: correct red/blue responses; additional KV reuse for a repeated image; different image content with the same routing hint did not reuse the first image's prefix or answer.
  • Captured GPU events were replayed through the companion Dynamo decoder: two image stores indexed, none ignored.
  • Targeted pre-commit hooks passed. CPU and real-weight GPU tests are registered in the L0 CPU/A10 test lists; native event-manager regression coverage is also extended.

Local GPU evidence uses a TensorRT-LLM 1.4.0rc0 runtime with the relevant Python sources installed and explicit validation-only adapters for the new native UUID getter and release capacity discovery. This is not a matching compiled PR wheel. Validation of the new binding and the native introspection-based event suite requires the matching upstream build. Full HTTP routing between two workers and performance benchmarking remain pending. Matching-build validation and full HTTP cache-aware selection between two workers remain required before merge.

PR Checklist

  • Reviewed the applicable checklist: description, coding guidelines, tests and CI registration, additive API compatibility, documentation, dependencies, and ownership. No new dependencies or ownership changes.

Dev Engineer Review

The change adds optional image-routing UUIDs to streaming KV events. Content digests remain the cache identity. OpenEngine advertises routing version 1 only for aggregated Qwen3-VL when KV cache manager V2, block reuse, and ZMQ events are enabled. Disaggregated routing remains disabled.

The UUID mapping is bounded, ignores UUIDs over 256 UTF-8 bytes, and rejects conflicting UUIDs for the same digest. Verify that consumers handle missing or evicted hints without dropping later removals. The new read-only GenericLlmRequest.multimodal_uuids property and media-I/O defaults are additive API changes.

Reported validation includes focused CPU tests, GPU conformance, and targeted pre-commit checks. The GPU test used a different TensorRT-LLM runtime and validation-only adapters. Matching-build validation and full two-worker HTTP routing remain pending. The reported CI runs failed. No current review findings were supplied, so review severity counts are unavailable.

QA Engineer Review

Tests were added or modified in the OpenEngine, KV-cache event-manager, and executor test directories. Coverage includes capability selection, UUID propagation, content-sensitive hashes, event serialization, text-only omission, mapping eviction, oversized UUIDs, conflicting hints, and real-model cache reuse.

The CPU CI list includes test_control.py, test_image_routing.py, and test_multimodal.py. The A10 CI list includes test_image_routing_conformance.py. The KV-cache event-manager and executor tests have no test-list entries reported here. Focused CPU tests and GPU conformance were reported as passing, but the PR CI runs failed. Matching-build validation and full two-worker HTTP routing remain pending. Coverage verdict: needs follow-up.

Per-File QA Perspective

  • cpp/tensorrt_llm/nanobind/batch_manager/bindings.cpp — Verify that GenericLlmRequest.multimodal_uuids returns None when UUID data is absent and a copy when present.
  • tensorrt_llm/_torch/pyexecutor/kv_cache/kv_cache_manager_v2.py — Verify that streaming event managers receive each digest/UUID pair and that other manager types skip registration.
  • tensorrt_llm/_torch/pyexecutor/kv_cache_events.py — Verify bounded UUID retention, conflict handling, oversized UUID rejection, and optional metadata emission. Check missing or evicted hints and subsequent removals.
  • tensorrt_llm/grpc/openengine/README.md — Check that documented support limits match runtime behavior, including disaggregated routing and non-image modalities.
  • tensorrt_llm/grpc/openengine/capabilities.py — Verify the image-routing capability conditions and exclusions.
  • tensorrt_llm/grpc/openengine/control.py — Verify that GetModelInfo advertises the routing version only when the capability is supported.
  • tensorrt_llm/inputs/registry.py — Verify that the new default media-I/O kwargs preserve behavior when processors do not define decode defaults.
  • tests/integration/test_lists/test-db/l0_a10.yml — Adds the GPU conformance test to the A10 CI list.
  • tests/integration/test_lists/test-db/l0_cpu.yml — Adds the CPU image-routing test; the list also contains the modified control and multimodal tests.
  • tests/unittest/grpc/openengine/test_control.py — Covers capability conditions and exclusions. Listed in test-db/l0_cpu.yml.
  • tests/unittest/grpc/openengine/test_image_routing.py — Covers UUID propagation, content-sensitive hashes, text-only omission, eviction, oversized UUIDs, and conflicts. Listed in test-db/l0_cpu.yml.
  • tests/unittest/grpc/openengine/test_image_routing_conformance.py — Covers real-model routing, cache reuse, and captured KV events. Listed in test-db/l0_a10.yml.
  • tests/unittest/grpc/openengine/test_multimodal.py — Covers image-source mapping with absent and explicit media-I/O defaults. Listed in test-db/l0_cpu.yml.
  • tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_event_manager.py — Covers routing metadata, bounded retention, digest independence, oversized hints, and conflicts. No test-list entry was reported.
  • tests/unittest/_torch/executor/kv_cache/test_kv_cache_v2_first_new_block_probe.py — Updates the test stub’s event_manager default to None; no test-list entry was reported.
  • tests/unittest/_torch/executor/kv_cache/test_kv_cache_v2_multimodal_runs.py — Updates the fixture’s event_manager default to None; no test-list entry was reported.
  • tests/unittest/_torch/executor/test_pytorch_model_engine.py — Updates two MRoPE test setup calls; no test-list entry was reported.
  • tests/unittest/_torch/test_connector_adp.py — Updates distributed test mocks and rank setup; no test-list entry was reported.

GuanLuo and others added 30 commits September 23, 2026 16:31
…ngine-image-media

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

# Conflicts:
#	tensorrt_llm/grpc/openengine/capabilities.py
#	tensorrt_llm/grpc/openengine/request_mapping.py
#	tensorrt_llm/inputs/media_io.py
#	tests/unittest/grpc/openengine/test_multimodal.py
#	tests/unittest/inputs/test_url_validation.py
Signed-off-by: krishung5 <[email protected]>

# Conflicts:
#	tensorrt_llm/inputs/utils.py
@krishung5
krishung5 requested a review from a team as a code owner October 29, 2026 19:58
@krishung5

Copy link
Copy Markdown
Collaborator Author

/bot run

@krishung5

Copy link
Copy Markdown
Collaborator Author

This branch now uses #19529’s native UUID transport instead of a parallel Python lookup table. The OpenEngine capability and normalization metadata remain on top. #19529 itself is unchanged, and this PR depends on it merging first. Post-merge validation passed 402 focused cases and 8/8 unpinned two-worker routing repeats; all 14 responses and usage counts matched the engines. Full merged-wheel CI remains pending.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81504 [ run ] triggered by Bot. Commit: e894e65 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81504 [ run ] completed with state SUCCESS. Commit: e894e65
/LLM/main/L0_MergeRequest_PR pipeline #67174 completed with status: 'SUCCESS'

CI Report

Link to invocation

@BowenFu
BowenFu enabled auto-merge (squash) October 30, 2026 03:33
auto-merge was automatically disabled October 30, 2026 04:32

Head branch was pushed to by a user without write access

@krishung5

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81589 [ run ] triggered by Bot. Commit: 367f243 Link to invocation

@BowenFu
BowenFu enabled auto-merge (squash) October 30, 2026 06:14
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81589 [ run ] completed with state SUCCESS. Commit: 367f243
/LLM/main/L0_MergeRequest_PR pipeline #67260 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@krishung5

Copy link
Copy Markdown
Collaborator Author

/bot run

1 similar comment
@krishung5

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81709 [ run ] triggered by Bot. Commit: 367f243 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81709 [ run ] completed with state FAILURE. Commit: 367f243
/LLM/main/L0_MergeRequest_PR pipeline #67369 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@krishung5

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81741 [ run ] triggered by Bot. Commit: c8efaef Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81741 [ run ] completed with state SUCCESS. Commit: c8efaef
/LLM/main/L0_MergeRequest_PR pipeline #67400 completed with status: 'SUCCESS'

CI Report

Link to invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants