DynoInfer: Adaptive Resource Orchestration for LLM Inference on Resource-Constrained PCs
摘要
As LLMs become popular, there is a growing trend toward deploying LLMs on personal computers (PCs) to save inference costs, reduce network latency, and enhance privacy protection. However, the limited hardware resources of PCs and inefficient resource allocation of existing frameworks slow down the LLM inference. While recent works focus on reducing the resources consumed by LLM inference, they overlook the fact that available resources are changing dynamically due to the multitask nature of PCs. This paper presents DynoInfer, an LLM inference framework that dynamically allocates resources, specifically designed for resource-constrained personal computing environments. Basically, DynoInfer captures and utilizes CPU and memory resources that are not consumed by other running workloads in PCs, to improve overall resource utilization and reduce resource contention. For CPU resources, a locality-aware dynamic thread allocation strategy is adopted to adjust threads allocated for LLM inference. For memory resources, a parameter preloading with dynamic residing strategy is employed to carefully load parameters from storage to memory. Furthermore, DynoInfer capitalizes on idle periods to compress historical conversations, extending the memorized context length under resource-constrained scenarios. Evaluations show that DynoInfer can achieve an inference speedup of \(5.76\times \) compared to llama.cpp, while it hardly interferes with other user workloads.