# mit-han-lab/once-for-all

[ICLR 2020] Once for All: Train One Network and Specialize it for Efficient Deployment

Repository: https://github.com/mit-han-lab/once-for-all
Canonical: https://ross.abutalabs.com/products/once-for-all
Homepage: https://ofa.mit.edu/
Language: Python
License: MIT
License Family: permissive
Topics: tinyml, edge-ai, efficient-model, acceleration, nas, automl
Last push: 2023-12-14T04:44:52+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 2432, "days_push": 993, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1956, forks 344 (observed 2026-08-28T04:05:58.983667+00:00)

## What it is
Once-for-All (OFA) is a PyTorch library implementing the ICLR 2020 Once-for-All network, which trains a single supernet that can be specialized into many efficient sub-networks for different devices and latency constraints. It provides a pretrained model zoo, progressive shrinking training, and sub-network sampling/search for efficient edge deployment.

## Use cases
- deploy image classification models on mobile and edge devices
- run neural architecture search without retraining from scratch
- specialize one trained network for many hardware targets
- compress a model by depth, width, kernel size, and resolution
- achieve high ImageNet accuracy under mobile latency budgets
- benchmark efficient models on CPU, DSP, and FPGA

## When to choose
- you need efficient vision models for diverse edge hardware without per-device retraining
- you want pretrained MobileNetV3/ResNet50-style supernet weights to sample sub-networks from
- you are researching NAS, AutoML, or model compression

## When to avoid
- you need general-purpose model training unrelated to architecture search
- you want actively developed tooling - the project is research code with infrequent updates
- your target is LLM or generative model efficiency rather than vision classification

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, deep-learning, llm-training
- domain: machine-learning, deep-learning, computer-vision, embedded-systems, gpu-computing
- platform: python, cross-platform
- tags: neural-architecture-search, automl, model-compression, tinyml, edge-ai, progressive-shrinking, efficient-inference, imagenet, pytorch, gpu

## Member repositories
- mit-han-lab/once-for-all (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:58.983667+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:06:13.992468+00:00, confidence not recorded.
  - readme: https://github.com/mit-han-lab/once-for-all (fetched 2026-08-28T04:05:58.983667+00:00, sha 9df88418bb27)
  - homepage: https://ofa.mit.edu/ (fetched 2026-08-29T10:46:09.742580+00:00, sha 12901d48b051)
  - site_page: https://hanlab.mit.edu/ (fetched 2026-08-29T10:46:09.745360+00:00, sha 4be659389a86)
- Data as of 2026-08-30T08:39:29.467469+00:00.
