Supernetwork-based efficient mapping of deep learning applications to mixed-precision hardware using model adaptation.
The 2 matches
- [1] § Methods › Comparison setup ↔ MPS/mps/supernet.py, lines 22 to 113 · score 0.51 · digital weight, Mixed Precision, PyTorch, AIHWKit, inference, INT8 · Report a mismatch
- [2] § Methods › MixeD-precision Supernetwork Training › Rank-preserving fine-tuning ↔ MPS/train_mps.py, lines 196 to 299 · score 0.51 · fine tune, fairness, phase, loss, ranks, supernetwork · Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 196 lines · 6.4 KB · Apache-2.0 · 1 match
- from __future__ import annotations
- from dataclasses import dataclass
- from typing import Dict, List, Optional, Tuple
- import torch
- import torch.nn as nn
- import torch.nn.functional as F
- from .aihwkit_backend import AnalogConfig, make_inference_rpu_config, analog_conv2d_from_digital, analog_linear_from_digital, maybe_move_analog_to_cuda
- from .ops_qat import make_qat_conv2d, make_qat_linear, SkipOp
- @dataclass
- class ChoiceConfig:
- enable_fp16: bool = True
- enable_int8: bool = True
- enable_analog: bool = True
- enable_skip: bool = True
- class MixedPrecisionChoice(nn.Module):
- def __init__(
- self,
- name: str,
- base: nn.Module,
- is_conv: bool,
- in_shape: Tuple[int, ...],
- out_shape: Tuple[int, ...],
- choice_cfg: ChoiceConfig,
- analog_cfg: AnalogConfig,
- device: str,
- ):
- super().__init__()
- self.name = name
- self.is_conv = is_conv
- self.in_shape = in_shape
- self.out_shape = out_shape
- self.choice_cfg = choice_cfg
- self.analog_cfg = analog_cfg
- self.device = device
- self.ops = nn.ModuleDict()
- # fp16 path = base module (executed under autocast by training loop)
- if choice_cfg.enable_fp16:
- self.ops["fp16"] = base
- # int8 path = QAT-prepared module (still float weights during training)
- if choice_cfg.enable_int8:
- self.ops["int8"] = make_qat_conv2d(base) if is_conv else make_qat_linear(base)
- # analog path = AIHWKIT analog module (weights copied from base)
- if choice_cfg.enable_analog:
- rpu = make_inference_rpu_config(analog_cfg)
- a = analog_conv2d_from_digital(base, rpu) if is_conv else analog_linear_from_digital(base, rpu)
- # Copy trained digital weights into analog weights container
- # AIHWKIT uses analog tiles; set_weights is the supported way.
- with torch.no_grad():
- w = base.weight.detach().cpu().numpy()
- b = None if (getattr(base, "bias", None) is None) else base.bias.detach().cpu().numpy()
- a.set_weights(w, b)
- a = maybe_move_analog_to_cuda(a, want_cuda=("cuda" in device))
- self.ops["analog"] = a
- if choice_cfg.enable_skip:
- self.ops["skip"] = SkipOp(in_shape, out_shape, is_conv=is_conv)
- self.op_names = list(self.ops.keys())
- self.alpha = nn.Parameter(torch.zeros(len(self.op_names), dtype=torch.float32))
- self.sampled_op: Optional[str] = None
- self.use_gumbel: bool = False
- self.gumbel_tau: float = 1.0
- def set_sampled_op(self, op: Optional[str]) -> None:
- self.sampled_op = op
- def set_gumbel(self, enabled: bool, tau: float) -> None:
- self.use_gumbel = enabled
- self.gumbel_tau = tau
- def softmax_probs(self) -> torch.Tensor:
- return torch.softmax(self.alpha, dim=0)
- def argmax_op(self) -> str:
- return self.op_names[int(torch.argmax(self.alpha).item())]
- def set_analog_out_noise(self, out_noise: float) -> None:
- # Progressive noise scaling: update rpu_config forward noise if possible
- if "analog" in self.ops:
- analog = self.ops["analog"]
- if hasattr(analog, "rpu_config") and hasattr(analog.rpu_config, "forward"):
- if hasattr(analog.rpu_config.forward, "out_noise"):
- analog.rpu_config.forward.out_noise = float(out_noise)
- def forward(self, x: torch.Tensor) -> torch.Tensor:
- if self.sampled_op is not None:
- return self.ops[self.sampled_op](x)
- if self.use_gumbel:
- w = F.gumbel_softmax(self.alpha, tau=self.gumbel_tau, hard=False, dim=0)
- out = 0.0
- for i, k in enumerate(self.op_names):
- out = out + w[i] * self.ops[k](x)
- return out
- w = self.softmax_probs()
- out = 0.0
- for i, k in enumerate(self.op_names):
- out = out + w[i] * self.ops[k](x)
- return out
- class SuperNet(nn.Module):
- def __init__(self, model: nn.Module, choices: List[MixedPrecisionChoice]):
- super().__init__()
- self.model = model
- self.choices = nn.ModuleList(choices)
- def named_choices(self):
- return [(c.name, c) for c in self.choices]
- def set_all_sampled(self, mapping: Optional[Dict[str, str]]) -> None:
- for c in self.choices:
- c.set_sampled_op(None if mapping is None else mapping.get(c.name, None))
- def set_gumbel_all(self, enabled: bool, tau: float) -> None:
- for c in self.choices:
- c.set_gumbel(enabled, tau)
- def extract_mapping(self) -> Dict[str, str]:
- return {c.name: c.argmax_op() for c in self.choices}
- def forward(self, x: torch.Tensor) -> torch.Tensor:
- return self.model(x)
- def _infer_shapes(model: nn.Module, input_shape=(1, 3, 32, 32)):
- shapes = {}
- hooks = []
- def register(name, mod):
- def hook(m, inp, out):
- x = inp[0]
- shapes[name] = (tuple(x.shape[1:]), tuple(out.shape[1:]))
- return hook
- for name, m in model.named_modules():
- if isinstance(m, (nn.Conv2d, nn.Linear)):
- hooks.append(m.register_forward_hook(register(name, m)))
- model.eval()
- with torch.no_grad():
- model(torch.zeros(*input_shape))
- for h in hooks:
- h.remove()
- return shapes
- def convert_to_supernet(
- model: nn.Module,
- choice_cfg: ChoiceConfig,
- analog_cfg: AnalogConfig,
- device: str,
- input_shape=(1, 3, 32, 32),
- ) -> SuperNet:
- shapes = _infer_shapes(model, input_shape=input_shape)
- choices: List[MixedPrecisionChoice] = []
- for name, m in list(model.named_modules()):
- if isinstance(m, (nn.Conv2d, nn.Linear)):
- parent = model
- parts = name.split(".")
- for p in parts[:-1]:
- parent = getattr(parent, p)
- leaf = parts[-1]
- in_shape, out_shape = shapes[name]
- is_conv = isinstance(m, nn.Conv2d)
- wrapped = MixedPrecisionChoice(
- name=name,
- base=m,
- is_conv=is_conv,
- in_shape=in_shape,
- out_shape=out_shape,
- choice_cfg=choice_cfg,
- analog_cfg=analog_cfg,
- device=device,
- )
- setattr(parent, leaf, wrapped)
- choices.append(wrapped)
- return SuperNet(model=model, choices=choices)
supernet.py at commit 25261a1, under Apache-2.0 · at the source
Overview
- IBM Research Europe, Rüschlikon, Switzerland
- IBM T. J. Watson Research Center, Yorktown Heights, NY USA
- IBM Research—Almaden, San Jose, CA USA
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 2 matches between paragraphs and lines of code.
ibm/analog-nas
25261a145f0d09998fc2ff0154571a513137d998, 4 March 2026Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
79 files
- AnalogNAS_Tutorial.ipynb
, Jupyter, 66 lines - MPS/
models/ , Python, 1 line__init__.py - MPS/
models/ , Python, 53 linesresnet8_supernet.py - MPS/
mps/ , Python, 4 lines__init__.py - MPS/
mps/ , Python, 69 linesaihwkit_backend.py - MPS/
mps/ , Python, 41 linesops_qat.py - MPS/
mps/ , Python, 35 linespareto.py - MPS/
mps/ , Python, 196 lines, 1 matchsupernet.py - MPS/
mps/ , Python, 41 linesutils.py - MPS/
tests/ , Python, 64 linestest_resnet8.py - MPS/
train_mps.py , Python, 303 lines, 1 match - analognas/
analogainas/ , Python, 1 line__init__.py - analognas/
analogainas/ , Python, 2 lines__version__.py - analognas/
analogainas/ , Python, 1 lineevaluators/ __init__.py - analognas/
analogainas/ , Python, 79 linesevaluators/ base_evaluator.py - analognas/
analogainas/ , Python, 199 linesevaluators/ mlp.py - analognas/
analogainas/ , Python, 28 linesevaluators/ prepare_data.py - analognas/
analogainas/ , Python, 117 linesevaluators/ xgboost.py - analognas/
analogainas/ , Python, 1 linesearch_algorithms/ __init__.py - analognas/
analogainas/ , Python, 72 linessearch_algorithms/ bo.py - analognas/
analogainas/ , Python, 32 linessearch_algorithms/ ea.py - analognas/
analogainas/ , Python, 121 linessearch_algorithms/ ea_optimized.py - analognas/
analogainas/ , Python, 61 linessearch_algorithms/ worker.py - analognas/
analogainas/ , Python, 150 linessearch_spaces/ config_space.py - analognas/
analogainas/ , Python, 44 linessearch_spaces/ dataloaders/ cutout.py - analognas/
analogainas/ , Python, 67 linessearch_spaces/ dataloaders/ dataloader.py - analognas/
analogainas/ , Python, 212 linessearch_spaces/ dataloaders/ kws.py - analognas/
analogainas/ , Python, 269 linessearch_spaces/ resnet_macro_architectur e.py - analognas/
analogainas/ , Python, 69 linessearch_spaces/ sample.py - analognas/
analogainas/ , Python, 199 linessearch_spaces/ train.py - analognas/
analogainas/ , Python, 76 linesutils.py - analognas/
build/ , Python, 1 linelib/ analogainas/ __init__.py - analognas/
build/ , Python, 2 lineslib/ analogainas/ __version__.py - analognas/
build/ , Python, 1 linelib/ analogainas/ evaluators/ __init__.py - analognas/
build/ , Python, 79 lineslib/ analogainas/ evaluators/ base_evaluator.py - analognas/
build/ , Python, 199 lineslib/ analogainas/ evaluators/ mlp.py - analognas/
build/ , Python, 28 lineslib/ analogainas/ evaluators/ prepare_data.py - analognas/
build/ , Python, 115 lineslib/ analogainas/ evaluators/ xgboost.py - analognas/
build/ , Python, 1 linelib/ analogainas/ search_algorithms/ __init__.py - analognas/
build/ , Python, 72 lineslib/ analogainas/ search_algorithms/ bo.py - analognas/
build/ , Python, 32 lineslib/ analogainas/ search_algorithms/ ea.py - analognas/
build/ , Python, 120 lineslib/ analogainas/ search_algorithms/ ea_optimized.py - analognas/
build/ , Python, 57 lineslib/ analogainas/ search_algorithms/ worker.py - analognas/
build/ , Python, 76 lineslib/ analogainas/ utils.py - analognas/
docs/ , JavaScript, 123 lines_build/ html/ _static/ _sphinx_javascript_frame works_compat.js - analognas/
docs/ , JavaScript, 156 lines_build/ html/ _static/ doctools.js - analognas/
docs/ , JavaScript, 14 lines_build/ html/ _static/ documentation_options.js - analognas/
docs/ , JavaScript, 2 lines_build/ html/ _static/ jquery.js - analognas/
docs/ , JavaScript, 1 line_build/ html/ _static/ js/ badge_only.js - analognas/
docs/ , JavaScript, 4 lines_build/ html/ _static/ js/ html5shiv-printshiv.min. js - analognas/
docs/ , JavaScript, 4 lines_build/ html/ _static/ js/ html5shiv.min.js - analognas/
docs/ , JavaScript, 1 line_build/ html/ _static/ js/ theme.js - analognas/
docs/ , JavaScript, 199 lines_build/ html/ _static/ language_data.js - analognas/
docs/ , JavaScript, 566 lines_build/ html/ _static/ searchtools.js - analognas/
docs/ , JavaScript, 70 lines_build/ html/ _static/ sidebar.js - analognas/
docs/ , JavaScript, 144 lines_build/ html/ _static/ sphinx_highlight.js - analognas/
docs/ , JavaScript, 1 line_build/ html/ searchindex.js - analognas/
docs/ , Python, 41 linesconf.py - analognas/
nas_search_demo.py , Python, 18 lines - analognas/
setup.py , Python, 59 lines - analognas/
starter_notebook.ipynb , Jupyter, 114 lines - analognas/
tests/ , Python, 13 lines01_general_search.py - analognas/
tests/ , Python, 14 lines02_bo.py - analognas/
tests/ , Python, 6 lines03_random_sample.py - analognas/
tests/ , Python, 7 lines04_generate_architecture .py - analognasbench/
analognasbench/ , Python, 5 lines__init__.py - analognasbench/
analognasbench/ , Python, 172 linesdata.py - analognasbench/
build/ , Python, 5 lineslib/ analognasbench/ __init__.py - analognasbench/
build/ , Python, 168 lineslib/ analognasbench/ data.py - analognasbench/
examples/ , Python, 177 linesbananas.py - analognasbench/
examples/ , Python, 47 linesbrute_force.py - analognasbench/
examples/ , Python, 162 linesevolutionary_algorithm.p y - analognasbench/
examples/ , Python, 62 linesrandom_search.py - analognasbench/
setup.py , Python, 16 lines - analognasbench/
test.py , Python, 37 lines - analognasbench/
training_script.py , Python, 680 lines - analognasbench/
training_script.sh , Shell, 24 lines - LICENSE, License, 201 lines
- README.md, Text, 98 lines
Code availability statement
The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: ibm/
analog-nas
Read it in the paper: doi.org/10.1038/s41467-026-71071-1.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 77 scripts, each with its path and the digest of its content;
- 2 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: ibm/
analog-nas
Read it in the paper: doi.org/10.1038/s41467-026-71071-1.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 30 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 11 authors, 2 keywords, 6 references.
Cite
This paper
Benmeziane, H., Lammie, C., Boybat, I., Rasch, M., Le Gallo, M., Vasilopoulos, A., Tsai, H., Burr, G. W., Narayanan, V., El Maghraoui, K., & Sebastian, A. (2026). Supernetwork-based efficient mapping of deep learning applications to mixed-precision hardware using model adaptation. Nature communications, 17(1), 4501. https://
BibTeX
@article{benmeziane2026s
author = {Benmeziane, Hadjer and Lammie, Corey and Boybat, Irem and Rasch, Malte and Le Gallo, Manuel and Vasilopoulos, Athanasios and Tsai, Hsinyu and Burr, Geoffrey W and Narayanan, Vijay and El Maghraoui, Kaoutar and Sebastian, Abu},
title = {{Supernetwork-based efficient mapping of deep learning applications to mixed-precision hardware using model adaptation}},
journal = {Nature communications},
year = {2026},
month = mar,
volume = {17},
number = {1},
pages = {4501},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {41896236},
pmcid = {PMC13187305}
}
RIS
TY - JOUR
AU - Benmeziane, Hadjer
AU - Lammie, Corey
AU - Boybat, Irem
AU - Rasch, Malte
AU - Le Gallo, Manuel
AU - Vasilopoulos, Athanasios
AU - Tsai, Hsinyu
AU - Burr, Geoffrey W
AU - Narayanan, Vijay
AU - El Maghraoui, Kaoutar
AU - Sebastian, Abu
TI - Supernetwork-based efficient mapping of deep learning applications to mixed-precision hardware using model adaptation
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 4501
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Supernetwork-based efficient mapping of deep learning applications to mixed-precision hardware using model adaptation",
"container-title": "Nature communications",
"author": [
{
"family": "Benmeziane",
"given": "Hadjer"
},
{
"family": "Lammie",
"given": "Corey"
},
{
"family": "Boybat",
"given": "Irem"
},
{
"family": "Rasch",
"given": "Malte"
},
{
"family": "Le Gallo",
"given": "Manuel"
},
{
"family": "Vasilopoulos",
"given": "Athanasios"
},
{
"family": "Tsai",
"given": "Hsinyu"
},
{
"family": "Burr",
"given": "Geoffrey W"
},
{
"family": "Narayanan",
"given": "Vijay"
},
{
"family": "El Maghraoui",
"given": "Kaoutar"
},
{
"family": "Sebastian",
"given": "Abu"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "4501",
"DOI": "10.1038/
"PMID": "41896236",
"PMCID": "PMC13187305",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
27
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1038/s41467-026-75783-2 [code]
- Broadband encoding and high-speed probabilistic bit generation with integrated microwave neurons.Journal: Nature communicationsIn common: PyTorch, scikit-learn, pandas, 3 other tools, 1 reference
- [2] doi:10.3389/frai.2025.1662984 [code]
- Search-optimized quantization in biomedical ontology alignment.Journal: Frontiers in artificial intelligenceIn common: PyTorch, scikit-learn, pandas, 2 other tools, 1 reference
- [3] doi:10.1038/s41467-026-73669-x [code]
- Homeostatic dendritic neuron based on co-integrated volatile and non-volatile memristors for neuromorphic processing.Journal: Nature communicationsIn common: PyTorch, scikit-learn, SciPy, 2 other tools, 1 reference
- [4] doi:10.1038/s41467-026-72900-z [code]
- Resistive memory-based neural differential equation solver for score-based diffusion model.Journal: Nature communicationsIn common: PyTorch, pandas, SciPy, 2 other tools, 1 reference
- [5] doi:10.1038/s41467-026-68905-3 [code]
- Homogeneous integration of two-dimensional material-based optoelectronic neurons and ferroelectric synapses for neuromorphic vision.Journal: Nature communicationsIn common: PyTorch, pandas, SciPy, 2 other tools, 1 reference
- [6] doi:10.1038/s41467-024-55220-y [code]
- Quantum-limited stochastic optical neural networks operating at a few quanta per activation.Journal: Nature communicationsIn common: PyTorch, pandas, Matplotlib, 1 other tool, 1 reference
- [7] doi:10.1126/sciadv.adr7571 [code]
- Continuous-time digital twin with analog memristive neural ordinary differential equation solver.Journal: Science advancesIn common: PyTorch, SciPy, Matplotlib, 1 other tool, 1 reference
- [8] doi:10.1038/s44172-025-00437-y [code]
- Super-Turing synaptic resistor circuits for intelligent morphing wing.Journal: Communications engineeringIn common: scikit-learn, SciPy, Matplotlib, 1 other tool, 1 reference
- [9] doi:10.1038/s41467-026-68858-7 [code]
- Bioinspired spiking architecture enables energy constrained touch encoding.Journal: Nature communicationsIn common: SciPy, Matplotlib, NumPy, 1 reference
- [10] doi:10.1126/sciadv.adr2082 [code]
- HfZrO-based synaptic resistor circuit for a Super-Turing intelligent system.Journal: Science advancesIn common: NumPy, 1 reference
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 77 scripts, and 2 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:0a779eb6e413658e…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41467-026-71071-1)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-71071-1.svg
:target: https://openscicode.org/badge/doi/10.1038/s41467-026-71071-1
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-71071-1"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-71071-1.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
