Full-Stack Training on Domestic AI Chips: A Practical Guide to Multimodal Generation

    This article examines what it takes to train and deploy a multimodal image generation model entirely on a domestic AI software and hardware stack. It covers capability boundaries, the four key layers of the training pipeline (data, training parallelism and memory budgeting, operator and precision adaptation, and inference delivery), a three-layer evaluation approach, and common pitfalls with practical workarounds. The focus is on a reproducible engineering paradigm rather than a single model release.

    1. Why Full-Stack Domestic Training Deserves Its Own Discussion

    In image generation, whether a model can be reproduced often depends not on the architecture diagram in a paper but on whether the training and inference pipeline runs stably on the target hardware. A common industry path is to train on general-purpose accelerators and then migrate to domestic chips for inference. Completing the entire workflow—data processing, model training, and inference deployment—on a domestic software and hardware stack imposes far stricter engineering constraints: operator coverage, numerical precision, communication library behavior, and memory management strategy must all be internally consistent.

    The core value of this kind of effort is not “another text-to-image model.” It validates a reproducible paradigm for training on domestic compute. For developers and enterprise users, it answers a practical question: without relying on the inertia of an existing ecosystem, how do you train a multimodal generation model stably and ship it to production?

    2. A Rational View of Capability Boundaries

    From a feature standpoint, these models typically offer the following general capabilities:

    • Accept Chinese and English prompts, including mixed-language input and proper nouns;
    • Cover multiple styles such as photorealistic, illustration, and design sketches;
    • Work alongside other multimodal models in the same family to form a “understand—generate—understand again” loop.

    It is worth stressing that a feature list is not the same as technical value. The real dividing line is whether the entire training process runs on domestic chips and whether performance reaches a generally usable industry level. The former determines supply chain and compliance certainty; the latter determines whether the model can enter production.

    3. Four Key Layers of the Full-Stack Training Pipeline

    Multimodal generation places extremely high demands on image-text pair quality. The engineering work typically includes language identification and filtering, image aesthetic scoring, resolution and aspect ratio normalization, text denoising and sensitive content filtering, and near-duplicate clustering for deduplication. A common mistake on the data side is focusing only on “volume” while ignoring “distribution”: if style labels are missing or long-tail categories have too few samples, the model will visibly collapse on specific styles.

    3.2 Training Layer: Parallelism Strategy and Memory Budget

    Training diffusion models on domestic chips is mainly bottlenecked by memory and communication. A common approach is hybrid parallelism: data parallelism carries throughput, tensor parallelism splits individual layer weights, pipeline parallelism splits network depth, and sequence parallelism is added when necessary to handle high-resolution feature maps. The memory budget can be understood through a rough relationship:

    1. per-card memory ≈ parameter shard + optimizer state shard + activations + temporary buffers

    Activations grow non-linearly with resolution and batch size, so gradient checkpointing (activation checkpointing) is almost mandatory, trading a small amount of recomputation for lower memory usage.

    3.3 Operator and Precision Layer: Adaptation Takes Longer Than Tuning

    The most common blocker when running on domestic chips is not model architecture but missing operators or behavioral differences. Practical recommendations:

    • Build an operator coverage checklist; for missing operators, first apply equivalent substitutions, then consider custom implementations;
    • Prefer bf16/fp16 mixed precision, while keeping fp32 for numerically sensitive modules such as LayerNorm and softmax;
    • Perform bit-level alignment verification for “detail-sensitive” operators such as random number generation and upsampling interpolation, to avoid a training curve that looks normal but produces structural artifacts in generated images.

    3.4 Inference Layer: From Usable to Deliverable

    Finishing training is only the starting point. Going live requires a full set of engineering techniques—graph optimization, operator fusion, KV/cache reuse, dynamic resolution bucketing, and batch scheduling—combined with general cloud capabilities such as object storage, container platforms, logging services, and monitoring and alerting to close the delivery and operations loop.

    4. Evaluation: Look Beyond “It Looks Good”

    A three-layer evaluation is recommended:

    1. Automatic metrics: image-text alignment, aesthetic score, sharpness, and noise statistics;
    2. Human preference: double-blind comparison on a fixed prompt set, covering photorealistic, illustration, and sketch styles;
    3. Stability regression: variance across repeated samples of the same prompt, truncation behavior for extremely long prompts, and semantic drift under mixed Chinese-English input.

    A skeletal evaluation harness is shown below:

    1. prompts = load_prompt_set("cn_en_mixed_v1")
    2. for p in prompts:
    3. imgs = generate(p, n=4, seed=fixed_seed)
    4. scores_auto = auto_metrics(p, imgs) # image-text consistency / sharpness
    5. scores_human = human_preference(p, imgs) # double-blind scoring
    6. log_result(p, scores_auto, scores_human)

    5. Common Pitfalls and How to Avoid Them

    • Loss spikes in late training caused by abrupt resolution changes: use a progressive resolution curriculum;
    • Numerical inconsistency between the text encoder and the generation backbone on domestic chips: align intermediate tensors segment by segment;
    • Missing long-tail styles: apply style-based resampling and label completion;
    • Inference latency misses the target: profile at the operator level first, then decide on quantization or distillation, avoiding blind precision reduction.

    6. Conclusion

    A multimodal generation model trained end to end on domestic chips turns “controllability” into a verifiable engineering fact: controllable data, controllable compute, and controllable delivery. What a team needs to accumulate is not the weights of any single model but data governance standards, an operator adaptation checklist, hybrid parallelism configuration templates, and a three-layer evaluation system. With this infrastructure in place, model iteration is only a matter of time; without it, even strong one-off results are hard to reproduce reliably.