Skip to content

Kyojin: open-source engine that runs 100 GB-class open models (GLM-5.3, Qwen3.8, DeepSeek V4.1) on one desktop machine. AMD Strix Halo, NVIDIA RTX and Apple Mac. OpenAI API, built on ExLlamaV3.

exl3_gemm_kernel: drop the grid barrier after the last row tile

YanissAmz411d9b378637
diff --git a/exllamav3/exllamav3_ext/quant/exl3_gemm_kernel.cuh b/exllamav3/exllamav3_ext/quant/exl3_gemm_kernel.cuh
index 3591819..ada67fd 100644
--- a/exllamav3/exllamav3_ext/quant/exl3_gemm_kernel.cuh
+++ b/exllamav3/exllamav3_ext/quant/exl3_gemm_kernel.cuh
@@ -45,7 +45,9 @@ void exl3_gemm_kernel(EXL3_GEMM_ARGS)
else C_ = (void*) (((half*) C_) + TILESIZE_M * size_n);
size_m_ -= TILESIZE_M;
- if (size_m_ > 0 || svh)
+ // Rows beyond this tile reuse the column locks, so wait for the whole grid; the output rotation by
+ // svh is done by the last block of each column inside the tile, so nothing follows the last tile
+ if (size_m_ > 0)
grid.sync();
}