Training Generative Image Models on Domestic AI Accelerators: A Technical Breakdown

    This article examines how a generative image model was trained end to end on a domestic accelerator using a domestic deep learning framework. It covers the hybrid autoregressive plus diffusion-decoder architecture, engineering details such as operator fusion, mixed precision, parallel strategies, and data pipelines, plus native non-standard resolution support and controllable Chinese text rendering. It closes with evaluation and deployment recommendations for teams building their own inference stack.

    1. Background: Compute Supply Shifts Meet In-House Model Development

    Two recent industry signals are worth reading together: signs of easing export restrictions on certain high-performance accelerator cards, and the release of a generative image model trained end to end on domestic accelerators, with weights published as open source.

    The two look unrelated, but they point to the same engineering question: can training and inference for generative models close the loop on a self-controlled compute stack. The first affects short-term elasticity of compute supply; the second validates the long-term technical path. For developers, the second carries more information, because it shows the full chain of model architecture, training framework, operator libraries, and hardware can be traversed end to end rather than replaced at a single point.

    Note that export policy is an external variable with high volatility, while engineering system building is internal capability that accumulates. Focusing on the latter yields more certain returns.

    2. Core Architecture: Why Autoregressive Plus a Diffusion Decoder

    The model uses a hybrid architecture that splits cleanly into two modules with distinct responsibilities.

    1) Autoregressive backbone (roughly 9B parameters)
    Handles semantic understanding, instruction following, and global layout planning. It models images as discrete token sequences and therefore inherits language model capabilities: long-context reasoning, multi-turn instruction parsing, and mixed Chinese-English understanding. This layer decides what to draw and how to arrange it.

    2) Diffusion decoder (a DiT structure of roughly 7B parameters)
    Turns the backbone’s semantic representations back into pixels, working with a dedicated text encoding module to handle glyph rendering. This layer decides how sharp the image is and whether the text is correct.

    The value of this split is decoupling: the semantic layer can reuse language model training and alignment experience, while the visual detail layer can focus on reconstruction quality. This matches the approach that has gained traction over the past year, using language model reasoning to drive image generation, often called cognitive generation, where the process includes explicit planning and self-checking rather than a one-shot mapping.

    Illustrative call flow (pseudocode, data flow only):

    1. # 1. Encode text/multimodal instruction
    2. prompt_tokens = tokenizer.encode("Generate a Chinese promotional poster, main title: Limited-time offer")
    3. # 2. Autoregressive backbone: output semantic plan and image token sequence
    4. plan, image_tokens = autoregressive_backbone(prompt_tokens)
    5. # 3. Text encoding module: provide glyph-level constraints
    6. glyph_feat = glyph_encoder(detected_text_regions(plan))
    7. # 4. Diffusion decoder: iteratively denoise back to pixels
    8. image = diffusion_decoder(image_tokens, glyph_feat, steps=28)
    9. return image # tensor at any non-standard resolution

    3. Engineering Implementation: Training on a Domestic Compute Stack

    The key official detail is that the entire pipeline, from data preprocessing to large-scale pretraining, ran on a single domestic training server, built on a domestic deep learning framework with a self-developed training suite. The engineering difficulty usually concentrates in four areas.

    Operator adaptation and fusion
    Training throughput is often bottlenecked not by peak compute but by memory access and operator scheduling. In practice, a set of hardware-affine operators is rewritten for the domestic hardware, for example fused implementations of the AdamW optimizer update with exponential moving average, channel attention modules, and normalization layers such as RMS Norm, merging many small operator calls into a single kernel to reduce intermediate tensor writes.

    Mixed precision and numerical stability
    The autoregressive backbone and the diffusion decoder have different numerical sensitivity: the former is sensitive to logits precision, the latter to accumulated error over long denoising steps. The common practice is to set precision policy per layer and keep higher-precision accumulation at critical reductions.

    Combining parallel strategies
    The 9B and 7B modules differ markedly in memory footprint, so a hybrid split of data, tensor, and pipeline parallelism is typical, combined with activation recomputation and sequence parallelism to control peak memory during long-context training.

    Data pipeline
    Image-text pair cleaning, resolution bucketing, and text region annotation must be tightly coupled with the training framework to avoid accelerators idling while waiting for data.

    4. Non-Standard Resolution: The Tokenizer Strategy Is Key

    Traditional generative models fix resolution to a few preset aspect ratios, so anything outside that range requires cropping or stretching, which is why posters and social media covers often end up with broken composition.

    This model improves on the tokenization and position encoding strategy: finer-grained image token splitting plus extrapolatable position representations enable native output between 1024x1024 and 2048x2048 with arbitrary width and height, such as non-standard sizes like 1240x1600.

    Two engineering points are worth noting:

    • Long side and token budget: higher resolution grows token count roughly quadratically, and attention cost rises with it, so a total cap and bucketed training are needed;
    • Aspect ratio extrapolation: extreme ratios outside the training distribution can still degrade, so for ratios beyond the common range, small-sample fine-tuning or prompt constraints are advisable.

    5. Chinese Text Rendering: From Missing Characters to Controllable Glyphs

    When generative models write wrong characters, the root cause is that text is learned as ordinary texture without glyph-level supervision. Viable options include adding a glyph encoding branch to provide stroke structure constraints, increasing Chinese long-text and mixed-script samples in training data, and region-specific inpainting over text areas at inference time. For evaluation, look at both overall aesthetic score and text accuracy, where the latter should be measured per character rather than by eye.

    6. Evaluation and Deployment Recommendations

    Public leaderboards place it among the top open-source entries on complex visual text generation and long-text rendering. Such metrics are useful for selection but should not replace testing on your own scenarios. Suggested rollout:

    1. Build an evaluation set of 50 to 100 real business prompts covering sizes, text length, and mixed Chinese-English;
    2. Define quantitative metrics: text accuracy, composition completeness, latency and cost per image;
    3. For on-premises deployment, assess the inference adaptation effort on the domestic compute stack, verifying operator coverage and memory footprint first;
    4. In production, pair it with general cloud capabilities such as object storage, container platforms, logging services, and monitoring and alerting, and handle elastic scaling and failure retries.