Running Full-Parameter LLMs on a Single GPU: Shared Memory Pool Design and Scheduling

    This article explains how to run full-parameter large models on a single GPU by treating VRAM, host memory, and disk I/O as a constrained resource triangle. It covers how to calculate the usable shared memory pool, why host memory locking limits real capacity, the trade-off between context length and resident expert layers, the cost of repeated model loading, and why server-side platforms are a better fit. A pre-launch decision checklist and general optimization directions are included to help achieve stable, predictable inference on limited hardware.

    1. The Problem: Real Constraints of Running Massive Models on One GPU

    Over the past year, open-weight releases of massive-parameter models have appeared steadily, and more developers are trying to run local inference on a single machine with a single GPU. The appeal is straightforward: data never leaves the machine, invocation costs stay controlled, and link latency stays low. The real engineering difficulty, however, is not whether the model can be loaded. It is that VRAM, host memory, disk I/O, and context length form a resource triangle in which each element constrains the others.

    A typical failure scenario looks like this: the model weights fit entirely into host memory, and the GPU VRAM is fully utilized, yet throughput once the model is actually running falls far below expectations. The cause is usually not insufficient compute. It is that the shared memory pool never reached the required capacity, leaving some expert layers stranded in host memory and causing frequent page swaps in and out during inference. Understanding this chain is the first step in deploying large-parameter models locally.

    2. Capacity Accounting: How Much Can the Shared Memory Pool Actually Provide

    The common approach to local inference is to merge GPU VRAM with a portion of host memory into a single addressable pool, then split the model weights by layer and place them accordingly. The available capacity can be approximated as:

    1. Usable pool capacity ≈ VRAM capacity + free host memory that can be registered as resident on the host side
    2. Actual loadable weights ≈ Usable pool capacity - context cache - runtime overhead

    The second term is the one most often overlooked. General-purpose operating systems impose quotas at the graphics driver level on how much host memory can be locked by a device over the long term. This means that of a nominal 192GB of memory, often only about half can actually be brought into the shared pool. Add the VRAM ceiling of the GPU itself, and if the sum of the two is smaller than the actual size of the model weights, the excess can only exist as ordinary memory pages and cannot be accessed efficiently.

    This yields a practical conclusion: subtract first, then decide. Compare the weight size plus estimated context cache against “VRAM + lockable memory.” The difference is the source of performance loss. Only when the difference is zero is it meaningful to discuss high throughput.

    3. The Zero-Sum Relationship Between Context and Expert Layers

    For large models built on a sparse expert structure, what must remain resident in high-speed storage at runtime is not only the attention portion but also the expert layers that will be called along the currently active path. The longer the context, the larger the cache footprint, and the fewer expert layers fit into the high-speed region. Conversely, raising throughput requires compressing the context.

    This relationship can be abstracted into a constraint:

    1. Context cache + resident expert layer size + weight base ≤ high-speed storage capacity

    In testing, this constraint proves very rigid. At a 64K context, throughput holds at just over twenty tokens/s; widening the context to 128K drops throughput to under ten tokens/s. In other words, under current hardware conditions, context capacity and generation speed are approximately inversely proportional, and there is no free zone where both can be had at once.

    4. The Underrated Cost: The Time Bill for Repeated Loading

    Many solution documents assume model loading is a matter of seconds, but in the face of hundred-GB-scale weights, loading is a heavyweight operation measured in tens of minutes. Even with a high-speed SSD on a high-speed I/O channel, reading a hundred-plus GB of weights from disk into memory and VRAM still takes on average over ten minutes.

    This leads to an important engineering judgment: the iteration cost of tuning and validation is extremely high. Every adjustment to context length or the number of resident layers requires a full “release—reload” cycle. Local large-parameter model tuning should therefore not be trial-and-error based, but planned in a single pass. Fortunately, the process is mostly read-only and does not significantly wear out storage or memory lifespan.

    5. Platform Choice: Why Server Systems Are a Better Fit

    The graphics driver’s quota policy for locking host memory is the main friction point for local deployment on desktop systems. If the runtime environment is a server operating system or a virtualized environment, memory locking and device passthrough are noticeably more controllable, and the usable proportion of the shared pool is closer to the hardware’s nominal value. For scenarios that must stay on a desktop, a workable compromise is to run through a virtualization layer, but the memory locking quota should be confirmed in advance to avoid discovering insufficient capacity only after setup is complete.

    6. A Pre-Launch Decision Checklist

    Since configurations cannot be hot-swapped at runtime, the right approach is to move decisions ahead of loading:

    • Define the workload profile: long-document understanding and repository-level code analysis prioritize context; batch generation and interactive Q&A prioritize throughput.
    • Run a capacity calculation against the constraint above and confirm whether the difference is zero.
    • Prepare two configuration baselines, one biased toward context and one toward speed, but choose only one at launch.
    • Place the weights on high-speed read-only media to shorten the loading window.
    • After loading completes, stop changing parameters, and queue long-context and short-context tasks in separate batches.

    7. General Directions for Further Optimization

    On the application side, layered scheduling can ease the conflict: a primary agent with a longer context handles task decomposition and planning, while sub-agents with short contexts and high throughput handle concrete execution, turning “long context” and “high speed” from mutually exclusive into a division of labor. On the platform side, if a cloud container platform and object storage are used, weights can be warmed into a resident cache image, with monitoring and alerting to observe paging behavior; the model service itself still needs capacity design within single-machine resource boundaries.

    8. Conclusion

    Running massive-parameter models on a single GPU is feasible, but its essence is a constraint problem of capacity and scheduling rather than a pure compute problem. Putting the lockable memory quota, the resident expert layer size, and the context cache into the same table for accounting, and factoring tuning costs into the plan, is what makes stable, predictable inference achievable on limited hardware.