Repository navigation
Studio Windows XPU Triton: verify the swap and torch's XPU triton payload, repair a broken triton, skip pip backups - #16250
Conversation
The XPU swap that replaces triton-windows with torch's XPU triton now runs with inherited UV_OVERRIDE / UV_EXCLUDE / UV_CONSTRAINT / PIP_CONSTRAINT cleared and require-hashes relaxed, as the ROCm pairing does, and counts an install only once a fresh probe shows the XPU dist recorded, no triton-windows left and triton importing. The triton-windows fallback is verified the same way; one that exits 0 without a working triton fails setup instead of certifying the venv. The fast-path check and the swap probe look dists up by name, so a ~riton_windows-* or ~itsandbytes-* backup left by an interrupted pip is no longer read as installed. Follow-up to #16074.
Codex Review SummaryThis 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. |
setup.ps1 - The dependency fast path and the post-stack swap also ask whether triton imports. Once only a ~riton_windows backup is left there is no triton-windows record to trigger a repair, so a payload removed with it stayed broken. A broken triton with no record is now reinstalled from the XPU wheel, with nothing to uninstall. - A failed triton-windows uninstall puts the install manifest back only while triton still imports. One that removed files part way and left triton unimportable fails setup when triton worked before the swap. A triton that was already broken warns and withholds the manifest, so the next update retries; the fallback failure path follows the same rule. install_python_stack.py (_ensure_xpu_triton) - Download, uninstall and install run with UV_OVERRIDE, UV_EXCLUDE, UV_CONSTRAINT and PIP_CONSTRAINT cleared and require-hashes off, restored afterwards, as setup.ps1 does. - After the install a fresh interpreter must find the XPU dist, no generic triton and a working triton.language; otherwise setup fails with a repair command instead of certifying a venv with no triton. - The generic triton probe looks dists up by name, so a ~riton-* backup is not a triton to swap out. CI: run test_xpu_triton_windows_swap.ps1 under pwsh and Windows PowerShell 5.1 in the cross-platform parity workflow. [skip ci]
…on probe, defer offline, keep the rollback [skip ci]
…e repair, keep the rollback offline, check the payload [skip ci]
…ss offline, as on main
…back under the installer, drop the Intel directory check [skip ci]
## Summary Every `Core zoo` cell in `consolidated-tests-ci.yml` is now being cancelled at its 35 minute job cap, on unrelated PRs, with the unsloth_zoo suite at 99%. It is the same failure #14240 fixed at 25 minutes: the suite has grown past the cap. A passing cell from today, for scale: the zoo `pytest -n 4` step reported `14494 passed, 2462 skipped ... in 1770.53s (0:29:30)`, and the whole job ran 34m57s, three seconds under the cap. ## Change - `Core zoo` job: `timeout-minutes: 35` -> `50`, comment updated with the current numbers. - Unchanged: the 5 minute `PYTEST_TIMEOUT` per test, which is what names and stack-dumps a genuine hang. The job cap only bounds the total. ## Evidence Staging Core runs since 2026-10-30 21:28 UTC, Core zoo cells by combo: | PR | HF=4.57.6 | HF=default | HF=latest | |---|---|---|---| | #16041 | failure | cancelled | cancelled | | #16249 | cancelled | cancelled | cancelled | | #16250 | cancelled | cancelled | cancelled | | #16257 | cancelled | cancelled | cancelled | | #16255 (run 1) | cancelled | success (34m57s) | success (28m46s) | | #16255 (run 2) | success | cancelled | cancelled | The cancelled cells end with `##[error]The operation was canceled.` while the suite is printing its last progress lines (98-99%). ## Tests `tests/studio/test_zoo_suite_parallel_isolation.py`, `test_workflow_guards_run_unfiltered.py` and every test that reads `consolidated-tests-ci.yml`: 267 passed. ## Not proven - This PR's own CI run is the first measurement at the new cap; whether 50 minutes leaves enough headroom as the suite keeps growing is not known.
…able driver supports XPU [skip ci]
|
Codex Review: Didn't find any major issues. Hooray! 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". |
|
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". |
Summary
Follow-up to #16074. The review of that PR found problems in the Intel XPU Triton handling of the Windows installer. They date from before #16074, so it left them alone. #16074 added helpers that already solve the same problems on the AMD ROCm path, and this PR reuses them. It changes only the Windows installer (
studio/setup.ps1); the Python stack's copy of the swap is listed under "Not covered".On Intel XPU, setup replaces
triton-windowswith torch's own XPU triton, because both own thetritonpackage.studio/setup.ps1triton-windowsfallback ran with whateverUV_OVERRIDE,UV_EXCLUDE,UV_CONSTRAINTandPIP_CONSTRAINTthe shell had. WithUV_EXCLUDEset, the install can exit 0 without installing the wheel aftertriton-windowswas already removed. Setup then restored the install manifest over a venv with no triton.triton-windowsis left, and triton imports (Get-TritonRuntimeState). Anything less falls back totriton-windows:triton-windowsfiles;triton-windowsis recorded and triton imports;triton-windowsfails setup, so the installer keeps its rollback copy.Get-XpuTritonStatechecks torch's XPU triton itself:packaging, else pip's vendored copy, else an exact==match on the versions without their local labels. A missing or versionless record fails, and so does a parser that is found but does not import: it falls through to the next one instead of failing the whole probe.__version__must match the dist, so generic triton files at another version under the XPU dist's record are not accepted. This runs as its own probe, so a triton that crashes on import still leaves the metadata readable. A metadata probe that fails part way still returns the fields it read (torch's requirement,triton-windows), so the repair can still run; the state stays unverified.Namefield. That also matches the~riton_windows-*and~itsandbytes-*backup folders an interrupted pip replacement leaves behind. Both lookups now useimportlib.metadata.distributions(name=...), asGet-RocmTritonPairingdoes.triton-windowsrecord was never repaired. Once only a backup is left, nothing namedtriton-windowstriggers the dependency pass or the swap. A payload removed along with the record stayed broken. Two checks now also ask whether triton imports:UV_OFFLINEset (or on the verified offline fast path), the triton triggers do not start the dependency pass: not an activetriton-windows, not a missing or wrong XPU triton. A stale or missing bitsandbytes still runs it, as on main. The swap fetches nothing either. Both say the repair is left for the next online update, as the ROCm pairing does.install.ps1(installer-managed setup) setup fails whenever torch wants an XPU triton and triton does not import. That includes a triton already broken before the swap, an offline run that left the repair for later, and a metadata probe that could not read torch's requirement. The installer then restores its rollback copy instead of committing this venv.New helpers sit next to the ROCm pairing helpers:
Enter-TritonInstallEnv/Exit-TritonInstallEnv, now also used by the ROCm repair, whose behaviour is unchanged;Get-XpuTritonState.CI
tests/studio/test_xpu_triton_windows_swap.ps1now runs incross-platform-parity-ci.yml, under pwsh and under Windows PowerShell 5.1, next to the ROCm pairing test. It is also added to both path filters.Not changed
The ROCm repair's handling of a triton that was already broken. If the ROCm pairing cannot be repaired and triton did not import before, setup still warns and continues, including under
install.ps1. Its test asserts that a missing triton that cannot be installed only warns, since on ROCm that leaves flex attention decode unfused rather than breaking anything that worked.The triton-windows 3.9 to 3.8 churn on Windows ROCm torch 2.11 / 2.12. A fresh install still resolves
triton-windows3.9 first, and the Studio Windows AMD: pair triton-windows with torch after the dependency stack #16074 repair then replaces it with 3.8. Pinning it instudio/install_python_stack.pyis not a small change:single-env/constraints.txtthat every install receives as-c.The repair is already verified, so this is left as is.
Tests
tests/studio/test_xpu_triton_windows_swap.ps1, 68 checks, ASCII only. It cuts the helpers, the fast-path check and the swap out ofsetup.ps1.triton-windowsstill recorded after the install; an unreadable post-install probe; an install that leaves a version torch does not accept; an importable generic triton under the XPU dist's record;triton-windowsrecorded, and a failed fallback;triton-windows;triton-windowsthat imports;triton-windows;tritonpackage:~riton_windowsbackup alone, with the files present and with them gone (the fast path, also offline, and the swap);triton-windows(also offline); a record withoutVersion; a~itsandbytesbackup (also offline and alone, where the dependency pass still runs);Version: none isXpuOk, and the fast path runs the dependency pass for the first two;XpuOk; atriton/backends/inteldirectory does not decide;==3.5.0+git...against an installed3.5.0+git...with no version parser importable:XpuOk;packagingthat does not import: the next parser decides.tests/studiothat readsetup.ps1: they pass. On main, the 25 that exist there pass too.tests/studio_setup_ps1: 245 passed, 0 failed, 7 skipped, the same as main.setup.ps1: 10111 passed and 26 failed, the same failing test IDs as the previous revision (Linux host failures, unrelated).pytorch-triton-xpu==3.5.0wheel, installed alone into a venv, reports__version__3.5.0 and the backendsamd,intel,nvidia, which the probe accepts.Not covered
_ensure_xpu_tritoninstudio/install_python_stack.py, used on Linux and by direct runs). It has the same kind of gaps: inherited resolver inputs, exit 0 taken as success, backups counted, no repair of a missing payload, and thesetup.shfast path checking only for a generic dist-info. It needs its own probe and tests, so it is left for a follow-up. The latest review's findings oninstall_python_stack.pyandsetup.sh(resolver inputs and verification around the XPU install, the early return with no generic record, thesetup.shfast path) are part of that follow-up, not this PR.pytorch-triton-xpuwheel was not tried.