Serving a Trillion-Parameter MoE Model on Two Domestically Produced AI Accelerator Nodes: A Practical Guide

    This article walks through deploying an ultra-large-scale Mixture-of-Experts (MoE) model—roughly 2.8T total parameters with 104B activated parameters—across two accelerator nodes. It covers memory budgeting, network planning, weight distribution and verification, parallelism strategy selection, deployment steps, functional validation, and stress testing. All conclusions include the underlying calculations so readers can adapt them to their own hardware and software environments.

    1. Background and Goals

    When a model reaches the trillion-parameter scale, a single server’s accelerator memory typically cannot hold the full weights. The common approach for multi-node inference is to shard the weights across multiple accelerator units on multiple nodes, with nodes cooperating over high-speed interconnects. Before landing such a deployment, teams generally need to answer four questions: Is the hardware scale sufficient? Can the weights be delivered reliably to every node? Which parallelism strategy should be chosen? And do performance and stability meet expectations once the service is live?

    This article is organized around these four questions and provides a reproducible set of steps. By following them, readers can complete a two-node deployment, functional verification, and stress testing. The measured data in this article comes from one specific environment; results will vary with different hardware and software versions. For this reason, every conclusion is accompanied by its calculation process, making it easy to substitute your own environment’s numbers.

    2. Model Characteristics and Memory Budget

    The model deployed here has approximately 2.8T total parameters and 104B activated parameters, natively supports multimodal input, and offers a context window of up to 1M tokens. The defining trait of the MoE architecture is that each token activates only a small subset of experts, so per-step computation is comparable to a dense model of around 100B parameters. However, all expert weights must remain resident in device memory, so memory capacity is still the primary constraint.

    Before deployment, compute a memory budget. Using the quantized weights for this deployment as an example:

    • The total size of the weight files is 1,466,844,769,783 bytes, roughly 1,366 GiB (converted at 1 GiB = 2^30 bytes).
    • The two nodes provide 32 compute dies in total, each with 64 GiB, for a combined 2,048 GiB.
    • Weights average about 42.7 GiB per die, leaving roughly 21 GiB for KV cache, activations, communication buffers, and runtime overhead.

    These numbers tell us two things. First, 32 dies can hold these weights, but with limited headroom. Second, the remaining memory directly caps the achievable concurrency and maximum context length. In long-context scenarios, KV cache grows quickly and 21 GiB can be exhausted rapidly. Static calculation therefore only gives an upper bound; the actual concurrency limit must be determined through stress testing.

    3. Hardware and Network Planning

    3.1 Nodes and Compute Units

    This deployment uses two servers with 16 compute dies each—32 in total. In the parallelism strategy, these 32 dies form a single complete inference instance, referred to as an instance with a world size of 32.

    3.2 Inter-node Interconnect

    Dies within the same node communicate over high-bandwidth on-board links. Cross-node communication relies on the accelerators’ parameter network. Before deployment, add the parameter network interfaces of all participating nodes to the same network and run a full-mesh connectivity check to confirm that every pair of nodes can establish communication at the expected bandwidth.

    The scheduler should select nodes based on this network topology so that an instance never spans nodes that cannot communicate. If this step is skipped, problems usually surface only at model loading or the first inference attempt—far more expensive to debug.

    4. Weight Acquisition and Distribution

    4.1 Downloading and Version Pinning

    On the first node, download the weights from the model hub and record the exact version identifier—a commit hash or revision. Only by pinning the version can you guarantee that the weights will be identical in subsequent redeployments.

    4.2 Direct Transfer Between Nodes

    The second node does not need to access the public network again; it can copy the same weights directly from the first node. Measured transfer rates from this test:

    • Public network download: roughly 50–57 MB/s. At a midpoint estimate of 53 MB/s, 1.47 TB takes about 7.7 hours.
    • Direct node-to-node transfer: roughly 490 MB/s, about 50 minutes for the same volume.

    Direct transfer is roughly 9–10x faster than downloading over the public internet. Actual times depend on region, time of day, and network conditions—use measurements from your own environment.

    4.3 Per-File Verification

    After downloads complete on both sides, compute the hash of every shard and compare it against the manifest. The following example uses only the standard library:

    1. import hashlib
    2. from pathlib import Path
    3. def sha256_of(path: Path, chunk_size: int = 1 << 20) -> str:
    4. digest = hashlib.sha256()
    5. with path.open("rb") as f:
    6. for block in iter(lambda: f.read(chunk_size), b""):
    7. digest.update(block)
    8. return digest.hexdigest()
    9. def verify_model(model_dir: str, manifest: dict[str, str]) -> list[str]:
    10. """Return the relative paths of files that failed verification or are missing.
    11. manifest format: {relative_path: sha256}."""
    12. failed = []
    13. for rel_path, expected in manifest.items():
    14. target = Path(model_dir) / rel_path
    15. if not target.exists() or sha256_of(target) != expected:
    16. failed.append(rel_path)
    17. return failed

    The weights in this deployment consist of 346 shards. The manifest should cover all of them, and you should verify both the total file count and the total byte count.

    5. Runtime Environment and Version Management

    The inference image should be published by the hardware vendor or the community alongside the model. When using an image, pin the version by digest rather than by a mutable tag. A tag can be re-pointed to a new build, whereas a digest uniquely identifies one image.

    Drivers, runtime libraries, and the inference framework must be mutually compatible. After upgrading any one of them, re-run the connectivity check and functional verification.

    6. Parallelism Strategy Design

    The world size for this instance is 32, computed as the number of nodes multiplied by dies per node: 2 × 16. The parallelism parameters must satisfy: tensor parallel size × pipeline parallel size = world size.

    The chosen configuration is tensor parallelism of 16 within each node and pipeline parallelism of 2 across nodes. The rationale:

    • Tensor parallelism splits attention heads and feed-forward layers, requiring collective communication at every layer. Since it is the most communication-intensive, it belongs on the high-bandwidth intra-node links.
    • Pipeline parallelism partitions the model by layers and only passes activations at stage boundaries. The per-transfer data volume is small and can tolerate cross-node latency.

    An alternative would be tensor parallelism of 32 spanning both nodes. That approach requires cross-node synchronization at every layer, significantly increasing communication overhead, and is generally not the first choice. Pipeline parallelism has its own cost: with small inference batches, some pipeline stages sit idle, so per-request latency may be higher. Watch for this during stress testing.

    Below is an illustrative parameter structure. Field names are for explanation only—refer to the documentation of your inference framework for the actual schema:

    1. # Illustrative configuration
    2. deployment:
    3. nodes: 2
    4. devices_per_node: 16
    5. tp_size: 16 # intra-node tensor parallelism
    6. pp_size: 2 # cross-node pipeline parallelism
    7. max_context_len: 204800

    7. Deployment Workflow

    The complete workflow can be broken into six steps.

    1. Onboard the nodes. Generate the installation command in the management console and run it on each server. Once a node is online, the platform automatically reports accelerator, NIC, and storage information.
    2. Configure the parameter network. Add both nodes’ parameter network interfaces to the same network and run the connectivity check. Proceed only after the check passes.
    3. Download and distribute the weights. Download on the first node, sync to the second via direct transfer, then verify every file.
    4. Select the inference template. Specify the parallelism sizes, context length, and image digest, then initiate deployment. The scheduler should only choose among nodes that passed the connectivity check.
    5. Check startup status. Confirm that the process on every compute die is ready and that memory usage falls within the budget. If any die fails to start in the logs, troubleshoot first—do not jump straight into stress testing.
    6. Functional verification. In sequence, verify ordinary chat, reasoning-output, and tool calling.

    Functional verification can be performed with a single request using only the standard library. The service URL, model ID, and key are read from environment variables to avoid hardcoding:

    1. import json
    2. import os
    3. import urllib.request
    4. url = os.environ["SERVICE_URL"] + "/v1/chat/completions"
    5. payload = {
    6. "model": os.environ["MODEL_ID"],
    7. "messages": [{"role": "user", "content": "Introduce yourself in one sentence"}],
    8. "max_tokens": 128,
    9. }
    10. req = urllib.request.Request(
    11. url,
    12. data=json.dumps(payload).encode("utf-8"),
    13. method="POST",
    14. headers={
    15. "Content-Type": "application/json",
    16. "Authorization": "Bearer " + os.environ["API_KEY"],
    17. },
    18. )
    19. with urllib.request.urlopen(req, timeout=120) as resp:
    20. body = json.loads(resp.read())
    21. print(body["choices"][0]["message"]["content"])

    For reasoning output, check whether the response structure contains a thinking-content field. For tool calling, include tool definitions in the request and confirm the response contains the corresponding call information.

    8. Stress Testing Plan

    Stress testing here consists of three groups covering regular load and two long-context scenarios:

    • Random input of 2,048 tokens and output of 512 tokens, to observe regular throughput and latency.
    • Agent-style long context of 80K tokens, simulating context growth across multiple tool-calling turns, to observe KV cache pressure.
    • Long context of 200K tokens, to test stability at the extreme context length.

    Each group should collect the following metrics:

    • Time to first token (TTFT): from request dispatch to the return of the first output token.
    • Time per output token (TPOT): reflecting sustained generation speed.
    • Overall throughput: measured in requests per second or output tokens per second.
    • Request success rate and error type distribution.
    • Peak memory usage, to validate the earlier budget estimate.

    Across the three groups, 836 requests were sent in this test—all succeeded, with no timeouts or failures. The success rate shows the service is stable under this load, but it does not represent the performance ceiling. To find the performance boundary, ramp concurrency step by step and record how latency changes as concurrency grows.

    9. Common Issues and Troubleshooting

    • Weight verification failures: redistribute only the failed shards, then compare version identifiers. If versions differ, revert everything to the pinned version.
    • Out-of-memory at startup: recheck the memory budget first, then reduce the maximum context length or concurrency limit. If it is still insufficient, check the KV cache allocation ratio.
    • Inter-node connection failures or timeouts: verify that both nodes are on the same parameter network and re-run the connectivity check.
    • High TTFT on long contexts: prefill computation grows with input length. Consider chunked prefill, or cap the length admitted into prefill at one time.
    • Abnormal output quality: compare outputs against a fixed test question set, and check that the quantization configuration matches the released version.

    10. Practical Recommendations

    • Pin versions: use a fixed revision for weights and a fixed digest for images, and record both in the deployment log.
    • Validate the network before downloading weights: if connectivity fails, download and distribution time is wasted.
    • Use the memory budget to constrain concurrency: static calculation gives the upper bound, stress testing gives the actual value—record both.
    • Stress test both short and long contexts: passing regular load does not guarantee stability in long-context scenarios.
    • Prefer direct inter-node transfer: download the weights from the public network only once, then copy them to other nodes over the internal network.