From 0d48584e8f64411622adcc68c0d8bb9c70171301 Mon Sep 17 00:00:00 2001 From: danielhanchen Date: Mon, 6 Jul 2026 10:12:30 +0000 Subject: [PATCH] setup.ps1: keep the ROCm CPU-fallback force line the pr5940 test guards 5c93ffd4 folded the pin-change force-reinstall into the ROCm CPU-fallback condition on one line, so the exact literal that test_pr5940_followups.py checks (if ($ROCmCpuFallback) { $cpuForce = @("--force-reinstall") }) no longer appeared and the test failed. Split the two conditions into separate if lines: the ROCm fallback line is restored verbatim and the pin-change force is its own line. Both still set $cpuForce to the array, so @splat passes one arg. --- studio/setup.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/studio/setup.ps1 b/studio/setup.ps1 index daa045f498..2c865d7056 100644 --- a/studio/setup.ps1 +++ b/studio/setup.ps1 @@ -3205,9 +3205,10 @@ if (-not $ROCmIndexUrl -and ($CuTag -eq "cpu" -or $ROCmCpuFallback)) { # Build the array directly: an if-expression collapses @("x") to a scalar string, # which @splat would then enumerate char-by-char into broken single-letter args. $cpuForce = @() + if ($ROCmCpuFallback) { $cpuForce = @("--force-reinstall") } # --force-reinstall also on a pin change: a stale +cu / +rocm wheel still # satisfies the CPU torch>= range, so uv would keep it and only swap companions. - if ($ROCmCpuFallback -or $script:PinChangedForceReinstall) { $cpuForce = @("--force-reinstall") } + if ($script:PinChangedForceReinstall) { $cpuForce = @("--force-reinstall") } if ($script:UnslothVerbose) { Fast-Install torch torchvision torchaudio @cpuForce --index-url $TorchInstallIndexUrl $torchInstallExit = $LASTEXITCODE