Skip to content

v0.4.0 — SA backend, GPU optimisations, automated PyPI publish

Choose a tag to compare

@Yuma-Ichikawa Yuma-Ichikawa released this 19 Apr 03:30
· 57 commits to main since this release

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.0

Live demo: https://parallelquasiquantum4co.streamlit.app/
Docs: https://yuma-ichikawa.github.io/QQA4CO/

Added

  • qqa.simulated_annealing: GPU-parallel SA baseline mirroring the
    qqa.anneal API. Auto-dispatches a QUBO fast path (Glauber-like
    parallel update, single matmul per sweep) or a generic single-spin
    Metropolis fallback. New SAResult dataclass.
  • Streamlit dashboard: Compare page now has a PQQA vs SA shootout
    mode that races both backends on the same problem and reports a
    wall-clock speedup factor.
  • CLI: qqa solve --backend sa with --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_patience argument.
  • Head-to-head benchmark notebook:
    notebooks/benchmark_sa_vs_qqa_vs_pignn.ipynb.
  • New docs/explanation/algorithm.md section covering SA.

Changed (performance)

  • HistoryRecorder buffers per-epoch metrics as GPU scalars and does a
    single bulk .cpu() transfer in on_train_end, eliminating per-epoch
    host-device sync.
  • qqa.anneal and the PI-GNN trainers now use
    optimizer.zero_grad(set_to_none=True).
  • SpinRelaxation.project no longer allocates ones_like(x)
    intermediates.
  • CategoricalRelaxation.penalty_from_forward removes a redundant
    forward pass per epoch.
  • CPRA multi_problem: stacks same-shape Q_mat tensors and computes
    every replica cost in one batched einsum.

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]"