HN 日本語サマリー

← 一覧へ戻る
AI・機械学習

同じモデル、同じQ4_K_Mラベル:5.02、5.07、5.27ビット/重み

Same model, same Q4_K_M label: 5.02, 5.07 and 5.27 bits per weight (github.com)

6 pointsby logickkk10 コメント

要約

picchioは、ローカルLLMのパフォーマンスを測定するためのPythonツールです。モデルの量子化ラベルが同じでも、実際のビット/重みやトークン/秒(tok/s)の速度が異なる場合があることを示し、GPUオフロードの失敗やCPUフォールバックといった問題点を明らかにします。このツールは、プリフィル、デコード、ウォールクロックの各速度を分離して計測し、GPUが実際に処理を行っているか、その理由を検証します。

全文翻訳

[画像: pixel woodpecker on a trunk](https://github.com/logxio/picchio/blob/main/assets/picchio-mark-a.svg)

Inference Placement Receipts for local LLMs

[画像: selftest](https://github.com/logxio/picchio/actions/workflows/selftest.yml) [画像: license: MIT](https://github.com/logxio/picchio/blob/main/LICENSE) [画像: python 3.9+, stdlib only](https://camo.githubusercontent.com/bdf1d9e5721298fee42b4594b8fc03145f5d60be2af3e8b0433390af05ddaabb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d332e392532422532432532307374646c69622532306f6e6c792d333737366162)

Run it · Browse results · Add your machine

推論配置レシート(Inference Placement Receipt)は、エンジンのレイヤー配置、システムのGPU測定値、および実行ごとの個別の速度測定値を結合したものです。単一のトークン/秒(tok/s)の数値だけでは分からない、ローカルモデルが実際にどこで実行されたかを示します。例えば、27Bモデルが5.7 tok/sで応答した場合でも、その記録されたレシートは、66レイヤー中28レイヤーがCPUで実行され、メモリ不足が原因であったことを示しています。Watch the demo。

[画像: Recorded Qwen3.8-27B run: 38 of 66 layers on GPU, 28 on CPU, 5.7 tok/s warm decode](https://github.com/logxio/picchio/blob/main/assets/picchio-demo.svg)

別のLinux CUDA 27Bレシートは、RTX 5090上で66レイヤーすべてを実行し、GPU使用率92%、ウォームデコードで81.5 tok/sを記録しています。その3回のキャプチャされたパスとNVMLサンプルは、Apple M5 GPUおよび強制CPU実行の結果と共に公開されています。

著者によるKaggle Linux T4ペアの実行では、同じQwen3.5-9Bファイルと正確なパスごとのプロンプトを使用しました。GPUレシートは33/33レイヤーと40.1 tok/sのウォームデコードを示し、一方強制CPUレシートは0/33レイヤーと2.6 tok/sを示しています。これらのキャプチャされたレシートを、GPUやモデルのダウンロードなしで再計算してください:

python3 scripts/replay_receipts.py

このコマンドは、公開されている各レシートをキャプチャされた入力に対してチェックします。不一致があった場合、影響を受けたファイルまたはレシートの行を示し、ゼロ以外のコードで終了します。

Run it

curl -fsSL https://raw.githubusercontent.com/logxio/picchio/main/public/picchio.pyz -o picchio
chmod +x picchio
./picchio

Windowsでは、PowerShellで以下を実行します:

curl.exe -fsSL https://raw.githubusercontent.com/logxio/picchio/main/public/picchio.pyz -o picchio.pyz
python picchio.pyz

引数なしで実行すると、PicchioはOllamaタグ、ローカルGGUFファイル、およびHugging FaceとLM Studioのキャッシュにあるモデルを検索します。いずれかを選択すると、3回のパスを実行します。

モデルまたは実行中のサーバーを直接指定することもできます:

./picchio model.gguf
./picchio qwen3.5:9b
./picchio http://127.0.0.1:8080

Python 3.9+がインストールされていれば、macOS、Linux、Windowsで動作します。ダウンロードは1ファイルで、標準ライブラリのみを使用します。

Next

  • Linux Radeonの実行結果をさらに収集し、実際のエンジン出力と比較してGPUアクティビティとマルチカードの結果を確認します。これはRX 7900 XTXレポートに基づいています。
  • WindowsハードウェアでのOllamaの完全なパスを検証します。モデルの検索から実行場所の報告までを行います。

公開されている作業は2026年7月から9月にかけて行われ、v1.0.0は8月にリリースされました。Issue #1では、Radeonユーザーが速度測定値の欠落とコールドランの誤った内訳を報告しました。メンテナーは修正を返信し、新しい評価を求めました。ユーザーはその再実行結果をまだ投稿していないため、そのマシンでの修正された結果は検証されていません。

Contribute a run or a fix。

Use the result

| I want to… |
| --- | --- |
| catch CPU fallback and measure the run | ./picchio MODEL |
| know whether a model fits here before I download it | ./picchio plan https://huggingface.co/.../model-Q4_K_M.gguf · ./picchio plan qwen3.5:9b |
| check that fit at my own context and KV type | ./picchio plan MODEL --ctx 262144 --kv q8_0 |
| guard something already running and get told the moment it leaves the GPU: your own command, a loaded model, a server | ./picchio guard -- COMMAND · ./picchio guard ollama · ./picchio guard http://127.0.0.1:8080 |
| compare two runs and show the first changed setting | ./picchio compare before.txt after.txt |
| turn one run into a complete Ollama or llama.cpp Issue report | ./picchio MODEL --share bug-report |

マシン可読の出力を得るには--jsonを追加してください。問題がより大きなコンテキストでのみ発生する場合は--ctx 262144を追加してください。

フィットチェックは、ファイルヘッダーとレジストリマニフェストから、ダウンロード前に行われ、1つの単語と1つの操作で回答します。ブラウザでは:will it fit?

FITS. The whole model fits in this machine's memory.
  5.3 GiB to download

What it gives you

  • the exact number of model layers on the GPU
  • separate prefill, decode and wall-clock speeds
  • GPU activity, memory, power and energy per generated token
  • the first setting that changed when you compare two runs
  • a clear HEALTHY, CPU FALLBACK or PARTIAL OFFLOAD result
  • a paste-ready GitHub Issue with your machine, model, GPU placement and measured rates

Compare machines

I measured these with Picchio:

machinemodel and engineplacementprefilldecodewall-clock
Apple M5Qwen3.5-9B, llama.cpp Metal33/33588.021.115.5
Apple M5same file, forced CPU0/3326.812.23.0
RTX 4090same file, llama.cpp CUDA33/336763.3138.025.2
RTX 5090same file, llama.cpp CUDA33/339135.9226.457.3
RTX 5090same file, llama.cpp Vulkan33/336206.3198.451.0
RTX 5090qwen3.5:9b, Ollama100% GPU8614.7193.5153.9
RTX 4070 SUPERsame file, llama.cpp CUDA33/334187.878.228.9
your machine

Open every result or compare the outputs in examples/。

What Picchio reads

  • llama.cpp: per-layer placement, applied sampling settings and timing
  • Ollama: CPU/GPU weight split and timing
  • macOS: Apple GPU activity, memory, power and energy per token
  • NVIDIA on Linux and Windows: GPU activity, memory, power and energy per token through NVML
  • AMD on Linux: GPU activity and memory through amdgpu sysfs

PicchioをGGUFパス、Ollamaタグ、または実行中のllama-server URLに向けます。結果はモデルがどこで実行されたか、そして比較に安全な数値はどれかを示します。

One run, two sources of evidence

llama-bench documentationは、backends、n_gpu_layers、および繰り返しテストのavg_ts / stddev_ts出力を示しています。そのn_gpu_layersはテスト設定であり、GPUアクティビティの測定値ではありません。llama-cli documentationには--show-timingsが含まれています。Picchioはエンジンの出力を読み取り、同じ実行中にOSをサンプリングします:

Input and sourceOutput in the public Apple M5 / Qwen3.5-9B receiptsWhat it can establish
llama.cpp stderr from each passoffloaded 33/33 with prompt/eval timings in the GPU run; offloaded 0/33 in the forced CPU runActual layer placement and engine timing as reported by llama.cpp; not independent proof that the GPU was busy.
Picchio's time-aligned macOS GPU samples from those same passesGPU run: 99% work, +6.0 GiB, 11.0 W, 0.52 J/token; forced CPU run: 5% work, +0.3 GiB, 0.1 W, 0.01 J/tokenOS-side activity, memory and energy alongside the engine report; these are whole-GPU readings, not per-process attribution or total-system energy.
Picchio's combined resultHEALTHY versus SILENT CPU FALLBACK, with --device none -ngl 0 identified in the CPU runA diagnosis for each recorded run. The different placement and rates come from the GPU settings, not from Picchio accelerating inference.

2つのM5レシートは、1つのApple M5、同じモデルパス、エンジンビルド、コンテキスト、サンプリング設定を報告しています。強制CPU実行は--device none -ngl 0を変更します。生のファイルには独立したマシンまたはモデルバイトのフィンガープリントは含まれておらず、OSサンプルはGPU全体を測定します。この比較にはllama-benchのスループット数は含まれていません。Linux 27Bレシートは、3回の記録されたCUDAパスとNVMLサンプルから再生されます。OSサンプルはGPU全体を測定し、生のファイルには独立したマシンまたはモデルバイトのフィンガープリントはありません。4070 SUPER 27Bレシートは、それ自体の算術(66 − 38 = 28 CPUレイヤー)でチェックできます。その生のレイヤーとタイミングログは公開されていないため、再生コマンドはそれらの測定値を独立して再現しません。2つの27Bマシン間の速度は、制御された比較ではなく、Picchioが推論を高速化することの証拠でもありません。

Send me your machine

./picchio MODEL --share row > result.md 2> picchio.txt

Add your result。Picchioがあなたの実行を誤りと判断した場合、まずそれを送ってください。

License

MIT