Cloud Compute Foundations for Large Language Models: Engineering Practices Behind LLM Commercialization
This article looks past the valuation headlines around large language model (LLM) companies to the heavy compute investment underneath. From an engineering perspective, it breaks down the real resource demands of LLM training and inference, outlines the three layers of a cloud compute foundation—elastic compute and networking, tiered storage, and orchestration with observability—and offers practical approaches to elastic scheduling, storage tiering, and cost observability, along with batching and auto-scaling examples. It is a technical analysis, not investment advice.
LLM companies are going public and valuations keep hitting new highs. On the surface this looks like a capital narrative, but underneath it is a very heavy compute investment curve. From a technical perspective, leaps in model capability depend on scaling compute, and scaling compute in turn requires infrastructure that is stable, low-cost, and schedulable. Starting from engineering practice, this article breaks down the real resource requirements of LLM training and inference, maps out the three layers of a cloud compute foundation, and presents practical ideas for elastic scheduling, storage tiering, and cost observability. This article is a technical analysis only and does not constitute investment advice.
1. The Compute Logic Behind the Capital Wave
The capital flowing into LLM companies is not merely a financial event, but an inevitable result of training and inference entering a capital-intensive stage. The more frequently models iterate and the larger their parameter counts, the higher the demands on accelerators, high-speed networking, storage throughput, and scheduling systems. The long-term capital that markets provide is essentially paying for a very heavy technology-infrastructure curve.
For model companies, the ability to keep iterating depends on whether they can reliably, and cheaply, acquire and schedule large-scale compute. For cloud providers, LLM training and inference is a core scenario driving demand for compute, storage, and networking. The two form a long-term, mutually enabling relationship. Understanding this is more valuable than focusing on short-term valuation numbers.
2. Why LLMs Consume So Much Compute: From Training to Inference
LLM compute demand needs to be split into two stages—training and inference. Their resource profiles differ, and so do their optimization goals.
Training: Long-Running, Large-Scale, Tightly Coupled
Pre-training a model with hundreds of billions of parameters is essentially solving a very large optimization problem. Three characteristics define the training side:
- Parallelism is a hard requirement. A single accelerator’s memory usually cannot hold the full model, gradients, and optimizer states, so you need to combine strategies such as data parallelism, tensor parallelism, and pipeline parallelism. There is no fixed template for the parallel strategy; it must be composed according to the model structure and the cluster’s interconnect conditions, and sequence parallelism is sometimes added on top. Expert parallelism is also commonly introduced in MoE scenarios.
- High-speed interconnect sets the efficiency ceiling. Gradient synchronization and parameter updates across accelerators are high-frequency, communication-intensive operations. Network bandwidth and latency directly affect the effective compute utilization of the cluster. Once the network becomes a bottleneck, compute accelerators may sit idle waiting.
- Stability matters more than peak performance. A single pre-training run may last weeks or even months. Node failures, network jitter, or storage anomalies can all roll back progress. Checkpointing, automatic recovery, and fault isolation are therefore the lifeline of a training system.
Inference: Low Latency, High Concurrency, Cost-Sensitive
Training is only the starting point; what actually serves massive numbers of users is inference. The core tension in inference is balancing cost against service quality.
Inference cost cannot be judged by accelerator count alone; you also have to look at effective throughput, memory utilization, queuing latency, and resource idle rate. Memory usage is not tied to concurrency alone—roughly, it can be understood as:
Per-request memory ≈ weight shard + KV Cache + activations
Here, the KV Cache grows with context length and is further affected by the number of concurrent requests. Batching is therefore not a one-way optimization; it is a trade-off among memory, throughput, and latency. In engineering practice, this is often combined with paged KV management, continuous batching, quantization/compression, and request scheduling to raise output per accelerator-hour.
| Dimension | Training | Inference |
|---|---|---|
| Primary bottleneck | Interconnect, stability, parallel partitioning | Latency, memory, throughput, cost |
| Typical methods | Data, tensor, pipeline, sequence, and expert parallelism | Batching, KV Cache management, quantization, auto-scaling |
| Scaling pattern | Training jobs are usually launched together and run for long periods | Scales elastically with QPS and latency fluctuations |
| Cost focus | Effective compute utilization, cost of recomputation after failures | Cost per request, idle rate, peak reservation |
| Reliability focus | Checkpoints, automatic recovery, job rescheduling | Timeout control, graceful degradation, canary releases |
Example: Inference Batching Scheduling
The following is pseudocode meant to convey the idea. MAX_BATCH_SIZE and MAX_WAIT_MS need to be calibrated by load-testing against the first-token latency SLO, and you must distinguish first-token latency from full-generation latency.
import timedef schedule_inference(requests, now_fn=time.monotonic):batch = []# MAX_BATCH_SIZE and MAX_WAIT_MS must be calibrated against the first-token# latency SLO, and must distinguish first-token latency from full-generation latency.for req in requests:if not batch:batch.append((now_fn(), req))else:batch.append((now_fn(), req))full = len(batch) >= MAX_BATCH_SIZEtimeout = (now_fn() - batch[0][0]) >= MAX_WAIT_MSif full or timeout:dispatch_to_accelerator([item[1] for item in batch])batch = []if batch:dispatch_to_accelerator([item[1] for item in batch])
The core of this logic is finding a balance point between throughput and latency. Batching raises throughput, but waiting too long pushes up end-to-end latency; waiting too little lowers accelerator utilization. From an engineering perspective, inference cost can be roughly understood as:
Inference cost ≈ accelerator-hour unit price ÷ effective throughput
Effective throughput, in turn, is jointly affected by per-accelerator throughput, effective batch size, KV Cache management, queuing latency, and idle rate.
3. The Cloud Compute Foundation: Three Layers That Support LLMs
Whether training or inference, both rely on a complete cloud infrastructure. The capability categories below are not tied to specific products; implementation details should follow each vendor’s documentation.
Layer 1: Elastic Compute and High-Speed Networking
LLM demand for compute resources is clearly elastic. Training requires spinning up large-scale clusters, while inference needs to scale with traffic. The foundation typically needs to provide:
- On-demand, rapidly provisioned large-scale accelerated compute instances;
- High-bandwidth, low-latency network interconnect to support multi-node, multi-accelerator coordination;
- Resource pooling so resources can be managed centrally and allocated on demand;
- Job-level isolation and quota management to prevent different workloads from interfering with each other.
Layer 2: Tiered Storage That Is Both High-Performance and Low-Cost
Training data, checkpoints, and model artifacts are often enormous. A single storage solution can rarely meet both performance and cost requirements, so tiering is a common approach:
- Hot data: checkpoints during training and frequently accessed samples, placed on a high-performance storage tier to guarantee read/write throughput;
- Warm and cold data: historical corpora, archived models, and low-frequency logs, moved down to low-cost tiers such as object storage;
- Cache layer: reduces repeated reads and lowers pressure on the underlying storage;
- Lifecycle management: sets automatic cleanup or archival policies for expired data, temporary files, and archived data.
Layer 3: Orchestration, Scheduling, and End-to-End Observability
Managing large-scale clusters is impossible without container orchestration and scheduling systems. Their value shows up in three main areas:
- Abstracting tasks such as training, inference, and data processing into orchestratable workloads, enabling automated provisioning, scaling, and self-healing from failures;
- Combining job priorities with resource quotas so that training and inference can share a cluster while reducing contention;
- Using logs, metrics, distributed tracing, and monitoring/alerting to observe utilization, latency, failure rates, and resource fragmentation in real time.
Cost observability here is not simply reading a bill; it means mapping resource consumption to business metrics. For example: which jobs consume large amounts of accelerated compute, which inference services have high idle rates, which storage tiers amplify cost through reads and writes, and which failures cause wasteful recomputation.
4. Cloud Vendors and Model Companies: A Symbiotic Relationship
Putting these three layers back into an industry view, the relationship between cloud infrastructure providers and model companies is not a simple buyer-seller one, but a two-way enablement.
- For model companies, stable compute supply is the prerequisite for iteration. Long-term, predictable resource guarantees usually matter more than a one-time low price.
- For cloud providers, LLM training and inference is an important scenario driving compute, storage, network, and scheduling demand; large-scale, long-duration compute consumption brings continuous business growth.
- For the ecosystem, model capability and infrastructure form a positive feedback loop: stronger models attract more users, more users bring more compute consumption, which in turn supports larger infrastructure investment.
From a technical perspective, the party that owns large-scale cloud infrastructure is more likely to hold an advantageous position in this round of compute competition—but this does not constitute investment advice. As a cloud service provider, Baidu AI Cloud, through general capability categories such as elastic compute, object storage, container platforms, log services, and monitoring/alerting, provides composable and scalable infrastructure support for different types of AI workloads, helping enterprises balance compute investment against business value. This is a technical-perspective analysis and does not constitute investment advice or a product performance commitment.
5. Engineering Practices: Making Compute Investment More Sustainable
For most enterprises, there is no need to replicate the cluster scale of the leading model companies, but they face the same problem: “compute is expensive and hard to use well.” The following practices have broad reference value.
- Match resources to each stage: use high-spec clusters for concentrated breakthroughs in training, and elastic resources that scale on demand for inference, rather than using one configuration for all scenarios.
- Treat utilization as the primary metric: cluster monitoring should not only check “is it online” but also the actual utilization of GPUs/accelerators. Low utilization often means a bottleneck in data supply, scheduling, or communication.
- Use checkpoints and fault tolerance to cut recomputation cost: save checkpoints automatically and frequently so that failures recover instead of starting over. Checkpoints are best saved as multiple off-site replicas; object storage can enable versioning and delete protection to avoid accidental deletion or overwrite.
- Do fine-grained cost governance on the inference side: combine batching, quantization, KV Cache management, and auto-scaling to bring cost per request into a sustainable range. Quantization requires evaluating accuracy loss and regression-testing against an evaluation set.
- Build a closed observability loop: use logs, metrics, and distributed tracing to connect the observation path from the application down to the underlying resources, so cost anomalies can be detected and attributed promptly.
Example: Resource Auto-Scaling Strategy
The following is corrected auto-scaling pseudocode. The core idea is to drive scaling with business metrics rather than manual experience, while adding upper/lower bounds, a cooldown window, and latency safeguards to avoid scaling jitter.
import mathimport timedef autoscale(current_qps, latency_p99, replicas,last_change_ts, now_ts):# QPS_PER_INSTANCE, LATENCY_SLO_MS, MIN_REPLICAS, MAX_REPLICAS,# COOLDOWN_SEC must be calibrated against your own load tests, SLO, and budget.# It is recommended to run load tests before launch, then roll out gradually.replicas_eff = max(replicas, MIN_REPLICAS)# 1) QPS-based target: avoid division by zero when replicas=0if QPS_PER_INSTANCE > 0:target_qps = math.ceil(current_qps / QPS_PER_INSTANCE)else:target_qps = replicas_efftarget_qps = max(replicas_eff, target_qps)# 2) Latency-based target: not masked by the QPS branchif latency_slo_ms > 0 and latency_p99 > 0:target_latency = math.ceil(current_qps * latency_p99 / latency_slo_ms)else:target_latency = replicas_efftarget_latency = max(replicas_eff, target_latency)# 3) For scale-out, take the larger of the two targetstarget = max(target_qps, target_latency)# 4) Scale-in only looks at throughput, with a cooldown window to avoid flappingif (now_ts - last_change_ts >= COOLDOWN_SEC andreplicas_eff > MIN_REPLICAS andcurrent_qps / replicas_eff < QPS_PER_INSTANCE * 0.4):if QPS_PER_INSTANCE > 0:down_target = math.ceil(current_qps / QPS_PER_INSTANCE)else:down_target = MIN_REPLICAStarget = min(target, max(MIN_REPLICAS, down_target))# 5) Bounds protection: prevent unbounded scale-out or scaling down to zerotarget = max(MIN_REPLICAS, min(MAX_REPLICAS, target))return target
The key to this logic: scale-in must have a cooldown window, scale-out must consider both QPS and latency, and the number of resources must have a minimum-instance floor and a maximum-instance ceiling. Auto-scaling without bounds easily turns a stability problem into a cost problem.
Inference Cost Self-Check Checklist
When inference cost is abnormal, troubleshoot in the following order:
- How to dampen a sudden QPS spike: check whether there is a cooldown window, a max-instance limit, and min-instance protection; avoid repeatedly scaling up and down in a short time.
- When first-token latency P99 exceeds the SLO: first look at queuing, then at batching parameters, and finally at whether the KV Cache is too large, the context is too long, or memory is insufficient.
- When GPU utilization is low: first check whether data supply is insufficient, then whether communication is the bottleneck, and finally whether scheduling is causing resource fragmentation or jobs waiting.
- When cost suddenly rises: check for long-idle instances, excessive log writes, object storage request amplification, too-frequent checkpoints, or abnormal retries.
6. FAQ: LLM Compute Requirements
How do I choose?
First determine whether the main scenario is training or inference. For training, prioritize high-speed interconnect, cluster stability, and checkpoint capability; for inference, prioritize elastic scaling, latency control, KV Cache management, and cost per request. Do not look only at single-accelerator performance—look at end-to-end effective throughput.
What are common mistakes?
Common mistakes include: only checking whether instances are online, not their utilization; reserving resources long-term for peak traffic; treating batching as an unconditional optimization; ignoring the impact of KV Cache on memory; saving checkpoints as a single replica; auto-scaling without a cooldown window or bounds; and going live without load-testing first.
What should I pay attention to?
Pay attention to risk control and observability. Load-test before gray-releasing auto-scaling, and set a minimum-instance floor; save checkpoints as multiple off-site replicas; pay attention to versioning and delete protection for object storage; evaluate accuracy loss when quantizing; and make sure the monitoring system can pinpoint the job, queue, storage, and network layers.
7. Conclusion
LLM companies going to the capital markets is one sign that the AI industry is maturing, but what determines long-term competitiveness is not the valuation itself, but whether one can make good and economical use of a capital-intensive, tightly coupled compute foundation. Technical teams need to build an end-to-end compute engineering mindset: for training, look at parallelism, interconnect, and fault tolerance; for inference, look at throughput, latency, and cost; for the foundation, look at elastic compute, tiered storage, orchestration/scheduling, and a closed observability loop. Turning limited compute into sustainable business value is the most critical infrastructure logic behind LLM commercialization.
