Technical Analysis and Implementation Key Points of Cognitive Image Generation Models Trained on Self-Developed Chips

    This article analyzes an image generation model fully trained on self-developed domestic chips, based on existing technical documentation. It covers parameter scales, architectural details, and performance descriptions without independent reproduction. The article does not constitute a performance guarantee and does not cover all chip models; readers should rely on official documentation and empirical test results. It explores training-side operator optimizations, hybrid architecture design, variable resolution handling, and engineering deployment strategies to provide a comprehensive understanding of the solution's implementation.

    Based on existing technical introductions, this article analyzes an image generation model whose entire training pipeline was completed on self-developed domestic chips. The parameter scales, architecture details, and performance descriptions are derived from the original solution’s documentation and have not been independently reproduced. This article does not constitute a performance guarantee and does not cover all domestic chip models. Readers should rely on official documentation and their own empirical test results.

    There are three core conclusions. First, this solution demonstrates that domestic computing power can handle the training process of large-scale image generation models, with specific acceleration effects depending on hardware, network topology, and parallel strategies. Second, the division of labor between an “autoregressive module plus a diffusion decoder” benefits text rendering, though the effects must be verified using a fixed test set. Third, the variable resolution capability only holds within the range covered during training; handling beyond this range or failing grid alignment requires degradation strategies.

    I. Training-Side Operator Optimization

    Large model training increasingly relies on underlying computing power and infrastructure. The original solution’s training pipeline, from data preprocessing to large-scale pre-training, was entirely completed on a domestic computing cluster. Beyond replacing the computing hardware, it is necessary to adapt the deep learning framework to the hardware’s operator implementation. The original solution developed a training suite based on a mainstream framework and adapted it at the operator level. The three optimizations mentioned are as follows:

    • AdamW EMA (Exponential Moving Average): EMA maintains a sliding average copy of parameters outside the optimizer. The decay rate is commonly set between 0.999 and 0.9999, adjusted according to training steps. EMA increases memory usage because it requires an extra copy of parameters; it does not save memory. Merging EMA updates with optimizer updates into the same kernel reduces the number of read/write passes over parameters, thereby reducing memory access pressure. The gains should be confirmed by comparing single-step latency and peak memory under the same model and batch size.

    • COC (Communication and Computation Overlap Strategy): The original text refers to this as a communication and computation fusion operator. This article terms it the communication and computation overlap strategy based on its mechanism: splitting the collective communication (e.g., AllReduce) for gradient synchronization into buckets and sending computed gradients while backpropagation is still running. The benefit of this overlap depends on three conditions: network bandwidth, cluster topology, and the combination of data parallelism and tensor parallelism. If communication accounts for a small portion of single-step latency, the overlap brings limited gains.

    • RMS Norm: Compared to Layer Norm, RMS Norm does not compute the mean, requiring fewer calculation steps. The original text mentions fusing it with scaled dot-product operations to reduce the number of times intermediate results are written back to memory. The goal of such fusion is to reduce memory round-trips, but actual effects depend on specific operator implementations and must be confirmed using profiling tools.

    The core value of operator fusion is reducing kernel launch counts and memory read/writes. Training teams should first use profiling tools to identify bottlenecks before deciding which fused operators to introduce. Blindly stacking optimizations may increase maintenance costs and make numerical behavior difficult to troubleshoot.

    II. Hybrid Architecture: Division of Labor Between Understanding and Rendering

    The architecture described in the original text divides the generation task into two stages. The first stage is an autoregressive module with a parameter scale of about 9B, responsible for parsing text prompts, understanding user intent, and planning the spatial layout and composition of the image. Autoregressive models excel at sequential, step-by-step reasoning, making them suitable for handling semantics and layout. The second stage is a diffusion decoder, with a stated scale of about 7B, adopting the DiT (Diffusion Transformer) structure. DiT applies Transformers to the diffusion process, enabling the denoising process to utilize global attention, resulting in more stable control over the overall structure.

    This division of labor is a design choice, not the only approach. Its advantage is that the two modules can be optimized and replaced independently. The cost is that inference requires loading both sets of weights simultaneously, increasing memory usage and latency.

    The original text refers to this generation method separating understanding and rendering as “cognitive generation.” This term currently lacks a unified definition, but this article follows this nomenclature.

    Text rendering is a focal point of the original text. It notes that traditional image generation models often suffer from deformed text, misspelled words, or missing strokes. The introduced Glyph Encoder encodes the glyph features of target text into high-dimensional vectors, which are then cross-modally fused with image features to guide glyph restoration during the denoising process. The original text does not provide data on glyph coverage, fonts, font sizes, or comparison baselines, so this article makes no judgment regarding the magnitude of improvement in text accuracy.

    When evaluating text rendering capabilities, it is recommended to prepare a fixed set of prompts covering different character counts, font sizes, fonts, layout directions, and rare characters. Use OCR to count character-level accuracy and compare it against a baseline model or a version without the Glyph Encoder. Conclusions are only valuable as references when test conditions are public and results are reproducible.

    III. Variable Resolution: Tokenizer Applicability Boundaries

    Traditional image generation models typically only support fixed ratios like 1:1, 4:3, and 16:9. When encountering non-standard sizes, the common practice is to generate a standard image first and then crop or stretch it, which leads to content loss or distortion. The original text proposes that by improving the Tokenizer strategy and 2D positional encoding, the model can directly generate images at non-standard resolutions.

    This capability needs to be understood within limits. The Tokenizer divides the image into a grid with a fixed step size, where each grid cell corresponds to a Token. If the downsampling factor is 16, the image width and height must be multiples of 16 to align perfectly with the grid. Taking 1240x1600 as an example, 1240 divided by 16 is 77.5, which is not an integer. During actual deployment, padding is required, or the width must be adjusted to the nearest multiple (e.g., 1248). Specific alignment rules should be subject to the official Tokenizer documentation.

    When exceeding the training resolution significantly, positional encoding requires extrapolation, and the model may exhibit repeated structures or compositional imbalance. For extreme aspect ratios (e.g., 1:8), the quality of the global layout usually degrades. Text near the edges of the frame in non-standard sizes may also be cropped. These scenarios should be explicitly listed during testing.

    When testing non-standard resolution generation, it is recommended to simultaneously run a baseline that generates standard sizes and then crops or stretches them, recording the following metrics:

    • Generation latency: End-to-end time for a single image, including both the autoregressive and diffusion stages.
    • Peak memory: Maximum usage at the same resolution.
    • Text OCR accuracy: Consistent with the test set in Section 2.
    • Composition error rate: Manually annotated according to fixed standards, such as subject truncation or proportion distortion.

    IV. Engineering Deployment and Monitoring

    Deploying a hybrid architecture model into production involves addressing issues different from single-model services. Below are general points directly related to this technical solution; specific platform selection and configuration are outside the scope of this article.

    1. Model Sharding: The autoregressive module and the diffusion decoder can be deployed on different device groups, sharded according to memory usage. Transmitting intermediate results between them increases communication volume and latency. The split point should be selected where the data transfer volume is minimal, and latency changes should be confirmed through testing.
    2. Quantization: Low-bit quantization can be attempted for autoregressive weights and KV cache. After quantizing the diffusion decoder and glyph-related modules, the text test set from Section 2 must be re-run. If the OCR accuracy drop exceeds the acceptable range, precision should be rolled back for that module.
    3. Dynamic Batching: Image generation requests vary significantly in latency; a fixed batch size will increase tail latency. Dynamic batching requires setting a maximum wait time and maximum batch size, both of which must be adjusted according to business latency targets.
    4. Version Control and Rollback: Model weights, Tokenizer configurations, and operator versions must be versioned together. During a canary release, the previous version should be retained, and rolled back if monitoring metrics indicate anomalies. The rollback process should be rehearsed once before going live.

    Post-launch monitoring can be executed according to the table below. The thresholds in the table are initial recommendations and need to be calibrated against your own business baseline data.

    Metric Collection Method Suggested Threshold (Calibrate based on baseline) Action on Alert
    Autoregressive Token Throughput Inference service calculates generated tokens divided by latency per request, aggregated every minute Below 70% of the post-launch baseline for 5 minutes Check batch size and device utilization; confirm if queuing exists
    Memory Utilization Device monitoring tool samples per card every 15 seconds Above 90% for 10 continuous minutes Reduce maximum batch size or scale up the device group for that module
    Text Accuracy Sample 1% of requests, compare with target text using OCR Drops by more than 3 percentage points compared to baseline Pause canary release; check recent model or quantization changes; rollback if necessary
    P95 Generation Latency Gateway statistics end-to-end latency Exceeds business SLA Check inter-shard transfer latency and dynamic batching parameters
    Request Error Rate (incl. OOM, Timeout) Service logs count by error type Exceeds 1% Troubleshoot by error type; for OOM, prioritize checking the distribution of non-standard size requests

    V. Conclusion

    Under specific test conditions, this type of solution can provide a viable foundation for text rendering and non-standard size generation. Whether to adopt it depends on three factors: the available domestic computing power and network conditions, the actual resolution and aspect ratio distribution of the business, and whether the team possesses its own test set and OCR evaluation process. Without any one of these, the conclusions in this article will be difficult to directly apply to specific projects.