Wizardry Labs
Wizardry Labs
AIInferenceMetalApple Silicon

Research note · 6 min read

Layer streaming on Apple Silicon: scheduling around memory pressure

Model weights do not all need to be equally hot. Layer-aware prefetching and eviction can give a local runtime more room to work.

Layer streaming on Apple Silicon: scheduling around memory pressure

A model is also a movement problem

A local inference engine is balancing arithmetic, memory bandwidth, device memory, and the cost of moving weights. Once the model is larger than the comfortable working set, the schedule matters as much as the kernel.

A prototype schedule

Flatline groups GGUF tensors into layers. During its inference loop, it can ask the operating system to prefetch the next layer, run Metal work for the current layer, wait for the GPU command buffer, and mark the completed layer as no longer needed.

The design is intentionally simple: keep the current work available, prepare what comes next, and release what has finished. A production runtime would need more careful synchronization, profiling, and model-specific scheduling.

Why this matters for products

On-device AI is not only about shrinking a model. It is about building a runtime that respects the device. Scheduling, quantization, buffer ownership, and observability determine whether a technically capable model feels dependable in a real application.

Tools and concepts

MetalmmapmadviseGGUF layersApple Silicon

Claim status: Verified in the Flatline repository as prototype research.

Have a system worth exploring?

Let’s turn the hard part into something useful.

Contact us