Papers › SAMPa: Sharpness-aware Minimization Parallelized

SAMPa: Sharpness-aware Minimization Parallelized

14 Oct 2024arXiv:2410.10683archive 2025-07-28

Wanyun Xie, Thomas Pethick, Volkan Cevher

Sharpness-aware minimization (SAM) has been shown to improve the generalization of neural networks. However, each SAM update requires \emph{sequentially} computing two gradients, effectively doubling the per-iteration cost compared to base optimizers like SGD. We propose a simple modification of SAM, termed SAMPa, which allows us to fully parallelize the two gradient computations. SAMPa achieves a twofold speedup of SAM under the assumption that communication costs between devices are negligible. Empirical results show that SAMPa ranks among the most efficient variants of SAM in terms of computational time. Additionally, our method consistently outperforms SAM across both vision and language tasks. Notably, SAMPa theoretically maintains convergence guarantees even for \emph{fixed} perturbation sizes, which is established through a novel Lyapunov function. We in fact arrive at SAMPa by treating this convergence guarantee as a hard requirement -- an approach we believe is promising for developing SAM-based methods in general. Our code is available at \url{https://github.com/LIONS-EPFL/SAMPa}.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2410.10683")

Code

Syntology Ran 13 of 15 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 13 ran with no contract checked.

By repository: official repository: 15 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

lions-epfl/sampa officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 13 ran; 0 honoured the contract we drafted; 2 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

13ran
2unverified

Licence: 15 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from LIONS-EPFL/SAMPa. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

DenseNet121 LIONS-EPFL/SAMPa/model/densenet.py official repository ran no licence file found · pointer only · dfb395bae3d07d76 · report
DenseNet169 LIONS-EPFL/SAMPa/model/densenet.py official repository ran no licence file found · pointer only · f295fe3c209ecf78 · report
DenseNet201 LIONS-EPFL/SAMPa/model/densenet.py official repository ran no licence file found · pointer only · 6383aee1c940e7a5 · report
make_layers LIONS-EPFL/SAMPa/model/vgg.py official repository ran no licence file found · pointer only · ac62432dc5134b0d · report
perturbation_loss_log LIONS-EPFL/SAMPa/model/smooth_cross_entropy.py official repository ran no licence file found · pointer only · a51802083eb2dcec · report
resnet20 LIONS-EPFL/SAMPa/model/resnet.py official repository ran no licence file found · pointer only · a10d10e7bcf4cb4a · report
resnet32 LIONS-EPFL/SAMPa/model/resnet.py official repository ran no licence file found · pointer only · 85364deb653f2cf6 · report
resnet44 LIONS-EPFL/SAMPa/model/resnet.py official repository ran no licence file found · pointer only · cd8b7f0a3a1b23f4 · report
smooth_crossentropy LIONS-EPFL/SAMPa/model/smooth_cross_entropy.py official repository ran no licence file found · pointer only · 8ba7b4a94a39f790 · report
smooth_crossentropy LIONS-EPFL/SAMPa/utility.py official repository ran no licence file found · pointer only · f86df65986410c1d · report
unflatten LIONS-EPFL/SAMPa/utility.py official repository ran no licence file found · pointer only · c1ad6496b7bd2b05 · report
vgg11 LIONS-EPFL/SAMPa/model/vgg.py official repository ran no licence file found · pointer only · d61c738bf16ec3c0 · report
vgg11_bn LIONS-EPFL/SAMPa/model/vgg.py official repository ran no licence file found · pointer only · 09c336c3ecb596a3 · report
get_dataset LIONS-EPFL/SAMPa/get_dataset.py official repository unverified no licence file found · pointer only · caf601cac7f2ec8c · report
perturbation_loss_tanh LIONS-EPFL/SAMPa/model/smooth_cross_entropy.py official repository unverified no licence file found · pointer only · be5e295a85a5ce89 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

BASESAMSGD

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections