67.2 GB
208,150 files
Updated about 1 month ago
Name
Size
.agents
.git
.github
.pytest_cache
.vscode
Codes
Docs
__pycache__
audit
benchmark
benchmark_logs
benchmark_output
benchmark_results
cache
._Codes263 Bytes
xet
.git-credentials70 Bytes
xet
.gitignore7.71 kB
xet
.gitmodules0 Bytes
xet
.hfignore2.63 kB
xet
.huggingfaceignore312 Bytes
xet
A1_Vertical_Template_Electronics.pptx2.44 MB
xet
CHANGES.md5.8 kB
xet
CLEANUP_GUIDE.md12.9 kB
xet
COMPREHENSIVE_REMEDIATION_PLAN.md36.8 kB
xet
Dockerfile844 Bytes
xet
LICENSE1.07 kB
xet
MASTER_PROJECT_RESULTS.md74.6 kB
xet
MODULE_EXECUTION_STATUS.md25.6 kB
xet
PAPER_REVIEW_FINDINGS.md5.24 kB
xet
PHASE1_RESULTS_VALIDATION.md3.39 kB
xet
README.md12.4 kB
xet
SESSION_SUMMARY.md7.27 kB
xet
aasvd_4models.log24.4 kB
xet
adaptive_sweep_v3.log405 kB
xet
adaptive_sweep_v3_err.log0 Bytes
xet
aggregate_master_results.py6.11 kB
xet
all_4_aegis_hybrid.log31.2 kB
xet
all_canonical_modules.txt3.68 kB
xet
all_modules.txt3.02 kB
xet
all_results_light.zip23 MB
xet
append_qwen_rows.py1.14 kB
xet
apply_agent1_data.py2.45 kB
xet
apply_all_11_fixes.py15.7 kB
xet
apply_all_authentic_figures.py9.59 kB
xet
attention_structures.tex57.8 kB
xet
audit_83.py3.17 kB
xet
audit_accuracy.py1.35 kB
xet
audit_ampersands.py910 Bytes
xet
audit_and_lock_pipeline.py6.18 kB
xet
audit_categorized.py2.36 kB
xet
audit_hf_readmes.py1.21 kB
xet
audit_nonpass.py922 Bytes
xet
auto_commit_results.py3.3 kB
xet
auto_doc_builder.py3.43 kB
xet
auto_git_push.py3.5 kB
xet
auto_git_sync.py2.21 kB
xet
auto_snapshot_git.py6.92 kB
xet
auto_upload_hf_results.py16.2 kB
xet
backfill_missing_hf_uploads.py6.13 kB
xet
bench_upi_speed.py1.06 kB
xet
broken_modules.txt468 Bytes
xet
build_all_folder_plots.py5.97 kB
xet
build_dedup_final_list.py6.2 kB
xet
bundle_0a38b.bundle1.02 kB
xet
c4_ppl.log980 Bytes
xet
cache_inventory.py387 Bytes
xet
canonical_modules.txt2.25 kB
xet
catalog.json13.8 kB
xet
check_adaptive_span.py910 Bytes
xet
check_all.ps1307 Bytes
xet
check_all_status.ps1715 Bytes
xet
check_attn_out.py779 Bytes
xet
check_bad.py1.68 kB
xet
check_lora_baseline.py525 Bytes
xet
check_lora_keys.py283 Bytes
xet
check_metrics.py541 Bytes
xet
check_proc.ps195 Bytes
xet
check_procs.ps1361 Bytes
xet
check_queue.py1.28 kB
xet
check_qwen_cfg.py1.18 kB
xet
check_reg.py252 Bytes
xet
check_roberta_copy.py733 Bytes
xet
check_roberta_flow.py2.1 kB
xet
check_roberta_injected.py742 Bytes
xet
check_roberta_loc.py2.14 kB
xet
check_server_adapters.py181 Bytes
xet
check_server_source.py203 Bytes
xet
check_sweep_progress.py1.4 kB
xet
check_syntax.py1.07 kB
xet
check_unified.py920 Bytes
xet
check_updated_attn.py529 Bytes
xet
clean_and_fix_all_runners.py2.21 kB
xet
clean_branches.py1.29 kB
xet
clean_corrupt_pt.py739 Bytes
xet
clean_duplicate_labels.py2.03 kB
xet
clean_models.py555 Bytes
xet
clean_timeouts.py725 Bytes
xet
collect_table.ps12.31 kB
xet
compare_roberta_out.py1.42 kB
xet
compare_roberta_qkv.py1.97 kB
xet
README.md

🧬 NeuralOps: SVD Linear Attention & Model Compression Framework

NeurIPS/ICLR Reproducibility Python 3.12 / 3.13 PyTorch 2.5.0+ License: MIT Attention Mechanisms Compression Engines Verified Tracks CI Status

NeuralOps is an enterprise-grade research framework designed for rigorous empirical evaluation, zero-shot architectural introspection, and hardware roofline profiling of Linear & Subquadratic Attention Mechanisms, Subspace SVD Decompositions, State-Space Models (SSMs), and Structured Sparsity/Quantization across Foundation Models.


📑 Table of Contents

  1. Project Overview & Core Philosophy
  2. Taxonomy: The 5 Research Tracks
  3. Understanding Injection vs. Compression
  4. Hardware Requirements & Profiles
  5. Environment & Installation
  6. Commands to Reproduce Benchmarks
  7. Comprehensive Results Directory Architecture
  8. Automated Artifacts & Dashboard Telemetry
  9. Citation & License

🔬 Project Overview & Core Philosophy

Standard Multi-Head Attention (MHA) incurs quadratic computational $O(N^2)$ and memory complexity with respect to sequence length $N$. NeuralOps systematically solves, audits, and evaluates subquadratic alternatives through:

  • Universal Zero-Shot Module Injection: Dynamically replace transformer attention blocks across diverse families (distilbert, bert, roberta, t5, gpt2, qwen2.5) with exact projection weight slicing and geometry preservation (RoPE, GQA, and fused $QKV$ handling).
  • In-Place Weight Compression Engines: Evaluate singular value decomposition (SVD), structural pruning, low-rank quantization, and KV-cache compression without requiring structural attention class replacement.
  • Academic Rigor & Reproducibility: 5-seed paired Student's t-tests, Bonferroni corrections, per-sample prediction caching, and exact Pareto frontier mapping between parameter count, latency, and reasoning capability.

🏛 Taxonomy: The 5 Research Tracks

All modules implemented in Codes/framework/attentions/ and Codes/framework/compression_engine/ map directly into 5 primary research tracks:

Codes/framework/
├── attentions/               # 116 subquadratic, linear, and hybrid attention modules
│   ├── adaptive_span_attention.py, cosformer.py, flash_attention3.py,
│   ├── galerkin_attention.py, performer_attention.py, linformer_attention.py ...
└── compression_engine/       # 77 SVD factorizers, quantizers, and structural pruners
    ├── armor_pruner.py, ast_pruner.py, astro_quantizer.py, dobi_svd.py,
    ├── delta_kv.py, enlighten_compressor.py, faq_quantizer.py, mlorq_compressor.py ...
Track Focus Key Module Implementations
Track 1: SVD & Low-Rank Factorization Matrix decomposition, truncated SVD, dynamic energy truncation, symmetric low-rank projections asvd_attention, dobi_svd, aa_svd_compressor, dynamic_rank, erc_svd, saes_svd_v2, swift_svd_act
Track 2: Spectral & State-Space Models (SSMs) Recurrent formulations, selective state spaces, gated linear recurrence, linear decay mamba_block, griffin_ssd, gated_delta_net, gated_linear_attention, decay_linear_attention, aegis_v1–v6
Track 3: Mixture-of-Experts & Hybrids Sparse routing, token clustering, block-wise transformer approximations, hybrid layers bam_umoe, expert_choice_moe, block_transformer_hiba, cluster_attention, cur_moe_compressor
Track 4: Kernel Approximations & Quantization Positive Random Features (FAVOR+), kernel mapping, FP8/INT4 weight quantization performer_attention, cosformer, nystrom_attention, flash_attention3_fp8, astro_quantizer, coopq_quantizer, faq_quantizer
Track 5: Structural Pruning & KV-Cache Reduction Head pruning, ADMM channel sparsity, delta KV compression, dimension reduction armor_pruner, ast_pruner, admm_compressor, bonsai_pruner, flap, delta_kv, cachenotes_compressor, slicegpt

🔍 Understanding Injection vs. Compression

In benchmark reports and summary CSVs, you will observe the metric num_injected_attention_layers:

  1. Pure Compressors, SVD Factorizers, & Pruners (num_injected_attention_layers = 0):
    • Status: PASS / PASS_NO_COMPRESSION
    • Mechanism: Modules such as armor_pruner, dobi_svd, enlighten_compressor, and faq_quantizer operate directly on nn.Linear projection matrices ($W_q, W_k, W_v, W_o$) or MLP blocks.
    • Reason for 0: The original transformer class (e.g. GPT2Attention) is kept intact; only its weight tensors are compressed. This is expected and correct, yielding retention accuracies of 42.0% – 42.6% on zero-shot reasoning.
  2. Attention Architecture Replacements (num_injected_attention_layers = 12):
    • Status: PASS
    • Mechanism: Modules such as adaptive_span_attention, asvd_attention, or compressed_mha_attention completely replace the underlying PyTorch attention block with a custom forward computation class via UniversalAttentionWrapper.

💻 Hardware Requirements & Profiles

NeuralOps benchmarks are designed for execution across standard workstation and GPU compute profiles:

  • GPU: NVIDIA RTX 4070 (8 GB VRAM) / RTX 3080/4080 / A10 / A5000 / A100.
  • CUDA Environment: CUDA Version 12.1 – 12.7, PyTorch $\ge$ 2.5.0.
  • Host CPU & RAM: x86_64 or Apple Silicon (M-series), $\ge$ 16 GB Physical RAM.
  • Process Memory Safety Watchdog: Built-in memory monitors auto-throttle batch sizes and parallel worker counts if free RAM drops below 1.0 GB or VRAM exceeds 7.5 GB.

🚀 Environment & Installation

# 1. Clone the repository
git clone https://github.com/tahamajs/SVD_linear_Attention.git
cd SVD_linear_Attention

# 2. Set up virtual environment
python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# 3. Install PyTorch with CUDA acceleration
pip install --upgrade pip setuptools wheel
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

# 4. Install framework dependencies
pip install -r requirements.txt

⚡ Commands to Reproduce Benchmarks

A. Zero-Shot 5-Task Reasoning Suite (GPT-2)

Evaluates modules without fine-tuning across 5 reasoning benchmarks (PIQA, ARC-Easy, ARC-Challenge, HellaSwag, WinoGrande) with 500 samples per task:

# Run multi-worker parallel evaluator (e.g. 4-5 workers on 8 GB GPU):
python scripts/run_zeroshot_parallel.py \
  --parallel 4 \
  --num_samples 500 \
  --batch_size 8 \
  --model models/gpt2

# Aggregate all individual task predictions into master CSVs & Parquet:
python scripts/aggregate_zeroshot_details.py

B. Rank Sweeps & SVD Scaling (DistilBERT / RoBERTa)

Profiles accuracy retention across low-rank bottlenecks ($r \in {64, 128, 256, 384}$):

python Codes/framework/run_rank_sweeper.py \
  --modules armor_pruner,cluster_attention,dobi_svd,dynamic_rank \
  --ranks 64,128,256,384 \
  --model models/base_checkpoints/distilbert_mnli \
  --model_family bert \
  --dataset mnli \
  --output_base results/rank_sweep_mnli \
  --batch_size 16

C. Language Modeling & Perplexity (C4 / WikiText-2)

Computes causal autoregressive token cross-entropy loss and perplexity on long-form web text:

python Codes/framework/run_quality_sweep.py \
  --modules full,asvd_attention,cosformer,performer_attention \
  --model models/gpt2 \
  --model_family gpt2 \
  --dataset c4 \
  --rank 256 \
  --batch_size 8 \
  --output_dir results/c4_baselines

D. Multi-Seed Pretrained Fine-Tuning Sweep

Runs statistical multi-seed fine-tuning recovery across classification benchmarks:

python Codes/framework/run_multiseed.py \
  --modules svd_linear_attention,armor_pruner,cluster_attention \
  --models distilbert \
  --dataset sst2 \
  --seeds 42,123,456,789,999 \
  --output_dir results/multiseed_rigor_distilbert

📂 Comprehensive Results Directory Architecture

The results/ hierarchy contains 268 experimental suites structured cleanly as follows:

results/
├── README.md                                  # Complete structural taxonomy of all runs
├── benchmark_summary_v2.csv                   # Master multi-model, multi-dataset benchmark summary
├── master_aggregated_results.csv              # Master verified accuracy, parameter, and ratio table
├── SEQLEN_SCALING_MASTER.csv                  # Sequence-length scaling latency & memory matrix
│
├── zeroshot_parallel/                         # 183-Module Zero-Shot Reasoning Suite (GPT-2)
│   ├── <module_name>/
│   │   ├── <task>.json                        # Task summary metrics (e.g. piqa.json, hellaswag.json)
│   │   ├── <task>_detailed.json               # Full sample-level predictions & answers
│   │   ├── <module>_zeroshot.json             # Combined 5-benchmark macro performance
│   │   ├── run_metadata.json                  # Environment, GPU model, Git SHA, and versions
│   │   └── run.log                            # Raw execution trace
│
├── rank_sweep_mnli/ & rank_sweep_agnews/      # Rank sweeps (ranks 64 to 384)
├── c4_baselines/ & gpt2_c4_ppl/               # Autoregressive perplexity evaluations on C4
├── multiseed/ & multiseed_rigor_*/            # 5-seed statistical verification runs
├── distilbert_* & roberta_*                   # Bidirectional encoder GLUE classification runs
└── Unified/                                   # Full multi-model evaluation archive (237 subdirectories)

📊 Automated Artifacts & Dashboard Telemetry

  • Live Evaluation Monitor: Open zeroshot_live_monitor.md for live 20-minute inspection cycles, ranked Pareto tables, and comparative analysis.
  • Web Analytics Studio:
    python Codes/framework/live_monitor.py --port 8080 --host 0.0.0.0
    
  • Automated Publication LaTeX Generation:
    python Codes/framework/analysis/generate_sweep_publication_artifacts.py \
      --results_dir results/zeroshot_parallel/
    

⚖️ Citation & License

Distributed under the MIT License. See LICENSE for full details. If you use NeuralOps in academic research, please cite:

@inproceedings{neuralops2026,
  title={NeuralOps: Universal Benchmarking and Subspace Factorization for Subquadratic Attention Architectures},
  author={Schumacher, Hadi and Majs, Taha and Collaborators},
  booktitle={Thirty-Ninth Conference on Neural Information Processing Systems (NeurIPS)},
  year={2026}
}
Total size
67.2 GB
Files
208,150
Last updated
Sep 27
Pre-warmed CDN
US EU US EU

Contributors