Skip to content

armgit / PS5LM

Public Imported from GitHub
0

llama.cpp on a jailbroken PS5: run any GGUF model natively on the console, starting with Qwen 3.8

1.7 KB
Raw Blame
#!/usr/bin/env bash
# Fast offline checks by default; --rpc also builds and runs real CPU RPC inference.
set -euo pipefail
root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$root"
mkdir -p build/fleet-tests
python3 -m unittest discover -s tests -p 'test_fleet_*.py' -v
cxx=${CXX:-c++}
"$cxx" -std=c++17 -Wall -Wextra -Werror -I ps5/app \
    tests/fleet_worker_config_test.cpp -o build/fleet-tests/worker-config
build/fleet-tests/worker-config
"$cxx" -std=c++17 -Wall -Wextra -Werror -I ps5/app -I third_party/llama.cpp/ggml/include \
    tests/fleet_worker_runtime_test.cpp ps5/app/fleet_worker.cpp -o build/fleet-tests/worker-runtime
build/fleet-tests/worker-runtime
"$cxx" -std=c++17 -O1 ps5/app/model_plan_test.cpp ps5/app/model_plan.cpp -o build/fleet-tests/existing-model-plan
build/fleet-tests/existing-model-plan
bash -n scripts/build-fleet-host.sh scripts/build-app.sh scripts/test-fleet.sh
if [[ ${1:-} == --rpc ]]; then
    # Fail fast on a clean runner, before the C++ build, if fixture imports
    # are missing. This uses the pinned submodule, never a separately installed gguf.
    PYTHONPATH="$root/third_party/llama.cpp/gguf-py${PYTHONPATH:+:$PYTHONPATH}" \
        python3 -c 'import numpy, yaml, gguf'
    scripts/build-fleet-host.sh
    out="${PS5LM_FLEET_BUILD:-$root/build/fleet-host}"
    "${CMAKE:-cmake}" -E env CTEST_OUTPUT_ON_FAILURE=1 \
        "$(dirname "$(command -v "${CMAKE:-cmake}")")/ctest" --test-dir "$out" -R '^test-rpc-multi-server$'
    python3 tests/fleet_rpc_no_comm_test.py --binary "$out/bin/ggml-rpc-server"
    python3 tests/fleet_rpc_smoke.py --build "$out"
    python3 tests/server_system_messages_test.py --build "$out"
elif [[ $# != 0 ]]; then
    echo 'usage: scripts/test-fleet.sh [--rpc]' >&2
    exit 2
fi