Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
[Intel] make intel device support ROPE (#3164)
Lei Zhenyuan781c890c6543
diff --git a/unsloth/kernels/rope_embedding.py b/unsloth/kernels/rope_embedding.pyindex 46b6766edb0..a5e5853878f 100644--- a/unsloth/kernels/rope_embedding.py+++ b/unsloth/kernels/rope_embedding.py@@ -15,7 +15,7 @@import tritonimport triton.language as tlimport torch-from .utils import calculate_settings, torch_gpu_device+from .utils import calculate_settings, torch_gpu_device, torch_device_streamROPE_GROUP_SIZE : int = 4def _rope_embedding(@@ -156,8 +156,7 @@ def fast_rope_embedding(Q, K, cos, sin):Q = Fast_RoPE_Embedding.apply(Q.transpose(1, 2), cos, sin).transpose(1, 2)K = Fast_RoPE_Embedding.apply(K.transpose(1, 2), cos, sin).transpose(1, 2)# synchronize before cat to avoid race condition- torch.cuda.current_stream(Q.device).synchronize()-+ torch_device_stream(Q.device).synchronize()return Q, Kpass@@ -201,6 +200,6 @@ passdef inplace_rope_embedding(Q, K, cos, sin, position_ids):Q = Slow_RoPE_Embedding.apply(Q, cos, sin, position_ids)K = Slow_RoPE_Embedding.apply(K, cos, sin, position_ids)- torch.cuda.current_stream(Q.device).synchronize()+ torch_device_stream(Q.device).synchronize()return Q, Kpassdiff --git a/unsloth/kernels/utils.py b/unsloth/kernels/utils.pyindex 1470068e76b..0fa156d4126 100644--- a/unsloth/kernels/utils.py+++ b/unsloth/kernels/utils.py@@ -174,6 +174,8 @@ else:cgemm_4bit_inference_naive_bf16 = bnb.functional.lib.cgemm_4bit_inference_naive_bf16pass+torch_device_stream = torch.xpu.current_stream if DEVICE_TYPE == "xpu" else torch.cuda.current_stream+torch_mm = torch.mmtorch_mv = torch.mvtorch_matmul = torch.matmul