clpeak

krrishnarrajGPL-3.0活跃维护

跨平台命令行工具,用同一套测试测 CPU、GPU、NPU 的峰值算力、内存带宽和延迟,覆盖 CUDA、Metal、OpenCL 等主流 API。

Peak compute, memory bandwidth and latency of CPUs, GPUs and NPUs: the same tests through every API that reaches a device. Command line and app for Windows, macOS, Linux and Android

3.0.5发布于 2026-11-07 16:56 UTC533star143fork同步于 2026-11-10 23:56 UTC

怎么上手

由 README 提炼,执行前请确认
git clone --recursive https://github.com/krrishnarraj/clpeak
cd clpeak
cmake -S . -B build
cmake --build build -j
./build/clpeak
硬件要求按 README 说明

README 未说明最低显存或具体 GPU 型号要求;支持 CPU、GPU 与 NPU,覆盖 Windows、macOS、Linux、Android。

支持 Apple Silicon需要 CUDA支持 ROCm / AMD
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

跨 API 实测 CPU、GPU、NPU 的峰值算力、显存带宽与延迟,同一套测试便于横向对比

跨平台命令行工具,用同一套测试测 CPU、GPU、NPU 的峰值算力、内存带宽和延迟,覆盖 CUDA、Metal、OpenCL 等主流 API。

核心能力

  • 同一套测试跑遍 CUDA、ROCm、Metal、SYCL、Vulkan、OpenCL 各后端
  • 用 ONNX Runtime、Core ML、LiteRT 测 NPU 与 AI 加速器
  • 按运行时指令集选择原生内核测 CPU(x86-64、AArch64)
  • 支持按设备、后端、类别或单项测试过滤运行
  • 可导出 JSON 并与历史运行结果对比

容易踩的坑

必须带 --recursive 克隆,否则子模块缺失导致构建失败;后端只在找到对应 SDK 时才编译,可用 -DCLPEAK_ENABLE_=OFF 排除;ONNX Runtime 与 LiteRT 后端无需 SDK,但运行时才加载对应库,可用 --onnx-lib、--litert-lib 指定;发布二进制未签名,Windows 需先解除锁定、macOS 需在隐私与安全性中允许打开。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本3.0.5
  1. 3.0.5最新正式版2026-11-07 · 2026-11-07 16:56 UTC

    clpeak 3.0.5 adds CPU coverage for older x86 parts and for phones that hide their cache sizes, and makes a held run on a phone keep what it measured. Scripts and saved runs from 3.0.x work unchanged. A run left unfinished by an earlier build still has to be continued with that build, as before.

    CPU

    • AVX rows for CPUs with AVX but not AVX2 + FMA. Sandy Bridge and Ivy Bridge, Bulldozer through Steamroller, and Jaguar/Puma ran only SSE2 rows. A new AVX build of the fp32, fp64, fp32 latency and divide/sqrt tests now runs on them, labelled [AVX]. On a 4× Xeon E5-4657L v2 (Ivy Bridge-EP): fp32 MT 1.00 → 2.01 TFLOPS, fp64 0.50 → 1.00 TFLOPS. Divide/sqrt reads the same as SSE2 there, which is right: Ivy Bridge splits 256-bit divides. Piledriver and Steamroller have FMA3 but not AVX2, so they run these mul+add rows and read about half their FMA peak. Thanks @lilyanatia (#226).
    • Multi-socket CPUs report their real core count. On Linux the CPU backend assumed one socket, so a multi-socket machine showed the wrong core count and its SMT went undetected. It now counts the sockets /proc/cpuinfo lists. Confirmed on the same 4-socket Ivy Bridge-EP. Thanks @lilyanatia (#227).
    • Cache sizes the OS leaves out are measured. Android lists the caches of a Galaxy S24, S24 Ultra and Z Fold8 without sizes, and a CMF Phone 1 lists only its L1d, so every cache row skipped. A dependent-load walk over growing working sets now finds where each listed level ends, on one core of each type, and the device header marks the size (measured).
      • It runs only for a level the OS lists without a size, stops at 60 s, and does not run where cores cannot be pinned (macOS).
      • A level the OS does not list is not made up. A listing with nothing past the L1d now says so, instead of "no L3 on this CPU".
      • A level whose step is not found stays unsized, and its rows skip with that reason.
      • CMF Phone 1: L1d 64 KB (A78) and 32 KB (A55), and the L1 rows run. Threadripper 3955WX: 32 KB / 512 KB / 15–16 MB, against the 16 MB it has.
      • --verbose logs each sweep.

    Reliability

    • A held run saves what it has measured before it waits. A test reached the checkpoint only when its whole Benchmark finished. A Galaxy S24 Ultra held right after the last reading of its QNN matmul test, Android ended the app 95 minutes later, and the continued run measured the test again: 38.3 → 30.3 TOPS. The checkpoint is now written before a hold or a thermal pause starts, and the tests in progress are listed in it as held_tests. A resumed run keeps those readings and adds only the ones still missing. See docs/format-v3.md.

    Full Changelog: https://github.com/krrishnarraj/clpeak/compare/3.0.4...3.0.5

  2. 3.0.42026-10-22 · 2026-10-22 04:36 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/krrishnarraj/clpeak/compare/3.0.3...3.0.4

  3. 3.0.32026-10-21 · 2026-10-21 12:32 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/krrishnarraj/clpeak/compare/3.0.2...3.0.3

  4. 3.0.22026-10-21 · 2026-10-21 10:03 UTC
    查看更新说明

    New

    • Continue a run. With -o, a run keeps what it has finished in <output>.partial.json. clpeak --resume <output> runs the rest into the same document, and --skip-crashed records the test the run died in as an error rather than running it again. The app offers Continue from History, and after a run it died in, on its next launch.
    • Pause. The app's run screen has Pause. A run also holds while the app is off screen, where a phone throttles and then freezes it, and a notification brings it back.
    • Thermal pause. On Android and iOS a run waits between readings while the OS reports the device at severe or hotter, until it cools.
    • GPU time budgets. --max-time is now --max-time-gpu keeps the 500 ms default. The new --max-time-ml-gpu (1000 ms) caps how long one ONNX Runtime, LiteRT or Core ML run on a GPU may be predicted to take: a 7 s submission reset a Galaxy S24's Adreno 750.
    • Runtimes. LiteRT 2.3.0 and ONNX Runtime 1.31.0 (1.30.0 on iOS). The oneapi zips are built with oneAPI 2026.2. LiteRT's GPU now declines bf16 and fp8 rather than aborting, and falls back to OpenGL ES where there is no OpenCL.
    • Android. NPU libraries are delivered only to the chipsets that use them, so a phone without a Snapdragon NPU downloads 26 MB instead of 101. The 3.0.1 Play build listed no Hexagon NPU because it lacked the QNN runtime, which it now carries. The SME kernels now compile; 3.0.1's APK had none, so a Snapdragon 8 Elite Gen 5 read every SME-only row as unsupported.

    Corrected measurements

    • CPU on phones. Single-thread rows ran on cpu0, a little core on Android (a Galaxy S24's fp32 ST read an A520's 31 GFLOPS). All-core rows read the slowest core times the thread count. ST now runs on the fastest core, and MT threads share the work.
    • Cache sizes. Where the OS lists a cache without its size, clpeak assumed 32 KB / 512 KB, and a Galaxy S24 read DRAM at 71.7 GB/s on a 68 GB/s bus. Those rows now skip and name the gap.
    • Arm mixed precision. The FMLAL chain no longer converts every step. M1 Pro mp: 46.5 → 98.1 GFLOPS ST, 373 → 820 MT, the fp32 rate.
    • GPU fp32 and fp16. M1 Pro fp32 and fp16 read 4.47 → 5.16 TFLOPS on Metal, Vulkan and OpenCL (peak 5.3), level with mixed precision. On an Arc A380 the chain is also timed at sub-group 16, where a mad's sources stop sharing a register bank: Vulkan mixed 3.5 → 4.8, OpenCL fp32 3.9 → 4.9, oneAPI mixed 3.9 → 4.6 TFLOPS.
    • Arc matrix engines. Vulkan coopmat is timed at the narrower sub-groups DPAS runs at: A380 fp16 14.5 → 30.8 TFLOPS, int8 22.1 → 61.5 TOPS. oneAPI joint_matrix now matches those (fp16 15.5 → 30.8, int8 31.0 → 61.5). oneMKL races its four layouts (int8 11.7 → 37.9 TOPS). OpenVINO's ONNX GEMM reduces row-first and tries taller layers (fp16 20.0 → 25.6 TFLOPS).
    • llvmpipe coopmat. The compiler folded tiles built from one scalar, so Mesa's CPU Vulkan read 2.78 TFLOPS fp16 on a Threadripper 3955WX whose fp32 peak is 2.2. It now reads 0.14.
    • OpenCL. Intel's int8 dot-product kernels compiled out without OpenCL C 3.0; Intel's CPU runtime now reads 100 GOPS where it read nothing. Image bandwidth races the walks Vulkan does (M1 Pro 172 → 184 GB/s, matching Vulkan).
    • Wrong answers. ONNX Runtime and Core ML withhold a rate whose answer is wrong, as LiteRT already did. LiteRT's OpenCL GPU never converted int8 inputs and outputs, so int8 rows on an Adreno 750 and a Mali-G710 timed unwritten tensors; those graphs now take float I/O.
    • LiteRT units. int8_weight and int4_weight count OPS where the kernel multiplies in int8.
    • LiteRT WebGPU. It no longer crashes or runs out of file descriptors. On an RTX 5060, 3.0.1 lost the device in its first test; the whole suite now runs (fp16 GEMM 32.5 TFLOPS, int8 61.5 TOPS).
    • MediaTek APU. On a Dimensity 7300, fp16 rows were refused for want of a bias, and convolution rows stopped at 32x32 behind a 15 s compile. fp16 now runs (GEMM 766 G
  5. 3.0.2-b1pre-release2026-10-15 · 2026-10-15 06:24 UTC
    查看更新说明

    Signpath sign test

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    clpeak

    Latest release Build License

    clpeak — compute latency peak. It measures the peak compute throughput, memory bandwidth and latency that CPUs, GPUs and NPUs actually reach, using small, tight kernels alongside each vendor's own tuned libraries. It reaches a device through every API that exposes it and runs the same tests on each, so the numbers from one machine can be compared side by side.

    • GPU compute APIs: CUDA, ROCm/HIP, Metal, oneAPI/SYCL, Vulkan, OpenCL
    • AI runtimes (NPU, GPU and CPU): ONNX Runtime, Core ML, LiteRT
    • CPU: native kernels, picked per instruction set at run time (x86-64, AArch64)

    The same engine ships as a command-line tool and as an app for Windows, macOS, Linux and Android.

    Sample output

    Condensed from the saved runs in results/.

    $ clpeak --cuda
    Backend: CUDA
      Device 0: NVIDIA GeForce RTX 5060
        Tensor cores (WMMA / mma.sync)
          fp16     : 42.6 TFLOPS
          fp8_e4m3 : 85.2 TFLOPS
          nvf4_e2m1 : 328 TFLOPS
          int8     : 84.7 TOPS
        cuBLASLt GEMM peak
          fp16     : 79.1 TFLOPS
          nvf4_e2m1 : 300 TFLOPS
        Global memory bandwidth
          float4   : 420 GB/s
        Kernel launch latency
          roundtrip : 6.35 us
    
    $ clpeak --devices coreml:0
    Backend: CoreML
      Device 0: Apple Neural Engine
        Core ML matmul peak
          fp16     : 10.4 TFLOPS
          int4_lut : 11.3 TFLOPS
          int8_qdq : 11.5 TOPS
        Transformer block, prefill
          fp16_s512 : 4.99 TFLOPS
        Transformer block, decode
          fp16_kv2048 : 43.2 GB/s
        Core ML dispatch latency
          trivial_op : 781 us
    

    More screenshots are on the project page.

    Build

    git clone --recursive https://github.com/krrishnarraj/clpeak
    cd clpeak
    cmake -S . -B build
    cmake --build build -j
    ./build/clpeak
    

    A backend is built when its SDK is found, and -DCLPEAK_ENABLE_<BACKEND>=OFF leaves it out. The ONNX Runtime and LiteRT backends need no SDK: their runtimes are loaded when clpeak runs. The desktop app is built alongside the CLI when the Flutter SDK is on PATH, into build/clpeak-gui/. The project page lists every option; Android and iOS builds are in app/AGENTS.md.

    Usage

    clpeak                            # every test on every device
    clpeak --list-devices             # what clpeak can see, named as --devices takes them
    clpeak --devices cuda:0,vulkan:1  # only these devices
    clpeak --vulkan --opencl          # only these backends
    clpeak --bandwidth                # one category: --compute, --bandwidth, --latency, --ai, …
    clpeak --gemm                     # one test, on every backend that has it
    clpeak --describe                 # what each test and each reading measures
    clpeak -o run.clpeak.json         # save the run as JSON
    clpeak --compare run.clpeak.json  # run again and compare with a saved run
    

    clpeak --help lists every flag. --onnx-lib and --litert-lib choose which ONNX Runtime or LiteRT library to load.

    Running the release binaries

    Each release has a zip per platform with the CLI and the app, plus cuda, rocm and oneapi variants that add those backends, and a .dmg of the macOS app. The binaries aren't signed with a developer certificate, so the OS asks before running them the first time.

    Windows: before extracting, right-click the zip → Properties → tick Unblock → OK. If SmartScreen still says "Windows protected your PC", choose More info → Run anyway.

    macOS: open the .dmg and drag clpeak to Applications. The first launch is refused; open System Settings → Privacy & Security and click Open Anyway next to clpeak. Or clear the quarantine flag from a terminal, which also works for the CLI from the zip:

    xattr -dr com.apple.quarantine /Applications/clpeak-gui.app
    xattr -dr com.apple.quarantine ~/Downloads/clpeak-*-macos-arm64
    

    Linux: sudo snap install clpeak --classic, or use the zip as it is.

    Android: Google Play.

    Reporting a bug

    Numbers that look wrong, missing devices and crashes are all worth reporting. Attach a verbose run so the report can be debugged without your machine.

    • CLI: run clpeak --verbose -o report.clpeak.json and attach report.clpeak.json. If clpeak crashed before finishing, attach report.clpeak.log from the same folder instead: it is written as the run goes.
    • App: turn on Settings → Diagnostics → Verbose diagnostics, run again, then use Export JSON on the results page. A run the app did not survive is listed in History under "Runs that did not finish", with its own export.

    Then open an issue and add the file to it.

    For AI agents

    The tree is documented for coding agents with AGENTS.md files. Start at the root AGENTS.md for the architecture, the directory map and the conventions for adding a benchmark or a backend; a subdirectory's own AGENTS.md covers the code in it. Saved runs in results/ are the baselines to check a suspicious number against, and NOTES.md lists the workarounds for runtime bugs that are waiting on an upstream fix.