Repository navigation
[None][perf] use native protobuf and streamline gRPC result delivery - #19760
Merged
jthomson04 merged 19 commits intoOct 26, 2026
Merged
Conversation
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
jthomson04
marked this pull request as ready for review
October 1, 2026 20:11
jthomson04
requested review from
EmmaQiaoCh,
QiJune,
Tabrizian,
ZhanruiSunCh,
allisonlim-nv,
brnguyen2,
chienchunhung,
kaiyux and
laikhtewari
October 1, 2026 20:11
Collaborator
Author
|
/bot run --disable-fail-fast |
Contributor
Collaborator
|
PR_Github #76002 [ run ] triggered by Bot. Commit: |
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Collaborator
|
PR_Github #76002 [ run ] completed with state
|
Collaborator
Author
|
/bot run --disable-fail-fast |
Collaborator
|
PR_Github #76086 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #76086 [ run ] completed with state
|
tanmayv25
reviewed
Oct 3, 2026
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
…al deltas Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
… deltas Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Oct 31, 2026
Ported from NVIDIA/TensorRT-LLM#19760 Generated by autojump (AI); review before merging.
1 task done
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The container inherits Python protobuf, SMG copies the complete token history on each streaming update, and shared result queues schedule a coroutine for each notification. This PR makes native
upbthe container default, removes the unnecessary SMG history copies, and schedules direct event-loop callbacks for single and batched queue notifications.Both gRPC launchers warn before model startup when Python protobuf is active and continue startup. Native
upbandcppdo not produce a warning. Backend detection is optional: if the private protobuf implementation API cannot be imported or has noTypeattribute, the launchers skip the warning and continue startup. The notification change keeps queue order, existing batch deduplication, event-loop ownership, and shutdown handling.Streaming boundaries, token order, text deltas, logprob alignment, terminal metadata, cancellation, and slow-consumer isolation are preserved. The benchmark engine emits one token per result. No streaming-interval change, response merging, extra token buffering, public API change, or protocol change is included. OpenEngine text decoding remains enabled.
Current main versus this PR
Baseline: main at campaign start,
269365738865803f637cf6120a1d2098cc791004. Measured candidate:88f331b90f043315a5689fe2d3e2ac33a8a6e5f5. The candidate contains main plus this PR's changes; no other unmerged PR is included. The follow-up commit2b34042bd88b4baa21d9de368b048729f1cc4022makes backend detection optional and changes startup diagnostics and tests only. The campaign was not repeated; the results below remain measurements of88f331b90f043315a5689fe2d3e2ac33a8a6e5f5.One unprofiled run per adapter and revision at trace concurrency 32:
Response bytes are serialized protobuf payloads, including terminal messages; network framing is excluded. SMG's final repeated token sequence is checked without counting those tokens twice. Latencies include drained completions for requests admitted during measurement. Full latency, response-gap, request-length, and client-dispatch distributions are in the report.
Producer capacity and profiles
Four direct-LLM checks retain production sampling, request processing, worker dispatch, IPC, queues, notifications, result processing, and adapter decoding. They omit gRPC response construction, serialization, and transport. Their concurrency is 32 requests, while the full-server concurrency is 32 AgentX traces with dependencies and fan-out.
The longer capacity prompts provide conservative headroom evidence for the retained CPU path. Both request and token rates are shown to avoid a claim based only on different output lengths. Four additional profile runs use separate 30-second
perfand ordinary Pythonpy-spywindows at 99 Hz. Their throughput does not replace the unprofiled measurements.At C32, the observed output-throughput gain is 2.59x for SMG and 2.08x for OpenEngine. Frontend CPU per token falls by 57.1% and 48.5%, respectively. These results measure the three changes together against main. They do not isolate the contribution of each change.
All four capacity checks exceed 2x in both token and request throughput. The PR has 3.60x token / 3.35x request headroom for SMG and 3.49x / 2.89x for OpenEngine, with longer prompts in the capacity checks. The retained producer path therefore has substantial headroom over these full-server measurements. The busiest client thread averages less than 0.01 cores in every timing run. The largest p99 dispatch delay is 0.142 ms; isolated maxima reach 9.135 ms. These records do not indicate a sustained client CPU or dispatch limit.
Remaining PR frontend samples include adapter request and response handling (SMG 29.8%, OpenEngine 40.7%), shared result processing (16.1%, 25.4%), and IPC (19.0%, 13.5%). OpenEngine tokenizer work appears in 5.4% of frontend stacks. Worker stacks contain more IPC work (59.5% for SMG, 51.8% for OpenEngine) than mock generation (8.9%, 12.5%). These are overlapping inclusive Python sample fractions, not exact CPU-time shares or predicted optimization gains. Native perf reports also show Python evaluation, allocation, and kernel work. Python protobuf appears in 35.9% / 37.8% of main frontend stacks; its absence from PR Python stacks does not mean native protobuf is free.
All workload, placement, CPU-record, drain, and shutdown checks pass. The main SMG frontend py-spy capture has one sampling error among 3,169 recorded stacks; the other seven Python captures have no sampling errors. All eight perf captures report zero lost samples. This profile qualification is retained separately and does not reject an unprofiled timing result.
These are directional measurements, with one observation per point. C32 alone does not establish a serving ceiling or a causal GIL limit. The results cover the production serving path, this AgentX workload, frozen runtime, and CPU allocation with a CPU engine mock. They exclude GPU inference. The adapters perform different protocol work.
Validation
upbprocesses, simulatedcpp, missing private API import/Type, and both launchers reaching model initialization. All 11 registered CPU cases collect successfully. Formatting and lint hooks passed. No benchmark or container build was repeated for this follow-up.upb; serving measurements retain main's Python protobuf and the PR'supb. Existing subprocess tests check the real Python and native backends.96e282482740ee2f345c9d49a6ce29674b8641d8included a successful fresh x86 development-image build withupb, plus PyTorch, ONNX, ModelOpt, and ONNX protobuf serialization checks (imagesha256:12e517048a913c11e869d336dce2c6ce49096b33bf337daf7f8fefd04043c981). That image build was not repeated for this notification update. GPU inference, full release/Triton image builds, and ModelOpt GPU plugins remain untested.Method and provenance
The harness calls the production server launchers. It replaces only model/GPU initialization and execution: the model factory, worker engine setup, empty GPU model registry, and unused startup CUDA stream. Production LLM processing, executor IPC, worker dispatch, result queues, response construction, serialization, and transport remain. The deterministic CPU mock is unchanged across revisions.
2936939: serverptyche0282, clientptyche0288. Frontend CPUs 0-35; worker/mock 36-71; client 0-71; memory NUMA 0. Client: 32 workers and 32 connections. Allocation released after collection.Qwen/Qwen3-0.6B@c1899de289a04d12100db370d81485cdf75e47ca. Trace loader: AIPerfedfbf94f004a610471c3454371e637f4969cc5a7.affd82461714d182d54d222fe28384cedd60a8bb; wheel SHA256df67a40e85c46e0792436040976623aa59530e4608812165b96160bb3b387945. Executor/bindings C++ source is unchanged through the pinned main. These are frozen native binaries with each revision's Python source, not fresh main/release image builds.1b5f90fd2a61b60da12ba08c4dc062267a78bbb507651ff97ec6cfa86244629e.5c95942deddd48aa2e62d61338e57ab4666c4b08cbd1f9440133bad2a8efc72d; client SHA256:d1a020cb72f3c8446cc0100178cb22cf3f30d0cde62474b64185517899f46186.ae47f2e5c8263fe71a539c23104660baf18716ebf7ff236e52f42e809538059d; frozen prompt tokens SHA256:64e176ca86a3609a3a6e6f3a2e24b2f3d6d7bf52bdde13aa1e389f8852db6939.Harness changes and raw artifacts are separate from this production PR. The report, exact source archives, loaded-source hashes, runtime replacements, dependencies, request distributions, CPU records, raw profiles, validation logs, and release record are saved on Tyche at
/lustre/fsw/coreai_comparch_trtllm/jothomson/trtllm-grpc-bench-20260930/main-notify-20261001.Evidence archive:
main-notify-20261001-evidence.tar.gz, 1,275,796,416 bytes, SHA2565f71919fa00d92141a2e7e875f97adb59af0da76d37a9c393561d8fa58f8640f. The downloaded archive and loaded source hashes were verified locally.Dev Engineer Review
The
baseandreleasecontainer stages now default to nativeupb. Both gRPC launchers warn when protobuf uses the Python implementation and continue startup. If the private detection API is unavailable or lacksType, the warning is skipped. Nativeupbandcppdo not warn.The SMG response path reuses token histories instead of copying them.
_SyncQueue.putandnotify_manyschedule synchronous callbacks withloop.call_soon_threadsafeand retain shutdown error handling. These changes target lower copy and notification overhead without changing the public API or protocol.No current review findings were supplied, so review severity counts are unavailable. Reported benchmarks use a CPU engine mock and combine all three performance changes. They do not establish GPU-serving performance or a causal GIL limit. GPU inference, full release/Triton image builds, and ModelOpt GPU plugins remain untested.
QA Engineer Review
Changed tests cover SMG streaming response construction, protobuf warning and launcher startup paths, queue notifications and shutdown, and the remote-dictionary test’s independence from the Python protobuf environment variable. The
l0_cputest list adds two SMG streaming-delta tests and five optional-gRPC tests. The supplied evidence does not include test IDs for the added entries.Reported validation includes 9 queue test passes on the PR, 15 shared-result test passes per revision, and 58 metadata test passes per revision. Affected executor tests had 83 passes and 9 GPU-startup import failures on both revisions. The affected adapter suite had 112 passes and 6 failures on the PR, compared with 102 passes and 8 failures on main; the author reports that all remaining PR failures also occur on main. CI results included failures and unstable pipelines. Coverage verdict: needs follow-up. GPU inference and the listed builds remain untested, and CI was not uniformly successful.
Per-File QA Perspective
docker/Dockerfile.multi: Verify thatPROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=upbis active in bothbaseandreleaseimages.docs/source/installation/containers.md: Verify that the protobuf setup guidance matches image defaults and launcher warning behavior.tensorrt_llm/grpc/_protobuf.py: Verify warnings for Python protobuf and continued startup when detection raisesImportErrororAttributeError.tensorrt_llm/grpc/openengine/README.md: Verify that documented protobuf setup matches image defaults and launcher behavior.tensorrt_llm/grpc/openengine/server.py: Verify that the warning runs before the server lifecycle and does not block startup.tensorrt_llm/grpc/smg/server.py: Verify that the warning runs before reflection loading and does not block startup.tensorrt_llm/grpc/smg/servicer.py: Verify token order, counts, and logprobs in streaming and completion responses when token histories are reused.tests/integration/test_lists/test-db/l0_cpu.yml: Adds two SMG streaming-delta tests and five optional-gRPC tests to the CPU CI list.tests/unittest/disaggregated/test_remoteDictionary.py: Verify that the test remains independent of the Python protobuf environment setting. No test-list change for this unit test is identified.tests/unittest/grpc/smg/test_smg.py: Covers streaming deltas, completion responses, and empty token histories. The supplied evidence does not establish whether this unit test is listed in a CI or manual-QA list.tests/unittest/grpc/test_grpc_optional.py: Covers protobuf warnings, unavailable detection APIs, launcher startup, and missing reflection imports. The supplied evidence does not establish whether this unit test is listed in a CI or manual-QA list.tensorrt_llm/llmapi/utils.py: Verify ordered queue delivery, batched notifications, and shutdown errors with synchronous event-loop callbacks.tests/unittest/llmapi/test_llm_utils.py: Covers queue notifications across queues, cancellation, late notifications, and stopped or closed loops. The supplied evidence does not establish whether this unit test is listed in a CI or manual-QA list.jenkins/current_image_tags.properties: Verify that the updated staging image tags point to the intended x86_64, SBSA, Rocky Linux, Python, and wheel configurations used by CI.