[https://nvbugs/6196391][fix] Carryover disagg TTFT improvements - #14719
Conversation
|
/bot run --disable-fail-fast |
📝 WalkthroughWalkthroughThis PR optimizes BlockKey construction in the C++ KVCache manager and enhances the OpenAI server with conditional performance metrics collection and improved streaming response handling with token preparation caching. ChangesBlockKey Construction Optimization
OpenAI Server Metrics and Streaming
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tensorrt_llm/serve/openai_server.py`:
- Around line 1638-1640: The code currently logs full request payloads
(request.messages and request) and uses a bare except; change the logger.error
calls that reference request, request.messages and tools_dict to only emit safe
identifiers and a redacted summary (e.g., log request.id, request.model, and a
short redacted messages summary or list of tool names instead of full contents)
and replace the bare exception handling with a specific exception catch for
tokenization errors (e.g., catch TokenizationError or ValueError as e in the
tokenization block), log the error with request id/model and redacted summary,
and avoid printing any sensitive message/tool arguments; update the logger.error
calls and exception clause where the symbols logger, request, request.messages,
and tools_dict appear.
- Around line 1606-1608: In openai_server.py, replace the two bare "except:"
blocks with explicit handling: catch asyncio.CancelledError and re-raise it
(except asyncio.CancelledError: raise), then catch other errors with "except
Exception as e:" and log the traceback (logger.error(traceback.format_exc()) or
logger.exception(...)) before re-raising; also change the existing "raise e"
usage to a plain "raise" so the original traceback is preserved. Target the bare
except blocks and the "raise e" instance in the file and apply these exact
exception patterns to preserve cancellation semantics and original tracebacks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4d26cc62-5cdd-48c8-aff4-6fa8bfa156d5
📒 Files selected for processing (2)
cpp/tensorrt_llm/batch_manager/kvCacheManager.cpptensorrt_llm/serve/openai_server.py
|
PR_Github #50929 [ run ] triggered by Bot. Commit: |
|
PR_Github #50929 [ run ] completed with state
|
5199e53 to
feecfd2
Compare
…ator Addresses CodeRabbit feedback on PR NVIDIA#14719: - Split the bare `except:` introduced by NVIDIA#14506 in `chat_harmony.create_streaming_generator` into `except asyncio.CancelledError: raise` plus `except Exception: logger.error(...); raise`. The bare except previously swallowed `CancelledError` propagation and logged a misleading traceback on every client-initiated stream disconnect. - Drop `raise e` in favor of plain `raise` in the harmony tokenization error path to preserve the original traceback (PEP 8 / ruff B904). Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
8775b5e to
a113d8e
Compare
6341deb to
52ebe4d
Compare
52ebe4d to
c017564
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #51113 [ run ] triggered by Bot. Commit: |
…ReuseTreeByBlockKey (NVIDIA#14499) [https://nvbugs/6196391][fix] avoid duplicate harmony tokenization & populate perf_metrics (NVIDIA#14506) Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
fc2f857 to
dbd2a4c
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #51123 [ run ] triggered by Bot. Commit: |
|
PR_Github #51113 [ run ] completed with state |
|
PR_Github #51123 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #51204 [ run ] triggered by Bot. Commit: |
|
PR_Github #51204 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #51212 [ run ] triggered by Bot. Commit: |
|
PR_Github #51212 [ run ] completed with state |
Description
This MR carries over following fixes to main:
a) Avoid retokenization on gen server in disagg - just pass them from ctx -> gen.
b) Enable populating perf metrics.
a) Avoid O(N^2) memcpy in kv cache reuse function used by disagg codepath.
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.Summary by CodeRabbit
New Features
Improvements