arXiv(opens in a new tab)cs.PLSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.05364

Design Docs Are All You Need: An AI-native Machine-Learning Performance Tool

Samuel Kushnir, Kimia Noorbakhsh, Kavya Sreedhar, Liqun Cheng, Ming Liu, Parthasarathy Ranganathan, Mohammad Alizadeh, Fred Kjolstad, Suvinay Subramanian

Abstract

Machine-learning performance modeling is a uniquely hostile terrain for long-lived software: the assumptions baked into today's abstractions are invalidated by tomorrow's models and systems, forcing perpetual refactoring of performance-modeling frameworks. Meanwhile, AI coding agents have become fast and capable enough that regenerating an entire library is cheaper than paying down the tech debt of incrementally patching it. We describe SMART, a rigorous symbolic performance-modeling library for ML systems whose main branch contains almost no code: the repository is a DAG of self-contained natural-language design docs, coding sub-agents regenerate the implementation from only the docs on new version updates, and every human change is a natural-language edit to a doc—self-documenting by construction. Two ingredients make regeneration reliable: (i) a design-doc style built around step-by-step worked examples that act as in-context demonstrations for the generating agents, and (ii) a minimal, recursively defined operator IR with symbolic (SymPy) cost expressions, a fast analytical roll-up mode for large sweeps, and a slow modulo-scheduling mode for fine-grained schedule studies. Regenerated implementations reproduce hand-audited reference models—including DeepSeek-V3 serving on a TPU pod slice—to round-off precision, suggesting that design docs—not code—can be the durable artifact for ML-systems co-design tools.

1 Introduction

Machine-learning performance modeling is a punishing environment for software abstractions, because the assumptions of current architectures and systems are constantly evolving. An abstraction that seemed reasonable a year ago—for instance, that every transformer layer looks the same—is suddenly false in the face of mixture-of-experts routing, latent attention, and heterogeneous inference phases. Performance-modeling frameworks sit at the intersection of the two fastest-moving parts of the stack—rapidly evolving model architectures on top, and underlying hardware accelerators and interconnects on the bottom—so they absorb this churn from both directions; the result is a never-ending stream of refactorings and hacks to absorb each new architecture or system change into an aging framework.

At the same time, AI coding tools have become remarkably capable and fast. Together, these two forces produce failure modes that compound technical debt:

  1. Incremental generation debt (predates AI). Let StS_t denote the specification of a library at time tt and let GG denote a code generator—a human engineer or an agent. A greenfield build computes Ct=G(St)C_t = G(S_t). In practice, however, the generator at time t+1t+1 is handed the previous implementation as an extra argument and computes Ct+1=G(St+1,Ct)C_{t+1} = G(S_{t+1}, C_t). We can define the technical debt of this process as
Dt+1=∥G(St+1,Ct)−G(St+1)∥,(1)D_{t+1} = \| G(S_{t+1}, C_t) - G(S_{t+1}) \|, \tag{1}

Figure

Figure 1: The regeneration workflow: sub-agents regenerate the implementation from the design-doc DAG in dependency order, and the result must pass reconciliation against hand-built references before it replaces the previous build. Humans only ever edit the docs.

the distance between the incrementally patched system and the one that would have been built from the current spec alone. Because starting over—deleting all of one's code—is mentally challenging and time-consuming for humans, the technical debt is in practice much larger than zero: incremental patches inevitably introduce compromises that compound with every spec revision.

  1. Context-window myopia AI coding agents are constrained by finite context windows, making it impossible to pass an entire mature codebase into a single prompt. Consequently, developers must feed the agent fragmented, localized code snippets when requesting revisions. Because the agent cannot see the whole picture—missing global invariants, cross-module dependencies, and the broader architectural intent—it frequently generates code that is locally plausible but globally sub-optimal. Over time, these piecemeal, context-blind updates degrade the structural coherence of the framework.

To solve these problems while exploiting the speed of AI coding agents, we make natural-language design docs the durable artifact and treat code as a regenerable build product (Section 2). Reliable regeneration imposes real demands on how docs are written (Section 2) and how the modeled system is factored into abstractions (Section 3). Because Ct=G(St)C_t = G(S_t) is recomputed from scratch on a regular cadence, Equation (1) is driven to zero by construction. This complete regeneration workflow is illustrated in Figure 1.

References (4)

  • Advances in Neural Information Processing Systems, 33:1877–1901, 2020
  • A Survey on In-context Learning
  • symbolic computing in Python
  • Roofline: an insightful visual performance model for multicore architectures