mirror of
https://github.com/mudler/LocalAI.git
synced 2026-09-21 05:34:56 -04:00
fix(fish-speech): use CUDA toolkit ptxas
Prefer an explicitly configured Triton assembler, otherwise use the executable ptxas from CUDA_HOME so torch.compile can target GPU architectures newer than Triton bundled tooling. Assisted-by: Codex:gpt-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
1 parent
f8e228e0ba
commit
f5ea6e4eab
3 files changed
+62
No files matched your search
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
WORK=$(mktemp -d)
|
||||
trap 'rm -rf "$WORK"' EXIT
|
||||
|
||||
REPO_ROOT=$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")
|
||||
BACKEND_DIR="$WORK/fish-speech"
|
||||
mkdir -p "$BACKEND_DIR/common" "$WORK/cuda/bin"
|
||||
cp "$REPO_ROOT/backend/python/fish-speech/run.sh" "$BACKEND_DIR/run.sh"
|
||||
|
||||
cat > "$BACKEND_DIR/common/libbackend.sh" <<'LIBBACKEND'
|
||||
startBackend() {
|
||||
printf '%s\n' "${TRITON_PTXAS_PATH:-}"
|
||||
}
|
||||
LIBBACKEND
|
||||
|
||||
fail() {
|
||||
echo "FAIL: $*"
|
||||
exit 1
|
||||
}
|
||||
|
||||
touch "$WORK/cuda/bin/ptxas"
|
||||
chmod +x "$WORK/cuda/bin/ptxas"
|
||||
|
||||
got=$(CUDA_HOME="$WORK/cuda" bash "$BACKEND_DIR/run.sh")
|
||||
[ "$got" = "$WORK/cuda/bin/ptxas" ] || \
|
||||
fail "expected toolkit ptxas, got '$got'"
|
||||
|
||||
got=$(CUDA_HOME="$WORK/cuda" TRITON_PTXAS_PATH=/custom/ptxas \
|
||||
bash "$BACKEND_DIR/run.sh")
|
||||
[ "$got" = "/custom/ptxas" ] || \
|
||||
fail "explicit TRITON_PTXAS_PATH was overwritten with '$got'"
|
||||
|
||||
chmod -x "$WORK/cuda/bin/ptxas"
|
||||
got=$(CUDA_HOME="$WORK/cuda" bash "$BACKEND_DIR/run.sh")
|
||||
[ -z "$got" ] || fail "non-executable ptxas was selected as '$got'"
|
||||
|
||||
echo "PASS: fish-speech selects a usable toolkit ptxas"
|
||||
Reference in new issue
Block a user