Running a Trillion-Parameter Multimodal Model on Domestic GPUs: A Day-0 Adaptation Practice

    Ultra-large multimodal models push both accelerator hardware and the AI software stack beneath them to their limits. This article documents a real-world effort to serve a 3-trillion-parameter open-weight multimodal model on China's domestically developed training-and-inference GPUs with Day-0 support—on the very day the weights were released. It covers the layered software stack that made rapid adaptation possible, the migration of key compute paths such as sparse attention indexing, hybrid vision-text attention, and sharded weight loading, the reuse of multi-card communication and an established inference engine, and a set of reusable engineering lessons for teams facing new model-and-hardware combinations.

    As open-weight models continue to grow in scale, serving ultra-large multimodal models places increasingly demanding requirements on the underlying accelerator hardware and software stack. Completing adaptation within an extremely short window after the weights are released, connecting both text and image inference pipelines, and keeping the service stable in production have become key indicators of an AI software stack’s engineering maturity. Drawing on a representative adaptation of a trillion-parameter multimodal model onto domestically developed training-and-inference accelerator cards, this article walks through the complete technical path—from model architecture analysis and migration of key compute paths to bringing up a working inference service—and distills a reusable engineering methodology.

    Background: The Dual Challenge of Trillion-Scale Parameters and Multimodality

    The target model was the first release in an open-source model family, with roughly 3 trillion parameters and support for context windows on the order of 1 million tokens. It underwent large-scale post-training and reinforcement learning optimization for code generation, 3D content creation, financial research, knowledge question answering, and long-horizon agent tasks. In public agent evaluation leaderboards, it ranks near the top in the open-weight category and holds first place among open models across the work, coding, and chat task categories; on code- and agent-related benchmarks, its long-horizon task performance has reached or is approaching the level of top closed-source models.

    From an engineering standpoint, a model of this scale introduces three types of pressure:

    1. Memory and bandwidth pressure: At the trillion-parameter level, simply loading the weights requires fine-grained sharding and scheduling strategies. A single card cannot hold the full weights, so multi-card parallelism and efficient communication primitives are mandatory.
    2. Complex compute paths: The model introduces a sparse attention mechanism to reduce computation over long contexts, layered on top of visual encoding and image-text fusion paths. The inference pipeline is no longer a single text autoregressive pathway.
    3. An extremely short adaptation window: Once the weights are released, users expect to launch services on the target hardware the same day—so-called “Day-0 support.” This demands rapid compatibility-based migration from the software stack, not a layer-by-layer rewrite.

    The core of the adaptation work, therefore, was not development from scratch. Instead, the team migrated and integrated the key inference paths on top of the existing stack’s programming model, runtime interfaces, and AI framework compatibility layer.

    The Layered Software Stack: Infrastructure for Fast Adaptation

    A complete AI software stack can typically be divided into several layers, each with clearly defined responsibilities. This is what makes it possible to “reuse mature interfaces and change only the incremental paths” when a new model architecture arrives:

    • Programming model and runtime interface layer: Provides device abstraction, memory management, and stream and event scheduling. This layer largely determines the cost of porting upper-level frameworks.
    • AI framework compatibility layer: Hosts mainstream model implementations so that community model definitions can run on the target hardware with minimal changes.
    • Operator library and compiler toolchain: Covers both general-purpose operators and newly added compute paths, improving execution efficiency through graph optimization, operator fusion, and code generation.
    • Communication and multi-card coordination layer: Handles collective communication under tensor parallelism and pipeline parallelism, ensuring multi-card inference scales.

    This adaptation was built on exactly this layered structure. The framework compatibility layer hosted the upstream model implementation, while the operator library, a Triton-compatible layer for the target hardware, a domain-specific operator programming language, and an in-house compiler were used to migrate and integrate the new architecture’s key compute paths—ultimately turning community model code into a running inference service on the target accelerator cards. This “layered reuse” approach meant the team did not need to touch the model’s core logic; they only focused on the compute paths that were new or had changed.

    Migrating and Optimizing the Key Compute Paths

    Integrating the Sparse Attention Indexing Path

    In long-context scenarios, sparse attention is the core mechanism for keeping computation under control. The typical approach is to first use an indexer network to produce coarse-grained scores between queries and keys, filter out the key blocks most relevant to the current query, and then run attention computation only over the selected blocks. This path involves index scoring, block selection, mask construction, and the attention kernel that runs after sparsification—making it a newly added compute path in the model’s architecture.

    During adaptation, the team mapped the operators for the indexing module within the framework compatibility layer, decomposing the index scoring and block selection logic into combinations of operators that could execute on the target device, and implemented mask construction using the general-purpose primitives provided by the operator library. For the sparsified attention kernel, they rewrote and tuned it through the Triton-compatible layer for the target hardware, giving the kernel reasonable thread partitioning and memory access patterns on the target device. The benefit of this layered treatment is clear: generic logic reuses mature operators, performance-sensitive sections are optimized in isolation, and the regression risk of a full rewrite is avoided.

    Connecting Hybrid Attention and the Vision Compute Pipeline

    A multimodal model’s inference pipeline typically consists of a vision encoder and a text decoder. The two may differ in their attention mechanisms, forming a hybrid attention structure. The vision side handles image tiling, feature extraction, and projection; the text side must then incorporate the visual features as a prefix in its attention computation.

    The priority at this stage was pipeline connectivity rather than single-point performance: ensuring that the vision encoder’s operators executed correctly under the operator library and compiler toolchain, that visual features were injected into the text decoder’s key-value cache with the correct layout and data type, and that positional encoding and mask logic remained consistent for mixed image-text inputs. In practice, the team built end-to-end test cases covering three input types—pure text, pure image, and mixed image-text—and compared intermediate results numerically, segment by segment, to locate and fix layout conversion and precision alignment issues.

    Weight Loading and Service Startup

    For a trillion-parameter model, weight loading is the most time-consuming phase of service startup. The adaptation used a sharded-loading, parallel-initialization strategy: weights were split according to the tensor parallelism degree and read in parallel by each card, reducing IO pressure on any single card. Data type conversion and layout adjustment were completed during loading itself, avoiding an extra post-processing pass. During service startup, a unified runtime interface handled device initialization, communication domain establishment, and inference engine registration, allowing the model to expose a stable service interface on the target accelerator cards.

    Reusing Multi-Card Communication and the Execution Framework

    Multi-card inference scalability depends on the correctness and efficiency of collective communication. The adaptation reused the software stack’s existing communication layer, covering primitives such as all-reduce and all-gather under tensor parallelism, with topology detection and link selection performed during communication domain setup. Because the communication layer’s interfaces are decoupled from the upper-level framework, model adaptation did not need to concern itself with low-level link details—the team simply declared the sharding scheme according to the parallelism strategy.

    At the execution framework level, the team used a mature inference engine to host the upstream model implementation, unifying model definition, parallelism strategy, and sampling logic in the service configuration. This meant the cost of onboarding a new model was concentrated in the operator mapping for the compute paths described above, rather than in modifying the service framework—significantly shortening the cycle from weights release to a usable service.

    Engineering Methodology: Reusable Lessons

    Several reusable lessons can be drawn from this adaptation:

    1. Gain speed through layered reuse: Solve problems first at the framework compatibility layer and operator library, and apply targeted optimization only to newly added compute paths. This avoids the repeated cost of building “one stack per model.”
    2. Treat incremental paths as the unit of adaptation: Break down model architecture differences into a small set of incremental paths—sparse attention indexing, visual feature injection, and so on—then verify and optimize them one at a time to reduce overall regression risk.
    3. Guarantee correctness with end-to-end test cases: Errors in multimodal pipelines tend to appear in the “glue layers”—layout conversion and precision alignment. End-to-end cases covering multiple input forms, combined with numerical comparison, are essential.
    4. Support fast iteration with unified interfaces: The stability of the programming model, runtime interfaces, and communication layer is the prerequisite for quickly adapting future models of the same class. The more stable the interfaces, the shorter the integration cycle for new models.

    Conclusion

    Bringing a trillion-parameter multimodal model into production tests not just raw compute, but the layered design of the software stack and the engineering organization behind it. Through coordinated work across the programming model, framework compatibility, operator compilation, and communication coordination, domestically developed training-and-inference accelerator cards completed adaptation on the day the model weights were released and brought up the full image-text inference pipeline—a replicable blueprint for building inference infrastructure on domestically developed hardware. For developers, understanding this layered adaptation methodology makes it easier to identify the boundary of required changes when facing a new combination of model and hardware, so that limited engineering effort is concentrated on the paths that genuinely affect correctness and performance.