Repository navigation
[LoRA][XPU] Enable LoRA on Intel XPU - #30488
Closed
dayanandav wants to merge 2 commits into
Closed
dayanandav wants to merge 2 commits into
dayanandav wants to merge 2 commits into
Conversation
Make the LoRA path device-portable so it runs on Intel XPU (in addition to CUDA/ROCm), and enable the corresponding tests. Source changes: - backends (triton/chunked/torch): use torch.device(self.device) instead of a hard-coded "cuda" in init_cuda_graph_batch_info. - lora_moe_runners: route XPU to the pure-torch _naive_moe_lora_align_block_size fallback (the moe_lora_align .cu kernel is CUDA-only). - rotary_embedding base.py / mrope.py: guard the XPU-only sgl_kernel imports (fused_qk_rope_with_cos_sin_cache_inplace, multimodal_rotary_embedding) so a missing symbol no longer breaks the native model registry on XPU (which would silently fall back to the generic Transformers backbone); forward_xpu falls back to the generic kernel when unavailable. - lora_overlap_loader: use self.device_module.current_stream() instead of torch.cuda.current_stream(). Test changes: - Device-agnostic device selection via get_device() and register_xpu_ci across the kernel/unit and small-model LoRA tests. - Guard the tvm_ffi CUDA-JIT align variant behind is_cuda(). - lora_utils.run_lora_test_by_batch: compare SRT vs HF greedy outputs with the established ROUGE-L tolerance on XPU (exact string match elsewhere), since minor kernel-level fp differences can diverge greedy decoding on XPU. Co-Authored-By: Anupa Sajikumar <anupa.sajikumar@intel.com>
dayanandav
requested review from
BBuf,
Edwardf0t1,
Fridge003,
HaiShaw,
Ying1123,
ch-wan,
ispobock,
jybsuper,
lifuhuang,
merrymercy and
yushengsu-thu
as code owners
July 8, 2026 07:23
Contributor
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Contributor
Author
|
Duplicate of #30345 |
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.
Summary
Key Changes
torch.device("cuda")withself.devicefor CUDA graph setupTest Plan
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Missing
run-cilabel -- add it to run CI tests.Latest PR Test (Extra): ❌ Blocked --
run-ciis required first.