Deploying MoE Models on Two Used Data Center GPUs: Practices and Lessons

    This article examines a real-world practice of running a sparse Mixture-of-Experts (MoE) model on two used 32GB data center GPUs for 64GB of VRAM combined. It breaks down the key engineering decisions behind the setup: VRAM budgeting, the software stack needed to make legacy GPUs usable again, 8-bit quantization, long-context and multi-slot configuration, and performance analysis through a memory-wall model. It also covers spare-VRAM reuse, tool-call reliability, and model-selection strategy. Readers will find a reusable benchmarking script, a deployment checklist, and transferable lessons for anyone running local LLM inference on limited or older hardware.

    1. Background and Why It Matters

    Among budget-constrained teams and individual developers, “running large models on old hardware” is a representative challenge. Accelerator cards bought early by data centers are steadily entering the second-hand market. They share several traits: large per-card memory, fully depreciated value, and a low per-card price; but their architecture is relatively old, vendors often no longer support them by default in newer software stacks, and some cards lack high-speed inter-card interconnect. Repurposing this kind of card is essentially a mismatch problem between the software ecosystem and the hardware lifecycle.

    This article uses a deployment write-up from a public community as a reference sample. That write-up describes a setup meeting the following conditions:

    • Hardware: two used data center accelerator cards with 32GB each, 64GB VRAM combined;
    • Software: a self-compiled build of an open-source inference framework targeting the corresponding older GPU architecture;
    • Model: a sparse Mixture-of-Experts (MoE) model with roughly 26 billion total parameters that activates only about 4 billion parameters per generated token, using 8-bit weight quantization;
    • Service mode: 3 inference slots enabled, each with a context window of over 260K tokens, about 786,432 tokens in total;
    • Observed performance: during context filling on initialization of a coding assistant, filling a context of just over ten thousand tokens approached 1000 tokens/s, and model output was about 50 tokens/s;
    • Spare VRAM: enough left to load another small MoE model of about 20 billion parameters to run a resident “heartbeat” task;
    • Experience comparison: in the author’s environment, this model produced no tool-call errors, whereas a comparable competitor model errored frequently. After a newer generation of models was released, this model quickly fell out of favor.

    These numbers come from a single observation under specific hardware and a specific software version and should not be treated as universal conclusions, but the engineering trade-offs behind them are broadly applicable. This article breaks down each of the key technical decisions and provides reproducible validation methods.

    2. Overall Architecture and VRAM Budget

    2.1 Scenario Positioning

    To judge whether a setup is suitable, first clarify its use case:

    1. Personal and R&D scenarios: a local coding assistant, long-document Q&A, retrieval-augmented knowledge bases, and so on;
    2. Lightweight multi-user scenarios: a single service instance handles several concurrent sessions across multiple slots, each session owning a segment of context.

    This configuration is better suited to tasks that are “long on context, low on concurrency, and insensitive to time-to-first-token.” If you need high concurrency or a strict service-level agreement, the used-card approach is usually not the best choice.

    2.2 VRAM Budget: From Formula to Measurement

    Before deployment, lay out a VRAM budget and estimate how much each part consumes:

    Component Estimation Rough scale
    Model weights total params × bytes per param; ~1.07 bytes/param at 8-bit ~28GB (26B params)
    KV cache global layers × layers × K and V bytes per token × context length × number of slots must be calculated against the actual model structure; visible directly in the startup log
    Compute graph and scheduling buffers runtime parameters such as batch size and reserved VRAM typically on the order of 1GB–2GB
    Heartbeat small model params × bytes per param; ~0.6 bytes/param at 4-bit ~12GB (20B-param MoE)

    By this rough estimate, the parts already add up to nearly or more than 64GB of physical VRAM, seemingly leaving no headroom. But there are two key points here:

    First, “786,432 context in total” is a capacity ceiling, not VRAM consumed simultaneously. Only slots that actually hold tokens consume KV cache, so actual VRAM usage is far below the theoretical peak.

    Second, an MoE model’s weights must stay resident in VRAM, but decoding reads only the activated experts. At a batch scale of 4K–8K, the activation per token is about 4B parameters, hitting only a few experts, so most expert weights spend most of their time “asleep.” This makes MoE stand out on cost-effectiveness in VRAM-constrained scenarios: it trades full weights for memory capacity, and sparse reads for fast single-stream decoding.

    Note that different inference frameworks manage memory differently. A common approach reserves KV cache space in one shot at startup based on slot count and context length; other implementations allocate on demand with paging. When budgeting, go by the actual allocation strategy of your version and read the VRAM breakdown in the startup log first.

    2.3 Topology Constraints

    If the cards lack high-speed interconnect, cross-card tensor parallelism introduces synchronization communication at every layer, which is costly. In that case, the more common approaches are:

    • Pipeline-style layer splitting: assign different layers of the model to different cards, so requests pass through the two cards in sequence like an assembly line. This minimizes communication, but the compute of the two cards cannot be used simultaneously for a single request;
    • Tensor parallelism: a clear advantage when high-speed interconnect is available; otherwise the payoff may fall short of expectations.

    The “fast path when experts aren’t populated” is a similar optimization idea: when the model only needs to process a very short context, or only needs to generate a few tokens from history, it can take a lightweight path without fully loading all experts. For a used-card setup, this kind of optimization is equally worth attention.

    3. Software Stack: Making Old GPUs “Supported” Again

    Whether the hardware can be put to use depends on the software stack.

    Driver and toolchain version matching. A common plight with used accelerator cards: a newer toolchain marks the old architecture as unsupported, the build fails with “unsupported architecture,” and at runtime it reports “device not found.” There are usually two paths:

    • Install an older toolchain version that still supports the architecture;
    • Explicitly specify the target architecture when compiling the inference framework — essentially telling the compiler manually that “this card is still on the support list.”

    Self-compiling the inference framework. You need to explicitly enable the corresponding GPU backend in the build configuration and specify the target architecture. Parameter names vary across frameworks and versions; the following is illustrative:

    1. # Parameter names below are illustrative; refer to the docs of the framework and version you use
    2. cmake -S . -B build \
    3. -DCMAKE_BUILD_TYPE=Release \
    4. -DGGML_HIP=ON \
    5. -DCMAKE_HIP_ARCHITECTURES=gfx906
    6. cmake --build build --config Release -j "$(nproc)"

    Performance flags for old architectures. Some newer framework versions assume by default that the hardware supports newer instruction sets, such as hardware-native fp16 arithmetic. On older architectures these optimizations may be unavailable or even trigger errors, and need to be disabled per the framework’s instructions. Such details often directly decide whether performance meets expectations, and are a main reason “modified builds” circulate in the community.

    From an engineering standpoint, the more robust approach is to:

    1. Prefer frameworks that still maintain the corresponding backend;
    2. Freeze “build artifacts, toolchain version, architecture flags, and key switches” into a reproducible build script and put it under version control.

    This eases migration and rollback and reduces the trial-and-error cost of future framework upgrades.

    4. Quantization Strategy: Why 8-bit

    Quantization trades precision for VRAM and speed. Common bit widths include 4-bit, 8-bit, and tiered quantization that mixes and allocates by importance.

    Why not choose more aggressive low-bit quantization? On an MoE model whose parameter count is already large, 4-bit quantization is enough to compress the weights to about 15GB, yet the practitioner still chose 8-bit. The reasons may include:

    1. Less information loss. Storing about 8 bits per parameter means a near-lossless representation, which is more stable on tasks like long-context understanding and structured output;
    2. MoE’s sparse activation naturally amplifies error. Each token activates only a few experts, so if a few experts carry larger quantization error, it may concentrate on a certain class of tasks and be hard to catch through average metrics;
    3. Downstream selection strategy. The practitioner later switched models, which shows that the choice of quantization bit width needs to account for portability.

    Empirical trade-offs between precision and bit width:

    • For scenarios sensitive to output structure (such as tool calls), prefer 8-bit, or keep higher precision in critical layers;
    • For compute-constrained scenarios where throughput is the top goal, consider mixed precision: keep higher precision in sensitive parts like attention layers and word embeddings, and lower precision in expert layers.

    Quantizing the key-value cache. Context length determines KV cache size, and KV cache quantization is an important means of compressing VRAM, but it is a separate switch from weight quantization. In ultra-long-context scenarios, the precision trade-off for the KV cache is often more worth attention than weight quantization.

    5. Long Context and Multi-Slot: Clearing Up Key Concepts

    5.1 Slots and Context Length

    In many inference frameworks, a “slot” refers to an inference context that can independently handle one session: each slot holds its own KV cache, while different slots share the same model weights. Therefore:

    • With n slots enabled and context length l per slot, the KV cache capacity ceiling is about n × l × KV bytes per token;
    • A single request’s context cannot exceed l, and it occupies only one slot;
    • Multiple slots improve concurrent-session capacity, not the speed of a single request.

    The “3 slots, 786,432 context in total” in the case is essentially three independent long-context sessions of about 260K tokens each, suited to “one person, multiple sessions” or “a few users each holding a long conversation.” If one slot’s session stays active for a long time while another stays idle, you need to monitor each slot’s real occupancy, because the VRAM budget is estimated for the worst case.

    5.2 Why Such Long Context Is Possible

    A traditional Transformer’s KV cache grows linearly with context length; supporting 260K tokens often means tens of GB of KV cache. The case model achieves this mainly through two mechanisms:

    • Sliding-window attention. Most layers attend only to a recent span of tokens (say, a few thousand), so those layers’ KV cache has an upper bound;
    • Global attention layers. A global layer is inserted every few layers to integrate information across windows, and its KV cache grows linearly with context length.

    Combined, the per-token KV overhead is roughly the number of global layers times the single-layer KV bytes — usually only a small fraction of a full-attention model of the same size. This kind of hybrid attention structure is fairly common in some open-source models in recent years. So when assessing “can it support ultra-long context,” first look at the model card’s description of the attention layer configuration and then estimate the KV cache, rather than staring only at the context-length number.

    5.3 Long Context Isn’t “Free”

    Even with an efficient attention structure, long context comes at a cost:

    1. Time-to-first-token rises with input length. Attention computation grows superlinearly with sequence length, so a longer input means higher time-to-first-token;
    2. Uneven information distribution. When key information sits in the middle of the context, the model tends to ignore it. Putting instructions and key material at the start or end of the context is more reliable;
    3. Prefix reuse. If the system prompt and tool descriptions stay unchanged across sessions, prefix caching can reuse the repeated part, pre-filling it only once. Context filling on initialization of a coding assistant benefits especially from this;
    4. Context isn’t always better when longer. The longer and more verbose the input, the greater the compute and VRAM overhead, and irrelevant content may also interfere with output. It’s better to assemble context on demand combined with retrieval.

    6. Performance Testing and Bottleneck Analysis

    6.1 Three Core Metrics

    Evaluating an inference service usually focuses on three metrics:

    • Time-to-first-token: the time from sending a request to the first token returned, mainly affected by the prefill stage, and directly determining interactive experience;
    • Decode speed: the average generation speed per token after the first token, mainly affected by VRAM bandwidth and batching efficiency;
    • Context capacity: the maximum tokens a single request can hold, determining whether it can handle long documents and long sessions.

    The case’s “context filling approaching 1000 tokens/s at initialization, generation about 50 tokens/s” corresponds to the first two. Both numbers can be explained by the “memory wall” model.

    6.2 Explaining the Numbers with the Memory-Wall Model

    LLM inference can be split into two stages:

    1. Prefill: processing all input tokens at once; it is compute-intensive, and speed depends mainly on compute and matrix-multiply efficiency;
    2. Decode: generating token by token, where each step must read the activated weights and KV cache; it is bandwidth-intensive.

    This gives two approximate upper bounds:

    • Decode speed ≈ effective VRAM bandwidth ÷ bytes read per step. Assuming about 4B activated parameters at about 1 byte per parameter, each token needs to read at least about 4GB; assuming the combined bandwidth of the two cards is on the order of 1TB/s, the theoretical ceiling is about 250 tokens/s. The measured ~50 tokens/s means there are clear non-ideal factors in decoding: the old architecture lacks efficient low-precision matrix instructions, cross-card pipeline scheduling has bubbles, fine-grained expert reads are hard to fully pipeline, and other requests in the batch cause interference. So multiplying speed by several times usually requires optimizing at the framework and kernel level, not just tuning parameters;
    • Prefill throughput ≈ peak compute × compute efficiency ÷ compute per token. The FLOPs per token during prefill is about twice the activated parameter count, i.e., billions of FLOPs. At 1000 tokens/s, this needs about 8 TFLOP/s of compute, which is achievable on a GPU with good matrix arithmetic — and old-architecture cards are often exactly where the compute shortfall lies.

    This shows that the performance ceiling on old hardware is mainly determined by architectural capability, with tuning room concentrated in reducing waste: batch size, layer-splitting approach, data copies between CPU and GPU, and the precision and quantity of KV cache.

    6.3 A Reusable Stress-Test Script

    The following script relies only on the standard library. It measures time-to-first-token and generation throughput, and is suitable for baseline comparison after switching models, adjusting slot count, or changing the quantization scheme:

    1. #!/usr/bin/env python3
    2. """Baseline benchmark for an inference service: measures time-to-first-token and
    3. decode throughput using only the standard library."""
    4. import json
    5. import os
    6. import sys
    7. import time
    8. import urllib.request
    9. BASE_URL = os.environ.get("LLM_BASE_URL", "http://127.0.0.1:8080")
    10. MODEL = os.environ.get("LLM_MODEL", "default")
    11. def bench(input_chars: int = 12000, max_tokens: int = 256):
    12. prompt = "Read the material and answer the question on the last line.\n" + \
    13. "This is sample text used to fill the context window.\n" * (input_chars // 16) + \
    14. "\nWhat is the last line of the material above?"
    15. body = json.dumps({
    16. "model": MODEL,
    17. "messages": [{"role": "user", "content": prompt}],
    18. "max_tokens": max_tokens,
    19. "stream": True,
    20. "temperature": 0.0,
    21. }).encode()
    22. req = urllib.request.Request(
    23. BASE_URL + "/v1/chat/completions", data=body,
    24. headers={"Content-Type": "application/json"})
    25. t0 = time.perf_counter()
    26. first, last, chunks = None, None, 0
    27. with urllib.request.urlopen(req, timeout=1800) as resp:
    28. for raw in resp:
    29. line = raw.decode("utf-8", "ignore").strip()
    30. if not line.startswith("data:"):
    31. continue
    32. payload = line[5:].strip()
    33. if payload == "[DONE]":
    34. break
    35. chunk = json.loads(payload)
    36. delta = chunk["choices"][0].get("delta", {}).get("content")
    37. if delta:
    38. now = time.perf_counter()
    39. if first is None:
    40. first = now
    41. last, chunks = now, chunks + 1
    42. ttft = first - t0 if first else float("inf")
    43. decode_time = (last - first) if first and last else 0
    44. tps = chunks / decode_time if decode_time > 0 else 0
    45. print(f"input ~{input_chars} chars | output {chunks} chunks | "
    46. f"TTFT {ttft:.2f}s | decode ~{tps:.1f} tokens/s")
    47. print("Note: for English text, roughly 4 characters ≈ 1 token.")
    48. if __name__ == "__main__":
    49. bench(int(sys.argv[1]) if len(sys.argv) > 1 else 12000)

    When using it, set the input length to a few thousand and then tens of thousands of characters in turn to get a curve of how time-to-first-token grows with context, used to verify “whether long context is acceptable.” At the same time, record results under different slot counts, batch sizes, and quantization schemes to form a comparable performance baseline.

    7. Supporting Engineering: Spare VRAM and the Limits of Multi-Model Coexistence

    Beyond model inference, common supporting components include:

    • Heartbeat task: used to confirm the service is still alive, or to trigger cleanup and state sync when a long session is idle. The case didn’t use a simple HTTP probe; instead, it kept a small MoE model of about 20B parameters resident in VRAM to “run the heartbeat,” which hints that spare VRAM can also be reused — for example, lightweight task routing, conversation summarization, or state detection;
    • Risk one: OOM. When the main model enables all slots, the KV cache may grow to occupy a large amount of VRAM, competing with the resident small model for resources. Set a VRAM cap or reserved ratio for the inference framework, and alert on the two parts’ VRAM usage separately in monitoring;
    • Risk two: GPU partitioning limits. Some GPUs support splitting a single card into multiple instances, assigning fixed VRAM to different workloads; cards that lack this capability can only rely on software-level VRAM caps and scheduling isolation;
    • Risk three: co-residency noise. When different models share a GPU, their batching and VRAM fluctuations affect each other. It’s advisable to measure single-model and dual-model-coexistence baselines separately during stress testing.

    8. Tool-Call Stability: A Metric That Matters More Than Benchmarks

    For scenarios like coding assistants and automation agents, whether the model can correctly produce tool-call arguments is often more critical than generation speed. In the case, one direct reason the practitioner chose this model was that its tool calls produced no errors.

    Common tool-call failure modes include:

    1. Wrong function name: outputting a non-existent tool name, or concatenating multiple tool names;
    2. Wrong argument format: invalid JSON syntax, missing fields, or wrong types;
    3. Hallucinated arguments: fabricating undefined fields, or stuffing natural-language content into structured fields;
    4. Not calling when it should: the user’s intent is clear, yet the model gives a natural-language answer directly.

    For these problems, the following measures help:

    • Output constraints: use the framework’s grammar constraints (such as JSON schema constraints) to restrict output structure, eliminating most format errors;
    • Argument validation and retry: validate argument types and ranges on the server side, feed the error message back to the model for a retry on failure, and cap the number of retries;
    • Streamlined tool definitions: the shorter the tool descriptions and the clearer the fields, the less likely the model is to err;
    • Stable ordering: keep the tool list order unchanged to leverage prefix caching and reduce repeated pre-fill overhead;
    • Layered testing: use a fixed task set to assess “single-turn selection accuracy,” “argument validity rate,” and “multi-turn convergence rate” together.

    One key detail: structured output is more sensitive to quantization error. Low-bit quantization may make the model “drift” in edge cases, which explains why 8-bit quantization is the more conservative and preferable choice to try first in tool-call scenarios.

    9. Selection Strategy: The Challenge of Fast Model Iteration

    In a follow-up note, the practitioner mentioned that once a newer-generation model appeared, the former top choice quickly fell out of favor. This detail is more instructive than any benchmark:

    1. Model lifecycles are shrinking. Comparable new models keep appearing, each varying in architectural efficiency, tool-call stability, and licensing terms; hardware depreciates over years, but model choice may be measured in months;
    2. Selection should return to metrics. Rather than chasing leaderboards, build your own evaluation set: a set of fixed tasks, a set of real business samples, and a set of failure cases, run it every time you switch models, and compare horizontally across four metrics — “tool-call accuracy, long-context Q&A quality, time-to-first-token, decode speed”;
    3. Keep the architecture and inference stack portable. Choose a model format supported by multiple inference frameworks, and script the quantization scheme and compile flags, so switching models only changes config, not architecture;
    4. Shift focus from “model” to “system.” Retrieval strategy, context organization, output validation, retry mechanisms, and monitoring/alerting — these engineering capabilities don’t become invalid when you swap models and should be a long-term investment.

    10. Deployment Checklist and Common Pitfalls

    Area Recommended practice
    Hardware assessment Confirm inter-card interconnect, per-card VRAM and available bandwidth; estimate the decode-speed ceiling
    Software stack Choose an actively maintained inference framework, explicitly specify the target architecture, freeze the build script
    Quantization Prefer 8-bit for structured scenarios like tool calls; prioritize compressing the KV cache for long context
    Context planning Define the single-request length cap and concurrent slot count; distinguish “capacity” from “actual usage”
    Performance baseline Record time-to-first-token and decode speed with a unified script to form comparable historical data
    Tool calls Output constraints + argument validation + retry, with continuous regression on a fixed task set
    Resource isolation Set a VRAM cap for the resident small model, monitor headroom, and configure alerts
    Model iteration Decouple the evaluation set from the inference stack; select by metrics rather than hype

    Common pitfalls include:

    • Mistaking “total context length” for “VRAM available simultaneously”;
    • Ignoring old-GPU architecture flags, causing performance far below expectations;
    • Focusing only on decode speed while ignoring time-to-first-token’s impact on interactive experience;
    • Using overly aggressive low-bit quantization in tool-call scenarios;
    • Binding selection deeply to one model’s characteristics, making later migration costly.

    11. Conclusion

    The core logic of this setup isn’t complicated: trade VRAM for context, trade precision for stability, and use engineering to compensate for hardware shortfalls. That two cards with 64GB of VRAM can simultaneously carry ultra-long-context sessions, stable tool calls, and a resident heartbeat task relies on the coordinated design of quantization, attention structure, inference framework, and VRAM budgeting — not on any single parameter.

    For readers building local LLM deployments, three transferable lessons emerge:

    1. Do the math before you start. Work out the VRAM budget, bandwidth ceiling, and context capacity before deployment;
    2. Freeze your baselines. Both performance and quality need reproducible measurement methods;
    3. Keep a “replaceable” mindset toward models. Hardware is an asset, the model is a configuration, and engineering capability is the long-term competitive edge.