Papers › Once-for-All: Train One Network and Specialize it for Efficient Deployment

Once-for-All: Train One Network and Specialize it for Efficient Deployment

26 Aug 2019arXiv:1908.09791archive 2025-07-28

Han Cai, Chuang Gan, Tianzhe Wang, Zhekai Zhang, Song Han

We address the challenging problem of efficient inference across many devices and resource constraints, especially on edge devices. Conventional approaches either manually design or use neural architecture search (NAS) to find a specialized neural network and train it from scratch for each case, which is computationally prohibitive (causing CO₂ emission as much as 5 cars' lifetime) thus unscalable. In this work, we propose to train a once-for-all (OFA) network that supports diverse architectural settings by decoupling training and search, to reduce the cost. We can quickly get a specialized sub-network by selecting from the OFA network without additional training. To efficiently train OFA networks, we also propose a novel progressive shrinking algorithm, a generalized pruning method that reduces the model size across many more dimensions than pruning (depth, width, kernel size, and resolution). It can obtain a surprisingly large number of sub-networks (> 10¹⁹) that can fit different hardware platforms and latency constraints while maintaining the same level of accuracy as training independently. On diverse edge devices, OFA consistently outperforms state-of-the-art (SOTA) NAS methods (up to 4.0% ImageNet top1 accuracy improvement over MobileNetV3, or same accuracy but 1.5x faster than MobileNetV3, 2.6x faster than EfficientNet w.r.t measured latency) while reducing many orders of magnitude GPU hours and CO₂ emission. In particular, OFA achieves a new SOTA 80.0% ImageNet top-1 accuracy under the mobile setting ($<$600M MACs). OFA is the winning solution for the 3rd Low Power Computer Vision Challenge (LPCVC), DSP classification track and the 4th LPCVC, both classification track and detection track. Code and 50 pre-trained models (for many devices & many latency constraints) are released at https://github.com/mit-han-lab/once-for-all.

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="1908.09791")

Code

Syntology Ran 4 of 34 code samples harvested from 7 repositories linked to this paper; 30 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 1 ran · our draft was wrong; 1 ran · fixture could not drive it.

By repository: official repository: 3 samples from 1 repository, 0 ran; community (archive-listed): 31 samples from 6 repositories, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

mit-han-lab/once-for-all officialmentioned in papermentioned on GitHubpytorchMIT report
MaximIntegratedAI/ai8x-synthesis mentioned on GitHubpytorchApache-2.0 report
MaximIntegratedAI/ai8x-training mentioned on GitHubpytorch report
analogdevicesinc/ai8x-training mentioned on GitHubpytorchApache-2.0 report
ito-rafael/once-for-all-2 mentioned on GitHubpytorchMIT report
jordan-hs/rss-interference-cvprw2022 mentioned on GitHubpytorchMIT report
pprp/ofa-cifar mentioned on GitHubpytorchMIT report
seulkiyeom/once-for-all mentioned on GitHubpytorchApache-2.0 report
twice154/ofa-for-super-resolution mentioned 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

34 samples harvested; 4 ran; 1 honoured the contract we drafted; 30 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.

1ran · honoured contract
1ran · violated contract
1ran · our draft was wrong
1ran · fixture could not drive it
30unverified

Licence: 0 of the 34 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 7 repositories linked to this paper, official or community; each sample names its own and says which. “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.

build_activation mit-han-lab/once-for-all/ofa/utils/pytorch_modules.py official repository unverified MIT (permissive) · da7205ae31eaf8ba · report
get_bn_param mit-han-lab/once-for-all/ofa/utils/my_modules.py official repository unverified MIT (permissive) · 324ab791d89fa48c · report
make_divisible mit-han-lab/once-for-all/ofa/utils/pytorch_modules.py official repository unverified MIT (permissive) · f53d5967171577a0 · report
get_same_padding seulkiyeom/once-for-all/utils.py community (archive-listed) ran · honoured contract fingerprinted Apache-2.0 (permissive) · 71cbea6f98bde1f9 · report
rgb2gray twice154/ofa-for-super-resolution/ofa/elastic_nn/networks/ofa_mbs4.py community (archive-listed) ran · violated contract fingerprinted Apache-2.0 (permissive) · e45c8e7895f4cb79 · report
rgb2y twice154/ofa-for-super-resolution/ofa/elastic_nn/networks/ofa_mbs4.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · c98aa6358ebfe3a4 · report
transform_matrix_offset_center pprp/ofa-cifar/ofa/imagenet_classification/data_providers/cifar10.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 3e773c6c5bc796d4 · report
accuracy seulkiyeom/once-for-all/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · f867572dc454a862 · report
apply_policy pprp/ofa-cifar/ofa/imagenet_classification/data_providers/cifar10.py community (archive-listed) unverified MIT (permissive) · 629948982eaffe6f · report
bn_fuser analogdevicesinc/ai8x-training/batchnormfuser.py community (archive-listed) unverified Apache-2.0 (permissive) · 37154c0fb52a4320 · report
build_activation jordan-hs/rss-interference-cvprw2022/ofa/utils/pytorch_modules.py community (archive-listed) unverified MIT (permissive) · b7d63a3b731686ad · report
conv1d MaximIntegratedAI/ai8x-synthesis/izer/compute.py community (archive-listed) unverified Apache-2.0 (permissive) · d2876e3d44cca1e5 · report
conv2d MaximIntegratedAI/ai8x-synthesis/izer/compute.py community (archive-listed) unverified Apache-2.0 (permissive) · d2090bf5a862262f · report
convert_to_x4_q7_weights MaximIntegratedAI/ai8x-synthesis/attic/armx4weights.py community (archive-listed) unverified Apache-2.0 (permissive) · 45ea9f999fe65e71 · report
convtranspose2d MaximIntegratedAI/ai8x-synthesis/izer/compute.py community (archive-listed) unverified Apache-2.0 (permissive) · a18531b8217a23ef · report
device analogdevicesinc/ai8x-training/devices.py community (archive-listed) unverified Apache-2.0 (permissive) · 438c11e6440fc7fb · report
download_url seulkiyeom/once-for-all/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 3396d2fc2ff97e58 · report
get_bn_param jordan-hs/rss-interference-cvprw2022/ofa/utils/my_modules.py community (archive-listed) unverified MIT (permissive) · f060e6240188a921 · report
get_data_loaders analogdevicesinc/ai8x-training/run_nas_network_search.py community (archive-listed) unverified Apache-2.0 (permissive) · 0b1206ef7396e7eb · report
get_evo_search_params analogdevicesinc/ai8x-training/run_nas_network_search.py community (archive-listed) unverified Apache-2.0 (permissive) · 27a78d9679cfa28a · report
idx MaximIntegratedAI/ai8x-synthesis/izer/datamem.py community (archive-listed) unverified Apache-2.0 (permissive) · 024ea8d0d27a2887 · report
load MaximIntegratedAI/ai8x-synthesis/izer/checkpoint.py community (archive-listed) unverified Apache-2.0 (permissive) · ddb4421b09db03c5 · report
make_divisible jordan-hs/rss-interference-cvprw2022/ofa/utils/pytorch_modules.py community (archive-listed) unverified MIT (permissive) · addfbda3077115a3 · report
parse_args analogdevicesinc/ai8x-training/run_nas_network_search.py community (archive-listed) unverified Apache-2.0 (permissive) · 7f34c5377a84222f · report
parse_json MaximIntegratedAI/ai8x-synthesis/izer/assets.py community (archive-listed) unverified Apache-2.0 (permissive) · a6fe7c130778ca63 · report
partnum analogdevicesinc/ai8x-training/devices.py community (archive-listed) unverified Apache-2.0 (permissive) · 6649c27f00740fa4 · report
passthrough_faker MaximIntegratedAI/ai8x-synthesis/izer/add_fake_passthrough.py community (archive-listed) unverified Apache-2.0 (permissive) · 4ec1082125016453 · report
quantize_clamp analogdevicesinc/ai8x-training/ai8x.py community (archive-listed) unverified Apache-2.0 (permissive) · df5e31805cad8a70 · report
quantize_clamp_pool analogdevicesinc/ai8x-training/ai8x.py community (archive-listed) unverified Apache-2.0 (permissive) · a5107b71c0946967 · report
shear_x pprp/ofa-cifar/ofa/imagenet_classification/data_providers/cifar10.py community (archive-listed) unverified MIT (permissive) · 3c5071b8a3d0e038 · report
unfold_batch analogdevicesinc/ai8x-training/ai8x.py community (archive-listed) unverified Apache-2.0 (permissive) · 4510fd0fdc46dfb1 · report
unpack MaximIntegratedAI/ai8x-synthesis/izer/datamem.py community (archive-listed) unverified Apache-2.0 (permissive) · 1db0589ff0da8775 · report
used MaximIntegratedAI/ai8x-synthesis/izer/datamem.py community (archive-listed) unverified Apache-2.0 (permissive) · e63ea88246d50a08 · report
write_mapping MaximIntegratedAI/ai8x-synthesis/izer/assets.py community (archive-listed) unverified Apache-2.0 (permissive) · e5200ffa1b2aced9 · report

Tasks

AllAutoMLNeural Architecture Search

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Neural Architecture Search ImageNet OFA w/ PS #75 Accuracy 76.9 #77 of 135 Archive leaderboard report
Neural Architecture Search ImageNet OFA w/ PS #75 MACs 230M #77 of 135 Archive leaderboard report
Neural Architecture Search ImageNet OFA w/ PS #75 Top-1 Error Rate 23.1 #77 of 135 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Pruning

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