Skip to content

[None][fix] avoid duplicate harmony tokenization & populate perf_metrics - #14506

Merged
longlee0622 merged 1 commit into
NVIDIA:feat/bench_xfrom
brb-nv:fix/disagg-chat-tokens-and-perf-metrics
May 27, 2026
Merged

[None][fix] avoid duplicate harmony tokenization & populate perf_metrics#14506
longlee0622 merged 1 commit into
NVIDIA:feat/bench_xfrom
brb-nv:fix/disagg-chat-tokens-and-perf-metrics

Conversation

@brb-nv

@brb-nv brb-nv commented May 24, 2026

Copy link
Copy Markdown
Collaborator

Description

This MR makes the following changes:

  1. Reuse the disagg ctx worker's pre-tokenized prompt_token_ids on the gen handler instead of re-running the harmony adapter. Inspired by @reasonsolo's change in [None][fix] propagate chat prompt token ids #14420.
  2. Populate perf_metrics for /v1/chat/completions in the harmony streaming generator.

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-compatible or api-breaking. For api-breaking, include BREAKING in 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.

@brb-nv
brb-nv requested a review from a team as a code owner May 24, 2026 21:27
@brb-nv
brb-nv requested review from JunyiXu-nv and removed request for a team May 24, 2026 21:27
@brb-nv
brb-nv force-pushed the fix/disagg-chat-tokens-and-perf-metrics branch from 0df721f to a81c0f2 Compare May 24, 2026 21:29
@brb-nv
brb-nv requested review from pcastonguay and reasonsolo May 24, 2026 21:29
@brb-nv brb-nv changed the title Fix/disagg chat tokens and perf metrics [None][fix] avoid duplicate harmony tokenization on disagg gen worker & populate /perf_metrics deque for chat endpoints May 24, 2026
@brb-nv brb-nv changed the title [None][fix] avoid duplicate harmony tokenization on disagg gen worker & populate /perf_metrics deque for chat endpoints [None][fix] avoid duplicate harmony tokenization & populate perf_metrics May 24, 2026
… & populate /perf_metrics deque for chat endpoints

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
@brb-nv
brb-nv force-pushed the fix/disagg-chat-tokens-and-perf-metrics branch from a81c0f2 to 7901019 Compare May 24, 2026 21:31
@brb-nv

brb-nv commented May 24, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #50114 [ run ] triggered by Bot. Commit: 7901019 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #50114 [ run ] completed with state SUCCESS. Commit: 7901019
/LLM/main/L0_MergeRequest_PR pipeline #39667 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

Link to invocation

@JunyiXu-nv JunyiXu-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@longlee0622
longlee0622 merged commit 91142da into NVIDIA:feat/bench_x May 27, 2026
4 of 5 checks passed
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request May 29, 2026
…ics (NVIDIA#14506)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request May 29, 2026
…ics (NVIDIA#14506)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request May 29, 2026
…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>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request May 29, 2026
…ReuseTreeByBlockKey (NVIDIA#14499)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>

[None][fix] avoid duplicate harmony tokenization & populate perf_metrics (NVIDIA#14506)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request May 29, 2026
…ReuseTreeByBlockKey (NVIDIA#14499)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>

[None][fix] avoid duplicate harmony tokenization & populate perf_metrics (NVIDIA#14506)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request May 29, 2026
…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>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request May 29, 2026
…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>
brb-nv added a commit to brb-nv/TensorRT-LLM that referenced this pull request May 29, 2026
…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>
reasonsolo pushed a commit to reasonsolo/TensorRT-LLM that referenced this pull request Jun 2, 2026
…ics (NVIDIA#14506)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
reasonsolo pushed a commit to reasonsolo/TensorRT-LLM that referenced this pull request Jun 4, 2026
…ics (NVIDIA#14506)

Signed-off-by: Balaram Buddharaju <169953907+brb-nv@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants