J. Rogers, SE Ohio
https://github.com/BuckRogers1965/ZeroPool
Modern systems-on-chip are sold on a simple promise: CPU, GPU, and NPU working together, sharing data, no copies. The hardware mostly delivers. The software does not. What you actually get is three separate stacks, each with its own allocator and its own memory model, and the "shared memory" story left as an exercise for the developer.
ZeroPool exists to close that gap. Its goal is a genuine shared-memory orchestrator: one allocation, handed to every compute engine, with each engine executing against the identical memory array.
The Problem: Three Libraries, Three Allocations
The pitch is heterogeneous compute. The reality is that the Adreno GPU stack, the Hexagon NPU stack, and the CPU each want to own their memory. Vulkan wants VkDeviceMemory it allocated. FastRPC wants buffers it mapped. The CPU wants its own mmap. Left alone, each library allocates separately, and every handoff between engines becomes a copy.
The kernel support for real sharing is there — dma_heap, external memory import, SMMU fd import. The libraries just don't default to it, and the documentation doesn't lead you there.
ZeroPool's first principle is therefore: the application owns the allocation, and every library takes a handle instead of allocating.
- Allocate once from
/dev/dma_heap/system. - CPU:
mmapthe fd. - Adreno: import the fd as external
VkDeviceMemoryinstead ofvkAllocateMemory. - Hexagon: import the fd into the cDSP SMMU instead of letting FastRPC allocate.
No library allocates. They all receive the same handle and operate on the same physical array.
What Had to Be Proven
"Takes a handle" and "operates on that memory" are different claims. The proof of concept had to show the stronger one: that all three engines, given the same handle, actually execute against the identical physical memory, in sequence, with correct data handoff.
The CPU is trivial. The GPU is relatively easy — import the fd, run a shader, it operates on the memory. The NPU is where it gets hard. FastRPC and the cDSP don't just take an arbitrary buffer; they want signed skels and a specific mapping discipline. Getting any NPU execution to operate on the shared buffer was the crux of the proof.
The early proof of concept demonstrates it end-to-end:
[STAGE 1 - CPU] Oryon CPU allocated 4 MB shared arena from /dev/dma_heap/system (fd=6)
[STAGE 1 - CPU] Oryon CPU wrote Slice A (fd=6, offset 0x0000): [100, 200, 300, 400, 500, 600...]
[STAGE 2 - GPU] Adreno X1-85 mapped shared dma_heap fd=6 into Vulkan VkDeviceMemory
[STAGE 2 - GPU] Adreno X1-85 operated on Slice A and wrote Slice B in shared memory
[STAGE 3 - NPU] Hexagon V73 mapped shared dma_heap fd=6 into cDSP SMMU
[STAGE 3 - NPU] Hexagon V73 operated on Slice B and wrote HVX FFT1024 to Slice C
[ZEROPOOL VERIFIED] Oryon CPU -> Adreno X1-85 GPU -> Hexagon V73 NPU -> Oryon CPU all operated zero-copy on fd=6!
One allocation. One fd. Three architecturally different cores executing against the same memory array, zero-copy at every hop.
The Orchestrator
Proving the mechanism is the foundation. The next step is a runtime that uses it: a dataflow orchestrator over the shared arena.
- Shared arena — one allocation, sized for the peak working set, with offsets handed out to every stage.
- Stage table — a DAG of steps, each
{engine, op, input_offset, output_offset, params_offset, in_place_flag}. Steps reference offsets, never allocations. - Dispatcher — walks the DAG and hands each step to the right engine. Output can be in-place or a different offset in the same block when shapes change.
- Hardware completion signals — each engine signals done with a hardware fence or sync object. The CPU orchestrates without touching the data, and can itself take a step when the GPU and NPU are both busy.
- Fallback chain — every op has a primary engine and a fallback: NPU, then GPU, then CPU. Because every engine operates on the same arena, falling back costs throughput, not correctness. No copy, no format conversion. The worst case is slower, never broken.
This is the shape of a real edge runtime: bounded memory, a stack of small models as layers, each layer dispatched to whichever engine is best and free, with in-place transforms where shapes allow and preallocated offsets where they don't.
The Open Question: The NPU Vocabulary
Today, the NPU leg runs against a handful of functions in precompiled signed libraries — whatever those libraries happen to expose. The orchestrator makes those functions go as far as possible by routing every matching step to the NPU and falling back to GPU or CPU for the rest. The workflow runs end-to-end regardless.
But the vocabulary is fixed by what has been signed, and that is the real constraint. The hardware can execute against shared memory. The memory model works. The orchestrator can dispatch to it. The missing piece is an open library of parameterized edge-AI primitives — matmul, elementwise, reductions, FFT, convolution — that developers can compose into their own models and run on the NPU they own.
For edge AI, that primitive set is small and sufficient. Composing a fixed set of signed primitives into arbitrary programs is how you get effective programmability without opening the NPU to arbitrary code. It is the same model as shaders on the GPU: a fixed instruction set, composed freely. The GPU has no signing gate. The NPU does.
The Ask
ZeroPool's goal is a genuine shared-memory orchestrator across compute cores — and the hardware already supports it. What is missing is for the compute engines to meet developers at the shared arena, and for the NPU's op vocabulary to be open enough to build real workloads on top.
Sign an open library of edge-AI primitives. Let developers compose their own models on the NPU they own. The mechanism works. The memory is already shared. The only thing left is the gate.
ZeroPool is a proof of concept demonstrating zero-copy execution across CPU, GPU, and NPU against a single dma_heap allocation on Snapdragon X Elite. The work is early; the foundation is proven; the orchestrator is next.