跳到主要內容

發表文章

目前顯示的是 8月 13, 2017的文章

16GB ROCm 本地 LLM-as-a-Verifier 實測數據:Qwen3.5-9B 跑起來到底多快

TL;DR: 用 Qwen3.5-9B(Q4_K)在單張 16GB AMD GPU 上跑本地 LLM-as-a-Verifier,每次 code comparison 約 0.5–2 秒,cache hit rate 66%,正確程式碼穩定給 1.0 分,有 bug 的給 0.0–0.14 分。16GB 跑 9B 模型綽綽有餘,還有空間跑其他服務。 這篇是實測續篇,前兩篇分別講了 架構設計 和 Docker 封裝 。前兩篇講的是「做什麼」跟「怎麼做」,這篇來量「到底多快」。 1. 測試環境 在一台 homelab Linux(CachyOS)上跑的: 項目 內容 GPU AMD 16GB(15.9 GiB)via ROCm 模型 Qwen3.5-9B(8.95B 參數,Q4_K ~5.7GB GGUF) 後端 llama.cpp(llama-server,ROCm HIP build) Verifier Docker container(llm-verifier),port 8010 模型 VRAM ~10.2 GB(模型本身 + 動態 KV cache) GPU 使用率 78% 系統 RAM 62 GB;使用 27 GB(swap 用了 9.3 GB) Context window 131,072 tokens MIN_SCORE 0.8 後端跑在另一台機器上,走 local Gigabit 網路連線。 2. Verifier 在幹嘛 docker-llm-as-a-verifier 包裝了 LLM-as-a-Verifier 這個研究套件,讀取 token-level log probability 來算連續分數,不是簡單的 yes/no 判斷。 Container 開了 7 個 HTTP endpoint: Endpoint Method 用途 /health GET 健康檢查 /v1/compare POST 兩組答案比對評分 /v1/select POST Best-of-N 選最佳 /v1/track POST Agent 軌跡分數追蹤 /v1/directed POST 導...

偷懶亂改之老 DIY CD player

小時候做了一台這個: 自製 CD 播放器 KTZ CD Player 現在其實很懶,本來是想要弄個切換器,可以切換原本的 CD Player 和現在想接的 Asus Tinker Board 板子,然後就挖到一個以前電腦顯卡有一片接 S 端子和 RCA 頭的東西,亂接一通就先用了。 接上 Asus Tinker Board 上面裝 Volumio 2,然後再把 Macbook 拆下來的 DVD-ROM 用 USB 外接上,用 abcde 這個轉檔程式轉 flac。 把以前的 CD 轉一轉,也可以用了,不用再做切換了。

[數位音樂] Listen Music Through Snapcast 實現多空間音樂同步聆聽 (Client 端)

Snapcast Server 裝好之後,你可以利用 Snapcast Client 去同步 Server 端正在播放的音樂。 目前 Snapcast 支援的環境有: Linux FreeBSD macOS Android OpenWrt Buildroot Raspberry Pi 文件在此: https://github.com/badaix/snapcast/blob/master/doc/build.md From: https://github.com/badaix/snapcast/releases/latest 一、Android 手機 有 apk 可以裝,記得打開允許安裝不明來源的應用程式,下載裝完。 打開 app 設定 Server 然後就按上面的箭頭就可以聽到聲音囉,也可以用 app 控制連上同一台 Snapcast Server 的 Client,調整音量或切換 Server 的頻道等。 二、樹莓派板子 有 deb 可以裝,不是用 debian 套件管理的就要自己編了。 wget https://github.com/badaix/snapcast/releases/download/v0.11.1/snapclient_0.11.1_armhf.deb sudo dpkg -i snapclient_0.11.1_armhf.deb 編輯 Snapcast Client Config,比方說 Server 端 IP 在 192.168.0.100 sudo vi /etc/default/snapclient START_SNAPCLIENT=true USER_OPTS="--user snapclient:audio" SNAPCLIENT_OPTS="-d -h 192.168.0.100" 啟動服務 sudo service snapclient start Server 開著並且有播音樂的話,應該就會聽到聲音了 三、MacBook 按照文件可以編譯成功 (Sierra 10.12.6),請參考: Build.md macOS (Native)

[數位音樂] Listen Spotify and Use Snapcast 實現多空間音樂聆聽 (Server 端)

昨天 那篇 ,如果是很單純只想聽 Spotify Premium,然後又不想只是切換到其中一個裝置,其實有比較簡單的解法。 只要使用 librespot 的 pipe backend 配合 Snapcast 即可。 一、Build librespot (Ubuntu) Udoo X86 use Ubuntu 17.04 (Zesty Zapus) 先裝 Rust 編譯環境 curl https://sh.rustup.rs -sSf " sh 裝相依的 library sudo apt update sudo apt install build-essential portaudio19-dev Clone 專案並編譯 git clone https://github.com/plietar/librespot.git cd librespot export PATH=$HOME/.cargo/bin:$PATH cargo build --release 然後把編譯好的 librespot 執行檔放到 /usr/local/bin 去 sudo cp target/release/librespot /usr/local/bin/ 二、Install Snapcast (Ubuntu) Download From: https://github.com/badaix/snapcast/releases/latest Get snapserver_0.11.1_amd64.deb wget https://github.com/badaix/snapcast/releases/download/v0.11.1/snapserver_0.11.1_amd64.deb dpkg -i snapserver_0.11.1_amd64.deb 三、Edit Snapcast Config file sudo vi /etc/default/snapserver START_SNAPSERVER=true USER_OPTS="--user snapserver:snapserver" SNAPSERVER_OPTS="-d -s spotify:///librespot?name=Spotify&username=YOURUS...

[數位音樂] Mopidy with Spotify and Snapcast 實現多空間音樂聆聽 (Server 端)

一、Install Modipy (Ubuntu) Udoo X86 use Ubuntu 17.04 (Zesty Zapus) apt update apt install mopidy mopidy-spotify 二、Install Snapcast (Ubuntu) Download From: https://github.com/badaix/snapcast/releases/latest Get snapserver_0.11.1_amd64.deb wget https://github.com/badaix/snapcast/releases/download/v0.11.1/snapserver_0.11.1_amd64.deb dpkg -i snapserver_0.11.1_amd64.deb 三、Edit Mopidy Config file sudo vi /etc/mopidy/mopidy.conf Add This [spotify] username = spotify premium account username password = spotify premium account password client_id = client_id you got from mopidy.com client_secret = client_secret you got from mopidy.com enabled = true bitrate = 320 [audio] output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/mopidyfifo mixer_volume = 100 Client ID and Client Secret get from: https://www.mopidy.com/authenticate/#spotify 四、Edit Snapcast Config file sudo vi /etc/default/snapserver START_SNAPSERVER=true USER_OPTS=...