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
Fix global dequantize buffer dtype mismatch across mixed-precision loads (#4026)
金黄色葡萄球君君afd5b687aa01
diff --git a/unsloth/kernels/utils.py b/unsloth/kernels/utils.pyindex b1211ae3450..3122282b38a 100644--- a/unsloth/kernels/utils.py+++ b/unsloth/kernels/utils.py@@ -398,7 +398,7 @@ if DEVICE_TYPE == "xpu" and HAS_XPU_STREAM:global ABSMAX_BUFFERSWEIGHT_BUFFER = WEIGHT_BUFFERS[device_index]ABSMAX_BUFFER = ABSMAX_BUFFERS[device_index]- if WEIGHT_BUFFER is None:+ if WEIGHT_BUFFER is None or WEIGHT_BUFFER.dtype != dtype:WEIGHT_BUFFERS[device_index] = WEIGHT_BUFFER = torch_empty(size, dtype = dtype, device = device, requires_grad = False)@@ -508,7 +508,7 @@ elif DEVICE_TYPE in ("cuda", "hip") and HAS_CUDA_STREAM:global ABSMAX_BUFFERSWEIGHT_BUFFER = WEIGHT_BUFFERS[device_index]ABSMAX_BUFFER = ABSMAX_BUFFERS[device_index]- if WEIGHT_BUFFER is None:+ if WEIGHT_BUFFER is None or WEIGHT_BUFFER.dtype != dtype:WEIGHT_BUFFERS[device_index] = WEIGHT_BUFFER = torch_empty(size, dtype = dtype, device = device, requires_grad = False)