From 41d4251cd5cdfa19b63275848fc5da9f29a1bbbf Mon Sep 17 00:00:00 2001 From: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com> Date: Fri, 31 Jul 2026 12:04:21 +0000 Subject: [PATCH 1/4] fix(qwen-tts): install flash-attn on CUDA 13 Add the missing cublas13 post-install requirements hook so the CUDA 13 backend uses FlashAttention instead of falling back to SDPA. Keep CUDA packaging parity covered by the backend test script. Assisted-by: Codex:gpt-5 --- backend/python/qwen-tts/requirements-cublas13-after.txt | 1 + backend/python/qwen-tts/test.sh | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 backend/python/qwen-tts/requirements-cublas13-after.txt diff --git a/backend/python/qwen-tts/requirements-cublas13-after.txt b/backend/python/qwen-tts/requirements-cublas13-after.txt new file mode 100644 index 000000000000..d0f50993616a --- /dev/null +++ b/backend/python/qwen-tts/requirements-cublas13-after.txt @@ -0,0 +1 @@ +flash-attn diff --git a/backend/python/qwen-tts/test.sh b/backend/python/qwen-tts/test.sh index eb59f2aaf3f3..e4833fe5e627 100755 --- a/backend/python/qwen-tts/test.sh +++ b/backend/python/qwen-tts/test.sh @@ -2,6 +2,11 @@ set -e backend_dir=$(dirname $0) + +for cuda_version in 12 13; do + grep -qx "flash-attn" "$backend_dir/requirements-cublas${cuda_version}-after.txt" +done + if [ -d $backend_dir/common ]; then source $backend_dir/common/libbackend.sh else From abb6e2b9d02f14d35da6185da92188b33d5e4c0e Mon Sep 17 00:00:00 2001 From: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com> Date: Sat, 1 Aug 2026 00:06:44 +0000 Subject: [PATCH 2/4] fix(qwen-tts): serialize CUDA 13 flash-attn build Limit the CUDA 13 FlashAttention source build to one ninja worker by default so it stays within CI runner memory. Preserve explicit MAX_JOBS overrides and leave other build profiles unchanged. Assisted-by: Codex:gpt-5 [web] --- backend/python/qwen-tts/install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/python/qwen-tts/install.sh b/backend/python/qwen-tts/install.sh index b7d487873f78..668969fff9fc 100755 --- a/backend/python/qwen-tts/install.sh +++ b/backend/python/qwen-tts/install.sh @@ -10,4 +10,10 @@ else source $backend_dir/../common/libbackend.sh fi +# CUDA 13 has no prebuilt FlashAttention wheel, so the fallback source build +# exceeds the CI runner's memory when ninja compiles multiple units at once. +if [ "x${BUILD_PROFILE}" = "xcublas13" ]; then + export MAX_JOBS="${MAX_JOBS:-1}" +fi + installRequirements From 7916c48f04fc0c6c6d61a2651201b3c06d332ae0 Mon Sep 17 00:00:00 2001 From: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com> Date: Sat, 1 Aug 2026 03:03:20 +0000 Subject: [PATCH 3/4] test(qwen-tts): guard CUDA 13 build concurrency Keep the CUDA 13 FlashAttention packaging check tied to its serialized source-build guard so the runner OOM fix cannot be removed unnoticed.\n\nAssisted-by: Codex:gpt-5 [Codex] --- backend/python/qwen-tts/test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/python/qwen-tts/test.sh b/backend/python/qwen-tts/test.sh index e4833fe5e627..df31e076533a 100755 --- a/backend/python/qwen-tts/test.sh +++ b/backend/python/qwen-tts/test.sh @@ -7,6 +7,9 @@ for cuda_version in 12 13; do grep -qx "flash-attn" "$backend_dir/requirements-cublas${cuda_version}-after.txt" done +grep -q 'BUILD_PROFILE.*cublas13' "$backend_dir/install.sh" +grep -q 'MAX_JOBS.*1' "$backend_dir/install.sh" + if [ -d $backend_dir/common ]; then source $backend_dir/common/libbackend.sh else From 127a5780f20dde5ba0c83dbb972fbee87fe6993d Mon Sep 17 00:00:00 2001 From: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com> Date: Sat, 1 Aug 2026 20:03:17 +0000 Subject: [PATCH 4/4] fix(qwen-tts): limit CUDA compiler threads The CUDA 13 FlashAttention build still exhausts hosted-runner memory with a single ninja worker because nvcc can compile multiple threads internally. Limit nvcc to one thread for that profile and guard the setting in the backend test script. Assisted-by: Codex:gpt-5 --- backend/python/qwen-tts/install.sh | 1 + backend/python/qwen-tts/test.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/backend/python/qwen-tts/install.sh b/backend/python/qwen-tts/install.sh index 668969fff9fc..9c8bcf83f39c 100755 --- a/backend/python/qwen-tts/install.sh +++ b/backend/python/qwen-tts/install.sh @@ -14,6 +14,7 @@ fi # exceeds the CI runner's memory when ninja compiles multiple units at once. if [ "x${BUILD_PROFILE}" = "xcublas13" ]; then export MAX_JOBS="${MAX_JOBS:-1}" + export NVCC_THREADS="${NVCC_THREADS:-1}" fi installRequirements diff --git a/backend/python/qwen-tts/test.sh b/backend/python/qwen-tts/test.sh index df31e076533a..97ea2faf916d 100755 --- a/backend/python/qwen-tts/test.sh +++ b/backend/python/qwen-tts/test.sh @@ -9,6 +9,7 @@ done grep -q 'BUILD_PROFILE.*cublas13' "$backend_dir/install.sh" grep -q 'MAX_JOBS.*1' "$backend_dir/install.sh" +grep -q 'NVCC_THREADS.*1' "$backend_dir/install.sh" if [ -d $backend_dir/common ]; then source $backend_dir/common/libbackend.sh