Clean-room C11 cross-vendor zero-copy runtime and ggml scheduler for freesilicon.
freesched coordinates heterogeneous unified-memory execution across GPU + NPU/TPU + CPU with zero host copies (DMA-BUF / AHardwareBuffer + sync_file fences) and zero proprietary vendor runtime dependencies (no QNN/QAIRT, no vendor EdgeTPU .so), targeting both Qualcomm Snapdragon (IQ-9075, Arduino VENTUNO Q / IQ-8275, Snapdragon 8 Elite Gen 5 / SM8850) and Google Tensor (Pixel 10 / laguna, Pixel 11 / malibu).
All benchmarks below are reproducible clean-room measurements committed in proof/ and mirrored as schema-validated receipts in twin/receipts/:
| Target Silicon | Workload & Execution Path | Verified Hardware Result | Proof / Receipt |
|---|---|---|---|
Snapdragon 8 Elite Gen 5 (SM8850, Android 16, uid=2000 Enforcing) |
Adreno 840 Vulkan 1.2 -> Hexagon v81 HMX shader-direct 32x32 F16Crouton_TCM AHardwareBuffer VLA + 128B HVX vmem/l2fetch + MAP_ARENA |
1,170 FPS (738 µs p50, M=256) / 625 FPS (1.60 ms p50, M=1024) — 3.88x faster than Adreno 840 GPU-only (161 FPS), 3.41x faster than CPU-staged, 112x DSP data-movement cut (17.88 ms -> 159.5 µs), 0 B copy, 0 mismatches |
proof/sm8850-v81-tiled-vla/PROOF.md |
Snapdragon 8 Elite Gen 5 (SM8850, uid=2000 Enforcing) |
Clean-room Hexagon v81 FP16 HMX systolic GEMM (HAP_power_set_HMX_v2, 1.824 GHz, 8 MiB VTCM, freestanding LLVM ELF — same 6 FP16 opcodes as v73) |
23.19 TFLOPS FP16 (nmse=0, 0 mismatches, 1.94x Dual-HTP IQ-9075, hardware ReLU verified) |
proof/sm8850-v81-hmx/PROOF.md |
Qualcomm IQ-9075 (QCS9075, Linux) |
Adreno 663 + Dual Hexagon v73 HTP 3-arm zero-copy DMA-BUF SYNC_FD VLA + Dual-HTP FP16 HMX (zero QNN/QAIRT) |
163.0 FPS (M=256) / 71.5 FPS (M=1024) (2.68x–8.85x vs single-chip), 11.95 TFLOPS Dual-HTP (2.000x scaling), 0 B copy, 0 mismatches |
proof/multi-soc-twin-vla-abc/PROOF.md |
Arduino VENTUNO Q (QCS8275, non-root Ubuntu Linux 6.8) |
Clean-room Hexagon v73 HMX + open-source Mesa Turnip Adreno 623 3-way zero-copy DMA-BUF (zero recompile) |
0.68 TFLOPS HMX FP16, 36.15 µs HVX M=1, 3-way Turnip <-> CDSP zero-copy (bit_exact=true, 0 mismatches) |
twin/receipts/iq8275-ventuno-q-calibrated.json |
Google Pixel 10 (laguna) & Pixel 11 (malibu) |
Heterogeneous PowerVR Volcanic (DXT/CXTP) + EdgeTPU (BUENOS_A0/malibu) + ARMv9 NEON/SME2 zero-copy DMA-BUF + directional thermal/power model |
20 µs GPU <-> EdgeTPU DMA-BUF handoff, 0 fallback copies, multi-profile thermal/power overlays |
twin/receipts/tensor-g5-swiglu-b1.json |
+-----------------------------------------------------------------------------+
| llama.cpp / ggml / robotics VLA / apps |
+-----------------------------------------------------------------------------+
|
v
+-----------------------------------------------------------------------------+
| freesilicon/freesched (Clean-Room C11 Cross-Vendor Zero-Copy Runtime) |
| - include/freesched.h (Frozen pure C11 / C++17 ABI) |
| - include/ggml_freesilicon.h (Thin ggml backend adapter seam) |
| - include/freehexagon*.h (Clean-room v73/v81 HVX + HMX + FastRPC ABI) |
| - Zero-copy DMA-BUF / AHardwareBuffer ownership + sync_file state machine |
| - Cost-model router + pluggable fs_backend_ops_t vtable |
| - twin/freesilicon-twin (Offline functional & ABI smoke validator) |
+-------------------+---------------------------+-----------------------------+
| (runtime plugin vtable) | (clean-room freestanding)
v v
+-----------------------------------+ +--------------------------------------+
| Google Tensor Backends | | Qualcomm Snapdragon Backends |
| - freesilicon/freetpu (EdgeTPU) | | - FreeHexagon v73/v81 (HVX + HMX) |
| - freesilicon/freepvr + mesa | | - Adreno 623/663/840 Vulkan/Turnip |
| - ARMv9 NEON / SME2 | | - AHardwareBuffer / DMA-BUF SYNC_FD |
+-----------------------------------+ +--------------------------------------+
Dependencies stay strictly one-way: freesched carries zero proprietary vendor libraries, zero vendored llama.cpp source, and binds backends through the clean-room C11 fs_backend_ops_t vtable and freestanding LLVM DSP skeletons.
| Profile / Target | SoC | NPU / TPU | Vulkan GPU | CPU Extensions | Unified RAM |
|---|---|---|---|---|---|
sm8850-v81 |
Snapdragon 8 Elite Gen 5 (SM8850) |
Hexagon v81 (8x128B HVX, 23.19 TFLOPS FP16 HMX, 8 MiB VTCM) |
Adreno 840 (32x32 tiled AHardwareBuffer) |
Oryon ARMv9 | 12–16 GiB LPDDR5X |
FS_PROFILE_QCOM_IQ9075 |
Qualcomm IQ-9075 (QCS9075) |
Dual Hexagon v73 HTP (11.95 TFLOPS FP16 HMX, 16 MiB VTCM) |
Adreno 663 Vulkan | Kryo Gen 6 NEON | 36 GiB LPDDR5 ECC |
iq8275-ventuno-q |
Arduino VENTUNO Q (QCS8275) |
Hexagon v73 (8 MiB VTCM) |
Adreno 623 (Mesa Turnip) | Kryo ARMv8 | Unified LPDDR5 |
FS_PROFILE_PIXEL10_LAGUNA |
Tensor G5 (laguna / Pixel 10) |
BUENOS_A0 (12 TOPS INT8, 1.8 W, 16 VII credits) |
PowerVR DXT-48-1536 (Mesa Volcanic) |
ARMv9 NEON | 16 GiB LPDDR5X |
FS_PROFILE_PIXEL11_MALIBU |
Tensor G6 (malibu / Pixel 11) |
malibu TPU (24 TOPS INT8, 1.6 W, 16 credits) |
PowerVR CXTP-48-1536 (3.2 TFLOPS FP16) |
ARMv9 NEON + SME2 |
16 GiB LPDDR5X |
FS_PROFILE_HOST_MOCK |
host_mock |
Built-in mock accelerator (exact reference parity) | Built-in mock Vulkan GPU | Host reference CPU | Portable macOS/Linux |
- Vision & Prefill (
M >= threshold, default32): RoutesFS_OP_PREFILL_GEMM/FS_OP_VISION_CONVtoFS_DEV_GPU_VK(AdrenoorPowerVR Volcanic). On Snapdragon VLA pipelines, the GPU vision stem writes directly intoF16Crouton_TCM32x32tiles inside a sharedAHardwareBuffer/DMA-BUFarena consumed zero-copy by Hexagon HMX. - Low-Watt Decode & Systolic Projections (
M < threshold/ HMX): RoutesFS_OP_DECODE_GEMV/FS_OP_SWIGLU(Q8_0,Q4_0,FP16,FP32) toFS_DEV_TPUor alternating dual-HTP lanes (FS_DEV_HTP0/FS_DEV_HTP1) with zero QNN/QAIRT dependencies. - Attention & Control: Routes
FS_OP_ATTN_SOFTMAX,FS_OP_ROPE,FS_OP_RMS_NORMtoFS_DEV_CPU_SME2(orFS_DEV_CPU_NEON). - Upfront Zero-Copy
DMA-BUFReconciliation:fs_dmabuf_reconcile()intersects alignment, tiling layout (linear/tiled/F16Crouton_TCM), and coherency attributes across participating engines before allocation;fs_buffer_handoff()enforces single-owner generation invariants (FS_ERR_OWNERSHIP),DMA_BUF_IOCTL_SYNC/SYNC_FD, andfallback_copies == 0. - Graceful Degradation: Disabling GPU, NPU/TPU, or both degrades cleanly to remaining online accelerators with 100% numerical parity.
Works out of the box on macOS and Linux using FREESCHED_MOCK=1:
# Make (zero external dependencies beyond clang/make)
make verify
# Run the Linux / ARM64 / host zero-copy DMA-BUF smoke tool directly
./build/freesched_dmabuf_smoke --profile laguna --jsonOr with CMake + Ninja:
cmake -S . -B build-cmake -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build-cmake
FREESCHED_MOCK=1 ctest --test-dir build-cmake --output-on-failure
FREESCHED_MOCK=1 ./build-cmake/bench_heterogeneousmake verify runs:
- Strict
-std=c11 -Wall -Wextra -Werrorand-std=c++17 -Wall -Wextra -Werrorchecks oninclude/freesched.handinclude/ggml_freesilicon.h. - Pure C11 ABI suite (
test_c11_abi). - Full C++17 unit & integration suite (
test_freesched) covering topology,DMA-BUFownership/race detection, heterogeneous prefill/attention/decode routing, bit-exact FP32/FP16/Q8_0/Q4_0 parity, graceful degradation, custom backend vtables, and theggml_freesiliconadapter. - Heterogeneous laptop benchmark (
bench_heterogeneous) and offline functional/ABI smoke checks (twin/freesilicon-twin). - Clean-room boundary audit (
./scripts/clean-room-audit.sh).
freesched includes a zero-dependency offline validator (twin/freesilicon-twin) and sanitized released-chip receipts (twin/receipts/) so contributors can validate DMA-BUF routing, ABI invariants, SRAM/VTCM layout bounds, and mock numerical parity on any laptop without hardware attached:
# Run offline functional & ABI smoke verification
./twin/freesilicon-twin self-test
# Evaluate heterogeneous schedules against native compiled bench_heterogeneous
make bench
./twin/freesilicon-twin sched --target laguna --native --pretty
./twin/freesilicon-twin sched --target malibu --native --prettySee docs/FREEHEXAGON.md, docs/FREEHEXAGON_HMX.md, twin/README.md, and CONTRIBUTING.md for clean-room rules and contributor issues.
Apache License 2.0 — see LICENSE.