Skip to content

InvokeAI: add Intel IPEX (XPU) PyTorch backend - #1787

Open
wesd6r wants to merge 2 commits into
LykosAI:mainfrom
wesd6r:invokeai-ipex
Open

wesd6r wants to merge 2 commits into
LykosAI:mainfrom
wesd6r:invokeai-ipex

Conversation

@wesd6r

@wesd6r wesd6r commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Problem

Stability Matrix's InvokeAI package only offers CPU, CUDA, ROCm and MPS. On an Intel Arc GPU, GetRecommendedTorchVersion() therefore falls back to CPU, even though InvokeAI publishes an XPU PyTorch index in its pins.json (torchIndexUrl.<platform>.xpu) and supports running on XPU.

Fix

  • Add TorchIndex.Ipex to InvokeAI.AvailableTorchIndices.
  • When reading InvokeAI's pins.json, map TorchIndex.Ipex to its xpu key.
  • Add PyTorch's XPU index as the fallback for release tags that have no xpu pins entry.
  • Document InvokeAI in the IPEX package list.

No behavior change for CPU, CUDA, ROCm or MPS.

Tests

  • dotnet test StabilityMatrix.Tests --filter InvokeAITorchIndexTests — 2 passed (IPEX offered, and recommended for Intel Arc).
  • dotnet build StabilityMatrix.Core and StabilityMatrix.Avalonia — 0 errors.
  • Clean-venv dry run with the same index arguments Stability Matrix passes (--index https://download.pytorch.org/whl/xpu --index-strategy unsafe-first-match) resolves:
    • invokeai==6.14.2
    • torch==2.14.1+xpu
    • torchvision==0.29.1+xpu
  • Verified on Fedora 44 with an Intel Arc A730M. (The SM install itself was not completed in this environment because Fedora is missing libcrypt.so.1 for the bundled Python 3.10; that is an unrelated host prerequisite.)

Notes

  • InvokeAI v6.14.2 and v7.0.0-alpha.3 both publish an xpu entry in pins.json.
  • I did not add a changelog entry; happy to add one if you prefer.

🤖 Generated with Claude Code

InvokeAI's release pins.json already publishes an xpu torch index, but the package only offered CPU, CUDA, ROCm and MPS, so Intel Arc users were recommended CPU. Add TorchIndex.Ipex, map it to the pins "xpu" key, and fall back to PyTorch's xpu index when an older tag has no pins entry.

Tests cover the offered backends and the Intel Arc recommendation.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

CLA Assistant Lite bot CLA Assistant bot All Contributors have signed the CLA.

@wesd6r

wesd6r commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@wesd6r

wesd6r commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Related compatibility note found while testing this install on Fedora 44: #1788 (HuggingFace downloads behind Clash/mihomo fake-IP DNS). Kept separate from this PR because it is an InvokeAI downloader/SSRF configuration issue, not IPEX-specific.

@mohnjiles

Copy link
Copy Markdown
Member

Looks right to me. The Ipex → xpu key matches InvokeAI's pins.json, the fallback index is PyTorch's XPU index, and the CPU, CUDA, ROCm and MPS paths are untouched.

One likely problem: InvokeAITorchIndexTests.RecommendsIpexForIntelArc will probably throw on Windows. InvokeAI's override calls rocmPackageHelper.GetCompatibility().IsCompatible there, and RocmCompatibilityResult is a non-virtual class, so the substitute returns null. CI runs on Linux, which is why it's green. Stubbing GetCompatibility() to return new RocmCompatibilityResult() should fix it. Also, using System.Linq; is redundant with implicit usings.

mohnjiles
mohnjiles previously approved these changes Nov 15, 2026
@mohnjiles

Copy link
Copy Markdown
Member

Thank you!

@mohnjiles
mohnjiles dismissed their stale review November 17, 2026 02:10

Approved too early, sorry! The test fix from my earlier comment is still open: RecommendsIpexForIntelArc needs GetCompatibility() stubbed to return a RocmCompatibilityResult so it doesn't throw on Windows. Happy to approve once that's in.

This branch has not been deployed

No deployments
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