← 文章總覽

F1 · Cloud & Infra

Profiling llama.cpp with Arm Streamline

L02 · 15 分鐘 · Arm Linux server; specific hardware not stated

導讀

LLM 在 CPU 上做 inference,時間到底花在哪裡?想調校之前,得先看清楚每一段在做什麼。本文在 Arm Neoverse 或 Cortex-A 平台上編譯啟用 KleidiAI 的 llama.cpp,用 Arm Streamline 的 marker 擷取 inference timeline,把 Prefill 與 Decode 拆開觀察 compute graph、KleidiAI kernel 與多 thread 行為,看出 Prefill 以 GEMM 為主、Decode 以 GEMV 為主,讓開發者用實際執行數據找出瓶頸。

驗證範圍

  • 定位為 Arm CPU 上的 llama.cpp profiling reference workflow,使用指定的 llama.cpp b6202、KleidiAI build、Streamline annotations 與 gator data capture,驗證 Prefill、Decode、operator 與多執行緒行為可被觀察。
  • 硬軟體依賴包括 Arm Neoverse 或 Cortex-A Linux/Android 平台、Arm Performance Studio 或 Development Studio、相符版本的 gator、PMU 存取權限,以及可供 llama-cli 執行的 GGUF 模型。
  • 範圍聚焦於 profiling instrumentation 與執行行為分析;觀察結果會受模型、prompt、llama.cpp 版本、build flags、thread configuration 與硬體影響,未涵蓋自動效能最佳化、跨平台 benchmarking 或 production workload tuning。
原文出處: https://learn.arm.com/learning-paths/servers-and-cloud-computing/llama_cpp_streamline/
本頁為導讀與驗證範圍標註,非官方內容轉載。