Trillion-Parameter Model Inference with Dual GPUs and Tiered Memory

    A personal experiment shows how two GPUs, system RAM, and persistent memory can work together to run a model whose weights far exceed available GPU memory. This article examines the capacity requirements, compute placement, reported performance gains, and testing practices needed to distinguish a model that merely loads from one that supports useful interaction.

    1. Reframing the Problem: Running a Trillion-Parameter Model with Limited GPU Memory

    For very large models, the first obstacle is often not insufficient compute but insufficient GPU memory to hold the weights. At the trillion-parameter scale, even low-precision weights can occupy hundreds of gigabytes or more.

    Adding another GPU is not, by itself, a solution. A more practical approach is to organize GPU memory, system RAM, and persistent memory into a tiered hierarchy, then assign computation according to the model’s structure. Components that benefit from GPU execution run on the GPUs, while large weight sets that are only partially accessed for each token remain on the CPU side.

    The source material describes a personal experiment in which a host using persistent memory to hold model weights was upgraded with two GPUs, while some model shards were moved to a RAM-backed filesystem. The resulting configuration reportedly achieved approximately 3.11 generated tokens per second and 16.8 prompt-processing tokens per second.

    The broader engineering question matters more than the hardware alone: When a model is much larger than available GPU memory, how can tiered storage and coordinated computation move it from merely loadable to usable interactively?

    All experimental figures below come from that individual account. They are not independently verified benchmark results and should not be treated as performance guarantees for other systems.

    2. Understanding Capacity: Total Parameters, Active Parameters, and File Size

    Total Parameters Determine Weight Storage Requirements

    The model described in the source has approximately 2.8 trillion parameters. At 16 bits, or 2 bytes, per parameter, its theoretical weight storage requirement is:

    Weight storage = Parameter count × Bytes per parameter

    For this model:

    2.8 trillion × 2 bytes ≈ 5.6 trillion bytes

    That is approximately 5.6 TB in decimal units, before accounting for the inference framework, temporary compute buffers, attention caches, and other runtime data.

    Determining whether a machine can run the model therefore requires more than comparing the model file size with available memory. Runtime headroom is essential. A model that barely fits may become unstable with longer contexts or multiple simultaneous requests.

    Active Parameters Affect Computation, Not the Need to Store the Full Model

    A sparse mixture-of-experts model routes each token through only a subset of its experts rather than using all of them.

    According to the source, the model has 896 experts and activates 16 per token, including two shared experts. Its active parameter count is approximately 104 billion.

    This creates a substantial difference between the total parameter count and the number of parameters involved in a token’s forward pass. However, these figures describe different constraints:

    • Total parameters determine the storage required for the complete weights.
    • Active parameters affect per-token computation and weight access.
    • Expert selection varies with the input, making weight access dynamic.
    • Attention, routing, shared components, and communication add further overhead.

    Using only a few experts per token does not mean that only those experts need to be stored. If the complete model must remain available locally, every expert’s weights still need a defined storage location.

    Quantized File Size Is Not Runtime Memory Usage

    The reported model files total approximately 865 GB, well below the theoretical size of 16-bit weights. This indicates a more compact representation, but the source does not provide enough information to establish the quantization precision of each tensor type.

    File size alone cannot show that all parameters use a uniform bit width. The files may also contain quantization scales, indexes, metadata, and tensors stored at different precisions.

    Runtime memory consumption can differ from file size as well. Memory mapping, temporary dequantization, compute buffers, and caching policies all influence the actual memory requirement.

    3. Tiered Storage: Assigning a Role to Each Memory Layer

    GPU Memory: Prioritize High-Value Computation

    The two GPUs in the experiment provide a combined 48 GB of GPU memory—approximately 5.5% of the 865 GB model file size.

    Clearly, the system does not hold the complete model in GPU memory. However, the fraction of weights that fits there does not directly determine the acceleration benefit. A small allocation can still improve overall performance if it supports components that execute much more efficiently on GPUs.

    Two GPUs also do not automatically expose their combined capacity as one contiguous memory pool. Effective use depends on model partitioning, operator support, and the data-transfer paths between devices.

    System RAM: Faster Access at a Higher Capacity Cost

    The experiment placed 45 of the model’s 94 shards in a RAM-backed filesystem, totaling approximately 414 GB. The remaining shards stayed in persistent memory.

    A RAM-backed filesystem lets a program access data in system RAM through a file interface. It does not create additional capacity and is not a separate acceleration device. Any benefit comes from changing where the data resides and how it is accessed.

    The 414 GB shard total is also not the machine’s complete RAM requirement. The operating system, application heap, caches, and temporary buffers need additional space. If memory pressure causes swapping, the intended faster access path can become another bottleneck.

    Persistent Memory: Keeping the Complete Weight Set Available

    Persistent memory can provide capacity for very large models, but its performance depends on access patterns, memory configuration, and how the software uses it. It should not be treated as equivalent to ordinary system RAM or confused with conventional external storage.

    In this hierarchy, its role is to retain the complete model without requiring every weight to reside on the fastest available medium.

    The architecture trades off capacity, bandwidth, and cost across storage tiers. It does not eliminate the model’s underlying resource requirements.

    4. Compute Placement: Why Limited GPU Memory Can Still Help

    According to the source, tensors associated with routed experts largely remain on the CPU side, while the GPUs handle attention computation. The upgrade therefore introduces two changes:

    1. Some computation moves to the GPUs.
    2. Some model files move from persistent memory to system RAM.

    The right criterion for this division is end-to-end benefit, not how fast an isolated operator runs on a GPU.

    A simplified relationship is:

    End-to-end execution time ≈ CPU compute time + GPU compute time + Data-transfer time + Synchronization wait time

    If moving an operator to a GPU saves less compute time than it adds in transfer and synchronization overhead, overall performance can decline. Heterogeneous inference must therefore consider both compute placement and data placement.

    Attention is not a fixed-cost component, either. Its resource requirements change with context length, batch size, cache layout, and implementation. A partitioning strategy that works well for short inputs may not remain advantageous with long contexts.

    5. Interpreting the Reported 41% Speedup

    Generation and Prompt Processing Measure Different Work

    The source reports two results:

    • Generation: approximately 3.11 tokens per second, about 41% faster than the previous configuration.
    • Prompt processing: approximately 16.8 tokens per second, about 26% faster than the previous configuration.

    Prompt processing can typically process multiple input positions together, making it better suited to batched computation. Token-by-token generation has sequential dependencies and is often more sensitive to weight access, synchronization, and per-step latency.

    Different gains in these two stages are therefore unsurprising. Reporting only one metric would not fully describe the user experience.

    Higher Throughput Does Not Mean an Equal Percentage Reduction in Time

    With a 41% increase in generation throughput, producing the same output under otherwise identical conditions takes approximately:

    1 ÷ 1.41 ≈ 70.9% of the original time

    That corresponds to a time reduction of approximately 29.1%, not 41%.

    Similarly, 3.11 tokens per second implies an average of roughly 0.32 seconds per generated token. This does not include the full time to first token, nor does it imply uniform intervals between tokens.

    The Gains Cannot Be Attributed Entirely to the GPUs

    The upgraded configuration adds GPUs and changes shard residency at the same time. Both changes can affect performance.

    The supported conclusion is therefore that the combined heterogeneous-compute and tiered-memory configuration improved overall performance. The available data does not establish how much each change contributed.

    Reliable attribution would require comparisons under identical conditions between at least four configurations:

    • A persistent-memory baseline.
    • Some shards moved to system RAM, without GPUs.
    • GPUs added, with the original weight placement unchanged.
    • GPUs and system-RAM shard placement enabled together.

    These controls help avoid mistaking a storage improvement for a compute improvement and provide a better basis for deciding where to invest next.

    6. A Practical Optimization Workflow

    Fix the Inputs and Runtime Conditions

    Tests should hold the model files, quantization version, input text, input length, output limit, and sampling settings constant. Record CPU thread counts, GPU task assignments, and shard locations as well.

    Include short-input, long-input, short-output, and sustained-generation scenarios. A single brief prompt can underestimate the effects of attention-cache growth and sustained load.

    Record cold-start and warmed-up measurements separately. First file access, cache state, and the extent to which weights are already resident can substantially affect results.

    Build a Complete Set of Observable Metrics

    Generated tokens per second is only one useful metric. Also monitor:

    • Time to first token.
    • Prompt-processing time.
    • Inter-token latency and its variability.
    • Peak system RAM and GPU memory usage.
    • CPU and GPU utilization.
    • Page faults, swapping, and unexpected storage access.
    • Data-transfer time and synchronization waits.
    • Power consumption, temperature, and stability during sustained operation.

    Persistently low GPU utilization may point to CPU computation, data supply, or synchronization as the limiting factor. If the system is continuously swapping, reducing memory pressure should take priority over expanding the RAM-backed filesystem.

    Place Shards According to Access Value, Not Just Shard Count

    Moving nearly half the shards into system RAM does not necessarily accelerate nearly half the weight accesses. Shard count, file size, and access frequency are not interchangeable.

    A better approach is to consider shard contents, access frequency, and measured performance when deciding which data should receive faster access. However, expert routing changes with the input. Hotspots observed on one workload may not generalize, so placement decisions should be validated across different input types.

    Approach Per-Tensor Quantization Carefully

    Using different precisions for different tensors is a potential optimization direction. The objective is not simply to reduce file size, but to balance model quality, memory traffic, dequantization overhead, and execution efficiency.

    Before adopting a representation, confirm that the inference implementation supports it and test for output-quality degradation. A more compact format without an efficient execution path may save capacity while increasing compute time.

    7. Limits: Running a Model Is Not the Same as Serving It in Production

    A few tokens per second may be sufficient for some research, offline analysis, or single-user interaction. It does not establish that the system can support high-concurrency serving.

    Production evaluation must also cover request queues, memory growth with long contexts, cancellation, failure recovery, output quality, and sustained operating costs. Multiple requests may improve hardware utilization, but they can also increase cache consumption and tail latency. Load testing is necessary to determine the actual trade-off.

    For resource-constrained teams, the evaluation sequence should be:

    1. Confirm that the complete model loads reliably.
    2. Verify that it runs at the target input length.
    3. Measure interactive latency.
    4. Evaluate concurrency capacity and operating cost.

    8. Conclusion: Reduce Critical-Path Overhead, Not Just Add Hardware

    This experiment illustrates one way to run a very large sparse model: retain the complete weights in a high-capacity storage tier, use system RAM to improve selected access paths, and assign high-value computation to limited GPU memory.

    Tiered architectures do not provide performance for free. Weight residency, operator partitioning, device communication, cache growth, and quantization implementation can each become a new constraint.

    The most reliable approach is to establish a reproducible baseline for the intended workload, isolate bottlenecks through single-variable experiments, and optimize incrementally. Capacity, end-to-end latency, output quality, and operating cost must be evaluated together to determine whether a trillion-parameter inference system is merely able to start—or is genuinely useful.