Repository navigation
[Fix] [Intel] diffusion: Skip XPU component prefetch that would not fit - #48436
Open
dayanandav wants to merge 1 commit into
Open
dayanandav wants to merge 1 commit into
dayanandav wants to merge 1 commit into
Conversation
On XPU, component-offload prefetch is a synchronous load. When the previous component is kept for the next stage, it loaded beside it and OOMed LongCat-Image on a 24 GiB card. Skip the prefetch when the component would not fit; it then loads on first use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dayanandav
requested review from
AgainstEntropy,
BBuf,
HaiShaw,
kevin-mii,
mickqian,
niehen6174,
ping1jing2 and
yichiche
as code owners
November 4, 2026 18:35
airMeng
pushed a commit
to airMeng/sglang
that referenced
this pull request
Nov 9, 2026
airMeng
pushed a commit
to airMeng/sglang
that referenced
this pull request
Nov 10, 2026
airMeng
pushed a commit
to airMeng/sglang
that referenced
this pull request
Nov 11, 2026
airMeng
pushed a commit
to airMeng/sglang
that referenced
this pull request
Nov 12, 2026
airMeng
pushed a commit
to airMeng/sglang
that referenced
this pull request
Nov 13, 2026
Contributor
Author
|
@siju-samuel @ANSHUMAN87 help to review. |
Contributor
Author
|
@mickqian help to review. |
airMeng
pushed a commit
to airMeng/sglang
that referenced
this pull request
Nov 15, 2026
airMeng
pushed a commit
to airMeng/sglang
that referenced
this pull request
Nov 16, 2026
airMeng
pushed a commit
to airMeng/sglang
that referenced
this pull request
Nov 17, 2026
airMeng
pushed a commit
to airMeng/sglang
that referenced
this pull request
Nov 18, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
On XPU, component-offload prefetch is a synchronous load. When a component is kept for the next stage, the next component is loaded beside it. LongCat-Image keeps its 16 GiB Qwen2.5-VL encoder for text encoding and prefetches the 12 GiB DiT, which runs out of memory on a 24 GiB card even with every component offloaded.
Modifications
ComponentOffloadStrategy.prefetch_for_use: on XPU, skip the prefetch (warn once) when the component won't fit in free device memory; it then loads on first use.current_platform.get_available_gpu_memory;torch.xpu.mem_get_inforeports free == total on torch 2.14.0+xpu.Accuracy Tests
N/A: only changes when weights are moved to the device. The LongCat-Image output (1024x1024, 50 steps, seed 42) looks correct after the change.
Speed Tests and Profiling
LongCat-Image,
--component-residency dit=component-offload text_encoder=component-offload vae=component-offload, 1024x1024, 50 steps, prompt rewrite on, no warmup, Intel XPU 24 GiB:--enable-cfg-parallelOther backends take the same path as before, so their speed is unchanged.
Tests run on Intel XPU:
test_component_residency.py,test_weight_snapshot.py,test_qwen_image21.py,test_text_encoding_cache.py,test_nvtx_pytorch_hooks.py,test_layerwise_offload.py(385 passed, 133 skipped). Not run on CUDA.🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #41888677432
Latest PR Test (Extra): ❌ Run #41888677265
Latest PR Test (AMD ROCm 10): ❌ Run #41888677484
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: