Demo: Responsive On-Device LLM Inference under Multitasking
Abstract
On-device Large Language Model (LLM) inference must operate in the highly dynamic multitasking environments of mobile devices, where users frequently switch between applications. The resulting memory pressure forces LLM memory, both model weights and KV cache, to be evicted by the operating system, and the inference system must restore the evicted memory through slow storage reads or recompute the entire KV cache before it can answer, severely degrading responsiveness. This paper demonstrates mzCache, an on-device LLM inference system with specialized memory management for multitasking environments. Under unpredictable memory pressure, mzCache elastically evicts LLM memory and leverages the unified memory of mobile SoCs to start inference on the GPU immediately with concurrent CPU-side restoration. We demonstrate mzCache as an Android application on a commercial smartphone, showing its memory footprint being evicted and restored in real time while using everyday applications.