Repository navigation
Conversation
poweiw
force-pushed
the
dev-release/0.4.0
branch
from
December 22, 2025 03:56
894eab2 to
d32753a
Compare
nvluxiaoz
reviewed
Dec 22, 2025
nvluxiaoz
left a comment
Collaborator
There was a problem hiding this comment.
Can we remove package.sh? This file seems not relevant.
Signed-off-by: Luxiao Zheng <[email protected]>
nvluxiaoz
force-pushed
the
dev-release/0.4.0
branch
from
January 2, 2026 18:06
d32753a to
6134649
Compare
Collaborator
|
Fully verified that I can push to your branch. Nice. |
suharvest
added a commit
to suharvest/TensorRT-Edge-LLM
that referenced
this pull request
May 22, 2026
Codex final audit (finding #1) identified that the slot pool ALREADY allocates per-slot IExecutionContext pairs (cpp:1914-1915 CP, :2952-2953 Talker), but the hot path in three call sites unconditionally falls back to the engine-global mPrefillContext / mDecodeContext whenever no explicit ctxOverride is passed: - CP generatePreparedInputs at cpp:1099-1100 - Talker prefill at cpp:2339-2341 - Talker decode at cpp:2508 Two concurrent handleAudioGeneration calls pass `slot != nullptr` but not `ctxOverride`, so both threads enqueueV3 against the SAME IContext. TRT IExecutionContext is not safe for concurrent enqueue — each call mutates input shapes, tensor address bindings, and profile index. That is the cumulative-state-corruption root cause behind the cudaMemsetAsync(state.read.rawPointer(), ...) illegal-access errors observed after 2-3 N=2 bursts under the prior C1+C2+C3+C5 config. Fix: in each of the three sites, when slot is non-null and owns a context, route through slot->prefillCtxOwned.get() / decodeCtxOwned.get() — keeping ctxOverride priority for the legacy captureDecodingCUDAGraph path. ~10-15 LOC. Empirical post-fix (orin-nx, profile jetson-multilang-highperf-nx, OVS_TTS_WORKER_CONCURRENCY=2, max_workers=2): - 30 sustained N=2 dual-client bursts: zero broken-state TTFAs - Mid-stress + post-stress N=1 audio MD5 = baseline f515a4376962cca876f21089130d7253 (byte-identical) - Audio quality preserved across the full gauntlet Caveat: throughput is now lower than the C2-first-burst peak. slow- client TTFA p50 ~4× single-client baseline, vs 1.4× pre-C6. That's likely findings NVIDIA#2 (slot reused mid-request) + NVIDIA#3 (resetSampling mutates all slots) from the audit — coming in follow-up commits. This commit closes the CRASH path; the THROUGHPUT path needs the remaining audit items addressed. Signed-off-by: suharvest <[email protected]>
suharvest
added a commit
to suharvest/TensorRT-Edge-LLM
that referenced
this pull request
May 22, 2026
…ll request Codex audit finding NVIDIA#2: at N=1 each engine method (prefill, decode) acquired+released its own slot. With concurrent N=2 requests, two threads played musical chairs with slots — request A's prefill could write KV into slot 0, slot 0 returned to pool, request B's decode then grabbed slot 0 and overwrote it. KV state corruption cascaded down through the codec frame loop and surfaced as cudaMemsetAsync(state.read.rawPointer(), ...) illegal-access in Code2Wav after 2-3 N=2 bursts under the prior C6 ctx-per-slot fix alone. Fix: add Qwen3TTSTalkerEngine::beginRequest() / endRequest() and the matching pair on Qwen3TTSCodePredictorEngine. Each one acquires the slot once at request start and stores it in an mActiveSlots map keyed by std::thread::id. The pre-existing slot-pool recursive acquire path in prefill/decode now first checks getActiveSlot() and uses that if present, only falling back to per-call acquire when no request guard is in scope (matches N=1 byte-equivalence at single-client). handleAudioGeneration calls beginRequest on both engines at the top of the function under an RAII EnginesRequestGuard that calls endRequest on scope exit, covering all error paths. Worker dispatch threads each run one handleAudioGeneration per request, so std::thread::id-keyed map is stable for the request lifetime. Empirical post-fix (orin-nx, profile jetson-multilang-highperf-nx, OVS_TTS_WORKER_CONCURRENCY=2, max_workers=2): - 30 sustained N=2 dual-client bursts: zero broken-state TTFAs - Zero CUDA runtime errors in docker logs across the gauntlet - N=1 audio MD5 = f515a4376962cca876f21089130d7253 baseline before AND after the 30-run stress (byte-identical) What's now SOLID: - Functional correctness under sustained concurrent load - Audio quality preservation - No crashes / no state corruption / no recovery needed What's still NOT met (deferred to next phase, finding #D): - Throughput target ≤ 1.5× single-client TTFA - Current slow-client p50 ~5× single-client baseline - Root cause: worker uses ONE shared CUDA stream (examples/omni/qwen3_tts_worker.cpp:656-658) for all handleAudioGeneration calls — CUDA ops serialize on stream regardless of per-slot ctx. Real parallelism needs per-request CUDA stream creation in the worker dispatch path. Signed-off-by: suharvest <[email protected]>
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.
Key features