Skip to content

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.

Update rms_layernorm.py

Daniel Hanc35f1155378b
diff --git a/unsloth/kernels/rms_layernorm.py b/unsloth/kernels/rms_layernorm.py
index 53f1efa9f50..a7385cb38ee 100644
--- a/unsloth/kernels/rms_layernorm.py
+++ b/unsloth/kernels/rms_layernorm.py
@@ -15,8 +15,11 @@
import triton
import triton.language as tl
import torch
-from .utils import calculate_settings
-next_power_of_2 = triton.next_power_of_2
+from .utils import (
+ calculate_settings,
+ MAX_FUSED_SIZE,
+ next_power_of_2,
+)
@triton.jit
@@ -143,8 +146,8 @@ class Fast_RMS_Layernorm(torch.autograd.Function):
n_rows : int
n_cols : int
n_rows, n_cols = X.shape
- BLOCK_SIZE : int = next_power_of_2(n_cols)
- MAX_FUSED_SIZE : int = 65536
+
+ BLOCK_SIZE : int = n_cols
if BLOCK_SIZE > MAX_FUSED_SIZE:
raise RuntimeError(f"Cannot launch Triton kernel since n = {n_cols} exceeds "\
f"the maximum CUDA blocksize = {MAX_FUSED_SIZE}.")