-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(trtllm): cherry-pick rc22 disagg request ID compat into feat/aa_glm5.2 #12205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
588b32e
fix(glm52): tool_call arguments dict and truncated tool_call content …
5791891
fix(glm52): correct paths for arguments normalization and streaming t…
461ee0d
fix(kv-router): return terminal prefill responses directly
krishung5 ebbd4cc
fix(trtllm): adapt disagg request IDs across API versions
krishung5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
63 changes: 63 additions & 0 deletions
63
components/src/dynamo/trtllm/tests/test_trtllm_disagg_request_id.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| from unittest.mock import patch | ||
|
|
||
| import pytest | ||
|
|
||
| from dynamo.trtllm.utils import disagg_utils | ||
|
|
||
| pytestmark = [ | ||
| pytest.mark.unit, | ||
| pytest.mark.trtllm, | ||
| pytest.mark.core, | ||
| pytest.mark.pre_merge, | ||
| pytest.mark.gpu_1, | ||
| ] | ||
|
|
||
|
|
||
| def test_rc22_machine_id_is_split_losslessly(): | ||
| with ( | ||
| patch.object(disagg_utils, "_TRTLLM_DISAGG_ID_HAS_PROCESS_ID", True), | ||
| patch.object( | ||
| disagg_utils, | ||
| "_trtllm_get_global_disagg_request_id", | ||
| return_value=123, | ||
| ) as generate, | ||
| ): | ||
| result = disagg_utils.get_compatible_global_disagg_request_id(1020) | ||
|
|
||
| assert result == 123 | ||
| generate.assert_called_once_with(15, 60) | ||
|
|
||
|
|
||
| def test_rc22_all_dynamo_machine_ids_are_in_range_and_unique(): | ||
| pairs = { | ||
| divmod(machine_id, disagg_utils._TRTLLM_PROCESS_ID_SPACE) | ||
| for machine_id in range(disagg_utils._DYNAMO_DISAGG_MACHINE_ID_SPACE) | ||
| } | ||
|
|
||
| assert len(pairs) == disagg_utils._DYNAMO_DISAGG_MACHINE_ID_SPACE | ||
| assert all(0 <= node_id < 256 for node_id, _ in pairs) | ||
| assert all(0 <= process_id < 64 for _, process_id in pairs) | ||
|
|
||
|
|
||
| def test_rc21_keeps_legacy_machine_id(): | ||
| with ( | ||
| patch.object(disagg_utils, "_TRTLLM_DISAGG_ID_HAS_PROCESS_ID", False), | ||
| patch.object( | ||
| disagg_utils, | ||
| "_trtllm_get_global_disagg_request_id", | ||
| return_value=456, | ||
| ) as generate, | ||
| ): | ||
| result = disagg_utils.get_compatible_global_disagg_request_id(1020) | ||
|
|
||
| assert result == 456 | ||
| generate.assert_called_once_with(1020) | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("machine_id", [-1, 1021]) | ||
| def test_invalid_dynamo_machine_id_fails_fast(machine_id): | ||
| with pytest.raises(ValueError, match="machine_id must be in range"): | ||
| disagg_utils.get_compatible_global_disagg_request_id(machine_id) |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Terminal prefill treats Error/Cancelled/ContentFilter as complete responses
is_terminalinconsume_prefill_stream(lib/llm/src/kv_router/prefill_router/admission.rs:117-121) is true for any finish reason exceptLength, which includesFinishReason::Error,Cancelled, andContentFilter. Previously such a prefill output lackingdisaggregated_paramswould raiseNoDisaggregatedParams; now it is returned directly to the caller as a terminal completion. For genuine EOS/Stop this is the intended fix, but an errored/cancelled one-token prefill would now surface as a normal terminal response rather than an error. This appears acceptable (the finish reason is preserved) but worth confirming against desired error-propagation semantics.Was this helpful? React with 👍 or 👎 to provide feedback.