Repository navigation
[None][fix] Let --disagg_cluster_uri override the config file uri - #20490
Open
spicysharkco wants to merge 1 commit into
Open
spicysharkco wants to merge 1 commit into
spicysharkco wants to merge 1 commit into
Conversation
extract_disagg_cluster_config() documents that a cluster_uri argument overrides the cluster_uri in the cluster config dict, and serve.py passes --disagg_cluster_uri through it, with a comment that the command line takes precedence over the config file. The argument was only used to construct DisaggClusterConfig. The update_dataclass() call that follows copies every key of the dict onto that object, including the dict's own cluster_uri, so the value from the config file replaced the command line value. The override only worked when the file had no cluster_uri. Apply the override after the dict has been copied. Add a unit test for the override and for the no-argument case. Signed-off-by: spicysharkco <321699413+spicysharkco@users.noreply.github.com>
Contributor
Open
1 task done
1 task done
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
trtllm-serve --disagg_cluster_uriis documented to take precedence overdisagg_cluster.cluster_uriin the config file (see the comment intensorrt_llm/commands/serve.pyabove theextract_disagg_cluster_configcall, and the docstring of that function). In practice the command line value is ignored whenever the config file also setsdisagg_cluster.cluster_uri, and the uri from the file is used instead.Root cause.
extract_disagg_cluster_config()buildsDisaggClusterConfig(cluster_uri or cluster_config_dict["cluster_uri"]), so the argument is used for the constructor. It then runsupdate_dataclass()over the same object with the wholecluster_config_dict. That loop sets every non-Nonekey, including the dict's owncluster_uri, and overwrites the value that was just passed in. The override only worked when the file had nocluster_uriat all.Repro (no GPU needed):
Fix. Apply the override after the config file values have been copied onto the dataclass. When no override is given, nothing changes. A config with neither a file uri nor an argument still raises
KeyErroras before.release/1.3has the same code and the same bug. #20128 also edits the import list intest_disagg_utils.py; whichever merges second needs a trivial rebase.This was found by reading the code path and confirmed with the unit test below. I did not launch a disaggregated deployment, so the
trtllm-serveside of the behavior is covered only throughextract_disagg_cluster_config, which is the single placeserve.pytakes the value from.Test Coverage
tests/unittest/disaggregated/test_disagg_utils.py::test_extract_disagg_cluster_config_uri_argumenthas two cases: no argument keeps the uri from the config, and an argument replaces it (the other fields still come from the config). The second case fails before this change.Run on CPU only with Python 3.12 and pytest, against the real
disagg_utils.py. The compiled bindings are not built there, sompi4pyandtensorrt_llm._utils.global_mpi_rank/global_mpi_sizewere replaced by small stubs;extract_disagg_cluster_configuses neither. GPU CI and a realtrtllm-servelaunch were not run.disagg_utils.pytest_disagg_utils.pya857768f9)Formatting hooks (yapf, isort, autoflake) pass on both touched files.
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.Dev Engineer Review
The inspected diff changes only two docstrings in
tensorrt_llm/llmapi/disagg_utils.py. The currentextract_disagg_cluster_config()implementation reapplies a truthycluster_uriargument after copying dictionary values, so the argument takes precedence. The diff does not establish that this behavior was introduced by the changes reviewed.QA Engineer Review
No test changes.
Per-File QA Perspective
tensorrt_llm/llmapi/disagg_utils.py: The current function uses the argument URI when it is truthy and otherwise uses the config URI. Verify both paths and confirm that a missing URI still raisesKeyError; the inspected diff does not change this behavior.