Files
LocalAI/scripts/build/fish-speech-ptxas_test.sh
Ettore Di Giacinto f5ea6e4eab 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>
2026-09-11 21:48:54 +00:00

40 lines
1.1 KiB
Bash

#!/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"