Repository navigation
[#18151][feat] Admit trusted KV hints and carry immutable request metadata - #20269
chienchunhung wants to merge 1 commit into
Conversation
|
/bot run |
|
PR_Github #77705 [ run ] triggered by Bot. Commit: |
|
PR_Github #77705 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #77927 [ run ] triggered by Bot. Commit: |
|
PR_Github #77927 [ run ] completed with state
|
b549b2d to
61ff6a9
Compare
61ff6a9 to
8645ea4
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #78251 [ run ] triggered by Bot. Commit: |
|
@Shixiaowei02 Thanks for the review. I addressed all of your comments as part of the design update.
Please take a look; thanks! |
|
PR_Github #78251 [ run ] completed with state
|
|
PR_Github #80778 [ run ] triggered by Bot. Commit: |
|
PR_Github #80716 [ run ] completed with state |
ee1790e to
9f2fad2
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #80786 [ run ] triggered by Bot. Commit: |
|
PR_Github #80778 [ run ] completed with state |
|
PR_Github #80786 [ run ] completed with state
|
efeb408 to
1389ebf
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #81487 [ run ] triggered by Bot. Commit: |
|
PR_Github #81487 [ run ] completed with state
|
…st metadata Signed-off-by: Chien-Chun Hung <2679986+chienchunhung@users.noreply.github.com>
1389ebf to
4a38ad7
Compare
|
/bot run |
|
PR_Github #81617 [ run ] triggered by Bot. Commit: |
|
/bot run --disable-fail-fast |
|
PR_Github #81622 [ run ] triggered by Bot. Commit: |
|
PR_Github #81617 [ run ] completed with state |
|
PR_Github #81622 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #81749 [ run ] triggered by Bot. Commit: |
chang-l
left a comment
There was a problem hiding this comment.
Approved from the VisualGen side.
|
PR_Github #81749 [ run ] completed with state |
Summary
Carry optional KV reuse hints through Python and HTTP requests while ignoring untrusted, unsupported, oversized or malformed envelopes. Freeze admitted metadata so later mutation cannot alter queued requests.
Scope
TRTLLM_TRUST_KV_HINTS=1opts in but does not authenticate clients.kv_hintsfromrepr()andstr()without removing it from serialized requests.This PR carries metadata; it does not execute actions or activate a backend. Required P/D handoff stays separate, and gRPC hint transport is not included. Explicitly logging serialized hints still requires redaction.
Earlier verification also identified CPU test-harness defects fixed in this PR: missing subprocess timeouts, a BOLT test import that left
sys.pathmodified, and conflicting capture fixtures in two perf-client tests.Verification
Current source:
4a38ad70b0409159f0d1bf9b92a4c472795ff01b, verified before commit from the frozen worktree snapshot on one H200 NVL, with normal TensorRT-LLM/native imports and repository pytest plugins, includingpytest-threadleak.tests/unittest/llmapi/test_kv_hints.pytests/unittest/disaggregated/test_kv_hint_selection.py196 distinct test cases passed; 340 successful executions include the three additional ingress runs. The hint suite includes 42 integer-boundary cases, 24 nesting cases and 6 request-representation/transport cases added in this revision.
Full-diff self-review found no unresolved issues, and all required commit hooks passed. The signed commit has the same source content as the verified snapshot; hooks made no file changes. All 2,138 package Python files matched the frozen source before and after execution. The prebuilt native artifact came from CI 67130, source
f6b302aa60a44569b319ded1d2769f6f184281ba; its full native build inputs match the PR base. This verification did not rebuild native code or run model inference, GPU-kernel correctness tests, multi-rank serving or full public CI.Full CI for
4a38ad70b0409159f0d1bf9b92a4c472795ff01bwas requested with/bot runand started as L0_MergeRequest_PR #67284. The trigger workflow, security scan and release checks passed; full CI results are pending.The previous-head CI report, build 67157 at
1389ebfd6d65d4538c90f85a74b8e22d5cc15351, finished with 100,344 passed, 0 failed and 14,385 skipped after retries. Its initial HTTP ingress failure reported an AnyIO worker thread; the file passed on retry. The async test-handler change targets that fixture issue. Multi-GPU stages did not run because the required approval label was absent when this run started; the label was added afterward.Earlier verification — not rerun on the current revision
At
1389ebfd6d65d4538c90f85a74b8e22d5cc15351, 1,031 tests passed, with no failures, errors or skips, in 248.28 seconds on one H200. This broader run used normal TensorRT-LLM imports, native bindings and repository pytest plugins, without import stubs or a marker filter. It included the child-request hint inheritance regression test.All 2,138 tracked package Python files matched that source snapshot before and after the run. It used the same compatible CI 67130 native artifact described above. Full-diff self-review before and after that rebase, diff checks and required hooks passed for that revision.
CI build 66524 at
9f2fad264b50a70519764a8d2d4dc4cb0e0848a2recorded 88,975 passed, 0 failed and 12,577 skipped. It was marked unstable because both multi-GPU dispatches were blocked by the missing approval label.Other earlier evidence: 10 candidate tests passed at
efeb4088; 157 selected tests passed at9f2fad2; nine timeout/recovery tests passed atee1790eb; and 694 selected tests passed on B300 atee8242a, including the earlier subprocess-timeout and Blackwell numerical cases. No numerical threshold was changed.Request-broadcast measurements (before rebase)
These tables are historical evidence for
efeb4088ae5bf64f7472fcdac0c863ec05b7a00b. They have not been rerun on the current head. These measurements exclude admission, including the new JSON and MessagePack checks. The rebase adopted upstream request-field collection and child-request construction changes; it retained full-envelope transport.A standalone benchmark exercised the real
RequestBroadcasterwith native requests andMPIDiston one AMD EPYC 7313P node with two H800 NVL GPUs. The tested source was9f2fad264b50a70519764a8d2d4dc4cb0e0848a2plus candidate-helper, test, and documentation changes now committed asefeb4088ae5bf64f7472fcdac0c863ec05b7a00b(patch SHA256229e3c0157c9289471dc5f19e5856c265c31683d91cf71489ee5a2f1342ed32b). The measured broadcast code matches that pre-rebase revision. A compatible prebuilt native wheel was used; this was not a full native rebuild.For TP2, batch size 1, and 256-token requests, each trial offered 10,000 requests/s for 5 seconds. Values below are medians across three trials.
The 64 KiB case completed 9,631–10,000 requests/s across trials and accumulated backlog in some trials. Its worst trial had 189 ms p99 lateness against the synthetic arrival schedule. At batch size 32 and the same offered rate, all sizes completed approximately 10,000 requests/s. In separate saturated TP2 trials with batch size 32 (200 broadcasts per trial, three trials), component throughput fell from 78,514 requests/s without hints to 29,554 with 64 KiB (62.4% lower).
The wider matrix also covered synchronous PP2, long prompts, and batches that crossed the MPI chunk boundary. All seven runs completed, and cross-rank payload checks passed. Prebuilt requests isolate metadata collection, serialization, communication, and receiver deserialization. These results exclude admission, model execution, provider access, and serving TTFT; they do not qualify TorchDist/NCCL or multiple nodes. Large hints with short inputs are transport stress cases, not verified reuse workloads.
Full-envelope broadcast remains unchanged. The measured cost is material at the maximum envelope size. Selecting on rank 0 remains a possible optimization that needs a defined selection owner and a common decision for all ranks. The benchmark is outside the PR diff; these measurements do not establish production performance acceptance.
Complete aggregate results — all 57 measured configurations
The tables contain every non-smoke configuration from the six measurement runs. Each configuration has three trials; 57 × 3 trials plus six smoke checks give 177 cases per rank, or 354 rank-trials across two ranks. All runs completed, with no missing cases or cross-rank payload mismatches.
Smoke check
Passed six smoke cases per rank. These checks validate execution and payloads; their timings are not performance results.
TP2, 256-token requests — initial trials (200 broadcasts per trial)
Synchronous PP2, 256-token requests (100 broadcasts per trial)
TP2, 131,072-token requests (100 broadcasts per trial)
TP2, batch 128 — MPI chunk stress (100 broadcasts per trial)
TP2, batch 1 — five-second arrival windows (50,000 broadcasts per trial)
TP2, batch 32 — 6.4-second arrival windows (2,000 broadcasts per trial)
Notes
Related to #18151 and #18153. One signed implementation commit based on
mainat7d8d94684c4b3b03c835c82c75be290f051a29f6, with no dependency on the backend or lender integration PRs. The rebase preserves upstream request-field collection and carries the immutable hint snapshot into child requests.api-compatible, and no new dependencies or LLM configuration fields.