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
Update utils.py
Daniel Hand27d992f5845
diff --git a/unsloth/kernels/utils.py b/unsloth/kernels/utils.pyindex 0af65edeee8..a8c20c75a47 100644--- a/unsloth/kernels/utils.py+++ b/unsloth/kernels/utils.py@@ -56,7 +56,8 @@ passimport bitsandbytes as bnb# https://github.com/bitsandbytes-foundation/bitsandbytes/pull/1330/filesHAS_CUDA_STREAM = Version(bnb.__version__) > Version("0.43.3")-CUDA_STREAM = torch.cuda.current_stream("cuda:0")+global CUDA_STREAM+CUDA_STREAM = Noneget_ptr = bnb.functional.get_ptrimport ctypescdequantize_blockwise_fp32 = bnb.functional.lib.cdequantize_blockwise_fp32@@ -129,6 +130,8 @@ if HAS_CUDA_STREAM:offset, state2 = compressed_statsabsmax2, code2, blocksize2, _, _, _, _ = state2pass+ global CUDA_STREAM+ if CUDA_STREAM is None: CUDA_STREAM = torch.cuda.current_stream("cuda:0")# Create weight matrixif out is None:@@ -236,6 +239,9 @@ if HAS_CUDA_STREAM:offset, state2 = compressed_statsabsmax2, code2, blocksize2, _, _, _, _ = state2pass+ global CUDA_STREAM+ if CUDA_STREAM is None: CUDA_STREAM = torch.cuda.current_stream("cuda:0")+# assert(dtype == X.dtype)bout = shape[0]