
Dawin: A drop-in continuous-time neuron with a fused Triton scan
Try DAWIN in 30 Seconds (Zero Setup): Run DAWIN_Quickstart.ipynb directly in Google Colab to install dawin, train a continuous-time DAWINMLP, verify Δt-shuffling causality, and plot out-of-range horizon extrapolation—or…
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
Try DAWIN in 30 Seconds (Zero Setup): Run DAWIN_Quickstart.ipynb directly in Google Colab to install dawin, train a continuous-time DAWINMLP, verify Δt-shuffling causality, and plot out-of-range horizon extrapolation—or install locally via pip install dawin.
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.
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_Quickstart.ipynb: Lightweight 30-second PyPI quickstart demo (pip install dawin) requiring no repository cloning.
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.
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.
All benchmark, profiling, and export commands save outputs to ./results_dawin by default (override with --results-dir <PATH>).
python run_all_dawin_benchmarks.py --precision bf16 --laplacian-weight 1e-4 --device cuda:0
- Standalone RQ4 GPU Throughput & Memory Profiling (BF16)
python run_all_dawin_benchmarks.py --profile-only --precision bf16 --device cuda:0
- 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:
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}, 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.5}, url = {https://pypi.org/project/dawin/} }
License
This project is released under the MIT License.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。
