Skip to main content

Damped Atomic Wave Integration Neurons (DAWIN)

PyPI version License: MIT arXiv DOI Python 3.10+ PyTorch 2.4+ Triton 3.0+ Open In Colab

Official PyTorch and Triton reference implementation for "Damped Atomic Wave Integration Neurons (DAWIN): A Universal Primitive for Continuous-Time Spatiotemporal Learning" (PDF) by Byunggu Yu and Justin Kim (University of the District of Columbia).

DAWIN serves as a drop-in, architecture-agnostic replacement for the conventional perceptron y = σ(wᵀx + b). For each unit m, DAWIN combines spatial wave phase and continuous-time Zero-Order Hold (ZOH) interval scaling into an indivisible (atomic) complex wave packet ui,m and integrates it into a neuron-local state ψi,m ∈ ℂ via:

ui,m = Am αm(Δti) exp(i(km⊤ xi − θm)),   ψi,m = exp(−(γm + iωm)Δti) ψi−1,m + ui,m

where αm(Δti) = 1 − e−γmΔti for Δti > 0 and αm(0) = 1.


Drop-In Usage Example

DAWINLinear (and its fused CUDA kernel TritonDAWINLinear) replaces nn.Linear + Activation anywhere in a model while propagating continuous-time complex quadrature states across irregular intervals Δti:

import torch
from dawin import DAWINLinear

# Batch size B=8, sequence length L=128, input dim d_in=16, hidden units M=64
x = torch.randn(8, 128, 16, device="cuda")
dt = torch.rand(8, 128, device="cuda") * 0.5  # irregular elapsed intervals

# Hidden layer emits paired real/imaginary quadratures [B, L, 2*M]
hidden_layer = DAWINLinear(in_features=16, out_features=64, mode="quad").cuda()
# Readout layer emits real quadrature [B, L, M]
out_layer = DAWINLinear(in_features=128, out_features=4, mode="real").cuda()

h = hidden_layer(x, dt)                        # [8, 128, 128]
y = out_layer(h, dt)                           # [8, 128, 4]
reg_loss = hidden_layer.laplacian_penalty()    # closed-form spatiotemporal curvature penalty

Repository Structure

Core Model, Kernel & Dataset Modules

  • dawin_core.py: Drop-in DAWINLinear primitive with paired-real quadrature propagation, parallel associative prefix scan (torch._higher_order_ops.associative_scan), exact serial fallback, component ablation toggles (none, undamped, memoryless, cosine_only, decoupled), and closed-form spatiotemporal Laplacian curvature regularization (laplacian_penalty(), compute_dawin_laplacian_loss()).
  • dawin_triton.py: Multi-block chunked Triton parallel associative scan kernel and custom autograd bridge supporting arbitrarily long sequences (L > 4096) in O(log L) parallel depth without materializing intermediate complex [B, L, M] tensors in HBM.
  • dawin_models.py: Drop-in continuous-time backbones (DAWINMLP, DAWINTransformer, DAWINGNN) with automatic CUDA Triton dispatch (use_triton=True), alongside parameter-matched comparators (MatchedReLUMLP, MatchedTimeTransformer, MatchedNeuralCDE, MatchedS5, MatchedMamba, MatchedGRUGNN) and find_matched_width (≤ 2% parameter parity).
  • dawin_datasets.py: Standardized data loaders, training-only normalization pipelines, and task metrics for MuJoCo irregular dynamics (HalfCheetah-v5, Hopper-v5, Reacher-v5, Walker2d-v5), PhysioNet Challenge 2012 (mask-aware mortality, mask-aware imputation, and dense WSP displacement), and ETH/UCY + JAAD trajectories.
  • dawin_diagnostics.py: RQ3 Δt-intervention diagnostics (true, batch-shuffled Δtperm, and constant-mean Δtconst), RQ4 GPU throughput/memory profiling, and 20,000-resample paired bootstrap / Holm-Bonferroni significance tests.

Experiment Runners, Exporters & Plotting Scripts

  • run_dawin_experiments.py: Executes 10-seed (101–110) parameter-matched sweeps for a single task with configurable --precision (fp32, bf16, fp16) and writes .json, .csv, and .md summaries.
  • run_all_dawin_benchmarks.py: Orchestrates sequential 10-seed sweeps across all 11 benchmark tasks, runs the --profile-b200 RQ4 GPU scaling suite, and automatically compiles LaTeX tables and publication figures.
  • export_dawin_latex_tables.py: Compiles master_benchmark_summary_<precision>.json and rq4_b200_scaling_<precision>.json into venue-agnostic (generic, outputting dawin_tables_<precision>.tex) or venue-specific (neurips, iclr, icml) LaTeX booktabs tables.
  • plot_dawin_figures.py: Renders publication-ready vector (.pdf) and raster (.png) figures for RQ1/RQ2 accuracy comparisons, RQ3 causal timing interventions, and RQ4 NVIDIA B200 GPU scaling curves.

Verification Suites & Interactive Notebook

  • verify_dawin_harness.py: Validates serial-vs-scan equivalence, BIBO stability under spatial outliers (‖x‖ ~ 10⁶), parameter parity, Triton-vs-PyTorch backbone gradient parity, and the end-to-end synthetic-to-LaTeX-and-figures pipeline.
  • verify_extended_comparators.py: Validates forward shapes, parameter parity (≤ 2%), and gradient flow across all parameter-matched comparators.
  • verify_dawin_datasets.py: Validates tensor shapes, non-negative Δt invariants, and evaluation metrics across all 11 benchmark configurations.
  • verify_triton_dawin.py: Verifies numerical parity of the multi-block Triton kernel under FP32, BF16, and FP16 autocast and benchmarks GPU latency.
  • DAWIN_10seed.ipynb: Self-contained Jupyter/Colab notebook for interactive GPU execution and result inspection.

Installation & Runtime Policy

Install the core PyTorch & Triton primitive directly from PyPI:

pip install dawin

To reproduce the full 11-task benchmark suite, LaTeX tables, and figures from source:

git clone https://github.com/yumakemore/DAWIN.git
cd DAWIN
pip install -r requirements.txt

Following our NVIDIA B200 experimental protocol, mixed-precision runs default to --precision bf16 with matrix-multiplication TF32 disabled (torch.backends.cuda.matmul.allow_tf32 = False), cuDNN TF32 enabled (torch.backends.cudnn.allow_tf32 = True), and FP32 accumulation retained inside the associative scan recurrence.


Quickstart & Verification

Run all four verification suites prior to launching cluster experiments:

python verify_dawin_harness.py
python verify_extended_comparators.py
python verify_dawin_datasets.py
python verify_triton_dawin.py

Interactive Execution (Google Colab)

For interactive, cell-by-cell execution on cloud GPUs (B200, B100, G4, A100, L4, or T4), open DAWIN_10seed.ipynb directly in Google Colab via the badge at the top of this page.


Reproducing Benchmarks, Tables & Figures

All benchmark, profiling, and export commands save outputs to ./results_dawin by default (override with --results-dir <PATH>).

1. Full 11-Task 10-Seed Benchmark Sweep

python run_all_dawin_benchmarks.py --precision bf16 --laplacian-weight 1e-4 --device cuda:0

2. Standalone RQ4 GPU Throughput & Memory Profiling (BF16)

python run_all_dawin_benchmarks.py --profile-only --precision bf16 --device cuda:0

3. Single-Task 10-Seed Sweep & Manual Table/Figure Export

python run_all_dawin_benchmarks.py --tasks HalfCheetah-v5 --precision bf16 --laplacian-weight 1e-4 --force
python export_dawin_latex_tables.py --results-dir results_dawin --precision bf16 --venue generic
python plot_dawin_figures.py --results-dir results_dawin --precision bf16 --formats pdf png

Generated Output Artifacts

Running the benchmark and export scripts populates ./results_dawin with:

  • master_benchmark_summary_<precision>.{json,csv,md}: Aggregated 10-seed Mean ± SD, paired differences, 95% bootstrap CIs, Holm-Bonferroni p-values, and RQ3 Δt-intervention results.
  • rq4_b200_scaling_<precision>.{json,csv,md}: GPU latency (ms), transition throughput (transitions/s), and peak VRAM (MiB) across batch sizes 1, 16, 256, 4096.
  • dawin_tables_<precision>.tex: Ready-to-include LaTeX booktabs tables (\begin{table*}).
  • figures/fig_rq*.{pdf,png}: Publication-ready accuracy comparison, timing-intervention, and scaling figures.

Citation

If you find DAWIN useful in your research, please cite both the paper and the software archive:

@article{yu2026dawin,
  title         = {Damped Atomic Wave Integration Neurons (DAWIN): A Universal Primitive for Continuous-Time Spatiotemporal Learning},
  author        = {Yu, Byunggu and Kim, Justin},
  year          = {2026},
  eprint        = {2611.30025},
  archivePrefix = {arXiv},
  primaryClass  = {cs.LG},
  doi           = {10.48550/arXiv.2611.30025},
  url           = {https://arxiv.org/abs/2611.30025}
}

@software{yu2026dawin_code,
  author    = {Yu, Byunggu and Kim, Justin},
  title     = {DAWIN: Damped Atomic Wave Integration Neurons (PyTorch and Triton Reference Implementation)},
  year      = {2026},
  publisher = {Zenodo},
  version   = {v1.0.1},
  doi       = {10.5281/zenodo.24485896},
  url       = {https://doi.org/10.5281/zenodo.24485896}
}

@software{yu2026dawin_pypi,
  author    = {Yu, Byunggu and Kim, Justin},
  title     = {dawin: PyPI Distribution of Damped Atomic Wave Integration Neurons},
  year      = {2026},
  publisher = {Python Package Index (PyPI)},
  version   = {1.0.3},
  url       = {https://pypi.org/project/dawin/}
}

License

This project is released under the MIT License.

Metadata

Release files for dawin 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dawin 1.0.3
File Size Uploaded Provenance Actions
dawin-1.0.3.tar.gz 26.1 kB With provenance Details for dawin-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dawin 1.0.3
File Interpreter ABI Platform Actions
dawin-1.0.3-py3-none-any.whl Python 3 none any Details for dawin-1.0.3-py3-none-any.whl

Total release size: 49.2 kB

Release files / dawin-1.0.3.tar.gz

Download URL dawin-1.0.3.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9c1b73ac1b98231de1ef8553de45e9e89d4dd11239d8a7751db37ab512f8d979
BLAKE2b-256 checksum
How to use checksums
bde3405bb0024cc0d278e757fb2068c5972e810895e4be9be0dc510045385245
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / dawin-1.0.3-py3-none-any.whl

Download URL dawin-1.0.3-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be2667933293b5d4cc042b509652593af81c0a24db17affb0484b6c344cdb3c7
BLAKE2b-256 checksum
How to use checksums
60144d7fc3dde92bab31799955e2593cad8e1651acdf3b80363edc6b54174192
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for dawin 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dawin-1.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page