[Performance] Disaggregated conversation routing retains a trie node for every block of every distinct document

Open
#23,078 0 comments 0 reactions 2 assignees View on GitHub

Maintainers usually reply within 1 day

@kaiyux is already working on this.

Since Nov 30, 2026.

  • #23079 by @HaoyangPing0324 — open

Assessment

This issue has not been assessed yet.

Description

Disaggregated serving General perf Investigating Performance triaged
Proposal to improve performance

The disaggregated ConversationRouter keeps an implicit prefix index for ordinary multi-turn requests without a conversation ID in single-process deployments. It also indexes first-request content when placing a new explicit conversation with prefix affinity. The current trie allocates a Python node, child dictionary and session-ID set at every block, including long paths that have just one session. Updating a conversation removes and reinserts the complete path. This makes the memory and control-plane cost noticeable when tracking many independent long documents or chats.

With four routing destinations and 256 retained conversations of 4k–24k token IDs (512 common leading tokens, two subsequent turns), the implicit index held 25,861 nodes by the third turn on our test host. Only 258 nodes were necessary to distinguish the sessions, their common prefix and their terminal points. Existing longest-valid-prefix routing and the count of sessions sharing any queried prefix can be preserved with compressed paths.

Report of performance regression

No response

Misc discussion on performance

No response

Your current environment (if you think it is necessary)

TensorRT-LLM 1.4.0rc4 wheel, current main router and tests, GPU-disabled container with two CPUs.

Before submitting a new issue...
  • Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.
Dominant language
Python
Stars
15.2k
Forks
3k
Avg merge
2d 21h
Merged PRs (30d)
477

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/TensorRT-LLM

All issues in NVIDIA/TensorRT-LLM

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.