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.

Apply suggestion from @danielhanchen

Daniel Han1e790b03b24c
diff --git a/unsloth/kernels/swiglu.py b/unsloth/kernels/swiglu.py
index 9e2680e862b..b3ae9d40e6f 100644
--- a/unsloth/kernels/swiglu.py
+++ b/unsloth/kernels/swiglu.py
@@ -128,7 +128,7 @@ def _DWf_DW_dfg_kernel(
def swiglu_DWf_DW_dfg_kernel(DW, e, g):
- batch, seq_len, hd = e.shape
+ batch_seq_len, hd = e.shape # Flattened to 2D, so 1st dim is bsz * seq_len
n_elements = e.numel()
grid = lambda meta: (triton.cdiv(n_elements, meta["BLOCK_SIZE"]),)
with torch_gpu_device(e.device):