Repository navigation
[Engine] reject duplicate GPUs in automatic replica groups - #3387
Open
j-luwierski wants to merge 1 commit into
Open
j-luwierski wants to merge 1 commit into
j-luwierski wants to merge 1 commit into
Conversation
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.
Problem and result
On the current upstream
main,gpu_groups()accepts overlapping GPUs when a numeric replica count derives groups from the configured GPU list. Reproduced before the fix:{"gpu":[0,0],"replicas":2}returns[[0],[0]];{"gpu":[0,1,1,2],"replicas":2}returns[[0,1],[1,2]]. The server can then start independent replica engines on the same card. After this change, these configurations raiseReplicaConfigErrorbefore replica engines start.Related discussion
PR #2953 was closed during the 0.2.0-beta tracker reset, not declined. The original change was revalidated against current
main. Search of open and closed issues and PRs forgpu_groups, duplicate cards and replica GPU grouping found no other fix for this case.Approach
Build numeric groups and pass them through the same non-empty and duplicate-card validation used for explicitly named groups. Add regression coverage for duplicate GPU IDs in list and comma-separated forms, normalized duplicate IDs, explicit groups, preserved card order, and disabled replica counts. Valid group ordering and the no-replica path remain unchanged. No engine backend or defaults are changed.
Validation
Passed:
mainate88ee39d1d6be6e3364183af3b39b62a7ed6f211, Linux Debian 13, Python 3.13.5: duplicate GPU configurations returned overlapping groups instead of raising an error.uv run --with-requirements requirements.txt python -m unittest serve.test_replicas serve.test_parallel -q, on the change based one88ee39d1d6be6e3364183af3b39b62a7ed6f211, Linux Debian 13, Python 3.13.5: 64 tests passed in 71.163 seconds. These tests use fake engines; no model or GPU was used.git diff --check: passed.Failed:
python3 -m unittest serve.test_replicas serve.test_parallel -qattempt could not importjinja2from the system Python. The same suite then passed when run with the pinned repository requirements in a temporaryuvenvironment.Not run:
Limits
This validates configuration handling and fake-engine server behavior. It does not establish GPU runtime behavior or performance on hardware.