Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diff-negf-synaptic

License: MIT Python 3.10+ DOI Base solver: diff-negf

Inverse Design of Synaptic Weight Updates with a Verified Differentiable NEGF Solver.

Quantum and Nano Devices (QuaNaD) Lab, Department of Electronics and Communication Engineering, PES University - Electronic City Campus, Bengaluru.

This repository accompanies the paper of the same name and contains the complete stack: the multi-state ferroelectric synapse forward model, the audited gradient machinery, the four inverse-design campaigns, the analog in-memory training evaluation, and scripts that regenerate every figure and verify every number quoted in the paper.

It extends the verified differentiable NEGF stack (diff-negf, DOI 10.5281/zenodo.21510020) from static transport to synaptic update objectives.

Everything runs on CPU; a laptop or a free Google Colab instance suffices. Each script prints the numbers quoted in the paper, and make verify re-derives all of them from the archived campaign data in about a minute.

The result in one line: adjoint gradients taken through a self-consistent quantum-transport fixed point cut the synaptic update non-linearity from NL = 0.28 to 0.155, which is worth +1.9 points of MNIST accuracy under an analog-SGD training model.

Layout

src/                        solvers, campaigns, verification
  s1_multistate.py          16-state polarization sheet-charge Poisson-NEGF forward model
  s2_gradient_audit.py      IFT-adjoint / complex-step gradients vs branch-consistent FD
  s3_inverse_design.py      5-parameter design model, loss, Adam with trust-region backtracking
  s3_driver.py              checkpointed campaign driver (resumable; A/B/C/D)
  s4_analog_training.py     pulsed analog-SGD tile model + MNIST evaluation
  s4_aihwkit_notebook.ipynb exact-toolkit reproduction via AIHWKit (see Notes)
  verify.py                 assert all 17 headline numbers; regenerate all figures
  make_fig2.py              Fig. 2 (forward model)
  make_figs345.py           Figs. 3-5 (campaigns, staircases, training)
data/                       archived campaign outputs (.json metrics, .npz arrays/checkpoints)
figures/                    generated figures (committed for convenience)
docs/
  reference_audit.md        per-reference verification status
  development_log.md        gap-discharge ledger and per-gap headline results

Install

pip install -r requirements.txt

Reproduce the paper

Fast path — assert every quantitative claim against the archived data and regenerate all figures (~1 min):

make verify

Full re-runs (approximate single-core runtimes):

make reproduce-s1      # ~15 min: forward model, 16-state campaign, convergence study
make reproduce-s2      # ~10 min: gradient audit
make reproduce-s4      # ~5 min:  4-way MNIST analog training, 5 seeds
make figures           # regenerate Figs. 2-5 from committed data

The S3 inverse-design campaigns are long-running and are driven through a resumable, checkpointed driver — re-run the same command to continue:

python3 src/s3_driver.py A:2:16         # campaign:seeds:steps[:lr]  (4-bit design)
python3 src/s3_driver.py B:9:11         # 6-bit transfer
python3 src/s3_driver.py C:7:18         # ablation
python3 src/s3_driver.py D:1,2:24:0.08  # identifiability

Results

Quantity Value
Forward baseline staircase 16 monotonic states, on/off 31.2, NL = 0.28
Self-consistent convergence order p = 1.99-2.02 (Richardson, finite-volume interfaces)
Gradient audit (adjoint vs branch-consistent FD) worst relative error 9.7e-6
4-bit inverse-designed champion NL = 0.155 at on/off 7.00, strictly monotonic
6-bit transfer (64 states) NL = 0.154, on/off 6.8, all states monotonic
Ablation (self-normalized loss) range collapse 7.0 -> 2.2 — the trivial solution
Identifiability P_r / U_B / W_b recovered to 0.5 / 3.5 / 3.3 %
Champion re-verified at finer grid 1.6 % max deviation; spot-audit 1.5e-5
MNIST (5 seeds): FP32 / ideal / designed / un-designed 93.99 / 90.66 / 90.25 / 88.31 %
Accuracy recovered by the design +1.94 points, 83 % of the un-designed-to-ideal gap

Champion design: U_B = 0.502 eV, W_b = 2.13 nm, P_r = 0.032 e/nm², U_s = -60 meV, V_read = +31 meV — a shorter barrier, softer sheet charge, a shallow transmission-enhancing well behind the barrier, and a raised read window.

Methods findings

Verification-first practice produced four transferable findings about differentiating self-consistent quantum transport, reported in the paper:

  • F1 — cold-started finite differences at a bistable state hop solution branches and are invalid as a reference; warm-started FD is mandatory.
  • F2dG/dV_read carries an ~86x explicit/implicit cancellation, so the complex step must sit well above the retarded/advanced pairing round-off floor.
  • F3 — complex-step differentiation through an iterated fixed point requires the seed to sit far above the solver tolerance, because the derivative lives in the imaginary channel while convergence is tested absolutely (eps = 1e-7 -> 2.3 % error; eps = 1e-4 -> 1.5e-5).
  • F4 — near the polarization switching edge the state chain is bistable at the ulp level, so closed-loop identifiability is well posed only per branch.

Notes

  • The manuscript source is not distributed with this repository; the figures it references are regenerated here by make figures.
  • src/s4_aihwkit_notebook.ipynb reproduces the analog-training comparison inside IBM AIHWKit, importing the designed staircase as a PiecewiseStepDevice. The device mapping is verified, but the current PyPI aihwkit 1.1.0 wheel has a binary-compatibility defect — its compiled extension fails against PyTorch 2.2, 2.5, 2.9.1 (its own declared minimum) and 2.13 with distinct missing-symbol and tensor-dimension errors. The notebook runs unchanged once a corrected wheel ships; the paper's numbers come from the NumPy implementation of the same pulsed-SGD update model.
  • Physics model and verification discipline follow the base solver; see the manuscript, Sec. III, for the model statement and the finite-volume interface treatment.

Cite

If you use this code or data, please cite the paper (BibTeX to be added with the archived DOI at camera-ready) and the base solver, DOI 10.5281/zenodo.21510020. A versioned Zenodo DOI is minted at the v1.0.0 release; see CITATION.cff.

License

MIT (see LICENSE). The manuscript text is © the author; all rights reserved pending publication.

About

Inverse design of synaptic weight-update characteristics with a verified differentiable NEGF solver

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages