Repository navigation
[Bug] AMD: GPU utilization on Windows is missing on comma-decimal locales (de-DE, fr-FR) because Get-Counter values are formatted with the host culture - #17520
Merged
danielhanchen merged 3 commits intoNov 14, 2026
Conversation
…t locale Get-Counter values were formatted with -f, which uses the host culture, so de-DE and other comma-decimal hosts printed 12,5 and every 3D engine sample failed float(). GPU utilization on AMD Windows came back missing. The counter value is now formatted with the invariant culture in both the combined display read and the standalone one.
This was referenced Nov 11, 2026
This was referenced Nov 13, 2026
danielhanchen
added a commit
that referenced
this pull request
Nov 13, 2026
…s since unsloth_zoo #2474 (#17686) ## Summary The Studio MLX `dispatch` job fails on every PR it runs for (seen on the staging run for #17520 and on #17666), because it installs the current unsloth_zoo: ``` studio/backend/tests/test_mlx_inference_backend.py::test_the_stub_answers_every_helper_zoo_imports_from_inference E AssertionError: zoo imports ['_QSA_TRIM_HELD', '_ast_fingerprint', '_bindings_intact', '_resolved_bindings', '_verify_with_lazy_replay'] from mlx.inference and the stub cannot answer them studio/backend/tests/test_mlx_inference_backend.py::test_the_stub_accepts_every_call_zoo_makes_to_an_inference_helper E AttributeError: _resolved_bindings ``` unslothai/unsloth-zoo#2474 (faster Qwen3.8 Flash Next decode) added a head replay and a lazy verify to `unsloth_zoo/mlx/speculative.py`, which import five private names from `mlx.inference`. The zoo change is correct. This test file stands in for `unsloth_zoo.mlx.inference` with a stub module, and these two tests exist to fail when zoo starts importing something the stub cannot answer. That is what happened, so the stub needs the new names. Reproduced with zoo main on `PYTHONPATH`: both tests fail on main. ## Change `studio/backend/tests/test_mlx_inference_backend.py`: - `_QSA_TRIM_HELD` joins `PLAIN_HELPERS` as an empty list (no QSA cache trims are held), next to `_FIRST_USE_WORK` and the other private names zoo's speculative.py reads. - `_ast_fingerprint`, `_bindings_intact`, `_resolved_bindings` and `_verify_with_lazy_replay` join `NEUTRAL_PLAIN_HELPERS` as one `_no_replay` stub that accepts any call and returns `None`. Their zoo bodies need Metal and a QSA cache, so, like `_unless_failed_buffer`, they get a do-nothing answer. Putting them in `PLAIN_HELPERS` would not work, because that table's entries must copy zoo's bodies exactly (`test_each_plain_helper_stub_matches_zoos_body`). Test-only change. Extra names in the stub do not affect an older unsloth_zoo. ## Testing Linux, zoo main on `PYTHONPATH`, the stub and helper tests (`-k "stub or plain_helper or unknown_zoo_helper"`): - main: 2 failed, 10 passed, 1 skipped - this branch: 12 passed, 1 skipped (the skip needs `mlx_lm`)
Member
|
@codex review |
1 similar comment
Member
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
On AMD Windows, Unsloth Studio reads GPU utilization from the
GPU Engineperformance counters through PowerShell. The value was printed with-f, which formats with the host culture, so on de-DE, fr-FR and other comma-decimal locales each sample came out as12,5. Python'sfloat()rejects that, every 3D engine sample was skipped, and GPU utilization showed as missing.The counter value is now formatted with
ToString([cultureinfo]::InvariantCulture), in both the shared display read and the standalone read. It's the same fix the NPU load reader in #17508 uses. Infinite, NaN and negative samples are still dropped.Tests
test_rocm_windows_gpu_util_locale.pyuses a fake PowerShell that prints comma decimals unless the script asks for the invariant culture. It covers the combined and standalone paths, filtering by adapter, comma output being skipped rather than misread, and invariantInfinity/NaNbeing dropped. 4 of its 6 tests fail without the fix.Tested on Windows 11, Ryzen 9 9950X + 2x R9700: the new tests plus the existing
test_rocm_windows_*suite (151 passed), and the real counter scripts run under PowerShell 5.1 with the thread culture forced to de-DE (the old format printed12,5; the new one printed12.5and returned a utilization). Not run on a Windows install whose system locale is de-DE.