Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

vulkan: enable flash attention (#12937)

Daniel Hiltgena4770107a6ea
diff --git a/ml/device.go b/ml/device.go
index 1fbe365e0..70e0c6a3d 100644
--- a/ml/device.go
+++ b/ml/device.go
@@ -432,7 +432,8 @@ func FlashAttentionSupported(l []DeviceInfo) bool {
supportsFA := gpu.Library == "cpu" ||
gpu.Name == "Metal" || gpu.Library == "Metal" ||
(gpu.Library == "CUDA" && gpu.DriverMajor >= 7 && !(gpu.ComputeMajor == 7 && gpu.ComputeMinor == 2)) ||
- gpu.Library == "ROCm"
+ gpu.Library == "ROCm" ||
+ gpu.Library == "Vulkan"
if !supportsFA {
return false
diff --git a/scripts/build_windows.ps1 b/scripts/build_windows.ps1
index 548545cb7..3c885b987 100644
--- a/scripts/build_windows.ps1
+++ b/scripts/build_windows.ps1
@@ -187,11 +187,11 @@ function buildROCm() {
function buildVulkan(){
if ($env:VULKAN_SDK) {
write-host "Building Vulkan backend libraries"
- & cmake --fresh --preset Vulkan --install-prefix $script:DIST_DIR -DOLLAMA_RUNNER_DIR="vulkan"
+ & cmake -B build\vulkan --preset Vulkan --install-prefix $script:DIST_DIR -DOLLAMA_RUNNER_DIR="vulkan"
if ($LASTEXITCODE -ne 0) { exit($LASTEXITCODE)}
- & cmake --build --preset Vulkan --config Release --parallel $script:JOBS
+ & cmake --build build\vulkan --target ggml-vulkan --config Release --parallel $script:JOBS
if ($LASTEXITCODE -ne 0) { exit($LASTEXITCODE)}
- & cmake --install build --component Vulkan --strip
+ & cmake --install build\vulkan --component Vulkan --strip
if ($LASTEXITCODE -ne 0) { exit($LASTEXITCODE)}
}
}