Skip to content

Studio: stop image loads exhausting Windows commit on Intel Arc iGPUs - #17378

Merged
danielhanchen merged 4 commits into
mainfrom
studio-xpu-igpu-pread
Nov 10, 2026
Merged

danielhanchen merged 4 commits into
mainfrom
studio-xpu-igpu-pread

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Fixes #17137

Problem

On Windows, loading Qwen-Image-2.1-Turbo or FLUX.3 Klein (GGUF denoiser + base repo) onto an Intel Arc 140V (Lunar Lake iGPU, 32 GB shared RAM) fails with

OSError: The paging file is too small for this operation to complete. (os error 1455)
  transformers/modeling_utils.py, in _load_pretrained_model: safe_open(file, framework="pt", device="cpu")

and the retry kills the backend with 0xc0000005, the native form of the same commit exhaustion (#13432, #14513).

Why:

  • On Windows, safetensors' default mmap backend maps a shard copy-on-write, and Windows charges the whole view to the commit limit while any tensor from that shard is alive.
  • Studio's media-load scope (Studio: fix host memory checks and improve logging for GGUF image loads #14514) moves only converting loads to pread; a same-dtype bf16 load keeps the mapping, which is fine on a discrete card.
  • On an iGPU the device copy is host commit too. Qwen-Image-2.1's text encoder is one 16.3 GB bf16 file: its mapped view stays charged until the last tensor has moved to the XPU, so the load needs about twice the encoder in commit.

Change

  • pread_safetensors(..., every_shard=True) reads same-dtype shards through pread as well (component dirs the small-host route keeps mapped still stay mapped).
  • The image-load scope sets it only on Windows when the current XPU is a Core Ultra Arc iGPU (xpu_is_integrated(), by PCI id: the iGPU subset of the existing XPU allowlist, split into _INTEL_XPU_IGPU_PCI_IDS with no change to _INTEL_XPU_PCI_IDS).

Every other platform and device keeps the byte-identical path: off Windows the scope installs nothing, and on Windows a CUDA, ROCm, discrete Arc or unclassifiable XPU load passes every_shard=False.

Tests

studio/backend/tests/test_safetensors_pread_igpu.py: the iGPU classifier over Lunar Lake / Meteor Lake / Panther Lake vs discrete Arc / Data Center ids, the backend choice with and without every_shard, the image-load scope engaging only on Windows + iGPU, and a Windows-only commit measurement (bf16 load at bf16, then each weight copied the way .to("xpu") does on shared memory, mmap vs pread arms).

@danielhanchen danielhanchen self-assigned this Nov 10, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-10T13:12:20.952328Z a10084a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 47951f8eaf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 63499bf6b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen

Copy link
Copy Markdown
Member Author

One CI red here is from this PR's hardware.py split, still present on 46fa5c7:

tests/studio/install/test_xpu_auto_route_update.py::test_the_allowlist_matches_hardware_py
ValueError: malformed node or string on line 651: <ast.BinOp ...>

That test literal_evals _INTEL_XPU_PCI_IDS in hardware.py and install_python_stack.py to keep the installer's XPU allowlist identical to the runtime one. _INTEL_XPU_PCI_IDS = _INTEL_XPU_IGPU_PCI_IDS | frozenset((...)) is no longer a literal, so it cannot be read. Either keep _INTEL_XPU_PCI_IDS a single frozenset((...)) literal (and derive the iGPU subset from it), or teach the test to resolve the union; the set contents themselves still match the installer's copy.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: a10084a8a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen
danielhanchen merged commit 8089179 into main Nov 10, 2026
@danielhanchen
danielhanchen deleted the studio-xpu-igpu-pread branch November 10, 2026 13:59
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.

[Bug] Image generation models fail to load on Intel Arc 140V

1 participant