Running 35B-Class Models on Integrated GPUs: The Unified Memory Path
This article explores how integrated GPUs with unified memory architecture can run 35B-parameter sparse models on budget-friendly mini PCs. It breaks down the engineering behind memory mechanisms, MoE architecture and quantization, software stack adaptation, and system-level tuning, offering practical guidance for developers who want to deploy large language models locally without dedicated graphics cards.
For a long time, running large language models locally was almost synonymous with dedicated GPUs and high-VRAM configurations. Model weights of tens of gigabytes pushed developers with limited budgets toward public cloud APIs, raising both cost concerns and data security considerations. However, as integrated GPUs and unified memory solutions have matured, running 35B-class sparse models on low-power mini PCs has become a viable technical path. This article examines the engineering rationale behind this approach from four angles: memory mechanisms, model compression, software stack adaptation, and system tuning.
From the VRAM Wall to Unified Memory: Breaking the Capacity Bottleneck
Traditional discrete GPUs maintain separate address spaces for VRAM and system memory. Model weights must first be loaded into VRAM before the GPU’s compute units can access them. Once weights exceed VRAM capacity, developers must resort to CPU offloading—shuttling data in chunks across the PCIe bus, which causes significant slowdowns. This is why many developers intuitively assume that “4GB of VRAM can only run small models.”
Integrated GPUs work differently. They have their own compute units but share the same physical memory as the CPU. On platforms with unified memory mapping, the GPU can directly access buffers in system memory without explicit copies over PCIe. In other words, model weights can reside in system memory, and the GPU’s parallel compute units read them on demand. The total system memory capacity becomes the practical ceiling for model size.
This comes with trade-offs. Shared memory means the CPU and GPU compete for the same memory bandwidth, and standard desktop memory bandwidth is far lower than the high-bandwidth memory used in dedicated GPUs. However, with careful design of model architecture, quantization precision, and compute scheduling, bandwidth bottlenecks can be managed within acceptable bounds. Essentially, this is an engineering trade-off: trading capacity for bandwidth, and throughput for sparsity.
MoE Sparse Architectures and Quantization: Getting 35B into 20GB
A dense 35B-parameter model requires roughly 70GB of memory in FP16 precision. Even with 4-bit quantization, it needs about 18GB. That’s still tight for a typical mini PC, but models based on mixture-of-experts (MoE) architecture present a very different picture.
MoE models split the feedforward network into multiple expert modules, and each token activates only a subset of experts. Although total parameters can reach 35B, the actual activated parameters per forward pass may be only 2B–4B. Activated parameters determine compute load, while total parameters determine memory footprint. After quantization, such models can satisfy both “fits in memory” and “manageable compute” simultaneously.
Quantization is another critical technique. By compressing weights from 16-bit to 4-bit or lower, model file sizes shrink to less than a quarter of their original volume. Modern quantization schemes employ grouped quantization, dynamic range calibration, and nonlinear transformations to preserve precision on important weights. A small calibration dataset can further reduce accuracy loss. The takeaway for developers: when selecting a model, don’t just look at total parameter count—pay attention to activated parameters and post-quantization size. Evaluate quality differences across quantization levels before deployment.
The Software Stack: Making Integrated GPUs the Inference Workhorse
Efficient inference on integrated GPUs requires more than just “throwing matrix operations at the GPU.” A complete software stack must handle computation graph mapping, operator fusion, memory reuse, and asynchronous scheduling.
First, the compute backend. Integrated GPUs must work across multiple hardware platforms, so building the compute pipeline typically relies on cross-platform graphics and compute APIs rather than vendor-specific SDKs. These APIs need to support general matrix multiplication, vector operations, memory barriers, and the ability to schedule concurrent tasks on the GPU. When loading a model, the inference engine translates the model’s computation graph into commands recognizable by these APIs.
Second, memory management. To reduce CPU-GPU interaction overhead, model files can be loaded directly into the process address space via memory mapping, allowing GPU compute units to read weights and intermediate activations directly from the memory pool. KV caches are reused to avoid reallocating memory for every request. KV cache usage becomes especially significant for long-context scenarios, requiring careful capacity budgeting and eviction strategies.
Third, pipeline scheduling. Generating a single token involves numerous fine-grained operators. If the CPU and GPU synchronize after each one, significant idle time results. A better approach is to submit compute tasks asynchronously, keeping the GPU continuously busy while the CPU handles preprocessing, sampling, and scheduling the next token. Some layers can remain on the CPU side, overlapping with GPU pipeline execution through task queues to hide transfer latency.
Here is a simplified inference flow in pseudocode:
engine = create_inference_engine()engine.configure(device="integrated_gpu", memory_budget=20GB)engine.load_model("model_quantized.bin", format="moe")stream = engine.generate(prompt, max_tokens=512, temperature=0.7)for token in stream:print(token)
In real-world projects, developers must tune parallel thread counts, batch sizes, and context lengths based on hardware characteristics—these parameters significantly affect generation speed and time-to-first-token.
System Tuning: Making Every Megabyte Count
Beyond the software stack, operating system and hardware configuration matter. Adjusting shared memory reservation in BIOS, enabling huge pages, using dual-channel memory, and shutting down unnecessary background processes all contribute to better overall performance.
Huge pages reduce address translation overhead, making GPU access to large contiguous memory regions more efficient. If the system supports it, allocate the memory region containing model files as huge pages and avoid frequent page swaps. Users with mechanical drives or slow storage should also watch I/O during model loading and keep model files on fast SSDs.
During runtime, system monitoring tools can simultaneously track GPU utilization, memory usage, and CPU load. In the ideal state, GPU compute cores maintain high utilization without excessive page swapping in system memory. If memory swapping occurs, actual memory demand exceeds physical capacity—reduce model size, lower context length, or apply more aggressive quantization.
Thread scheduling for inference workloads also matters. Pinning the inference process to reliable high-performance cores and minimizing interference from background tasks like disk indexing or virus scans can stabilize generation speed. For long-running agent services, reserving some memory headroom prevents OOM errors as KV caches grow.
How Local Inference Powers Full Agent Workflows
Running models locally isn’t just about saving API costs—it unlocks more complex autonomous agent scenarios. Agents typically require multi-turn conversation, tool calling, result verification, and error recovery, all of which are sensitive to inference stability and latency. With cloud APIs, every tool invocation incurs network round-trips and possible rate limits. Local inference can establish a fully autonomous execution loop in an intranet or even offline environment.
For example, a local agent can receive a user task, observe the current context, decide which tool to invoke, process the tool result, and continue reasoning until it produces a final answer. Within this loop, the model can output structured tool-call formats that the host program parses and executes. The entire process runs locally—no data leaves the environment.
def agent_loop(user_task):context = [system_prompt, user_task]while True:reply = local_model.chat(context, tools=tools_schema)if reply.has_tool_calls():context.append(reply)for call in reply.tool_calls:result = execute_tool(call)context.append(result)else:return reply.content
This workflow fits well in data-sensitive scenarios: enterprise knowledge base Q&A, code generation, internal system diagnostics, and offline document processing. As long as model capabilities are sufficient, developers can support multiple automation pipelines with a single local inference service.
The Boundary Between Local Inference and Public Cloud Services
Local inference is not meant to fully replace public cloud services. Cloud-based LLM services typically offer larger model scales, more stable hardware clusters, and more mature multi-tenant elasticity, making them suitable for ultra-long contexts, complex reasoning, and high-concurrency requests. But cost, network latency, and data transfer privacy concerns give many enterprises pause.
In practice, a hybrid deployment makes sense: run sensitive-data scenarios, high-frequency small tasks, and offline environments locally; reserve heavy workloads, complex multimodal tasks, and extreme concurrency for the cloud. Local inference serves as a low-cost fallback that lets teams prototype agent ideas at near-zero variable cost, then decide whether to migrate to cloud services as business volume grows.
Current Challenges and Future Outlook
While “integrated GPU + unified memory” can already run relatively large models on a limited budget, the approach has boundaries. Memory bandwidth is the biggest bottleneck. Standard desktop memory bandwidth is far lower than high-bandwidth VRAM, so generation speed degrades noticeably under long contexts and large batch settings. The larger the model, the more pressure weight reads and KV caches place on bandwidth—requiring smarter caching strategies and sparser compute designs.
Driver compatibility for cross-platform compute APIs also varies across hardware. Some older integrated GPUs may lack required features, causing deployment failures. Developers need to verify on target hardware in advance and prepare CPU fallback paths.
Looking ahead, continued advances in quantization techniques, sparse inference, memory pool optimization, and additional hardware acceleration instructions will keep improving local inference performance. The unified memory path of integrated GPUs isn’t merely a low-cost stopgap—it could become an important foundation for edge-side AI adoption.
For developers with limited budgets who want to experiment quickly with large models, this path is worth serious exploration. From model selection and quantization to tuning and agent workflows, every stage is full of engineering detail—and that’s precisely what makes it such a practically valuable technical capability.
