A Practical Guide to Selecting and Migrating to Domestic AI Compute
This guide explains how to evaluate domestic AI accelerators beyond peak FLOPS and migrate large language model workloads with controlled cost. It covers four selection dimensions—memory capacity and bandwidth, software ecosystem compatibility, product maturity, and cluster deployment density—followed by a six-stage migration process: baseline measurement, operator and dependency audit, precision alignment, performance tuning, inference serving, and capacity planning. Common pitfalls and a total cost of ownership view are included to help teams build a sustainable multi-source compute supply chain.
1. Background: A Structural Gap in Compute Supply
Since 2024, large language models have moved quickly from experimental environments into production business systems, and the open-source model landscape has expanded rapidly, with parameter counts spanning from a few billion to hundreds of billions. Application teams now have more choices, but the infrastructure question has become sharper: where does the accelerated compute for training and inference actually come from?
For a long time, general-purpose GPU accelerators effectively monopolized the AI training and inference market, and a mature ecosystem of programming models, operator libraries, and framework support grew around them. Supply chain uncertainty has turned reliance on a single technology stack into a risk, making domestic alternatives a requirement rather than an option. The point of substitution is not to pick hardware with better-looking specifications, but to find an engineering path with controllable migration cost, a sustainable ecosystem, and verifiable delivery.
2. Four Dimensions That Actually Matter in Selection
Many selection discussions stop at peak compute comparisons, which is far from sufficient in practice. Four factors determine whether a project succeeds.
2.1 Memory Capacity and Bandwidth: Can It Run at All?
The first barrier for large model inference is not compute but memory. For a model with hundreds of billions of parameters, weights alone occupy roughly twice the parameter count in memory under FP16 precision. Add KV Cache, activations, and framework overhead, and a small-memory single-card design can barely hold the model. Memory capacity therefore determines whether a model can be loaded on a single device or must be sharded across cards.
Sharding introduces communication overhead and parallelization complexity: tensor parallelism is sensitive to bandwidth, while pipeline parallelism is sensitive to scheduling. More available memory lets you use a simpler parallel strategy in exchange for lower latency jitter.
2.2 Ecosystem Compatibility: How Fast Can It Run?
Hardware is only the foundation; the software stack is what consumes engineering effort. Three points matter when assessing compatibility:
- Whether the programming model has a clear correspondence that lets existing kernels be ported over.
- Whether mainstream deep learning frameworks and inference engines offer official or community-adapted versions.
- Whether commonly used operators (attention, normalization, convolution, collective communication) have high-performance implementations.
If a solution requires rewriting business code from scratch, the hidden cost often exceeds the hardware price difference several times over.
2.3 Product Maturity: Is It Safe to Put into Production?
Maturity shows up in long-duration stability testing, failure recovery mechanisms, the iteration cadence of drivers and firmware, and the quality of available documentation and issue response. An accelerator lacking this support shifts risk onto the business team in 24/7 operations.
2.4 Cluster Form Factor and Deployment Density: How Do You Scale?
Modular, highly integrated form factors make unified power and cooling design easier in data centers and simplify compute density planning per rack. During selection, confirm the number of cards per node, interconnect topology, power ceiling, and cooling approach at the same time, so you avoid buying cards that cannot fit in the rack.
3. Six Stages of Migration
Stage 1: Feasibility and Baseline Measurement
Get the end-to-end path working in a small-scale environment first, and record baseline metrics: per-card memory usage, time to first token, throughput (tokens/s), and long-duration stability.
# Example: keep the same measurement definitions before and after migrationbaseline = {"gpu_mem_gb": 0, # peak memory usage"ttft_ms": 0, # time to first token"throughput": 0, # tokens/s"stability_hours": 0, # continuous failure-free runtime}
Stage 2: Operator and Dependency Audit
Export the model computation graph and measure the share of custom operators. In practice, the fewer custom operators there are, and the more concentrated they are in a few categories, the shorter the migration cycle. For missing operators, prefer equivalent compositions first, and consider hand-written kernels second.
Stage 3: Precision Alignment
This is the most underestimated step. Compare outputs layer by layer to locate the source of deviation:
# Example: compare tensors layer by layer, locate first then optimizemax_diff = (out_ref - out_new).abs().max()assert max_diff < 1e-2, f"layer drift too large: {max_diff}"
The recommended alignment order is: single-layer forward pass, single-operator backward pass, full-network forward pass, then full-network training or inference. Under mixed precision, pay extra attention to normal jitter caused by differences in reduction order.
Stage 4: Performance Tuning
The suggested tuning priority is: batching and concurrency strategy, then memory and cache reuse, then communication and parallel sharding, then kernel-level optimization. Most of the gains come from the first two, and moving to kernel-level work too early usually wastes effort.
Stage 5: Inference Serving
Package the model as a service, put load balancing and elastic scaling in front of it, and cover four metric categories with monitoring and alerting: latency, throughput, memory watermark, and error rate. Collect logs centrally to make cross-version comparison easier. Object storage can be used for version management of model weights and datasets.
Stage 6: Capacity Planning and Cost Assessment
Take business peak load as the input, work backward to the required number of cards and redundancy, and evaluate power, rack space, and operations headcount at the same time. The result should be a total cost of ownership view rather than a per-card price view.
4. Common Pitfalls
- Looking only at peak compute: ignoring memory and bandwidth makes a design impossible to deploy.
- Underestimating migration effort: no time reserved for operator adaptation and precision alignment.
- Skipping canary rollout: switching everything at once leaves the failure radius uncontrolled.
- Ignoring observability: performance regressions cannot be traced after launch.
5. Conclusion
Selecting domestic AI compute is fundamentally an engineering problem: memory capacity and ecosystem compatibility define the feasibility boundary, maturity and deployment form factor control delivery risk, and staged migration with strict precision alignment protects quality. Baidu AI Cloud provides general capabilities in heterogeneous compute scheduling and model serving. Enterprises can combine their own model scale and business latency requirements to build a sustainable, multi-source compute supply system, turning supply chain risk into a manageable engineering process.
