Skip to content

Fix the CPU-only ROCm routing errors and two font-scale UI flakes - #7469

Merged
danielhanchen merged 4 commits into
mainfrom
fix/cpu-ci-rocm-spoof-and-fontscale-flake
Jul 26, 2026
Merged

danielhanchen merged 4 commits into
mainfrom
fix/cpu-ci-rocm-spoof-and-fontscale-flake

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Two unrelated causes of red CI on effectively every open PR. Both were reproduced before being fixed.

1. ROCm routing: 12 errors on Repo tests (CPU)

tests/studio/install/test_rocm_rdna_routing.py spawns a child that spoofs torch as an AMD card. unsloth_zoo pulls in bitsandbytes, which picks a compute backend at import time. Once the spoof reports a GPU, bnb loads its ROCm/CUDA ops, which a CPU-only torch cannot satisfy:

OSError: libhipblas.so.2: cannot open shared object file
AttributeError: module torch._C has no attribute _cuda_getCurrentRawStream

The child then dies before printing RESULT, and all 12 tests error with child produced no result.

Nothing in this file tests bitsandbytes, so it is now imported first, under the honest hardware, before the spoof starts lying. The spoof still governs what unsloth_zoo sees, which is what the test is about.

This only reproduces on a CPU-only torch, which is why it passes locally for most people and fails in CI. Verified in a dedicated CPU-only torch venv:

result
before 11 passed, 12 errors
after 23 passed

Still 23 passed on a CUDA build, so the previously-passing case is unaffected.

2. Font-scale UI: two flakes in playwright_ui_font_scale.py

The select viewport. The step pressed ArrowDown six times behind fixed sleeps. Radix moves focus into the listbox after the content opens, so on a loaded runner the keys land on the trigger and nothing scrolls, giving:

[font-scale] FAIL: keyboard did not scroll the select viewport: 0

It now waits for the overflow to exist and presses until the viewport actually moves, bounded at 40 presses. A genuine regression still fails, just after more tries.

The settings dialog. open_appearance pressed each shortcut chord once behind a fixed 700 ms sleep, so a slow boot loses the dialog entirely (settings dialog did not open). It now alternates both chords on a bounded retry and waits for the control the caller is about to drive.

Reproduction

Run against a real Studio under full CPU load, 5 runs per version, twice:

passed
before 2 of 10
after 10 of 10

The exact CI signature, keyboard did not scroll the select viewport: 0, appeared 5 times in the 10 unfixed runs and never in the fixed ones.

That this is flake rather than detection is also visible upstream: the same assertion has failed on two unrelated PRs, one of which only swaps three CSS class tokens and cannot affect keyboard scrolling, while the same commit passes the same job on macOS and Windows.

Scope

Test-only. No production code is touched.

Two unrelated causes of red CI on every PR, both reproduced before fixing.

ROCm routing: 12 errors on Repo tests (CPU). The spoof reports an AMD GPU, and
unsloth_zoo pulls in bitsandbytes, which picks a compute backend at import. Once
torch looks like a GPU is present, bnb loads its ROCm/CUDA ops, which a CPU-only
torch cannot satisfy (no libhipblas.so.2, no torch._C._cuda_getCurrentRawStream),
so the child died before printing RESULT. Nothing here tests bitsandbytes, so
import it first, under the honest hardware. Reproduced in a CPU-only torch venv:
11 passed with 12 errors before, 23 passed after. Still 23 passed on a CUDA build.

Font-scale UI: the select-viewport step pressed ArrowDown six times behind fixed
sleeps, but Radix moves focus into the listbox after the content opens, so on a
loaded runner the keys landed on the trigger and nothing scrolled. Wait on the
overflow and press until it moves, bounded at 40. The same fixed-sleep pattern
made open_appearance miss the dialog when the shortcut fired before the app wired
its handler; alternate both chords on a bounded retry and wait for the control the
caller is about to drive.

Both were reproduced locally by running the suite against a real Studio under full
CPU load. Original: 2 of 10 passed, with the exact CI signature 'keyboard did not
scroll the select viewport: 0' five times. Fixed: 10 of 10.
danielhanchen added a commit to Datta0/unsloth-staging-3 that referenced this pull request Jul 26, 2026
danielhanchen added a commit to Datta0/unsloth-staging-3 that referenced this pull request Jul 26, 2026
danielhanchen added a commit to Datta0/unsloth-staging-3 that referenced this pull request Jul 26, 2026
@danielhanchen
danielhanchen merged commit 170b412 into main Jul 26, 2026
19 of 21 checks passed
@danielhanchen
danielhanchen deleted the fix/cpu-ci-rocm-spoof-and-fontscale-flake branch July 26, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants