Asynchronous Sharpness-Aware Minimization For Fast and Accurate Deep Learning
Organizations: Inha University
Abstract
Sharpness-Aware Minimization (SAM) is an optimization method that improves the generalization performance of machine learning models. Despite its effectiveness, it has not been widely adopted in real-world applications due to its high computational cost. Existing approaches reduce this overhead by approximating or reusing gradients in the perturbation step, but still assume sequential perturbation and update steps. In this study, we introduce AsyncSAM, a variant of SAM that enables concurrent model perturbation and parameter updates across multiple compute resources. By adjusting the perturbation batch size in a system-aware manner, our asynchronous scheme fully overlaps perturbation with updates, eliminating the overhead and allowing even CPUs to perform perturbations without extra time. We also provide theoretical analysis showing that AsyncSAM achieves the same order of convergence as conventional SAM. Extensive experiments demonstrate that AsyncSAM delivers superior generalization performance and the highest training throughput among state-of-the-art SAM variants. For example, in ViT fine-tuning on CIFAR-100, it achieves accuracy comparable to SAM while maintaining training time nearly identical to SGD.
Figures & tables
| Method | Small Batch | No Variance | Model | Unbiased | Efficient | Input Data- | Overlap Perturbation | System-aware |
|---|---|---|---|---|---|---|---|---|
| Availability | Tracking | Agnostic | Gradient | Perturbation | Independent | with Update | Batch Size | |
| SAM | ✓ | ✓ | ✓ | ✓ | ✗ | ✓ | ✗ | ✗ |
| Generalized SAM | ✓ | ✓ | ✓ | ✓ | ✗ | ✓ | ✗ | ✗ |
| SAM-ON | ✓ | ✓ | ✗ | ✓ | ✓ | ✓ | ✗ | ✗ |
| ESAM | ✓ | ✓ | ✓ | ✗ | ✓ | ✗ | ✗ | ✗ |
| LookSAM | ✗ | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ |
| Algorithm | CIFAR-10 | CIFAR-100 | Oxford_Flowers102 | Google Speech | CIFAR-100 | Tiny-ImageNet | ImageNet |
|---|---|---|---|---|---|---|---|
| (ResNet20) | (WRN-28) | (WRN-16) | (CNN) | (ViT Fine-Tuning) | (ResNet50) | (ResNet50) | |
| SGD | |||||||
| SAM | |||||||
| Generalized SAM | |||||||
| ESAM | |||||||
| LookSAM |
| Algorithm | CoLA | SST-2 | MRPC | STS-B | QQP | MNLI | QNLI | RTE | All |
|---|---|---|---|---|---|---|---|---|---|
| Mcc | Acc | Acc | Corr | Acc | m/mm | Acc | Acc | Avg | |
| SGD | |||||||||
| SAM | |||||||||
| ESAM | |||||||||
| LookSAM | |||||||||
| AsyncSAM |
| Benchmark | Perturbation | Update | Time (s) | Valid. Acc | |
|---|---|---|---|---|---|
| CIFAR-10 | RTX A6000 | RTX A6000 | |||
| EPYC 7452 | RTX A6000 | ||||
| RTX 4060 | RTX 4060 | ||||
| i9-13900HX | RTX 4060 | ||||
| i7-12650H | RTX 4060 | ||||
| Oxford | RTX A6000 | RTX A6000 |
| Benchmark | Validation Accuracy | ||
|---|---|---|---|
| CIFAR-10 (ResNet20) | 128 | 16 | |
| 32 | |||
| 64 | |||
| 128 | |||
| Oxford_Flowers102 | 40 | 5 | |
| 10 |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Model | Batch Size | Init. Learning Rate | Number of Epochs |
|---|---|---|---|---|
| CIFAR-10 | ResNet20 | 128 | 0.1 | 150 |
| CIFAR-100 | Wide-ResNet-28 | 128 | 0.1 | 200 |
| Oxford_Flowers102 | Wide-ResNet-16 | 40 | 0.1 | 100 |
| Google Speech | CNN | 128 | 0.1 | 10 |
| CIFAR-100 | ViT-b16 | 40 | 0.01 | 20 |
| Tiny-ImageNet | ResNet50 | 256 | 0.1 | 200 |
| Optimizer | Settings |
|---|---|
| SGD | momentum = |
| SAM | |
| Generalized SAM | , |
| ESAM | , , |
| LookSAM | , gradient ascent reuse interval = 2 |
| MESA | , , , start epoch = 5 |
| Dataset | CoLA | SST-2 | MRPC | STS-B | QQP | MNLI | QNLI | RTE |
|---|---|---|---|---|---|---|---|---|
| Batch Size | 128 | 128 | 128 | 128 | 128 | 128 | 128 | 128 |
| Learning Rate | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 | 0.001 |
| Number of Epochs | 10 | 10 | 10 | 10 | 10 | 10 | 10 | 10 |
| 0.01 | 0.01 | 0.01 | 0.01 | 0.01 | 0.01 | 0.01 | 0.01 | |
| 0.6 | 0.6 | 0.6 | 0.7 | 0.7 | 0.7 | 0.7 | 0.9 |
Deep Learning Optimization
Deep learning optimization develops algorithms and training strategies that help neural networks converge, generalize, and use compute efficiently.
See all 205 papers