How to Deploy Open-Source Multimodal LLMs Locally on Non-Mainstream GPUs

    A practical guide to deploying a 320B parameter open-source multimodal LLM on non-mainstream consumer and professional GPUs. This article covers framework branch selection, dynamic quantization, VRAM budgeting, parallelization strategies, and runtime choices for efficient local inference while ensuring data privacy and cost control.

    Background: Running LLMs on “Non-Mainstream” Hardware

    Mainstream LLM inference solutions typically rely on high-VRAM data center GPUs, which are expensive to purchase or rent. However, as open-source inference frameworks mature, consumer-grade or professional GPUs can also handle local inference for massive models, provided there is sufficient VRAM and proper framework branch support. This article documents a complete deployment practice: the target model is a 320B parameter native multimodal open-source model (supporting text, images, etc.), and the hardware consists of four 32GB compute cards, totaling approximately 119.4GB of physical VRAM.

    The core motivations for this approach are threefold: data security and privacy (keeping sensitive data local), cost control (avoiding long-term API fees), and verifying the boundaries of the open-source ecosystem on heterogeneous hardware.

    Model and Quantization Scheme Selection

    1. Prerequisite: Framework Branch Confirmation
      As of writing, the main branches of mainstream open-source inference frameworks do not yet support this model architecture, but community-maintained frontier feature branches can run it. The first step is to confirm branch compatibility—a common pitfall for beginners is pulling the main branch code directly, only to encounter architecture recognition errors during model loading. It is recommended to check the framework’s issue tracker and branch descriptions beforehand to ensure the target architecture is supported.

    2. Choosing the Quantization Version
      The original 320B parameter weights require about 640GB in FP16, making quantization mandatory. We selected a high-fidelity 2-bit version from a well-known community dynamic quantization scheme. Dynamic quantization adaptively allocates bits based on the importance of each weight layer, retaining higher precision for key layers and compressing non-key layers to lower levels, thus maintaining usable generation quality even at 2-bit. After quantization, the main model weights occupy approximately 108.7GB.

    3. Do Not Overlook the Multimodal Projection Module
      Deploying multimodal models differs from pure language models: in addition to the main weights, an extra visual projection module weight file (about 1.13GB, FP16 half-precision) is required. Its role is to encode input images and project them into visual embeddings that the main model can receive, corresponding to the connection/projection layer weights between the visual encoder and the language model. If only the main model is loaded and this file is omitted, image input inference will fail.

    The final disk footprint is about 110GB, which fits on four 32GB cards theoretically, but with limited headroom.

    VRAM Budgeting: Theoretical Surplus, Practical Tightness

    With 119.4GB of physical VRAM against 110GB of weights, there is a paper surplus of about 9GB. However, actual inference must also account for:

    • KV Cache: Proportional to context length and batch size; consumes significant memory in long-text scenarios.
    • Activations and Intermediate Results: The number of visual tokens in multimodal inputs far exceeds that of text; image inputs significantly spike instantaneous VRAM usage.
    • Compute Buffers: Temporary tensors for dequantization, sampling, etc.

    Therefore, it is recommended to start with a smaller context length and scale up gradually, avoid inputting multiple large images simultaneously during a single inference, and enable the framework’s VRAM usage logging to observe peaks before tuning parameters.

    Parallelization Strategy and Runtime Selection

    Among multi-GPU deployment options like tensor parallelism, pipeline parallelism, and layer-wise splitting, we adopted pipeline parallelism. Each card hosts several consecutive layers of the model, and requests are passed between cards in stages. This approach has lower requirements for inter-card interconnect bandwidth, making it a more pragmatic choice for PCIe-connected multi-GPU environments, at the cost of throughput being constrained by the longest stage.

    Regarding the underlying compute backend, one might ask why Vulkan was chosen over a more “official” solution like ROCm. First, the Vulkan backend offers better cross-platform compatibility and out-of-the-box usability, avoiding the complex matching issues between ROCm versions, kernel drivers, and Linux distributions. Second, for inference workloads dominated by matrix multiplication, the performance loss of the Vulkan backend is within acceptable limits. Third, troubleshooting costs are lower. If targeting a production scenario demanding extreme throughput, investing time to configure the vendor’s official compute stack is worthwhile.

    Test Results and Remaining Issues

    This deployment primarily tested text and image pipelines:

    • Short Text Answers: Basic Q&A and instruction following work normally. The quality loss of 2-bit quantization on general tasks is perceptible but does not affect usability.
    • Long Text Retrieval: Information locating within contexts of tens of K tokens shows stable recall, but attention must be paid to the VRAM pressure caused by the KV cache.
    • Video Input: Since the branch used has not yet integrated the native video processing pipeline, this could not be tested and was temporarily shelved.

    Practical Recommendations

    1. Confirm the framework branch’s support status for the target model architecture before deployment; do not assume the main branch is ready.
    2. For multimodal models, remember to prepare both the main model weights and the visual projection module weights.
    3. Estimate the VRAM budget as “weights + KV cache + activations”, and reserve at least a 10% safety margin.
    4. Prioritize pipeline parallelism for PCIe-connected multi-GPU environments.
    5. If VRAM permits, choose higher bit-level dynamic quantization for a better balance between quality and size.

    If local hardware is limited, an alternative is to directly utilize public cloud inference services to access large model capabilities, focusing your efforts on application-layer development. Local deployment and cloud inference are not mutually exclusive; combining them based on data sensitivity, cost, and latency requirements is the current mainstream engineering practice.