TL;DR
NeuSight is a novel performance forecasting framework that predicts the training and inference latency of deep learning models on new, "unseen" GPUs without requiring actual execution. By decomposing complex GPU kernels into smaller, hardware-aligned "tiles" and bounding predictions with fundamental performance laws, NeuSight reduces prediction errors for models like GPT-3 on H100 GPUs from over 120% in prior state-of-the-art work to just 2.3%.
What Problem Does This Paper Address?
In the current AI arms race, model sizes and GPU capabilities are both growing exponentially. However, the latest hardware—like NVIDIA’s H100—is often prohibitively expensive or has lead times exceeding a year. Researchers and engineers face a "chicken-and-egg" problem: they need to design new model architectures for future hardware, but they can't accurately gauge performance without having the hardware in hand.
Existing performance models generally fall into two camps: slow, cycle-accurate simulators that take days to run, or "black-box" machine learning models that predict latency directly. These ML models often fail spectacularly when asked to predict performance for a GPU or a model size they haven't seen before (out-of-distribution scenarios) because they don't account for the underlying physical laws of GPU execution or the specific ways software libraries optimize kernels.
Methods
NeuSight shifts the paradigm from predicting total latency to predicting device utilization at a tile-granularity. Its workflow consists of three main stages:
- Kernel Decomposition: Instead of looking at a massive matrix multiplication as one block, NeuSight breaks it down into "tiles"—the small, independent working sets that GPU libraries (like cuDNN) actually dispatch to Stream Multiprocessors (SMs).
- Hybrid Prediction:
- It uses a simple Multi-Layer Perceptron (MLP) to predict the utilization of hardware resources for a single tile based on architectural features (peak FLOPS, memory bandwidth, L2 cache size).
- It then applies fundamental performance laws (like the Roofline model) to bound these predictions, ensuring the model never predicts performance that exceeds physical limits.
- It accounts for latency hiding by modeling how GPUs schedule multiple "waves" of tiles to keep the SMs busy (see Figure 5).
- Aggregation: The framework extracts the model's dataflow graph using
Torch.fx, predicts the latency for every kernel, and aggregates them. For distributed setups, it integrates network latency estimates for operations like All-Reduce.
Datasets
The authors trained NeuSight using a diverse collection of ~150,000 data points gathered from:
- NVIDIA GPUs: P4, P100, V100, T4, and A100-40GB.
- AMD GPUs: MI100 and MI210.
- Operators: GEMM (General Matrix Multiplication), fully-connected layers, element-wise ops (ReLU, Tanh), Softmax, and Layer Normalization.
For evaluation, they tested on unseen hardware (H100, L4, A100-80GB, and MI250) and unseen model dimensions (GPT-3 2.7B, OPT 1.3B, and Switch Transformer).
Key Insights and Ideas
- Tiling is the "Atomic" Unit: The most critical insight is that GPU execution is inherently tiled. By training the ML model on tile-sized problems (which are relatively consistent across generations), the framework generalizes much better to massive models than a model trained on end-to-end latencies.
- Utilization > Latency: Latency is a complex, non-linear result of many factors. Utilization is a more stable metric to predict. By calculating
Latency = Work / (Peak_Capacity * Utilization), the authors ground the ML prediction in physics. - Hardware-Software Co-design: NeuSight doesn't just look at the chip; it looks at how libraries like CUTLASS partition work. This allows it to capture the "staircase" effect of GPU performance, where adding a small amount of work might trigger an entire new "wave" of execution, significantly increasing latency.
Key Results
NeuSight demonstrated remarkable robustness across different vendors and generations:
- Unseen GPUs: On the H100, NeuSight achieved an average error of only 8.1%, while prior methods like Habitat and Li et al. saw errors as high as 724% and 94%, respectively.
- GPT-3 Training: Specifically for GPT-3 on an H100, it reduced error to 2.3%.
- Cross-Vendor: Even when trained primarily on NVIDIA, it predicted AMD MI250 performance with an average error of 8.8% for inference.
- Distributed Training: For 4-GPU distributed setups (NVLink/DGX), the average error remained low at 7.7%.
Limitations and Future Work
- Small Model Overhead: The framework is slightly less accurate for very small models (like BERT on H100) because fixed software/library overheads—which NeuSight doesn't model in depth—become a larger percentage of the total execution time.
- New Operator Types: While it handles the most common DNN kernels, "exotic" or brand-new operators are currently treated as simple memory-bound tasks. The authors suggest adding specialized predictors for these as they become common.
- Multi-Node Validation: While NeuSight supports multi-node forecasting, the authors could not validate predictions for massive clusters (e.g., 3,000+ nodes) due to the obvious lack of access to such resources—the very problem NeuSight aims to solve!
Summary updated