[PR #3276] [CLOSED] [Other] setup: calibrate a dual config whose gpu is the string 0,1 #4541

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3276
Author: @MEsfits
Created: 10/19/2026
Status: ❌ Closed

Base: main ← Head: fix-calibrate-string-gpu-020


📝 Commits (1)

  • 3f52b2d setup: calibrate a dual config whose gpu is the string 0,1 (#3275)

📊 Changes

2 files changed (+31 additions, -2 deletions)

View changed files

📝 setup.py (+20 -2)
📝 tools/test_setup_amd.py (+11 -0)

📄 Description

Problem and result

Setup's calibration of a dual config whose "gpu" is the string form "0,1" (accepted and split by serve) dies after all measurement rounds with [X] there is no GPU 0,1: 0 = NVIDIA GeForce RTX 3090 Ti, 1 = NVIDIA GeForce RTX 3090. Nothing is saved, because the hardware key the rounds are stored under cannot be computed.

hardware_key() passed the raw value to gpu_info(), which matches one card by number (x["index"] == pick), so the string matched nothing. List-form duals ([0, 1]) worked; only the string form died. recommend_remote_expert_opt() had the same blind spot: its isinstance(cfg.get("gpu"), list) check skipped string-form duals, so they never got the helper-cache recommendation.

After the fix the same config keys and calibrates exactly like the list form.

Fixes #3275. The identical fix was sent earlier for the 0.1.45 line (#2378) and did not land; the 0.2.0 tree still had the pre-fix line. Focused bug fix, no scope agreement needed.

Approach

  • gpu_sel(value): a config's "gpu" as a list of card numbers -- 0, [0, 2] and the string form "0,2" (which serve splits the same way); [] when it names none.
  • hardware_key(): string-form selectors go through gpu_sel() before gpu_info().
  • recommend_remote_expert_opt(): len(gpu_sel(...)) < 2 instead of the isinstance(..., list) check.
  • Regression test in CalibrationKey: "0,1" keys exactly like [0, 1]; gpu_sel("0,1") == [0, 1], gpu_sel("0") == [0].

The NVIDIA key format is unchanged (the existing test asserts it). No behavior change outside setup; serve and the engine are untouched.

Validation

Passed:

  • python -m unittest tools.test_setup_amd.CalibrationKey on 3f52b2d7 (0.2.0 tree, e88ee39d) -- 8/8 tests OK, including the new test_nvidia_string_dual_keys_like_the_list.
  • Real dual config on 2x RTX 3090 (3090 Ti + 3090), Ubuntu 26.04, engine 0.1.45.3: hardware_key(cfg) with "gpu": "0,1" now returns NVIDIA GeForce RTX 3090 Ti + NVIDIA GeForce RTX 3090|48GB|AMD Ryzen 7 9800X3D 8-Core Processor|59GB|<model>|262144|images; before the fix the same call died with there is no GPU 0,1.

Failed:

  • none observed

Not run:

  • Full calibrate round-trip after the fix (the failing call itself is covered; the re-run on the reporting box is the next check).
  • No engine rebuild: the change is setup.py only (pure Python); CUDA/HIP/SYCL/CPU binaries are untouched.

Limits

  • Executed on Linux/NVIDIA only; the code path is platform-agnostic but Windows and macOS were not run.
  • Only hardware_key() and recommend_remote_expert_opt() are covered; the other gpu_info() callers already pass card numbers.

🔄 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/3276 **Author:** [@MEsfits](https://github.com/MEsfits) **Created:** 10/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-calibrate-string-gpu-020` --- ### 📝 Commits (1) - [`3f52b2d`](https://github.com/Niko1221/Strata/commit/3f52b2d714cca081388176600c313805081cb200) setup: calibrate a dual config whose gpu is the string 0,1 (#3275) ### 📊 Changes **2 files changed** (+31 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `setup.py` (+20 -2) 📝 `tools/test_setup_amd.py` (+11 -0) </details> ### 📄 Description ## Problem and result Setup's calibration of a dual config whose `"gpu"` is the string form `"0,1"` (accepted and split by serve) dies after all measurement rounds with `[X] there is no GPU 0,1: 0 = NVIDIA GeForce RTX 3090 Ti, 1 = NVIDIA GeForce RTX 3090`. Nothing is saved, because the hardware key the rounds are stored under cannot be computed. `hardware_key()` passed the raw value to `gpu_info()`, which matches one card by number (`x["index"] == pick`), so the string matched nothing. List-form duals (`[0, 1]`) worked; only the string form died. `recommend_remote_expert_opt()` had the same blind spot: its `isinstance(cfg.get("gpu"), list)` check skipped string-form duals, so they never got the helper-cache recommendation. After the fix the same config keys and calibrates exactly like the list form. ## Related discussion Fixes #3275. The identical fix was sent earlier for the 0.1.45 line (#2378) and did not land; the 0.2.0 tree still had the pre-fix line. Focused bug fix, no scope agreement needed. ## Approach - `gpu_sel(value)`: a config's `"gpu"` as a list of card numbers -- `0`, `[0, 2]` and the string form `"0,2"` (which serve splits the same way); `[]` when it names none. - `hardware_key()`: string-form selectors go through `gpu_sel()` before `gpu_info()`. - `recommend_remote_expert_opt()`: `len(gpu_sel(...)) < 2` instead of the `isinstance(..., list)` check. - Regression test in `CalibrationKey`: `"0,1"` keys exactly like `[0, 1]`; `gpu_sel("0,1") == [0, 1]`, `gpu_sel("0") == [0]`. The NVIDIA key format is unchanged (the existing test asserts it). No behavior change outside setup; serve and the engine are untouched. ## Validation **Passed:** - `python -m unittest tools.test_setup_amd.CalibrationKey` on 3f52b2d7 (0.2.0 tree, e88ee39d) -- 8/8 tests OK, including the new `test_nvidia_string_dual_keys_like_the_list`. - Real dual config on 2x RTX 3090 (3090 Ti + 3090), Ubuntu 26.04, engine 0.1.45.3: `hardware_key(cfg)` with `"gpu": "0,1"` now returns `NVIDIA GeForce RTX 3090 Ti + NVIDIA GeForce RTX 3090|48GB|AMD Ryzen 7 9800X3D 8-Core Processor|59GB|<model>|262144|images`; before the fix the same call died with `there is no GPU 0,1`. **Failed:** - none observed **Not run:** - Full calibrate round-trip after the fix (the failing call itself is covered; the re-run on the reporting box is the next check). - No engine rebuild: the change is `setup.py` only (pure Python); CUDA/HIP/SYCL/CPU binaries are untouched. ## Limits - Executed on Linux/NVIDIA only; the code path is platform-agnostic but Windows and macOS were not run. - Only `hardware_key()` and `recommend_remote_expert_opt()` are covered; the other `gpu_info()` callers already pass card numbers. --- <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:15 +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#4541
No description provided.