Skip to content

[None][fix] Fix GPT-OSS KV-aware router hashing#13675

Open
SimengLiu-nv wants to merge 5 commits intoNVIDIA:feat/bench_xfrom
SimengLiu-nv:fix-gptoss-router
Open

[None][fix] Fix GPT-OSS KV-aware router hashing#13675
SimengLiu-nv wants to merge 5 commits intoNVIDIA:feat/bench_xfrom
SimengLiu-nv:fix-gptoss-router

Conversation

@SimengLiu-nv
Copy link
Copy Markdown
Collaborator

@SimengLiu-nv SimengLiu-nv commented Apr 30, 2026

Route GPT-OSS chat requests through Harmony tokenization before
computing KV-aware router block hashes, and make the Harmony serving path honor pre-tokenized prompt_token_ids from the router. Also forward cache_salt from chat_harmony into generation.

Add regression coverage for cache-salt hash partitioning, zero-block
prompt routing, and partial final-block matched-token accounting.

@coderabbitai summary

Description

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)

  • 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.

    Route GPT-OSS chat requests through Harmony tokenization before
computing KV-aware router block hashes, and make the Harmony serving
path honor pre-tokenized prompt_token_ids from the router. Also forward
cache_salt from chat_harmony into generation.

    Add regression coverage for cache-salt hash partitioning, zero-block
prompt routing, and partial final-block matched-token accounting.

Signed-off-by: Simeng Liu <simengl@nvidia.com>
@SimengLiu-nv SimengLiu-nv requested a review from a team as a code owner April 30, 2026 18:14
@SimengLiu-nv SimengLiu-nv requested review from zhenhuaw-me and removed request for a team April 30, 2026 18:14
Bind the C++ BlockKeyHasher path for token IDs with optional cache salt and route all Python block hashing through it.

Add use_harmony as an explicit router override while preserving GPT-OSS name/config detection when unset.

Keep router tokenization side-effect free so generation workers can retokenize requests, and cover the behavior with router tests.

Signed-off-by: Simeng Liu <simengl@nvidia.com>
@SimengLiu-nv SimengLiu-nv requested a review from a team as a code owner May 1, 2026 02:53
tool.model_dump() if hasattr(tool, "model_dump") else tool
for tool in request.tools
])

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.

Add stable round-robin tie breaking for KV-aware router candidate sets and ignore weak prefix-cache matches so low-affinity requests fall back to load balancing.

Make KV-cache scheduling tolerate stale or already removed sequences instead of throwing during simulated pause accounting.

Signed-off-by: Simeng Liu <simengl@nvidia.com>
Preserve visible streaming output when Harmony parsing fails by decoding a fallback batch, stripping only Harmony control framing, and resetting parser state for later chunks.

Treat failed or timed-out context KV transfers as transfer errors instead of clean context completions, and avoid re-storing context blocks that were already stored for asynchronous disaggregated transfer.

Signed-off-by: Simeng Liu <simengl@nvidia.com>
@SimengLiu-nv SimengLiu-nv requested a review from a team as a code owner May 1, 2026 17:24
@SimengLiu-nv SimengLiu-nv requested review from lancelly and removed request for a team May 1, 2026 17:24
Match the router Harmony tokenization path to chat_harmony when a request explicitly provides an empty tools list, and include pre-commit formatting updates for the changed branch files.

Signed-off-by: Simeng Liu <simengl@nvidia.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.

2 participants