Training Multimodal Image Generation Models End-to-End on Domestic AI Chips: Architecture and Engineering Analysis
This article examines how a multimodal image generation model can be trained end-to-end on domestic AI chips, covering the four-stage pipeline of data processing, base pretraining, supervised fine-tuning, and reinforcement learning alignment. It breaks down the hybrid architecture of an autoregressive base model paired with a diffusion decoder, explains techniques for Chinese text rendering and native arbitrary aspect ratios, and outlines hardware adaptation, scheduling, and stability practices. Readers will also find a practical rollout checklist and risk list for building a repeatable training path on alternative compute hardware.
1. Why End-to-End Training on Domestic Compute Matters
Training multimodal image generation models has historically depended on a single hardware ecosystem. Engineering teams build path dependencies around operator libraries, communication libraries, and framework adaptation. When compute supply fluctuates, the model iteration cadence suffers with it.
This is why “completing the entire pipeline on domestic chips, from data preprocessing to large-scale pretraining” is significant. The value is not in a single successful run, but in validating a reproducible engineering path: the framework layer, operator layer, communication layer, and scheduling layer can all form a closed loop on domestic hardware.
Such an effort typically involves four stages: data cleaning and encoding, base pretraining, supervised fine-tuning, and reinforcement learning alignment. Each stage places different demands on hardware. The data stage is bound by memory bandwidth and codec throughput, pretraining is bound by matrix compute and interconnect bandwidth, and the alignment stage is bound by sampling throughput and VRAM capacity. Running the full pipeline means all of these differentiated workloads have been adapted.
2. Architecture Breakdown: Autoregressive Base Plus Diffusion Decoder
The mainstream “cognitive generation” approach combines the reasoning ability of a language model with image generation, letting the model first “read” the semantics and global composition, then “write” the details correctly. A typical implementation is a hybrid architecture:
- Autoregressive component (around 9B parameters): handles semantic understanding, instruction parsing, and global layout planning, emitting a sequence of discrete visual tokens.
- Diffusion decoder (around 7B DiT structure): takes the token sequence and reconstructs pixels, paired with a dedicated text encoder that handles glyph shapes to mitigate the “forgot the character mid-stroke” problem.
The inference flow can be abstracted as:
# Pseudocode: expresses stage boundaries only, not concrete APIslayout_tokens = autoregressive_model.encode(prompt) # semantics and compositionglyph_feat = glyph_encoder.encode(prompt) # glyph featuresimage = diffusion_decoder.decode(layout_tokens, glyph_feat, size=(H, W))
The engineering value of this split is that the semantic layer can be trained thoroughly on text corpora and image-text alignment data, while the rendering layer can strengthen glyph shapes and typography independently. The two can iterate without blocking each other.
3. Text Rendering: The Hard Part of Direct Chinese Poster Output
Rendering Chinese is far harder than rendering Latin characters: the character set is large, strokes are dense, and there are many visually similar characters. Common optimization directions include:
- Glyph condition injection: feed character-level glyph features into the decoder as an additional condition, rather than relying on semantic tokens alone.
- Layout constraints: introduce typography annotations into training data so the model learns font size, line spacing, whitespace, and hierarchy.
- Long-text consistency: a three-level structure of headline, subheadline, and body copy must stay consistent across tokens, avoiding mid-way character errors or text bleed between levels.
- Evaluation-driven iteration: use public evaluation dimensions such as complex visual text generation and long-text rendering for regression checks, focusing on readability and glyph accuracy rather than overall aesthetics alone.
4. Native Arbitrary Aspect Ratios: Coordinating Tokenizer and Position Encoding
Traditional models support only a few preset aspect ratios, but posters and social media covers require custom dimensions. Supporting native arbitrary aspect ratios usually takes three changes:
- Tokenizer strategy improvement: let the visual token grid be split dynamically according to the target width and height instead of using fixed blocks.
- Position encoding extrapolation: 2D position encodings must support different width-height combinations so image quality does not collapse once inputs fall outside the training distribution.
- Resolution range constraints: a common approach is to allow any aspect ratio within roughly 1024x1024 to 2048x2048, balancing sharpness against VRAM overhead.
In practice, it helps to converge on a set of common sizes based on business templates, run a small-batch evaluation first, and scale up afterward rather than covering too wide a distribution at once.
5. Training Engineering on Domestic Hardware
Completing end-to-end training on domestic chips typically requires adaptation at several layers:
- Framework and toolkit: build a training toolkit on a deep learning framework that supports domestic hardware, covering data preprocessing, pretraining, fine-tuning, and reinforcement learning.
- Scheduling optimization: multi-level pipeline dispatch for dynamic graphs relieves single-point dispatch bottlenecks; multi-stream parallelism lets communication and computation overlap.
- Fused operators: use hardware-affine fused implementations (such as optimizer updates with exponential moving average, normalization, and channel transformations) to reduce intermediate tensor writes and memory accesses.
- Stability engineering: combine logging services, monitoring and alerting, and containerized scheduling to enable self-healing and checkpoint resume.
If a team runs domestic compute resources in the cloud, it can rely on container platform elastic scaling, object storage for training data, and message queues to decouple the data pipeline, filling engineering gaps with general-purpose cloud capabilities.
6. Rollout Recommendations and Risk Checklist
- Start small, then scale: validate the adaptation chain with small-scale data before scaling to full pretraining.
- Establish regression baselines: text accuracy, aspect ratio coverage, and long-text consistency must be quantified.
- Balance VRAM and throughput: arbitrary aspect ratios introduce dynamic shapes, so reserve VRAM headroom.
- Compliance and copyright: confirm commercial licensing for training corpora and generated content in advance.
- Avoid single-point dependencies: abstract operators and communication strategies into replaceable layers to ease migration across hardware.
7. Conclusion
Training a multimodal image generation model end-to-end on domestic compute is essentially decoupling “model capability” from “engineering adaptation” and then coupling them again. For developers, what is truly reusable is the methodology: hybrid architecture division of labor, glyph condition injection, dynamic resolution adaptation, and scheduling and operator optimization for domestic hardware. With this combination in hand, teams can maintain a stable iteration cadence even when compute supply keeps shifting.
