Skip to content

fix(install): route Linux Intel GPU hosts away from CPU-only torch#5274

Draft
andomeder wants to merge 5 commits into
unslothai:mainfrom
andomeder:fix/linux-intel-xpu-install-routing
Draft

fix(install): route Linux Intel GPU hosts away from CPU-only torch#5274
andomeder wants to merge 5 commits into
unslothai:mainfrom
andomeder:fix/linux-intel-xpu-install-routing

Conversation

@andomeder

Copy link
Copy Markdown

Linux Intel GPU hosts can currently fall through to the CPU-only torch path in the normal local Studio install flow.

That means a user doing:

git clone https://github.com/leizhenyuan/unsloth unsloth-intel
cd unsloth-intel
git checkout zhenyuan_enable_studio
./install.sh --local

can get the wrong install path even when /sys/class/drm shows an Intel GPU.

This patch keeps that Linux install flow on the Intel/XPU path instead of the CPU fallback.

What changed

  • add _has_intel_xpu_gpu() in install.sh
  • if no NVIDIA or AMD ROCm path applies, return the xpu install path
  • add _install_intel_xpu_stack() for the Intel extras path
  • keep the normal --local overlay flow after the Intel install path runs
  • add a shell test for Intel DRM vendor detection

Linux installer routing only.

Validation

Ran locally on an Intel Linux machine:

  • bash tests/sh/test_get_torch_index_url.sh28 passed, 0 failed
  • bash -n install.sh → pass
  • ./install.sh --local → pass

Installer output now includes:

Intel GPU detected -- installing Intel XPU-enabled PyTorch and Unsloth extras

Note

UV_SKIP_WHEEL_FILENAME_CHECK=1 stays inside the installer for the current Intel extras path because one preview-wheel filename is rejected by uv otherwise.

Related:

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for Intel XPU GPUs by adding detection logic via DRM sysfs and a dedicated installation path for Intel-enabled PyTorch and Unsloth extras. It also refactors the Unsloth installation stages and updates the test suite to include Intel GPU scenarios. Review feedback identified a typo in a function call for runtime dependencies, accidental version downgrades for the Unsloth package, and missing unsloth-zoo git overlays in several refactored local installation paths.

Comment thread install.sh Outdated
Comment thread install.sh Outdated
Comment thread install.sh Outdated
Comment thread install.sh Outdated
Comment thread install.sh Outdated
Comment thread install.sh Outdated
@andomeder

Copy link
Copy Markdown
Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for Intel XPU GPUs in the installation script. Key changes include the addition of Intel GPU detection via DRM sysfs, a specialized installation routine for the Intel XPU PyTorch stack, and updates to the torch index URL selection logic. The PR also refactors local repository overlay logic into a reusable function and includes unit tests for the new detection paths. Review feedback recommends adding the --upgrade-package flag to Intel-specific installation commands for consistency and ensuring the new overlay function is used in all applicable local installation branches.

Comment thread install.sh
Comment thread install.sh Outdated
@andomeder

Copy link
Copy Markdown
Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for Intel XPU GPUs in the installation script by adding detection logic via DRM sysfs and a dedicated installation path for Intel-enabled PyTorch and Unsloth extras. It also refactors local repository overlay logic into a reusable function and updates the test suite to cover Intel GPU detection. A review comment identifies a discrepancy in the Intel XPU installation stack where version constraints and the unsloth-zoo package were missing in the non-local installation path, and suggests using the dynamic package name variable for better consistency.

Comment thread install.sh
@andomeder andomeder marked this pull request as ready for review May 4, 2026 18:25
Comment thread install.sh
fi
}

_overlay_local_repos() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you have this in your PR? seems like it leaked from another PR i already merged?

@rolandtannous rolandtannous marked this pull request as draft May 5, 2026 05:49
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