v0.4.0 — SA backend, GPU optimisations, automated PyPI publish
First release with a built-in Simulated Annealing baseline, GPU-friendly
optimisations to the QQA core loop, and automated PyPI publishing via
Trusted Publishing.
pip install qqa==0.4.0Live demo: https://parallelquasiquantum4co.streamlit.app/
Docs: https://yuma-ichikawa.github.io/QQA4CO/
Added
qqa.simulated_annealing: GPU-parallel SA baseline mirroring the
qqa.annealAPI. Auto-dispatches a QUBO fast path (Glauber-like
parallel update, single matmul per sweep) or a generic single-spin
Metropolis fallback. NewSAResultdataclass.- Streamlit dashboard:
Comparepage now has aPQQA vs SA shootout
mode that races both backends on the same problem and reports a
wall-clock speedup factor. - CLI:
qqa solve --backend sawith--sa-num-sweeps,
--sa-beta-start,--sa-beta-end,--sa-schedule. anneal(..., mixed_precision="bf16")opt-in for bfloat16 autocast on
CUDA (silently falls back to fp32 elsewhere).qqa.utils.enable_tf32()helper for Ampere+ matmul / cuDNN.train_cra_pi_gnn/train_cpra_pi_gnn: new
early_stop_disc_patienceargument.- Head-to-head benchmark notebook:
notebooks/benchmark_sa_vs_qqa_vs_pignn.ipynb. - New
docs/explanation/algorithm.mdsection covering SA.
Changed (performance)
HistoryRecorderbuffers per-epoch metrics as GPU scalars and does a
single bulk.cpu()transfer inon_train_end, eliminating per-epoch
host-device sync.qqa.annealand the PI-GNN trainers now use
optimizer.zero_grad(set_to_none=True).SpinRelaxation.projectno longer allocatesones_like(x)
intermediates.CategoricalRelaxation.penalty_from_forwardremoves a redundant
forward pass per epoch.- CPRA
multi_problem: stacks same-shapeQ_mattensors and computes
every replica cost in one batchedeinsum.
Net effect (CPU, 5-trial min, 32-node MIS):
| Workload | Speedup |
|---|---|
qqa.anneal (MIS) |
+9% |
qqa.anneal (Coloring) |
+3% |
| CPRA single-problem | +3% |
CPRA multi_problem (R=4) |
+40% |
QQA-MIS is bit-equivalent to 0.3.0; Coloring shows a <=0.12%
floating-point drift attributable to the penalty_from_forward
autograd graph change.
Compatibility
No public API removed. qqa.anneal, qqa.pignn.train_*, AnnealResult
and every problem class are unchanged. New keyword arguments
(mixed_precision, early_stop_disc_patience) are opt-in and default
to the prior behaviour.
Install / upgrade
pip install --upgrade qqa
pip install --upgrade "qqa[gui]"
pip install --upgrade "qqa[pignn]"