Deploying a 2.8T MoE Model: Weight Verification and VRAM Estimation

    A comprehensive guide to deploying a 2.8T Mixture of Experts (MoE) model, detailing weight verification processes and minimum VRAM calculations. It covers necessary memory requirements across different precisions, clarifies the limitations of running on 8 GPUs, and provides actionable steps for securely downloading and verifying model weights using SHA256 and safetensors header inspection.

    Key Takeaways

    • VRAM: Storing the weights alone requires about 1.56TB, excluding KV cache and runtime overhead.
    • 8 GPUs: Using standard 80GB GPUs, 8 units provide 640GB total, which is less than the weights themselves. Thus, the claim of “running locally on 8 GPUs” is only valid if weights are offloaded to CPU memory or disk, or if using lower precision, both of which will significantly reduce speed. This claim should be verified against official specifications and actual benchmarks.
    • Verification: All 96 shards are essential. Each must be checked against the official file list and SHA256 checksums.

    1. Understanding the Numbers

    • Total parameters: 2.8T, with approximately 104B active parameters per token. Weight files total about 1.56TB.
    • File sizes are usually calculated in decimal (1TB = 10¹² bytes), while nvidia-smi displays VRAM in binary units. 1.56TB is roughly 1.42TiB. Mixing these standards can cause estimation errors.
    • Average bits per parameter: 1.56×10¹² × 8 ÷ 2.8×10¹² ≈ 4.46 bit. This is close to 4-bit but is just an average, indicating weights are not all stored in the same precision. Check official quantization documentation for the exact allocation.
    • The 96 shards average about 16GB each, totaling ~1.5TB, consistent with the 1.56TB figure. The final size should be based on the repository’s file list.

    2. Weight Download and Verification

    1. Verify the source: Ensure the repository belongs to the official model publisher. Avoid unverified mirrors or repackaged weights.
    2. Check the file list: Confirm shards are numbered sequentially from 1 to 96. The typical naming format is model-00001-of-00096.safetensors, subject to the actual repository naming.
    3. Check disk space: In addition to the weights, reserve extra space for temporary files and conversion processes. It is recommended to reserve at least 20% more than the weight size.
    4. Parallel download: Use officially supported download tools with resume capability enabled.
    1. huggingface-cli download <organization>/<repository> --local-dir ./weights --max-workers 8
    1. Verify SHA256: If the repository provides a checksum file, compare directly:
    1. cd ./weights
    2. sha256sum -c SHA256SUMS

    If no checksum file is provided, extract the SHA256 for each shard from the repository page’s file metadata, compute it using sha256sum model-*.safetensors, and compare them one by one.

    1. Check file headers: The first 8 bytes of a safetensors file contain the header length, followed by JSON metadata. The following script quickly identifies truncated files:
    1. import json, struct, glob
    2. for path in sorted(glob.glob("weights/*.safetensors")):
    3. with open(path, "rb") as f:
    4. header_len = struct.unpack("<Q", f.read(8))[0]
    5. json.loads(f.read(header_len))
    6. print("ok:", path)
    1. Cross-check the index file: Open model.safetensors.index.json and verify that every shard referenced in weight_map exists.
    2. Handle missing or corrupted shards: Only re-download the failed shards instead of the entire model. Verify again after re-downloading.

    3. Estimating Minimum VRAM by Precision

    The minimum VRAM for weights can be estimated using this formula:

    Weight VRAM ≈ Total Parameters × Bytes per Parameter

    Calculated for 2.8T total parameters:

    Precision Bytes per Parameter Weight Size for 2.8T Notes
    FP16 / BF16 2 bytes ~5.6TB Common unquantized format
    FP8 / INT8 1 byte ~2.8TB Ideal value, excludes overhead
    INT4 0.5 bytes ~1.4TB Ideal value, ignores quantization scale parameters and metadata
    Official Release ~4.46 bit average ~1.56TB Based on actual file size

    The official weights are larger than the ideal pure INT4 value, indicating that some parameters may retain higher precision, or include…