Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
gemma4: Disable FA on older GPUs where it doesn't work (#15403)
Daniel Hiltgendde09129d143
diff --git a/llm/server.go b/llm/server.goindex e8fa4cce0..a8104f79f 100644--- a/llm/server.go+++ b/llm/server.go@@ -210,6 +210,18 @@ func NewLlamaServer(systemInfo ml.SystemInfo, gpus []ml.DeviceInfo, modelPath stfa = false}+ // Gemma 4's 512-dim attention heads require MMA FA kernels (Turing+, compute >= 7.5).+ // Older CUDA GPUs only have tile/vec FA kernels which abort on dk512 non-GQA attention.+ if fa && f.KV().Architecture() == "gemma4" {+ for _, gpu := range gpus {+ if gpu.Library == "CUDA" && (gpu.ComputeMajor < 7 || (gpu.ComputeMajor == 7 && gpu.ComputeMinor < 5)) {+ slog.Debug("disabling flash attention for gemma4 on pre-Turing GPU", "compute", fmt.Sprintf("%d.%d", gpu.ComputeMajor, gpu.ComputeMinor))+ fa = false+ break+ }+ }+ }+kvct := strings.ToLower(envconfig.KvCacheType())if tok == nil {