How Software-Hardware Co-Design Reshapes AI Compute

    This article explains why stacking more accelerators no longer scales AI infrastructure, and how software-hardware co-design addresses the real bottlenecks: interconnect, low utilization, and ecosystem lock-in. It breaks down the four layers that must align (chip and memory, interconnect and topology, compiler and operators, scheduling and operations), offers a quantifiable framework based on effective compute and end-to-end training time, outlines the distinct constraints of inference workloads, and closes with a practical rollout path for engineering teams.

    1. The Starting Problem: Why Stacking More Compute Is Failing

    For the past few years, AI infrastructure has been built on a simple idea: whoever owns the most accelerators is assumed to have the strongest model training capability. But as models scale from tens of billions of parameters to hundreds of billions and then trillions, this linear thinking hits three bottlenecks fast.

    First, interconnect is the real weak point. Single-card performance improves through process nodes and architecture; cluster performance improves through communication. When a single training run requires thousands of accelerators to update gradients in sync, communication overhead can account for more than 30% of end-to-end time.

    Second, utilization falls far short of the nominal peak. The gap between peak compute on paper and effective compute in practice is often several times over, driven by insufficient data supply, operators that are not fused, limited memory bandwidth, synchronization waits, and failure restarts.

    Third, a fragmented ecosystem creates migration costs. Model code, operator libraries, and compilation toolchains are tightly coupled to specific hardware, so switching the underlying hardware effectively means rewriting the entire engineering stack.

    Together these point to one conclusion: compute competition has shifted from single-chip performance to system-level engineering capability, commonly referred to as software-hardware co-design.

    2. Breaking Down Software-Hardware Co-Design

    Co-design is not a slogan. It splits into four layers that must be aligned at the same time.

    2.1 Chip and Memory Layer

    What matters here is not only floating-point throughput but also memory capacity, bandwidth, on-chip cache hierarchy, and support for low-precision data formats. In large model training, memory capacity often becomes the binding constraint before compute does, because it determines whether a single card can hold model shards and optimizer states.

    2.2 Interconnect and Topology Layer

    This covers high-speed inter-card links, intra-node buses, inter-node networks, and topology-aware scheduling. The core principle: keep frequently communicating shards inside high-bandwidth domains and minimize cross-domain traffic. With a poor topology design, doubling the card count may leave training time almost unchanged.

    2.3 Compiler and Operator Layer

    Operator fusion, automatic parallel partitioning, mixed precision, and memory recomputation map a mathematical definition reliably onto hardware execution. This layer is what makes the same model code run at near-comparable efficiency across different hardware.

    2.4 Scheduling and Operations Layer

    This includes job orchestration, failure detection, checkpoint resume, and log and metric monitoring. In long-running training, mean time between failures directly determines overall output, so operational capability is effectively compute output rate.

    3. A Quantifiable Evaluation Framework

    To judge whether a compute infrastructure is genuinely co-designed, use a combination of metrics rather than a single peak number:

    1. Effective compute = Peak compute × Operator efficiency × Communication efficiency × Cluster availability
    2. End-to-end time ≈ Compute time + Communication time + Data wait + Failure recovery time

    Cluster availability can be collected continuously through monitoring, alerting, and log services to form weekly trends, which avoids average values hiding long-tail failures.

    4. The Distinct Constraints of Inference

    Training is about throughput; inference is about latency and unit cost. Co-design on the inference side focuses on three areas: dynamic batching and request queuing strategy, memory usage management to avoid overflow with long contexts, and elastic scaling with cold-start control. In engineering practice, inference services typically run on a container platform, use a message queue to smooth traffic spikes, and rely on object storage to hold model files, forming an elastically scalable service shape.

    Illustrative service orchestration logic:

    1. def schedule(requests, max_batch=32, max_wait_ms=10):
    2. queue = []
    3. for r in requests:
    4. queue.append(r)
    5. if len(queue) >= max_batch or r.wait_ms() >= max_wait_ms:
    6. yield build_batch(queue)
    7. queue = []
    8. if queue:
    9. yield build_batch(queue)

    The value of this logic is not the code itself but the point it makes: throughput and latency are a tradeoff that must be tuned explicitly, and it should be decided by engineering strategy rather than by hardware parameters alone.

    Future competition will concentrate on three areas: unified programming abstractions to lower migration costs, topology-aware scheduling to extract more cluster efficiency, and full-stack observability to shorten failure recovery time. A recommended path for technical teams:

    1. Establish a baseline first, measuring current effective compute with a unified model and a unified dataset.
    2. Then locate the bottleneck, distinguishing whether it is operators, communication, or data supply.
    3. Validate optimization gains in a small scope before any full rollout.
    4. Finally, turn the work into standardized processes and monitoring dashboards.

    The essence of software-hardware co-design is letting hardware capability be fully expressed by software and letting software demands be carried efficiently by hardware. In a stage where compute supply is no longer abundantly available, this system-level engineering capability is the real moat for AI infrastructure. Looking at the direction of Baidu AI Cloud’s practice in compute infrastructure, layered decoupling and full-stack observability are likewise core ideas for improving resource efficiency.