[PR #3387] [CLOSED] [Engine] reject duplicate GPUs in automatic replica groups #4605

Closed
opened 2026-11-07 15:37:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3387
Author: @j-luwierski
Created: 10/20/2026
Status: ❌ Closed

Base: main ← Head: codex/strata-duplicate-replica-gpus


📝 Commits (1)

  • fd51c4b [Engine] reject duplicate GPUs in automatic replica groups

📊 Changes

2 files changed (+25 additions, -5 deletions)

View changed files

📝 serve/replicas.py (+6 -5)
📝 serve/test_replicas.py (+19 -0)

📄 Description

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 raise ReplicaConfigError before replica engines start.

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 for gpu_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:

  • Reproduced the issue on upstream main at e88ee39d1d6be6e3364183af3b39b62a7ed6f211, 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 on e88ee39d1d6be6e3364183af3b39b62a7ed6f211, 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:

  • The initial python3 -m unittest serve.test_replicas serve.test_parallel -q attempt could not import jinja2 from the system Python. The same suite then passed when run with the pinned repository requirements in a temporary uv environment.

Not run:

  • Multi-GPU inference and CUDA, HIP, SYCL or Metal builds; this change touches only Python server code and was verified with fake engines.

Limits

This validates configuration handling and fake-engine server behavior. It does not establish GPU runtime behavior or performance on hardware.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3387 **Author:** [@j-luwierski](https://github.com/j-luwierski) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/strata-duplicate-replica-gpus` --- ### 📝 Commits (1) - [`fd51c4b`](https://github.com/Niko1221/Strata/commit/fd51c4b4c3b78ad39f9bc00570aac71bfe322b36) [Engine] reject duplicate GPUs in automatic replica groups ### 📊 Changes **2 files changed** (+25 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `serve/replicas.py` (+6 -5) 📝 `serve/test_replicas.py` (+19 -0) </details> ### 📄 Description ## 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 raise `ReplicaConfigError` before replica engines start. ## Related discussion [PR #2953](https://github.com/Niko1221/Strata/pull/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 for `gpu_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:** - Reproduced the issue on upstream `main` at `e88ee39d1d6be6e3364183af3b39b62a7ed6f211`, 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 on `e88ee39d1d6be6e3364183af3b39b62a7ed6f211`, 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:** - The initial `python3 -m unittest serve.test_replicas serve.test_parallel -q` attempt could not import `jinja2` from the system Python. The same suite then passed when run with the pinned repository requirements in a temporary `uv` environment. **Not run:** - Multi-GPU inference and CUDA, HIP, SYCL or Metal builds; this change touches only Python server code and was verified with fake engines. ## Limits This validates configuration handling and fake-engine server behavior. It does not establish GPU runtime behavior or performance on hardware. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:37:47 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4605
No description provided.