Compute-Optimal Is Not Cluster-Optimal: Systems-Aware Scaling for Sparse Mixture-of-Experts
Summary (Overview)
-
MOSAIC framework: The paper introduces MOSAIC (Model Optimization via Systems-Aware TraIning Co-design), a unified optimization framework that jointly selects model architecture, training-token budget, and distributed parallel execution layout for sparse Mixture-of-Experts (MoE) language models, rather than treating scaling laws and systems tuning as disconnected stages.
-
Key finding on sparsity: Under a model-FLOPs budget alone, MoE sparsity admits no interior optimum—the fitted loss decreases monotonically with sparser models, driving the optimum to the upper boundary of the calibrated sparsity range. An interior, meaningful optimal sparsity emerges only when hardware-deliverable FLOPs (accounting for MFU, communication, and memory constraints) replace raw model FLOPs as the budget.
-
New scaling law: The authors fit a four-dimensional joint scaling law over total parameters, sparsity, training tokens, and expert split factor, spanning active parameters from 104M to 2.7B and total model sizes up to 79B parameters. The expert split factor enters with an identified exponent .
-
Performance model validation: An operator-level analytical performance model (released as ScalePlan) predicts MFU with mean absolute percentage error under 15% across sweeps up to 18B active parameters, with 100% Top-5 overlap in configuration ranking for large models.
-
Empirical validation: Staged pretraining runs up to 250B total parameters confirm that the loss ordering flips between the model-FLOPs axis and the hardware-compute axis, validating the co-design principle that compute-optimal configurations are not necessarily cluster-optimal.
Introduction and Theoretical Foundation
Background and Motivation
Traditional large-scale pretraining decouples architecture selection from systems optimization:
- Scaling law stage: Selects architecture and training recipe by optimizing loss under a compute constraint (e.g., Chinchilla-style laws over model size and token count ).
- Systems stage: Optimizes implementation for hardware efficiency, taking model size as given.
This separation is consequential because two architectures with the same predicted quality can differ several-fold in training throughput once attainable MFU and best parallel layout are accounted for. The paper argues that the architecture chosen by a scaling law should account for systems efficiencies rather than model FLOPs alone.
Theoretical Foundation
The central theoretical contribution is the concept of deliverable model FLOPs, which replaces the architecture-independent model-FLOPs budget:
where is the raw hardware ceiling, MFU is the Model FLOPs Utilization, and is the goodput fraction.
MFU is defined as:
The key insight is that is architecture-dependent: different architectures achieve different MFU values, so a fixed hardware budget translates into different amounts of useful computation depending on the chosen model geometry.
Key Definitions
The paper introduces two architectural knobs that parameterize the sparse MoE scaling laws:
- Sparsity: , the fraction of parameters inactive per token.
- Expert split factor: , the ratio of the dense FFN width to a single expert's hidden width, measuring how finely the dense FFN is partitioned into experts.
Methodology
MOSAIC Optimization Formulation
MOSAIC solves a bilevel mixed-integer nonlinear program (MINLP):
where:
- is the architecture decision variable (a realizable sparse MoE geometry)
- is the number of training tokens
- is the execution plan
- collects execution plans satisfying memory constraints:
Joint Scaling Law
The fitted scaling law incorporates total parameters, sparsity, training tokens, and expert split factor:
The fitted coefficients (with 95% BCa confidence intervals) are:
| Coeff. | Value | 95% BCa CI | Identifiability |
|---|---|---|---|
| 8.462 | [8.24, 8.85] | ridge | |
| 88.32 | [87.8, 89.9] | ridge | |
| 0.1828 | [0.181, 0.184] | ridge | |
| 0.7123 | [0.710, 0.713] | ridge | |
| 0.3129 | [0.307, 0.316] | ridge | |
| 0.1048 | [0.104, 0.106] | ridge | |
| 0.2070 | [0.206, 0.208] | identified | |
| 0.1249 | [0.119, 0.138] | ridge | |
| 0.5567 | [0.550, 0.577] | ridge | |
| 0.1702 | [0.167, 0.174] | ridge | |
| +0.9513 | [+0.911, +0.954] | identified |
The expert split factor exponent is a robust observation: larger discounts the loss penalty that sparsity imposes at fixed capacity.
Performance Model (ScalePlan)
The performance model estimates MFU and memory using:
-
Microbenchmarks on target hardware for: dense GEMMs, grouped GEMMs (MoE expert MLP), SDPA attention, top-k routing, cross-entropy, NCCL collectives, and CPU dispatch gaps.
-
Iteration-time model with three key components:
- Compute vs. dispatch: for the per-microbatch wall time, where
- Pipeline bubble: under 1F1B scheduling
- Vocabulary-stage imbalance:
-
Single calibration term capturing cross-node straggler and overlap effects:
Geometry Scaling Ladder
The search space is structured via a geometry ladder where layer count and head count follow with multiplier , residual width , and reference dense FFN width . A single seed fixes the backbone geometry.
Empirical Validation / Results
Scaling Law Findings
Boundary-seeking sparsity: Under a fixed model-FLOPs budget , the optimal sparsity lies at the upper boundary of the calibrated range. Three monotone trends hold over :
- Optimal total parameters increases monotonically with
- Optimal active parameters decreases
- Optimal loss decreases monotonically at every
The joint law achieves held-out RMSE of 0.00779 in loss units on the largest 10% of runs by within each stratum, with .
Performance Model Validation
Validation spans three sweeps on AWS p6-b200.48xlarge nodes (8 NVIDIA B200 GPUs each):
| Model | Nodes | MAPE | ||
|---|---|---|---|---|
| 0.7B | 16B | 4 | 9.6% | |
| 5.4B | 127B | 32/64 | 9.0% | |
| 18B | 434B | 64 | 13.2% |
Top-5 overlap between predicted and measured MFU rankings is 100% for 5.4B and 18B sweeps, 80% for 700M. The dominant systems lever is the pipeline fill ratio , explaining up to 3.1× layout spread in MFU.
MOSAIC Optimization Results
Optimal configuration under fixed envelope (32 p6 nodes, 20 days, FLOPs):
| E | K | G | (B) | S | TPP | D(T) | MFU (%) | Loss | pp | ep | mb | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 48 | 96 | 2 | 4 | 14.5 | 0.956 | 98 | 1.42 | 12.38 | 1.3898 | 8 | 8 | 4 |
Key insight: The candidate that realizes the most model FLOPs ( FLOPs, a G=2, E=32 geometry) is NOT the lowest-loss configuration. The optimal configuration reaches on model FLOPs—roughly 36% fewer than the rightmost candidate. Expert split factor orders the spread: G=8 geometries sit at low (median MFU ~8%), while G=2 geometries reach the right end (13–20% MFU).
Budget Sweeps
- Optimal sparsity sits on a wide plateau (roughly 0.915–0.963) and does not sharpen with budget—no monotone sparsity trend under hardware constraints (unlike model-FLOPs optimality).
- Optimal expert split factor is 4 across most budgets, with G=8 appearing only at the longest window and G=2 at the largest node budget.
- Active parameters stay near 14–15B across the days range, growing to 34B and 58B at the two largest node budgets.
Staged Pretraining Validation
Four configurations were selected from MOSAIC's ranked predictions on an 8-node, 10-day envelope:
| ID | E | K | G | (B) | (B) | S | pred. MFU (%) | norm. actual MFU | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 40 | 128 | 2 | 4 | 8.5 | 250.0 | 0.966 | 14.0 | 0.84 |
| 2 | 40 | 128 | 2 | 8 | 5.6 | 126.4 | 0.956 | 11.6 | 0.69 |
| 3 | 40 | 32 | 2 | 4 | 8.5 | 66.0 | 0.872 | 21.8 | 0.91 |
| 4 | 32 | 32 | 2 | 2 | 7.3 | 65.8 | 0.889 | 23.3 | 1.0 |
Results:
- The predicted MFU ranking reproduces exactly on hardware (rank correlation aligned).
- On the model-FLOPs axis, ID 2 (G=8, low active count) holds an advantage over much of the range; on the hardware-compute axis (), ID 1 (G=4, higher MFU) leads—the loss ordering flips between axes, confirming the co-design effect.
Theoretical and Practical Implications
Theoretical Contributions
-
Reframing the budget: The paper demonstrates that model FLOPs is an inadequate fairness metric for sparse MoE architecture selection. The appropriate budget is hardware-deliverable FLOPs, which is architecture-dependent through the MFU term.
-
Emergence of interior optima: The boundary-seeking sparsity under model-FLOPs budgets becomes an interior optimum once systems constraints (memory floor, GPU-hour costs, all-to-all penalties) are imposed. This emerges naturally from constraints rather than explicit caps on model dimensions.
-
Identified scaling exponent: The expert split factor exponent is identified (not on the coefficient ridge), quantifying how finer-grained experts soften the sparsity penalty at fixed memory footprint—a benefit that must be priced against communication overhead.
Practical Implications
-
Unified co-design: Practitioners should select architectures and parallel layouts jointly rather than in disconnected stages. The Kimi-K2 approach of treating MoE scaling laws and systems tuning separately is explicitly called out as consequential at scale.
-
Design rules for MoE parallelism: The MFU sweeps yield concrete rules: the pipeline fill ratio is the dominant lever; expert parallelism helps up to the node boundary and hurts past it; fix , set to the scale-up domain, and keep .
-
Hardware-dependent optimal geometry: The optimal sparsity and expert split factor are functions of cluster size and training window, not universal constants. Larger hardware budgets support larger active parameter counts.
Conclusion
Main Takeaways
MOSAIC demonstrates that compute-optimal configurations are not necessarily cluster-optimal for sparse MoE language models. By coupling a four-dimensional scaling law with an operator-level performance model, the framework shows that:
- Model-FLOPs-only optimization drives sparsity to the boundary of the calibrated range
- Hardware constraints (memory, communication, MFU) create an interior optimal sparsity
- The architecture that minimizes loss under a fixed hardware envelope is not the one that emits the most model FLOPs
- Loss ordering between configurations flips between model-FLOPs and hardware-compute axes, validating the co-design principle
Limitations
- Results are conditional on the chosen geometry ladder, hardware platform (NVIDIA B200), and training recipe
- Some reported optima require substantial extrapolation beyond the scaling law training regime
- Uncertainty in non-identified scaling law coefficients is not propagated through the discrete search
- The performance model mirrors a basic Megatron-Core stack; the absence of monotone trend in optimal may be an artifact of that stack's systems penalty
- Expert split factor is limited to
- The overtrained regime (beyond tokens-per-parameter ratio ~70) is not studied
Future Directions
- Joint batch-size and parallelism optimization: Extend the decision space to include global batch size
- Broader geometry families: Test whether the representation transfers across backbone geometries, incorporating hardware-friendly tile/wave constraints
- Communication-computation overlap: Extend the performance model to represent persistent/fused kernels that overlap collectives with computation
- Test-time scaling laws: Apply the co-design framework to inference under hardware costs
Related papers
- OasisKV: Scaling In-Decode KV Cache Beyond HBM with Lookahead Sparse Prefetching
OasisKV uses speculative decoding's draft tokens to predict future KV-cache access, enabling asynchronous prefetching that boosts LLM inference throughput up to 2.1x with negligible accuracy loss.
- Harness Continual Learning: Continual Adaptation Beyond Model Parameters
Harness Continual Learning enables frozen foundation models to accumulate capabilities by evolving prompts, memories, and tools around them, with guarded updates preventing harness-level forgetting.
- Phantom Gains: Auditing Self-Improvement Against a Measured Null
Transition-level auditing of LLM self-improvement requires measured nulls for every statistic; without them, a frozen model falsely appears to expand at 0.280.