neuralops 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- neuralops-1.1.0/CHANGELOG.md +48 -0
- neuralops-1.1.0/LICENSE +21 -0
- neuralops-1.1.0/MANIFEST.in +32 -0
- neuralops-1.1.0/PKG-INFO +538 -0
- neuralops-1.1.0/README.md +465 -0
- neuralops-1.1.0/neuralops/__init__.py +235 -0
- neuralops-1.1.0/neuralops/analysis/__init__.py +101 -0
- neuralops-1.1.0/neuralops/analysis/comparison/__init__.py +28 -0
- neuralops-1.1.0/neuralops/analysis/comparison/statistical_tests.py +761 -0
- neuralops-1.1.0/neuralops/analysis/generate_all_modules_analysis.py +56 -0
- neuralops-1.1.0/neuralops/analysis/generate_sweep_publication_artifacts.py +684 -0
- neuralops-1.1.0/neuralops/analysis/layerwise_analyzer.py +369 -0
- neuralops-1.1.0/neuralops/analysis/metrics.py +88 -0
- neuralops-1.1.0/neuralops/analysis/model_comparison.py +45 -0
- neuralops-1.1.0/neuralops/analysis/module_analysis/__init__.py +50 -0
- neuralops-1.1.0/neuralops/analysis/module_analysis/aggregators.py +150 -0
- neuralops-1.1.0/neuralops/analysis/module_analysis/constants.py +599 -0
- neuralops-1.1.0/neuralops/analysis/module_analysis/main.py +290 -0
- neuralops-1.1.0/neuralops/analysis/module_analysis/parsers.py +115 -0
- neuralops-1.1.0/neuralops/analysis/module_analysis/reporters.py +140 -0
- neuralops-1.1.0/neuralops/analysis/plotting.py +538 -0
- neuralops-1.1.0/neuralops/analysis/report_generator.py +96 -0
- neuralops-1.1.0/neuralops/analysis/utils.py +70 -0
- neuralops-1.1.0/neuralops/attentions/__init__.py +159 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/__init__.py +125 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/adaptive_span_attention.py +1143 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/block_transformer_hiba.py +1075 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/eat.py +1048 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/infini_attention.py +708 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/lola_attention.py +917 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/progressive_token_pruning.py +905 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/sink_attention.py +41 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/span_expanded_attention.py +823 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/squeezing_heads_distill.py +1067 -0
- neuralops-1.1.0/neuralops/attentions/adaptive/token_compressed_attention.py +1073 -0
- neuralops-1.1.0/neuralops/attentions/dense/__init__.py +29 -0
- neuralops-1.1.0/neuralops/attentions/dense/full_attention.py +713 -0
- neuralops-1.1.0/neuralops/attentions/dense/zeros_attention.py +771 -0
- neuralops-1.1.0/neuralops/attentions/experimental/__init__.py +17 -0
- neuralops-1.1.0/neuralops/attentions/experimental/template_attention.py +864 -0
- neuralops-1.1.0/neuralops/attentions/fast_kernels/__init__.py +65 -0
- neuralops-1.1.0/neuralops/attentions/fast_kernels/adasplash_attention.py +945 -0
- neuralops-1.1.0/neuralops/attentions/fast_kernels/flash_attention3.py +969 -0
- neuralops-1.1.0/neuralops/attentions/fast_kernels/flash_attention3_fp8.py +1062 -0
- neuralops-1.1.0/neuralops/attentions/fast_kernels/soa_attn.py +963 -0
- neuralops-1.1.0/neuralops/attentions/fast_kernels/xattention.py +1045 -0
- neuralops-1.1.0/neuralops/attentions/gated/__init__.py +113 -0
- neuralops-1.1.0/neuralops/attentions/gated/decay_linear_attention.py +1033 -0
- neuralops-1.1.0/neuralops/attentions/gated/gated_delta_net.py +1185 -0
- neuralops-1.1.0/neuralops/attentions/gated/gated_deltanet_block.py +387 -0
- neuralops-1.1.0/neuralops/attentions/gated/gated_linear_attention.py +916 -0
- neuralops-1.1.0/neuralops/attentions/gated/hgrn2_gated_deltanet.py +440 -0
- neuralops-1.1.0/neuralops/attentions/gated/hgrn2_gated_layer.py +668 -0
- neuralops-1.1.0/neuralops/attentions/gated/hgrn2_gated_outer.py +742 -0
- neuralops-1.1.0/neuralops/attentions/gated/hla_attention.py +638 -0
- neuralops-1.1.0/neuralops/attentions/gated/kda_attention.py +890 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/__init__.py +185 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/fusion_attn.py +1280 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/gated_hybrid_kernel_attention.py +1367 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/granite_hybrid.py +706 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/halo_regla.py +675 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/hybrid_attention.py +856 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/hybrid_local_kernel_attention.py +1211 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/landmark_local_attention.py +1094 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/mixattention_moska.py +1020 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/optimized_hybrid_attention.py +898 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/positive_kernel_linear_attention.py +1013 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/refined_landmark_attention.py +1131 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/regla_attention.py +969 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/spectron_fp8_attention.py +1369 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/split_head_hybrid_attention.py +1305 -0
- neuralops-1.1.0/neuralops/attentions/hybrid/tri_branch_hybrid_attention.py +1200 -0
- neuralops-1.1.0/neuralops/attentions/linear/__init__.py +197 -0
- neuralops-1.1.0/neuralops/attentions/linear/chela_slay.py +1266 -0
- neuralops-1.1.0/neuralops/attentions/linear/cosformer.py +482 -0
- neuralops-1.1.0/neuralops/attentions/linear/galerkin_attention.py +994 -0
- neuralops-1.1.0/neuralops/attentions/linear/linformer_attention.py +1107 -0
- neuralops-1.1.0/neuralops/attentions/linear/nasc_attention.py +980 -0
- neuralops-1.1.0/neuralops/attentions/linear/nystrom_attention.py +919 -0
- neuralops-1.1.0/neuralops/attentions/linear/performer_attention.py +1209 -0
- neuralops-1.1.0/neuralops/attentions/linear/primal_attention.py +831 -0
- neuralops-1.1.0/neuralops/attentions/linear/rala_attention.py +834 -0
- neuralops-1.1.0/neuralops/attentions/linear/rpc_attention.py +1008 -0
- neuralops-1.1.0/neuralops/attentions/linear/spectra_v2.py +798 -0
- neuralops-1.1.0/neuralops/attentions/linear/spectraformer_attention.py +854 -0
- neuralops-1.1.0/neuralops/attentions/linear/spectron.py +1265 -0
- neuralops-1.1.0/neuralops/attentions/linear/tlinformer_attention.py +1005 -0
- neuralops-1.1.0/neuralops/attentions/linear/tpa_attention.py +1135 -0
- neuralops-1.1.0/neuralops/attentions/linear/triton_cosformer.py +874 -0
- neuralops-1.1.0/neuralops/attentions/modern/__init__.py +125 -0
- neuralops-1.1.0/neuralops/attentions/modern/alibi.py +53 -0
- neuralops-1.1.0/neuralops/attentions/modern/cross_attention.py +82 -0
- neuralops-1.1.0/neuralops/attentions/modern/gqa_attention.py +981 -0
- neuralops-1.1.0/neuralops/attentions/modern/mla_attention.py +980 -0
- neuralops-1.1.0/neuralops/attentions/modern/mqa.py +84 -0
- neuralops-1.1.0/neuralops/attentions/modern/nha_attention.py +1023 -0
- neuralops-1.1.0/neuralops/attentions/modern/qcqa_attention.py +966 -0
- neuralops-1.1.0/neuralops/attentions/modern/sliding_window.py +60 -0
- neuralops-1.1.0/neuralops/attentions/modern/unified_rope.py +801 -0
- neuralops-1.1.0/neuralops/attentions/modern/vig_attention.py +845 -0
- neuralops-1.1.0/neuralops/attentions/modern/wgqa_attention.py +962 -0
- neuralops-1.1.0/neuralops/attentions/sparse/__init__.py +149 -0
- neuralops-1.1.0/neuralops/attentions/sparse/adaptive_sparse_attention.py +1065 -0
- neuralops-1.1.0/neuralops/attentions/sparse/bam_umoe.py +1063 -0
- neuralops-1.1.0/neuralops/attentions/sparse/cluster_attention.py +1110 -0
- neuralops-1.1.0/neuralops/attentions/sparse/expert_choice_moe.py +1010 -0
- neuralops-1.1.0/neuralops/attentions/sparse/hamming_attention.py +782 -0
- neuralops-1.1.0/neuralops/attentions/sparse/lsh_attention.py +1058 -0
- neuralops-1.1.0/neuralops/attentions/sparse/moba_attention.py +1022 -0
- neuralops-1.1.0/neuralops/attentions/sparse/moe_deltakv_paged.py +1222 -0
- neuralops-1.1.0/neuralops/attentions/sparse/nsa_attention.py +810 -0
- neuralops-1.1.0/neuralops/attentions/sparse/padre_attention.py +873 -0
- neuralops-1.1.0/neuralops/attentions/sparse/reap_moe.py +1168 -0
- neuralops-1.1.0/neuralops/attentions/sparse/routing_attention.py +961 -0
- neuralops-1.1.0/neuralops/attentions/ssm/__init__.py +209 -0
- neuralops-1.1.0/neuralops/attentions/ssm/goldfinch_ahn.py +1074 -0
- neuralops-1.1.0/neuralops/attentions/ssm/griffin_ssd.py +736 -0
- neuralops-1.1.0/neuralops/attentions/ssm/hymba_transx.py +1070 -0
- neuralops-1.1.0/neuralops/attentions/ssm/jamba.py +692 -0
- neuralops-1.1.0/neuralops/attentions/ssm/jamba_info.py +1116 -0
- neuralops-1.1.0/neuralops/attentions/ssm/mamba_block.py +938 -0
- neuralops-1.1.0/neuralops/attentions/ssm/mamba_svd_flash.py +1397 -0
- neuralops-1.1.0/neuralops/attentions/ssm/nexus.py +1268 -0
- neuralops-1.1.0/neuralops/attentions/ssm/orion.py +1194 -0
- neuralops-1.1.0/neuralops/attentions/ssm/phantom.py +872 -0
- neuralops-1.1.0/neuralops/attentions/ssm/samba_m3.py +925 -0
- neuralops-1.1.0/neuralops/attentions/ssm/samba_moe.py +424 -0
- neuralops-1.1.0/neuralops/attentions/ssm/selective_ssm.py +286 -0
- neuralops-1.1.0/neuralops/attentions/ssm/simple_ssm.py +330 -0
- neuralops-1.1.0/neuralops/attentions/ssm/spectral_mamba.py +984 -0
- neuralops-1.1.0/neuralops/attentions/ssm/upi_stuffed_mamba.py +990 -0
- neuralops-1.1.0/neuralops/attentions/ssm/vspec.py +1074 -0
- neuralops-1.1.0/neuralops/attentions/svd/__init__.py +257 -0
- neuralops-1.1.0/neuralops/attentions/svd/adaptive_svd_attention.py +1047 -0
- neuralops-1.1.0/neuralops/attentions/svd/asvd_attention.py +1083 -0
- neuralops-1.1.0/neuralops/attentions/svd/compressed_attention.py +722 -0
- neuralops-1.1.0/neuralops/attentions/svd/compressed_mha_attention.py +752 -0
- neuralops-1.1.0/neuralops/attentions/svd/factorised_matrix_state.py +972 -0
- neuralops-1.1.0/neuralops/attentions/svd/fused_svd_kernel.py +1288 -0
- neuralops-1.1.0/neuralops/attentions/svd/lora_attention.py +854 -0
- neuralops-1.1.0/neuralops/attentions/svd/minimal_nova.py +860 -0
- neuralops-1.1.0/neuralops/attentions/svd/minimal_svd.py +817 -0
- neuralops-1.1.0/neuralops/attentions/svd/naive_svd.py +102 -0
- neuralops-1.1.0/neuralops/attentions/svd/projection_factorized_attn.py +277 -0
- neuralops-1.1.0/neuralops/attentions/svd/residual_svd_attention.py +778 -0
- neuralops-1.1.0/neuralops/attentions/svd/salt_attention.py +1030 -0
- neuralops-1.1.0/neuralops/attentions/svd/svd_attention.py +960 -0
- neuralops-1.1.0/neuralops/attentions/svd/svd_compressed.py +1254 -0
- neuralops-1.1.0/neuralops/attentions/svd/svd_linear_attention.py +1582 -0
- neuralops-1.1.0/neuralops/attentions/svd/svd_linear_decay.py +194 -0
- neuralops-1.1.0/neuralops/attentions/svd/svd_llm_v2_attention.py +975 -0
- neuralops-1.1.0/neuralops/attentions/svd/svd_mamba.py +1012 -0
- neuralops-1.1.0/neuralops/attentions/svd/svd_projection_attention.py +840 -0
- neuralops-1.1.0/neuralops/attentions/svd/triton_svd_linear_attention.py +1183 -0
- neuralops-1.1.0/neuralops/benchmarks/__init__.py +44 -0
- neuralops-1.1.0/neuralops/benchmarks/__main__.py +8 -0
- neuralops-1.1.0/neuralops/benchmarks/adapters/__init__.py +13 -0
- neuralops-1.1.0/neuralops/benchmarks/adapters/classification.py +211 -0
- neuralops-1.1.0/neuralops/benchmarks/adapters/perplexity.py +173 -0
- neuralops-1.1.0/neuralops/benchmarks/adapters/ruler.py +190 -0
- neuralops-1.1.0/neuralops/benchmarks/adapters/zeroshot.py +243 -0
- neuralops-1.1.0/neuralops/benchmarks/api.py +120 -0
- neuralops-1.1.0/neuralops/benchmarks/cli.py +224 -0
- neuralops-1.1.0/neuralops/benchmarks/config.py +151 -0
- neuralops-1.1.0/neuralops/benchmarks/core/__init__.py +48 -0
- neuralops-1.1.0/neuralops/benchmarks/core/arguments.py +174 -0
- neuralops-1.1.0/neuralops/benchmarks/core/data_loader.py +149 -0
- neuralops-1.1.0/neuralops/benchmarks/core/evaluation.py +212 -0
- neuralops-1.1.0/neuralops/benchmarks/core/kd.py +124 -0
- neuralops-1.1.0/neuralops/benchmarks/core/model_loader.py +247 -0
- neuralops-1.1.0/neuralops/benchmarks/core/stats.py +99 -0
- neuralops-1.1.0/neuralops/benchmarks/core/training.py +96 -0
- neuralops-1.1.0/neuralops/benchmarks/discovery.py +138 -0
- neuralops-1.1.0/neuralops/benchmarks/discovery_overrides.json +13 -0
- neuralops-1.1.0/neuralops/benchmarks/eval_suite.py +78 -0
- neuralops-1.1.0/neuralops/benchmarks/executor.py +312 -0
- neuralops-1.1.0/neuralops/benchmarks/gpu_live_probe.py +2 -0
- neuralops-1.1.0/neuralops/benchmarks/harvest_gpu_benchmark_data.py +2 -0
- neuralops-1.1.0/neuralops/benchmarks/kd_quick_test.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/kernel_benchmark.py +51 -0
- neuralops-1.1.0/neuralops/benchmarks/launch_parallel_sweep.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/multi_mode_benchmark.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/orchestrator.py +220 -0
- neuralops-1.1.0/neuralops/benchmarks/registry.py +63 -0
- neuralops-1.1.0/neuralops/benchmarks/result.py +108 -0
- neuralops-1.1.0/neuralops/benchmarks/run_all_benchmarks.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_all_modules_scheduler.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_gpt2_sweep.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_long_context_sweep.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_multiseed.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_multiseed_rigor.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_one_module_isolated.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_quality_sweep.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_rank_sweeper.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_ruler_benchmark.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_seqlen_scaling.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_seqlen_scaling_bench.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/run_whitened_svd.py +20 -0
- neuralops-1.1.0/neuralops/benchmarks/runner.py +51 -0
- neuralops-1.1.0/neuralops/benchmarks/suite_runner.py +119 -0
- neuralops-1.1.0/neuralops/benchmarks/utils/__init__.py +1 -0
- neuralops-1.1.0/neuralops/benchmarks/utils/gpu_probe.py +255 -0
- neuralops-1.1.0/neuralops/benchmarks/utils/harvest_data.py +38 -0
- neuralops-1.1.0/neuralops/benchmarks/writers.py +136 -0
- neuralops-1.1.0/neuralops/compression_engine/__init__.py +89 -0
- neuralops-1.1.0/neuralops/compression_engine/experimental/__init__.py +65 -0
- neuralops-1.1.0/neuralops/compression_engine/experimental/flat_llm.py +680 -0
- neuralops-1.1.0/neuralops/compression_engine/experimental/hashed_net_compressor.py +942 -0
- neuralops-1.1.0/neuralops/compression_engine/experimental/liftr.py +645 -0
- neuralops-1.1.0/neuralops/compression_engine/experimental/lillama_compressor.py +708 -0
- neuralops-1.1.0/neuralops/compression_engine/experimental/roast_hashed_linear.py +585 -0
- neuralops-1.1.0/neuralops/compression_engine/kv_cache/__init__.py +77 -0
- neuralops-1.1.0/neuralops/compression_engine/kv_cache/aatc_xkv_compressor.py +995 -0
- neuralops-1.1.0/neuralops/compression_engine/kv_cache/cachenotes_compressor.py +1121 -0
- neuralops-1.1.0/neuralops/compression_engine/kv_cache/delta_kv.py +620 -0
- neuralops-1.1.0/neuralops/compression_engine/kv_cache/hybridkv_compressor.py +422 -0
- neuralops-1.1.0/neuralops/compression_engine/kv_cache/kvtc_compressor.py +824 -0
- neuralops-1.1.0/neuralops/compression_engine/kv_cache/zerokv_neo_compressor.py +500 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/__init__.py +293 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/a3_compressor.py +1304 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/come_compressor.py +1137 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/compot_compressor.py +496 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/cr_compressor.py +544 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/cur_compressor.py +508 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/cur_moe_compressor.py +477 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/dora_qlora.py +131 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/drone_compressor.py +305 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/enlighten_compressor.py +498 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/frandi_compressor.py +798 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/grecodec_compressor.py +581 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/lsc_compressor.py +722 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/mgie_svd_compressor.py +634 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/mlorq_compressor.py +873 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/modegpt_compressor.py +829 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/nmf_compressor.py +646 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/oats_compressor.py +692 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/rpca_compressor.py +490 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/salr.py +596 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/sdrm_compressor.py +545 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/slim_compressor.py +324 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/soka_compressor.py +360 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/svd_llm_compressor.py +770 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/tomoe_compressor.py +767 -0
- neuralops-1.1.0/neuralops/compression_engine/low_rank/uniql_compressor.py +559 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/__init__.py +113 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/admm_compressor.py +541 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/admm_pruner.py +992 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/armor_pruner.py +971 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/ast_pruner.py +785 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/bonsai_pruner.py +638 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/flap.py +582 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/mamba_shedder.py +921 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/proxsparse.py +709 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/sparsegpt.py +437 -0
- neuralops-1.1.0/neuralops/compression_engine/pruning/wanda.py +67 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/__init__.py +101 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/astro_quantizer.py +869 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/awq.py +64 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/coopq_quantizer.py +705 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/faq_quantizer.py +851 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/gptq.py +101 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/huffman_coder.py +639 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/kmeans_quantize.py +879 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/rotational_slicegpt_int4.py +717 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/slicegpt.py +618 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/slicegpt_pca.py +885 -0
- neuralops-1.1.0/neuralops/compression_engine/quantization/smoothquant.py +60 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/__init__.py +221 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/aa_svd_compressor.py +949 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/adaptive_ranks.py +1258 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/adasvd_compressor.py +1462 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/direct_svd.py +567 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/dobi_svd.py +665 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/dynamic_rank.py +1072 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/entropy_budget_allocation.py +587 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/erc_svd.py +562 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/fwsvd_compressor.py +416 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/gfws_d_compressor.py +638 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/hybrid_svd_layer.py +617 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/optimal_subspace_projection.py +731 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/residual_svd_compressor.py +457 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/saes_svd_v2.py +318 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/subspace_projection.py +660 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/svd_linear.py +458 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/swift_svd.py +530 -0
- neuralops-1.1.0/neuralops/compression_engine/svd/swift_svd_act.py +796 -0
- neuralops-1.1.0/neuralops/compression_engine/tensor_decomp/__init__.py +41 -0
- neuralops-1.1.0/neuralops/compression_engine/tensor_decomp/kronecker_compressor.py +1028 -0
- neuralops-1.1.0/neuralops/compression_engine/tensor_decomp/kronecker_tt_lora.py +897 -0
- neuralops-1.1.0/neuralops/compression_engine/tensor_decomp/tt_compressor.py +949 -0
- neuralops-1.1.0/neuralops/config/__init__.py +51 -0
- neuralops-1.1.0/neuralops/config/compression_config.py +94 -0
- neuralops-1.1.0/neuralops/config/config.py +65 -0
- neuralops-1.1.0/neuralops/config/data_config.py +24 -0
- neuralops-1.1.0/neuralops/config/experiment_config.py +45 -0
- neuralops-1.1.0/neuralops/config/hardware_config.py +13 -0
- neuralops-1.1.0/neuralops/config/loader.py +60 -0
- neuralops-1.1.0/neuralops/config/method_config.py +61 -0
- neuralops-1.1.0/neuralops/config/model_config.py +13 -0
- neuralops-1.1.0/neuralops/config/sweep_config.py +15 -0
- neuralops-1.1.0/neuralops/config/training_config.py +29 -0
- neuralops-1.1.0/neuralops/core/__init__.py +97 -0
- neuralops-1.1.0/neuralops/core/_attention_extractors.py +131 -0
- neuralops-1.1.0/neuralops/core/_attention_helpers.py +256 -0
- neuralops-1.1.0/neuralops/core/_attention_injectors.py +541 -0
- neuralops-1.1.0/neuralops/core/_attention_surgery.py +414 -0
- neuralops-1.1.0/neuralops/core/_attention_wrapper.py +497 -0
- neuralops-1.1.0/neuralops/core/adapters.py +254 -0
- neuralops-1.1.0/neuralops/core/architecture.py +202 -0
- neuralops-1.1.0/neuralops/core/attention_mask.py +172 -0
- neuralops-1.1.0/neuralops/core/attention_utils.py +121 -0
- neuralops-1.1.0/neuralops/core/autograd/__init__.py +6 -0
- neuralops-1.1.0/neuralops/core/autograd/flash_attention.py +85 -0
- neuralops-1.1.0/neuralops/core/autograd/fused_backward.py +64 -0
- neuralops-1.1.0/neuralops/core/base.py +190 -0
- neuralops-1.1.0/neuralops/core/common.py +553 -0
- neuralops-1.1.0/neuralops/core/compression_engine.py +21 -0
- neuralops-1.1.0/neuralops/core/compression_pipeline.py +63 -0
- neuralops-1.1.0/neuralops/core/config.py +17 -0
- neuralops-1.1.0/neuralops/core/cuda_graph.py +50 -0
- neuralops-1.1.0/neuralops/core/deprecated_aliases.json +659 -0
- neuralops-1.1.0/neuralops/core/fused_norm_attention.py +50 -0
- neuralops-1.1.0/neuralops/core/gqa_utils.py +88 -0
- neuralops-1.1.0/neuralops/core/legacy_ensemble.py +18 -0
- neuralops-1.1.0/neuralops/core/memory.py +87 -0
- neuralops-1.1.0/neuralops/core/metrics.py +120 -0
- neuralops-1.1.0/neuralops/core/model_family.py +247 -0
- neuralops-1.1.0/neuralops/core/model_utils.py +154 -0
- neuralops-1.1.0/neuralops/core/model_wrapper.py +236 -0
- neuralops-1.1.0/neuralops/core/multi_mode_benchmark.py +17 -0
- neuralops-1.1.0/neuralops/core/pruning_utils.py +490 -0
- neuralops-1.1.0/neuralops/core/quantized_attention.py +79 -0
- neuralops-1.1.0/neuralops/core/registry.py +408 -0
- neuralops-1.1.0/neuralops/core/replace_attention.py +260 -0
- neuralops-1.1.0/neuralops/core/rope.py +147 -0
- neuralops-1.1.0/neuralops/core/selective_scan.py +253 -0
- neuralops-1.1.0/neuralops/core/snapshot_restore.py +96 -0
- neuralops-1.1.0/neuralops/core/svd_utils.py +65 -0
- neuralops-1.1.0/neuralops/core/t5_compat.py +205 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/__init__.py +100 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/_common.py +615 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/_types.py +452 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/autotuner.py +58 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/block_sparse.py +44 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/elementwise.py +52 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/flash_decoding.py +91 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/fms_scan.py +545 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/fused_rope.py +60 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/gdn_scan.py +503 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/gla_scan.py +482 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/gqa.py +166 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/hgrn2_scan.py +254 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/linear_attn.py +451 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/low_rank.py +261 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/paged_attention.py +96 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/selective_scan.py +437 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/sliding_window.py +120 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/softplus.py +59 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/sparse_attn.py +291 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/state_update.py +309 -0
- neuralops-1.1.0/neuralops/core/triton_kernels/varlen_attention.py +51 -0
- neuralops-1.1.0/neuralops/core/triton_linear_attn.py +31 -0
- neuralops-1.1.0/neuralops/core/triton_sparse_attn.py +36 -0
- neuralops-1.1.0/neuralops/core/utils.py +102 -0
- neuralops-1.1.0/neuralops/data/__init__.py +87 -0
- neuralops-1.1.0/neuralops/data/augmentation.py +27 -0
- neuralops-1.1.0/neuralops/data/base.py +367 -0
- neuralops-1.1.0/neuralops/data/benchmark_datasets/__init__.py +50 -0
- neuralops-1.1.0/neuralops/data/benchmark_datasets/loaders.py +308 -0
- neuralops-1.1.0/neuralops/data/benchmark_datasets/manifest.py +328 -0
- neuralops-1.1.0/neuralops/data/benchmark_datasets/synthetic.py +430 -0
- neuralops-1.1.0/neuralops/data/benchmark_datasets.py +43 -0
- neuralops-1.1.0/neuralops/data/cached_tensors.py +168 -0
- neuralops-1.1.0/neuralops/data/custom.py +24 -0
- neuralops-1.1.0/neuralops/data/custom_loader.py +106 -0
- neuralops-1.1.0/neuralops/data/dataset_discovery.py +12 -0
- neuralops-1.1.0/neuralops/data/dataset_loader.py +146 -0
- neuralops-1.1.0/neuralops/data/glue.py +67 -0
- neuralops-1.1.0/neuralops/data/glue_loader.py +212 -0
- neuralops-1.1.0/neuralops/data/multi_choice.py +186 -0
- neuralops-1.1.0/neuralops/data/prepare_datasets.py +496 -0
- neuralops-1.1.0/neuralops/data/preprocessing.py +33 -0
- neuralops-1.1.0/neuralops/data/synthetic_generator.py +397 -0
- neuralops-1.1.0/neuralops/data/task_mapper.py +57 -0
- neuralops-1.1.0/neuralops/data/validation.py +77 -0
- neuralops-1.1.0/neuralops/evaluation/__init__.py +37 -0
- neuralops-1.1.0/neuralops/evaluation/ab_testing.py +53 -0
- neuralops-1.1.0/neuralops/evaluation/eval_all_models_datasets.py +197 -0
- neuralops-1.1.0/neuralops/evaluation/eval_data.py +329 -0
- neuralops-1.1.0/neuralops/evaluation/eval_patcher.py +545 -0
- neuralops-1.1.0/neuralops/evaluation/eval_perplexity.py +384 -0
- neuralops-1.1.0/neuralops/evaluation/eval_pipeline.py +1108 -0
- neuralops-1.1.0/neuralops/evaluation/eval_reporter.py +169 -0
- neuralops-1.1.0/neuralops/evaluation/eval_types.py +391 -0
- neuralops-1.1.0/neuralops/evaluation/eval_utils.py +125 -0
- neuralops-1.1.0/neuralops/evaluation/fairness.py +255 -0
- neuralops-1.1.0/neuralops/evaluation/full_mnli_validation.py +343 -0
- neuralops-1.1.0/neuralops/evaluation/label_quality.py +208 -0
- neuralops-1.1.0/neuralops/evaluation/metrics.py +6 -0
- neuralops-1.1.0/neuralops/evaluation/retraining.py +252 -0
- neuralops-1.1.0/neuralops/evaluation/run_baseline_comparison.py +274 -0
- neuralops-1.1.0/neuralops/evaluation/run_lm_eval_harness.py +388 -0
- neuralops-1.1.0/neuralops/experiment_logging/__init__.py +21 -0
- neuralops-1.1.0/neuralops/experiment_logging/callbacks.py +56 -0
- neuralops-1.1.0/neuralops/experiment_logging/config.py +27 -0
- neuralops-1.1.0/neuralops/experiment_logging/integration.py +56 -0
- neuralops-1.1.0/neuralops/experiment_logging/logger.py +194 -0
- neuralops-1.1.0/neuralops/experiment_logging/tracker.py +39 -0
- neuralops-1.1.0/neuralops/experiment_utils/__init__.py +21 -0
- neuralops-1.1.0/neuralops/experiment_utils/comparison.py +250 -0
- neuralops-1.1.0/neuralops/experiment_utils/config.py +148 -0
- neuralops-1.1.0/neuralops/experiment_utils/data.py +44 -0
- neuralops-1.1.0/neuralops/experiment_utils/main.py +367 -0
- neuralops-1.1.0/neuralops/experiment_utils/model.py +49 -0
- neuralops-1.1.0/neuralops/experiment_utils/orchestrator.py +189 -0
- neuralops-1.1.0/neuralops/experiment_utils/runner.py +13 -0
- neuralops-1.1.0/neuralops/experiment_utils/tasks.py +230 -0
- neuralops-1.1.0/neuralops/experiment_utils/train.py +86 -0
- neuralops-1.1.0/neuralops/inference/__init__.py +20 -0
- neuralops-1.1.0/neuralops/inference/engine.py +254 -0
- neuralops-1.1.0/neuralops/inference/paged_cache.py +107 -0
- neuralops-1.1.0/neuralops/integrations/__init__.py +15 -0
- neuralops-1.1.0/neuralops/integrations/distributed_compile.py +54 -0
- neuralops-1.1.0/neuralops/integrations/hf_automodel.py +61 -0
- neuralops-1.1.0/neuralops/integrations/serving.py +33 -0
- neuralops-1.1.0/neuralops/main.py +855 -0
- neuralops-1.1.0/neuralops/py.typed +0 -0
- neuralops-1.1.0/neuralops/results_saver/__init__.py +21 -0
- neuralops-1.1.0/neuralops/results_saver/backends/__init__.py +9 -0
- neuralops-1.1.0/neuralops/results_saver/backends/huggingface.py +79 -0
- neuralops-1.1.0/neuralops/results_saver/config.py +86 -0
- neuralops-1.1.0/neuralops/results_saver/pipeline/__init__.py +5 -0
- neuralops-1.1.0/neuralops/results_saver/pipeline/result_writer.py +242 -0
- neuralops-1.1.0/neuralops/results_saver/saver.py +506 -0
- neuralops-1.1.0/neuralops/results_saver/storage/__init__.py +0 -0
- neuralops-1.1.0/neuralops/results_saver/storage/sqlite_ops.py +127 -0
- neuralops-1.1.0/neuralops/results_saver/writers/__init__.py +0 -0
- neuralops-1.1.0/neuralops/results_saver/writers/csv_writer.py +108 -0
- neuralops-1.1.0/neuralops/results_saver/writers/json_parquet_writer.py +108 -0
- neuralops-1.1.0/neuralops/results_saver/writers/plot_writer.py +105 -0
- neuralops-1.1.0/neuralops/runners/__init__.py +26 -0
- neuralops-1.1.0/neuralops/runners/module_sweeps/__init__.py +0 -0
- neuralops-1.1.0/neuralops/runners/monitor/__init__.py +47 -0
- neuralops-1.1.0/neuralops/runners/monitor/endpoints.py +141 -0
- neuralops-1.1.0/neuralops/runners/monitor/rendering.py +32 -0
- neuralops-1.1.0/neuralops/runners/monitor/server.py +178 -0
- neuralops-1.1.0/neuralops/runners/monitor/stats.py +192 -0
- neuralops-1.1.0/neuralops/runners/monitor/telemetry.py +160 -0
- neuralops-1.1.0/neuralops/runners/run_autonomous_48h_pipeline.py +649 -0
- neuralops-1.1.0/neuralops/runners/run_continuous_orchestrator.py +165 -0
- neuralops-1.1.0/neuralops/runners/run_master_pipeline.py +163 -0
- neuralops-1.1.0/neuralops/runners/run_monitor_server.py +75 -0
- neuralops-1.1.0/neuralops/runners/run_sweep.py +57 -0
- neuralops-1.1.0/neuralops/runners/unified_orchestrator.py +271 -0
- neuralops-1.1.0/neuralops/tracking/__init__.py +24 -0
- neuralops-1.1.0/neuralops/tracking/backends.py +257 -0
- neuralops-1.1.0/neuralops/tracking/callbacks.py +34 -0
- neuralops-1.1.0/neuralops/tracking/tracker.py +138 -0
- neuralops-1.1.0/neuralops/trainer/__init__.py +143 -0
- neuralops-1.1.0/neuralops/trainer/base_trainer.py +16 -0
- neuralops-1.1.0/neuralops/trainer/callbacks.py +100 -0
- neuralops-1.1.0/neuralops/trainer/custom_loop_trainer.py +237 -0
- neuralops-1.1.0/neuralops/trainer/hf_trainer.py +122 -0
- neuralops-1.1.0/neuralops/trainer/hyperopt.py +148 -0
- neuralops-1.1.0/neuralops/trainer/losses.py +94 -0
- neuralops-1.1.0/neuralops/trainer/methods/__init__.py +52 -0
- neuralops-1.1.0/neuralops/trainer/methods/fisher.py +100 -0
- neuralops-1.1.0/neuralops/trainer/methods/gelora.py +141 -0
- neuralops-1.1.0/neuralops/trainer/methods/llrd.py +76 -0
- neuralops-1.1.0/neuralops/trainer/methods/lora.py +164 -0
- neuralops-1.1.0/neuralops/trainer/methods/mixout.py +58 -0
- neuralops-1.1.0/neuralops/trainer/methods/rdrop_r3f.py +140 -0
- neuralops-1.1.0/neuralops/trainer/methods/registry.py +59 -0
- neuralops-1.1.0/neuralops/trainer/metrics.py +113 -0
- neuralops-1.1.0/neuralops/trainer/optimizers/__init__.py +53 -0
- neuralops-1.1.0/neuralops/trainer/optimizers/factory.py +139 -0
- neuralops-1.1.0/neuralops/trainer/optimizers/muon.py +257 -0
- neuralops-1.1.0/neuralops/trainer/optimizers/riemannian.py +354 -0
- neuralops-1.1.0/neuralops/trainer/optimizers/stiefel.py +165 -0
- neuralops-1.1.0/neuralops/trainer/optimizers.py +47 -0
- neuralops-1.1.0/neuralops/trainer/registry.py +43 -0
- neuralops-1.1.0/neuralops/trainer/results_manager.py +179 -0
- neuralops-1.1.0/neuralops/trainer/rl_trainer.py +177 -0
- neuralops-1.1.0/neuralops/trainer/schedulers.py +65 -0
- neuralops-1.1.0/neuralops/trainer/train_lra.py +426 -0
- neuralops-1.1.0/neuralops/trainer/trainer.py +270 -0
- neuralops-1.1.0/neuralops/trainer/trainer_factory.py +15 -0
- neuralops-1.1.0/neuralops/trainer/trainer_svd.py +133 -0
- neuralops-1.1.0/neuralops/trainer/unsloth_trainer.py +82 -0
- neuralops-1.1.0/neuralops/trainer/utils.py +455 -0
- neuralops-1.1.0/neuralops/training/__init__.py +18 -0
- neuralops-1.1.0/neuralops/training/checkpointing.py +53 -0
- neuralops-1.1.0/neuralops/training/trainer.py +173 -0
- neuralops-1.1.0/neuralops/utils/__init__.py +96 -0
- neuralops-1.1.0/neuralops/utils/architecture.py +145 -0
- neuralops-1.1.0/neuralops/utils/attention_profiler.py +63 -0
- neuralops-1.1.0/neuralops/utils/attention_utils.py +0 -0
- neuralops-1.1.0/neuralops/utils/checkpoint.py +69 -0
- neuralops-1.1.0/neuralops/utils/compat/__init__.py +53 -0
- neuralops-1.1.0/neuralops/utils/compat/aliases.py +49 -0
- neuralops-1.1.0/neuralops/utils/compat/architectures.py +495 -0
- neuralops-1.1.0/neuralops/utils/compat/param_recovery.py +372 -0
- neuralops-1.1.0/neuralops/utils/compat.py +51 -0
- neuralops-1.1.0/neuralops/utils/config.py +47 -0
- neuralops-1.1.0/neuralops/utils/device.py +13 -0
- neuralops-1.1.0/neuralops/utils/helpers.py +97 -0
- neuralops-1.1.0/neuralops/utils/hf_git_exporter.py +560 -0
- neuralops-1.1.0/neuralops/utils/layer_norm_fix.py +193 -0
- neuralops-1.1.0/neuralops/utils/logger.py +37 -0
- neuralops-1.1.0/neuralops/utils/lora.py +265 -0
- neuralops-1.1.0/neuralops/utils/metrics.py +71 -0
- neuralops-1.1.0/neuralops/utils/model_family.py +26 -0
- neuralops-1.1.0/neuralops/utils/paths.py +22 -0
- neuralops-1.1.0/neuralops/utils/profiler.py +167 -0
- neuralops-1.1.0/neuralops/utils/qwen_compat.py +270 -0
- neuralops-1.1.0/neuralops/utils/replace_attention.py +598 -0
- neuralops-1.1.0/neuralops/utils/results_saver.py +76 -0
- neuralops-1.1.0/neuralops/utils/seed.py +16 -0
- neuralops-1.1.0/neuralops.egg-info/PKG-INFO +538 -0
- neuralops-1.1.0/neuralops.egg-info/SOURCES.txt +524 -0
- neuralops-1.1.0/neuralops.egg-info/dependency_links.txt +1 -0
- neuralops-1.1.0/neuralops.egg-info/entry_points.txt +2 -0
- neuralops-1.1.0/neuralops.egg-info/requires.txt +28 -0
- neuralops-1.1.0/neuralops.egg-info/top_level.txt +1 -0
- neuralops-1.1.0/pyproject.toml +91 -0
- neuralops-1.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to NeuralOps are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [1.1.0] - 2026-10-08
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Modern Attention Architectures**: Native implementations of Sliding Window Attention (Mistral), ALiBi, Attention Sinks, Multi-Query Attention (MQA), Cross-Attention, Softcapping, and Variable-Length packed attention.
|
|
14
|
+
- **Production Triton Kernels**: JIT GPU kernels with transparent PyTorch fallbacks for Sliding Window, Paged Attention, Flash-Decoding split-KV, Fused RoPE, Fused RMSNorm/LN + Attention, FP8 scaled attention, and elementwise SwiGLU.
|
|
15
|
+
- **Inference & Serving Runtime**: Dedicated `NeuralOpsInferenceEngine` supporting autoregressive generation with top-p/top-k/repetition penalty, streaming tokens, speculative decoding, beam search with length normalization, and continuous dynamic batching.
|
|
16
|
+
- **Advanced Model Compression Engine**: Real implementations of GPTQ (column error propagation with inverse Hessian damping), AWQ (salient channel activation protection), SmoothQuant (outlier migration), Wanda pruning, LoRA merging & SVD extraction, QLoRA, and DoRA.
|
|
17
|
+
- **Ecosystem & Framework Integrations**: HuggingFace `AutoNeuralOpsModel` and dynamic `patch_model_attention`, vLLM and TGI serving adapters, DeepSpeed ZeRO-1/2/3 configuration, and PyTorch FSDP wrapping.
|
|
18
|
+
- **Training Optimizations**: Complete `MixedPrecisionTrainer` with gradient accumulation and epoch training loops, `LoRATrainer`, and `CurriculumScheduler`.
|
|
19
|
+
- **Benchmarking & Evaluation Harness**: Complete speed, memory, accuracy, and sequence scaling sweep generator with CSV and Markdown output tables, LM-Eval adapter, and RULER needle-in-a-haystack evaluator.
|
|
20
|
+
|
|
21
|
+
## [1.0.0] - 2026-10-08
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- **Unified Benchmark CLI**: Consolidated sweep and evaluation workflows under `python -m neuralops.benchmarks` (`run`, `resume`, `plan`, `list`, `verify`, `results`).
|
|
25
|
+
- **Comprehensive Shared Test Infrastructure**: Introduced `neuralops/tests/conftest.py` with 20+ shared fixtures (device, dummy tensors, registries, tmp paths) and custom pytest markers (`smoke`, `gpu`, `slow`, `triton`, `integration`).
|
|
26
|
+
- **Full Registry Registry Key Verification**: Hardened registry containing exactly 159 attention mechanisms and 73 compression engine modules (232 total) with 641 backward-compatible alias mappings.
|
|
27
|
+
- **Decomposed Modular Subpackages**:
|
|
28
|
+
- `neuralops/data/benchmark_datasets/`
|
|
29
|
+
- `neuralops/runners/monitor/`
|
|
30
|
+
- `neuralops/trainer/optimizers/`
|
|
31
|
+
- `neuralops/utils/compat/`
|
|
32
|
+
- `neuralops/results_saver/`
|
|
33
|
+
- `neuralops/analysis/module_analysis/`
|
|
34
|
+
- **Exhaustive Unit Test Suites**: Full data layer, analysis, config, and runner smoke tests.
|
|
35
|
+
- **Documentation**: Added `MIGRATION_GUIDE.md`, `API_REFERENCE.md`, `ARCHITECTURE.md`, and `TEST_FILES_AUDIT.md`.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
- Refactored `train_task` in `neuralops/trainer/train_lra.py` into decomposed modular helper routines.
|
|
39
|
+
- Refactored `main` in `neuralops/evaluation/run_lm_eval_harness.py` into isolated phases.
|
|
40
|
+
- Accelerated cold import performance to < 3 seconds via registry lazy loading.
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
- Fixed 9 circular import cycles across core and utility packages.
|
|
44
|
+
- Extracted `neuralops/core/triton_kernels/_types.py` to prevent import issues in headless environments.
|
|
45
|
+
- Eliminated 45 legacy `sys.path.insert()` calls across test suites.
|
|
46
|
+
|
|
47
|
+
### Removed
|
|
48
|
+
- Archived 7 obsolete test files testing deprecated versioned module prototypes into `neuralops/tests/_archive/`.
|
neuralops-1.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Taha Majlesi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include README.md
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include pyproject.toml
|
|
5
|
+
include neuralops/core/deprecated_aliases.json
|
|
6
|
+
include neuralops/benchmarks/discovery_overrides.json
|
|
7
|
+
include neuralops/py.typed
|
|
8
|
+
|
|
9
|
+
recursive-include neuralops *.pyi
|
|
10
|
+
|
|
11
|
+
recursive-exclude neuralops/data/glue_data *
|
|
12
|
+
recursive-exclude neuralops/tests *
|
|
13
|
+
recursive-exclude neuralops/benchmarks/_legacy *
|
|
14
|
+
recursive-exclude neuralops/_archive *
|
|
15
|
+
recursive-exclude neuralops/core/_archive *
|
|
16
|
+
recursive-exclude neuralops/attentions/_legacy *
|
|
17
|
+
recursive-exclude neuralops/compression_engine/_legacy *
|
|
18
|
+
recursive-exclude tests *
|
|
19
|
+
recursive-exclude scripts *
|
|
20
|
+
recursive-exclude results *
|
|
21
|
+
|
|
22
|
+
global-exclude *.arrow
|
|
23
|
+
global-exclude *.parquet
|
|
24
|
+
global-exclude *.h5
|
|
25
|
+
global-exclude *.pyc
|
|
26
|
+
global-exclude *.pyo
|
|
27
|
+
global-exclude __pycache__
|
|
28
|
+
global-exclude *.bak
|
|
29
|
+
global-exclude *.err
|
|
30
|
+
global-exclude *.log
|
|
31
|
+
global-exclude .DS_Store
|
|
32
|
+
global-exclude *.swp
|
neuralops-1.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: neuralops
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: A Production-Grade Framework for Subquadratic Attention, Model Compression, and Hardware-Aware Transformer Optimization
|
|
5
|
+
Author-email: Taha Majs <tahamaj4@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Taha Majlesi
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/tahamajs/SVD_linear_Attention
|
|
29
|
+
Project-URL: Repository, https://github.com/tahamajs/SVD_linear_Attention
|
|
30
|
+
Project-URL: Issues, https://github.com/tahamajs/SVD_linear_Attention/issues
|
|
31
|
+
Project-URL: Documentation, https://github.com/tahamajs/SVD_linear_Attention#readme
|
|
32
|
+
Project-URL: Changelog, https://github.com/tahamajs/SVD_linear_Attention/blob/main/CHANGELOG.md
|
|
33
|
+
Keywords: attention,transformer,compression,svd,linear-attention,quantization,pruning,triton,pytorch,deep-learning
|
|
34
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
35
|
+
Classifier: Intended Audience :: Developers
|
|
36
|
+
Classifier: Intended Audience :: Science/Research
|
|
37
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
38
|
+
Classifier: Operating System :: OS Independent
|
|
39
|
+
Classifier: Programming Language :: Python :: 3
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
43
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
44
|
+
Requires-Python: >=3.10
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
License-File: LICENSE
|
|
47
|
+
Requires-Dist: torch>=2.2.0
|
|
48
|
+
Requires-Dist: transformers>=4.40.0
|
|
49
|
+
Requires-Dist: numpy>=1.24.0
|
|
50
|
+
Requires-Dist: pandas>=2.0.0
|
|
51
|
+
Requires-Dist: scipy>=1.11.0
|
|
52
|
+
Requires-Dist: datasets>=2.18.0
|
|
53
|
+
Requires-Dist: einops>=0.7.0
|
|
54
|
+
Requires-Dist: tqdm>=4.66.0
|
|
55
|
+
Requires-Dist: pyyaml>=6.0
|
|
56
|
+
Requires-Dist: safetensors>=0.4.0
|
|
57
|
+
Requires-Dist: packaging>=23.0
|
|
58
|
+
Provides-Extra: triton
|
|
59
|
+
Requires-Dist: triton>=2.3.0; extra == "triton"
|
|
60
|
+
Provides-Extra: eval
|
|
61
|
+
Requires-Dist: scikit-learn>=1.3.0; extra == "eval"
|
|
62
|
+
Requires-Dist: evaluate>=0.4.0; extra == "eval"
|
|
63
|
+
Provides-Extra: dev
|
|
64
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
65
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
66
|
+
Requires-Dist: pytest-xdist>=3.5.0; extra == "dev"
|
|
67
|
+
Requires-Dist: ruff>=0.4.0; extra == "dev"
|
|
68
|
+
Requires-Dist: black>=24.0.0; extra == "dev"
|
|
69
|
+
Requires-Dist: isort>=5.13.0; extra == "dev"
|
|
70
|
+
Requires-Dist: twine>=5.0.0; extra == "dev"
|
|
71
|
+
Requires-Dist: build>=1.2.0; extra == "dev"
|
|
72
|
+
Dynamic: license-file
|
|
73
|
+
|
|
74
|
+
# NeuralOps
|
|
75
|
+
|
|
76
|
+
[](https://pypi.org/project/neuralops/)
|
|
77
|
+
[](https://pypi.org/project/neuralops/)
|
|
78
|
+
[](https://opensource.org/licenses/MIT)
|
|
79
|
+
[](https://github.com/tahamajs/SVD_linear_Attention/actions/workflows/ci.yml)
|
|
80
|
+
|
|
81
|
+
**NeuralOps** is a production-grade, mathematically verified framework for linear attention mechanisms, model compression engines, and fused Triton kernels.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 📑 Table of Contents
|
|
86
|
+
|
|
87
|
+
1. [Key Highlights](#key-highlights)
|
|
88
|
+
2. [Installation](#installation)
|
|
89
|
+
3. [Quick Start](#quick-start)
|
|
90
|
+
4. [Architecture & Data Flow](#architecture-overview)
|
|
91
|
+
5. [Attention Mechanism Zoo (159)](#attention-mechanism-zoo-159)
|
|
92
|
+
6. [Compression Engine Registry (73)](#compression-engine-registry-73)
|
|
93
|
+
7. [Fused Triton Kernels](#fused-triton-kernels)
|
|
94
|
+
8. [Supported Architectures](#supported-architectures)
|
|
95
|
+
9. [Performance & Tradeoffs](#performance-and-tradeoffs)
|
|
96
|
+
10. [API Reference](#api-reference)
|
|
97
|
+
11. [Benchmarking CLI](#benchmarking-cli)
|
|
98
|
+
12. [FAQ](#faq)
|
|
99
|
+
13. [Contributing](#contributing)
|
|
100
|
+
14. [Citation & License](#citation-and-license)
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Key Highlights
|
|
105
|
+
|
|
106
|
+
- **159 Attention Mechanisms**: Canonical linear, sparse, gated, hybrid, SSM, and SVD factorized attention layers.
|
|
107
|
+
- **73 Model Compressors**: SVD truncation, activation-calibrated decomposition (ASVD/AdaSVD), structured pruning, and quantization.
|
|
108
|
+
- **21 Fused Triton Kernels**: Highly optimized GPU execution with seamless, transparent PyTorch CPU/MPS fallbacks.
|
|
109
|
+
- **Universal Architecture Surgery**: Drop-in zero-shot attention replacement across popular Transformer models.
|
|
110
|
+
- **Extensive Backwards Compatibility**: 657 preserved deprecated aliases for seamless backward compatibility.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Installation
|
|
115
|
+
|
|
116
|
+
### Requirements
|
|
117
|
+
|
|
118
|
+
| Component | Minimum | Recommended |
|
|
119
|
+
|:---|:---|:---|
|
|
120
|
+
| Python | 3.10 | 3.11+ |
|
|
121
|
+
| PyTorch | 2.2.0 | 2.4.0+ |
|
|
122
|
+
| CUDA (Optional) | 12.1 | 12.4+ |
|
|
123
|
+
| Triton (Optional) | 2.3.0 | 3.0.0+ |
|
|
124
|
+
|
|
125
|
+
### Platform Matrix
|
|
126
|
+
|
|
127
|
+
| Platform | Core Framework | Triton Kernels | Fallback Support |
|
|
128
|
+
|:---|:---:|:---:|:---:|
|
|
129
|
+
| Linux (NVIDIA GPU) | ✅ | ✅ | PyTorch Autograd |
|
|
130
|
+
| macOS (Apple Silicon) | ✅ | ❌ | MPS / CPU Fallback |
|
|
131
|
+
| Windows 10/11 | ✅ | ❌ | PyTorch Fallback |
|
|
132
|
+
| Linux (CPU) | ✅ | ❌ | PyTorch Fallback |
|
|
133
|
+
|
|
134
|
+
### Installation via PyPI
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Standard install
|
|
138
|
+
pip install neuralops
|
|
139
|
+
|
|
140
|
+
# Install from source
|
|
141
|
+
git clone https://github.com/tahamajs/SVD_linear_Attention.git
|
|
142
|
+
cd SVD_linear_Attention
|
|
143
|
+
pip install -e ".[dev]"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Verify your installation:
|
|
147
|
+
```bash
|
|
148
|
+
python -c "import neuralops; print(neuralops.__version__)"
|
|
149
|
+
python -m neuralops.benchmarks verify
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Quick Start
|
|
155
|
+
|
|
156
|
+
### Recipe 1: 3-Line Attention Surgery
|
|
157
|
+
|
|
158
|
+
Replace quadratic attention in HuggingFace models with subquadratic SVD Linear Attention:
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
import torch
|
|
162
|
+
from transformers import AutoModelForSequenceClassification
|
|
163
|
+
from neuralops.utils.replace_attention import replace_attention
|
|
164
|
+
|
|
165
|
+
model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased")
|
|
166
|
+
model = replace_attention(model, "svd_linear_attention", svd_rank=128)
|
|
167
|
+
|
|
168
|
+
inputs = torch.randint(0, 1000, (2, 64))
|
|
169
|
+
outputs = model(inputs)
|
|
170
|
+
print("Logits shape:", outputs.logits.shape)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Architecture Overview
|
|
176
|
+
|
|
177
|
+
```mermaid
|
|
178
|
+
graph TD
|
|
179
|
+
A[Pretrained Model] --> B[replace_attention / surgery]
|
|
180
|
+
B --> C{Architecture Adapter}
|
|
181
|
+
C -->|DistilBERT| D[Flat MultiHead Attention]
|
|
182
|
+
C -->|BERT/RoBERTa| E[Nested Self-Attention]
|
|
183
|
+
C -->|LLaMA/Qwen| F[GQA / RoPE Projections]
|
|
184
|
+
D --> G[NeuralOps BaseAttention Implementation]
|
|
185
|
+
E --> G
|
|
186
|
+
F --> G
|
|
187
|
+
G --> H[Execution Engine: Triton or PyTorch Fallback]
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Attention Mechanism Zoo (159)
|
|
193
|
+
|
|
194
|
+
| # | Key | Class | Module | Causal | GQA | RoPE | Description |
|
|
195
|
+
|---:|---|---|---|:---:|:---:|:---:|---|
|
|
196
|
+
| 1 | `adaptive_span_attention` | `AdaptiveSpanAttention` | `adaptive.adaptive_span_attention` | ✓ | ✓ | ✓ | |
|
|
197
|
+
| 2 | `adaptive_sparse_attention` | `AdaptiveSparseAttention` | `sparse.adaptive_sparse_attention` | ✓ | ✓ | ✓ | |
|
|
198
|
+
| 3 | `adaptive_sparse_attn` | `AdaptiveSparseAttention` | `sparse.adaptive_sparse_attention` | ✓ | ✓ | ✓ | |
|
|
199
|
+
| 4 | `adaptive_svd` | `AdaptiveSVDAttention` | `svd.adaptive_svd_attention` | ✓ | ✓ | ✓ | Multi-head attention with adaptive SVD + residual factorized projections. |
|
|
200
|
+
| 5 | `adaptive_svd_attention` | `AdaptiveSVDAttention` | `svd.adaptive_svd_attention` | ✓ | ✓ | ✓ | Multi-head attention with adaptive SVD + residual factorized projections. |
|
|
201
|
+
| 6 | `adasplash` | `AdaSplashAttention` | `fast_kernels.adasplash_attention` | ✓ | ✓ | ✓ | AdaSplash Attention Layer with α-Entmax and Local Splash Radius. |
|
|
202
|
+
| 7 | `adasplash_attention` | `AdaSplashAttention` | `fast_kernels.adasplash_attention` | ✓ | ✓ | ✓ | AdaSplash Attention Layer with α-Entmax and Local Splash Radius. |
|
|
203
|
+
| 8 | `alibi_attention` | `ALiBiAttention` | `modern.alibi` | ✓ | | | Attention with linear biases instead of positional embeddings. |
|
|
204
|
+
| 9 | `asvd` | `ASVDAttention` | `svd.asvd_attention` | | | | Hardened ASVD Attention with Factored Low-Rank Matrix Decomposition, GQA, RoPE, |
|
|
205
|
+
| 10 | `asvd_attention` | `ASVDAttention` | `svd.asvd_attention` | | | | Hardened ASVD Attention with Factored Low-Rank Matrix Decomposition, GQA, RoPE, |
|
|
206
|
+
| 11 | `bam_umoe` | `BAMUMoEBlock` | `sparse.bam_umoe` | | | | |
|
|
207
|
+
| 12 | `block_transformer_hiba` | `BlockTransformerHIBA` | `adaptive.block_transformer_hiba` | | | | Block Transformer with Hierarchical Intra-Block and Inter-Block Attention (HIBA) |
|
|
208
|
+
| 13 | `chela_slay` | `ChelaSlayAttention` | `linear.chela_slay` | | | | CHELA-SLAY: Spherical Linearized Attention with Yat-Kernel. |
|
|
209
|
+
| 14 | `chela_slay_attention` | `ChelaSlayAttention` | `linear.chela_slay` | | | | CHELA-SLAY: Spherical Linearized Attention with Yat-Kernel. |
|
|
210
|
+
| 15 | `cluster` | `ClusterAttention` | `sparse.cluster_attention` | ✓ | ✓ | ✓ | |
|
|
211
|
+
| 16 | `cluster_attention` | `ClusterAttention` | `sparse.cluster_attention` | ✓ | ✓ | ✓ | |
|
|
212
|
+
| 17 | `compressed_attention` | `CompressedAttentionLayer` | `svd.compressed_attention` | ✓ | ✓ | ✓ | |
|
|
213
|
+
| 18 | `compressed_attention_layer` | `CompressedAttentionLayer` | `svd.compressed_attention` | ✓ | ✓ | ✓ | |
|
|
214
|
+
| 19 | `compressed_attention_layer_energy` | `CompressedAttentionLayer2` | `svd.compressed_attention` | ✓ | ✓ | ✓ | |
|
|
215
|
+
| 20 | `compressed_mha` | `CompressedDistilBertAttention` | `svd.compressed_mha_attention` | ✓ | ✓ | ✓ | |
|
|
216
|
+
| 21 | `compressed_mha_attention` | `CompressedDistilBertAttention` | `svd.compressed_mha_attention` | ✓ | ✓ | ✓ | |
|
|
217
|
+
| 22 | `cosformer` | `CosformerAttention` | `linear.cosformer` | | | | |
|
|
218
|
+
| 23 | `cross_attention` | `CrossAttention` | `modern.cross_attention` | | ✓ | | Multi-head cross attention between query sequence and encoder/context sequence. |
|
|
219
|
+
| 24 | `decay_linear_attention` | `DecayLinearAttention` | `gated.decay_linear_attention` | | | | Decay Linear Attention Module with Data-Dependent Exponential Decay Gating. |
|
|
220
|
+
| 25 | `decay_linear_attn` | `DecayLinearAttention` | `gated.decay_linear_attention` | | | | Decay Linear Attention Module with Data-Dependent Exponential Decay Gating. |
|
|
221
|
+
| 26 | `eat` | `EATBlock` | `adaptive.eat` | | | | |
|
|
222
|
+
| 27 | `eat_attention` | `EATBlock` | `adaptive.eat` | | | | |
|
|
223
|
+
| 28 | `expert_choice_moe` | `ExpertChoiceMoEAttention` | `sparse.expert_choice_moe` | | | | Expert Choice MoE Multi-Head Attention Module. |
|
|
224
|
+
| 29 | `expert_choice_moe_attention` | `ExpertChoiceMoEAttention` | `sparse.expert_choice_moe` | | | | Expert Choice MoE Multi-Head Attention Module. |
|
|
225
|
+
| 30 | `factorised_matrix_state` | `FactorisedMatrixState` | `svd.factorised_matrix_state` | | | | Bidirectional & Causal Factorised Matrix State Recurrent Linear Attention. |
|
|
226
|
+
| 31 | `flash3` | `FlashAttention3` | `fast_kernels.flash_attention3` | | | | FlashAttention-3 Multi-Head Exact Attention. |
|
|
227
|
+
| 32 | `flash3_fp8` | `FlashAttention3FP8` | `fast_kernels.flash_attention3_fp8` | | | | FlashAttention-3 FP8 Hardware-Accelerated Multi-Head Attention. |
|
|
228
|
+
| 33 | `flash_attention3` | `FlashAttention3` | `fast_kernels.flash_attention3` | | | | FlashAttention-3 Multi-Head Exact Attention. |
|
|
229
|
+
| 34 | `flash_attention3_fp8` | `FlashAttention3FP8` | `fast_kernels.flash_attention3_fp8` | | | | FlashAttention-3 FP8 Hardware-Accelerated Multi-Head Attention. |
|
|
230
|
+
| 35 | `fms` | `FactorisedMatrixState` | `svd.factorised_matrix_state` | | | | Bidirectional & Causal Factorised Matrix State Recurrent Linear Attention. |
|
|
231
|
+
| 36 | `full` | `FullAttention` | `dense.full_attention` | ✓ | ✓ | ✓ | |
|
|
232
|
+
| 37 | `full_attention` | `FullAttention` | `dense.full_attention` | ✓ | ✓ | ✓ | |
|
|
233
|
+
| 38 | `fused_svd_kernel` | `FusedSVDKernelAttention` | `svd.fused_svd_kernel` | ✓ | ✓ | | Fused SVD-Kernel Linear Attention Module. |
|
|
234
|
+
| 39 | `fused_svd_kernel_attention` | `FusedSVDKernelAttention` | `svd.fused_svd_kernel` | ✓ | ✓ | | Fused SVD-Kernel Linear Attention Module. |
|
|
235
|
+
| 40 | `fusion_attention` | `FUSIONATTN` | `hybrid.fusion_attn` | ✓ | ✓ | | Hybrid sparse attention with block gating. |
|
|
236
|
+
| 41 | `fusion_attn` | `FUSIONATTN` | `hybrid.fusion_attn` | ✓ | ✓ | | Hybrid sparse attention with block gating. |
|
|
237
|
+
| 42 | `galerkin_attention` | `GalerkinAttention` | `linear.galerkin_attention` | ✓ | ✓ | | |
|
|
238
|
+
| 43 | `gated_delta_net` | `GatedDeltaNet` | `gated.gated_delta_net` | | | | |
|
|
239
|
+
| 44 | `gated_deltanet_block` | `GatedDeltaNetBlock` | `gated.gated_deltanet_block` | | | | Gated DeltaNet Transformer Block with Pretrained Weight Transfer. |
|
|
240
|
+
| 45 | `gated_hybrid_kernel` | `GatedHybridKernelAttention` | `hybrid.gated_hybrid_kernel_attention` | ✓ | ✓ | | |
|
|
241
|
+
| 46 | `gated_linear_attention` | `GatedLinearAttention` | `gated.gated_linear_attention` | ✓ | ✓ | | |
|
|
242
|
+
| 47 | `goldfinch` | `GoldFinchAHNBlock` | `ssm.goldfinch_ahn` | | | | GoldFinch-AHN: hybrid sliding-window attention + gated recurrent memory. |
|
|
243
|
+
| 48 | `goldfinch_ahn` | `GoldFinchAHNBlock` | `ssm.goldfinch_ahn` | | | | GoldFinch-AHN: hybrid sliding-window attention + gated recurrent memory. |
|
|
244
|
+
| 49 | `gqa_attention` | `GroupedQueryAttention` | `modern.gqa_attention` | ✓ | ✓ | ✓ | |
|
|
245
|
+
| 50 | `granite_hybrid` | `GraniteHybridBlock` | `hybrid.granite_hybrid` | | | | Granite Hybrid Attention-SSM Layer with MoE Feed-Forward and LoRA Adaptation. |
|
|
246
|
+
| 51 | `griffin_ssd` | `GriffinSSDBlock` | `ssm.griffin_ssd` | | | | Griffin Hybrid Block: local window + SSD linear attention. |
|
|
247
|
+
| 52 | `grouped_query_attention` | `GroupedQueryAttention` | `modern.gqa_attention` | ✓ | ✓ | ✓ | |
|
|
248
|
+
| 53 | `halo_regla` | `HALOReGLAAttention` | `hybrid.halo_regla` | | | | Hybrid Dense Softmax + Linear Attention with adaptive fusion gate. |
|
|
249
|
+
| 54 | `hamming_attention` | `HammingAttention` | `sparse.hamming_attention` | ✓ | ✓ | ✓ | |
|
|
250
|
+
| 55 | `hgrn2_gated_deltanet` | `HGRN2GatedDeltaNet` | `gated.hgrn2_gated_deltanet` | | | | HGRN-2 + Gated DeltaNet hybrid with proper fusion. |
|
|
251
|
+
| 56 | `hgrn2_gated_layer` | `HGRN2Layer` | `gated.hgrn2_gated_layer` | | | | HGRN-2 hybrid with local sliding-window attention. |
|
|
252
|
+
| 57 | `hgrn2_gated_outer` | `HGRN2GatedOuterBlock` | `gated.hgrn2_gated_outer` | ✓ | ✓ | | |
|
|
253
|
+
| 58 | `hgrn2_outer` | `HGRN2GatedOuterBlock` | `gated.hgrn2_gated_outer` | ✓ | ✓ | | |
|
|
254
|
+
| 59 | `hla_attention` | `HLAAttention` | `gated.hla_attention` | ✓ | ✓ | | Hadamard Linear Attention (HLA) Bidirectional / Causal Module. |
|
|
255
|
+
| 60 | `hybrid_attention` | `HybridAttention` | `hybrid.hybrid_attention` | ✓ | ✓ | ✓ | Hybrid softmax + linear attention with per-head dynamic gated fusion. |
|
|
256
|
+
| 61 | `hybrid_local_kernel` | `HybridLocalKernelAttention` | `hybrid.hybrid_local_kernel_attention` | ✓ | ✓ | | |
|
|
257
|
+
| 62 | `hymba_transx` | `HymbaTransXBlock` | `ssm.hymba_transx` | | | | HymbaTransX: Hybrid Differential Transformer & State Space Model Block. |
|
|
258
|
+
| 63 | `hymba_transx_attn` | `HymbaTransXBlock` | `ssm.hymba_transx` | | | | HymbaTransX: Hybrid Differential Transformer & State Space Model Block. |
|
|
259
|
+
| 64 | `inject_triton_cosformer` | `TritonCosformerAttention` | `linear.triton_cosformer` | | | | Triton-Accelerated Cosformer Linear Attention with Full Autograd Differentiabili |
|
|
260
|
+
| 65 | `inject_triton_svd_linear_attention` | `inject_triton_svd_linear_attention` | `svd.triton_svd_linear_attention` | | | | Safe factory function to inject TritonSVDLinearAttention into a model. |
|
|
261
|
+
| 66 | `inject_xattention` | `inject_xattention` | `fast_kernels.xattention` | | | | |
|
|
262
|
+
| 67 | `jamba` | `Jamba2Block` | `adaptive.infini_attention` | | | | |
|
|
263
|
+
| 68 | `jamba_info` | `JambaInfoBlock` | `ssm.jamba_info` | | | | |
|
|
264
|
+
| 69 | `kda_attention` | `KDAAttention` | `gated.kda_attention` | | | | |
|
|
265
|
+
| 70 | `landmark_local` | `LandmarkLocalAttention` | `hybrid.landmark_local_attention` | ✓ | ✓ | | |
|
|
266
|
+
| 71 | `linformer_attention` | `LinformerAttention` | `linear.linformer_attention` | ✓ | ✓ | | |
|
|
267
|
+
| 72 | `lola_attention` | `LoLAAttention` | `adaptive.lola_attention` | ✓ | ✓ | ✓ | |
|
|
268
|
+
| 73 | `lora_attention` | `LoRAAttention` | `svd.lora_attention` | ✓ | ✓ | ✓ | LoRA attention wrapper. |
|
|
269
|
+
| 74 | `lora_attn` | `LoRAAttention` | `svd.lora_attention` | ✓ | ✓ | ✓ | LoRA attention wrapper. |
|
|
270
|
+
| 75 | `lsh_attention` | `LSHAttention` | `sparse.lsh_attention` | ✓ | ✓ | | |
|
|
271
|
+
| 76 | `mamba_block` | `MambaBlock` | `ssm.mamba_block` | ✓ | | | Faithful S6 / Mamba block, production-hardened. |
|
|
272
|
+
| 77 | `mamba_svd_flash` | `MambaSVDFlash` | `ssm.mamba_svd_flash` | | | | Hybrid SSM + MHA with per-chunk SVD and learnable per-head gating. |
|
|
273
|
+
| 78 | `minimal_nova` | `MinimalNOVAAttention` | `svd.minimal_nova` | ✓ | ✓ | | MinimalNOVA: SVD-Factorized Low-Rank Projection Attention. |
|
|
274
|
+
| 79 | `minimal_svd` | `MinimalSVDAttention` | `svd.minimal_svd` | ✓ | ✓ | | MinimalSVD: SVD-Factorized Low-Rank Projection Attention. |
|
|
275
|
+
| 80 | `mixattention_moska` | `MixAttentionMoSKA` | `hybrid.mixattention_moska` | ✓ | ✓ | | MixAttention-MoSKA (FASA): frequency/variance-aware sparse attention. |
|
|
276
|
+
| 81 | `mla_attention` | `MLAAttention` | `modern.mla_attention` | ✓ | ✓ | | Multi-Head Latent Attention (MLA) — DeepSeek-V2 style. |
|
|
277
|
+
| 82 | `moba_attention` | `MoBAAttention` | `sparse.moba_attention` | ✓ | ✓ | | MoBA: Mixture of Block Attention for Long-Context Modeling. |
|
|
278
|
+
| 83 | `moe_deltakv_paged` | `MoEDeltaKVPagedAttention` | `sparse.moe_deltakv_paged` | | | | MoE-DeltaKV-Paged Hybrid Attention. |
|
|
279
|
+
| 84 | `mqa_attention` | `MultiQueryAttention` | `modern.mqa` | ✓ | ✓ | ✓ | Multi-Query Attention — multiple query heads share single key and value heads. |
|
|
280
|
+
| 85 | `naive_svd` | `NaiveSVDAttention` | `svd.naive_svd` | ✓ | ✓ | | Naive truncated SVD baseline attention module. |
|
|
281
|
+
| 86 | `nasc_attention` | `NASCAttention` | `linear.nasc_attention` | ✓ | ✓ | | NASC: NEXUS-AEGIS Spectral Cascade Attention. |
|
|
282
|
+
| 87 | `nexus` | `NEXUSAttention` | `ssm.nexus` | ✓ | ✓ | | |
|
|
283
|
+
| 88 | `nha_class` | `NativeHybridAttention` | `modern.nha_attention` | | | | Native Hybrid Attention: local sliding-window + global RFF, fused by a |
|
|
284
|
+
| 89 | `nsa` | `NativeSparseAttention` | `sparse.nsa_attention` | | | | |
|
|
285
|
+
| 90 | `nsa_attention` | `NativeSparseAttention` | `sparse.nsa_attention` | | | | |
|
|
286
|
+
| 91 | `nystrom` | `NystromAttention` | `linear.nystrom_attention` | | | | |
|
|
287
|
+
| 92 | `nystrom_attention` | `NystromAttention` | `linear.nystrom_attention` | | | | |
|
|
288
|
+
| 93 | `optimized_hybrid_attention` | `OptimizedHybridAttention` | `hybrid.optimized_hybrid_attention` | | | | |
|
|
289
|
+
| 94 | `orion` | `ORIONAttention` | `ssm.orion` | | | | |
|
|
290
|
+
| 95 | `padre_attention` | `PADReAttention` | `sparse.padre_attention` | | | | Polynomial Attention with Dropout Regularization (PADRe). |
|
|
291
|
+
| 96 | `performer` | `PerformerAttention` | `linear.performer_attention` | | | | |
|
|
292
|
+
| 97 | `performer_attention` | `PerformerAttention` | `linear.performer_attention` | | | | |
|
|
293
|
+
| 98 | `phantom` | `PHANTOMAttention` | `ssm.phantom` | | | | |
|
|
294
|
+
| 99 | `positive_kernel_linear` | `PositiveKernelLinearAttention` | `hybrid.positive_kernel_linear_attention` | ✓ | ✓ | | |
|
|
295
|
+
| 100 | `primal_attention` | `PrimalAttention` | `linear.primal_attention` | | | | |
|
|
296
|
+
| 101 | `progressive_token_pruning` | `ProgressiveTokenPruning` | `adaptive.progressive_token_pruning` | | | | Progressive Token Pruning attention. |
|
|
297
|
+
| 102 | `projection_factorized_attn` | `ProjectionFactorizedAttention` | `svd.projection_factorized_attn` | ✓ | ✓ | | Projection Factorized SVD Linear Attention. |
|
|
298
|
+
| 103 | `qcqa_attention` | `QCQAAttention` | `modern.qcqa_attention` | | | | |
|
|
299
|
+
| 104 | `rala_attention` | `RALALinearAttention` | `linear.rala_attention` | | | | |
|
|
300
|
+
| 105 | `rala_compressor` | `RALALinearAttention` | `linear.rala_attention` | | | | |
|
|
301
|
+
| 106 | `reap_moe` | `REAPMoEAttention` | `sparse.reap_moe` | | | | |
|
|
302
|
+
| 107 | `refined_landmark` | `RefinedLandmarkAttention` | `hybrid.refined_landmark_attention` | ✓ | ✓ | | |
|
|
303
|
+
| 108 | `regla_attention` | `inject_regla` | `hybrid.regla_attention` | | | | |
|
|
304
|
+
| 109 | `residual_svd_attention` | `ResidualSVDAttention` | `svd.residual_svd_attention` | | | | |
|
|
305
|
+
| 110 | `routing_attention` | `inject_routing` | `sparse.routing_attention` | | | | |
|
|
306
|
+
| 111 | `rpc_attention` | `inject_rpc` | `linear.rpc_attention` | | | | |
|
|
307
|
+
| 112 | `salt_attention` | `SALTAttention` | `svd.salt_attention` | ✓ | ✓ | | SALT Attention module replacing standard linear projections with SALTLinear. |
|
|
308
|
+
| 113 | `samba_m3` | `SAMBAM3Block` | `ssm.samba_m3` | | ✓ | | SAMBA-M3: Local Sliding-Window Attention + Spectral Mamba. |
|
|
309
|
+
| 114 | `samba_moe` | `SambaMoEBlock` | `ssm.samba_moe` | ✓ | ✓ | | SambaMoE: SAMBA-M3 + REAP-MoE Hybrid Architecture with pretrained weight copying |
|
|
310
|
+
| 115 | `selective_mamba` | `SelectiveMamba` | `ssm.upi_stuffed_mamba` | ✓ | | | Selective Mamba SSM block. |
|
|
311
|
+
| 116 | `selective_ssm` | `SelectiveSSM` | `ssm.selective_ssm` | ✓ | | | Faithful Mamba-style selective SSM block with hardened execution paths. |
|
|
312
|
+
| 117 | `simple_ssm` | `SelectiveSSM` | `ssm.selective_ssm` | ✓ | | | Faithful Mamba-style selective SSM block with hardened execution paths. |
|
|
313
|
+
| 118 | `simplessm` | `SelectiveSSM` | `ssm.selective_ssm` | ✓ | | | Faithful Mamba-style selective SSM block with hardened execution paths. |
|
|
314
|
+
| 119 | `sink_attention` | `SinkAttention` | `adaptive.sink_attention` | ✓ | ✓ | ✓ | Attention with dedicated sink tokens that always get attention. |
|
|
315
|
+
| 120 | `sliding_window_attention` | `SlidingWindowAttention` | `modern.sliding_window` | ✓ | ✓ | ✓ | Sliding window attention — attends to last W tokens only per position. |
|
|
316
|
+
| 121 | `soa_attn` | `SOAAttention` | `fast_kernels.soa_attn` | | ✓ | | Shared Orthogonal Attention (SOA) with Per-Projection Latent Bottlenecks. |
|
|
317
|
+
| 122 | `span_expanded_attention` | `SpanExpandedAttention` | `adaptive.span_expanded_attention` | | | | |
|
|
318
|
+
| 123 | `spectra_v2` | `SpectraV2Attention` | `linear.spectra_v2` | | | | MHA wrapper around PyTorch's scaled_dot_product_attention. |
|
|
319
|
+
| 124 | `spectraformer_attention` | `SpectraformerAttention` | `linear.spectraformer_attention` | | | | Spectraformer Attention: Exact linear-time attention via random feature kerneliz |
|
|
320
|
+
| 125 | `spectral_mamba` | `SpectralMambaAttention` | `ssm.spectral_mamba` | | | | |
|
|
321
|
+
| 126 | `spectron` | `SpectronAttention` | `linear.spectron` | ✓ | ✓ | | |
|
|
322
|
+
| 127 | `spectron_fp8` | `SpectronFP8Attention` | `hybrid.spectron_fp8_attention` | | | | |
|
|
323
|
+
| 128 | `split_head_hybrid` | `SplitHeadHybridAttention` | `hybrid.split_head_hybrid_attention` | ✓ | ✓ | | |
|
|
324
|
+
| 129 | `squeezing_heads_distill` | `SqueezingHeadsDistiller` | `adaptive.squeezing_heads_distill` | ✓ | ✓ | | Attention wrapper that keeps only the top-k most important heads |
|
|
325
|
+
| 130 | `svd_compressed` | `SVDCompressedAttention` | `svd.svd_compressed` | | ✓ | | Multi-head attention with truncated SVD projections, trainable LoRA adapters, |
|
|
326
|
+
| 131 | `svd_linear_attention` | `SVDLinearAttention` | `svd.svd_linear_attention` | ✓ | ✓ | | SVD Factorized Linear Attention with optional exponential decay gating. |
|
|
327
|
+
| 132 | `svd_linear_attn` | `SVDLinearAttention` | `svd.svd_linear_attention` | ✓ | ✓ | | SVD Factorized Linear Attention with optional exponential decay gating. |
|
|
328
|
+
| 133 | `svd_linear_decay` | `DecayGatedLinearAttention` | `svd.svd_linear_decay` | ✓ | ✓ | | Decay Gated SVD Linear Attention. |
|
|
329
|
+
| 134 | `svd_llm_v2_attention` | `SVDLLMV2Attention` | `svd.svd_llm_v2_attention` | | ✓ | | SVD-factorized attention layer with explicit U, Sigma, V^H matrix buffers |
|
|
330
|
+
| 135 | `svd_mamba` | `SVDMamba` | `svd.svd_mamba` | ✓ | | | SVD-Mamba module with SVD-factorized projections, causal convolution, and select |
|
|
331
|
+
| 136 | `svd_projection_attention` | `SVDProjectionAttention` | `svd.svd_projection_attention` | | ✓ | | Multi-Head Attention using Factorized SVD Linear Projections. |
|
|
332
|
+
| 137 | `svd_seq` | `SVDLinearAttention` | `svd.svd_attention` | | ✓ | | Low-Rank SVD-Compressed Sequence Attention Mechanism. |
|
|
333
|
+
| 138 | `template_attention` | `inject_custom_attn` | `experimental.template_attention` | | | | |
|
|
334
|
+
| 139 | `tlinformer_attention` | `TLinFormerAttention` | `linear.tlinformer_attention` | | | | TLinFormer: linear-time attention with learnable low-rank sequence projection. |
|
|
335
|
+
| 140 | `token_compressed_attention` | `TokenCompressedAttention` | `adaptive.token_compressed_attention` | ✓ | ✓ | | Token-Compressed Attention v3. |
|
|
336
|
+
| 141 | `tpa_attention` | `TPAttention` | `linear.tpa_attention` | ✓ | ✓ | | Tensor Product Attention v2 with asymmetric rank support. |
|
|
337
|
+
| 142 | `tri_branch_hybrid` | `TriBranchHybridAttention` | `hybrid.tri_branch_hybrid_attention` | ✓ | ✓ | ✓ | |
|
|
338
|
+
| 143 | `triton_cosformer` | `TritonCosformerAttention` | `linear.triton_cosformer` | | | | Triton-Accelerated Cosformer Linear Attention with Full Autograd Differentiabili |
|
|
339
|
+
| 144 | `triton_cosformer_inject` | `TritonCosformerAttention` | `linear.triton_cosformer` | | | | Triton-Accelerated Cosformer Linear Attention with Full Autograd Differentiabili |
|
|
340
|
+
| 145 | `triton_svd_linear_attention` | `TritonSVDLinearAttention` | `svd.triton_svd_linear_attention` | | | | Triton-Accelerated Linear Attention with Genuine SVD Low-Rank Projections, |
|
|
341
|
+
| 146 | `triton_svd_linear_attention_inject` | `inject_triton_svd_linear_attention` | `svd.triton_svd_linear_attention` | | | | Safe factory function to inject TritonSVDLinearAttention into a model. |
|
|
342
|
+
| 147 | `unified_rope` | `UnifiedRoPE` | `modern.unified_rope` | ✓ | ✓ | | Universal Rotary Position Embedding Attention module. |
|
|
343
|
+
| 148 | `upi_mamba` | `SelectiveMamba` | `ssm.upi_stuffed_mamba` | ✓ | | | Selective Mamba SSM block. |
|
|
344
|
+
| 149 | `upi_stuffed_mamba` | `SelectiveMamba` | `ssm.upi_stuffed_mamba` | ✓ | | | Selective Mamba SSM block. |
|
|
345
|
+
| 150 | `vig` | `ViGAttention` | `modern.vig_attention` | ✓ | ✓ | ✓ | Vision GNN-inspired 2D Grid Linear Attention with Learned Gated Fusion. |
|
|
346
|
+
| 151 | `vig_attention` | `ViGAttention` | `modern.vig_attention` | ✓ | ✓ | ✓ | Vision GNN-inspired 2D Grid Linear Attention with Learned Gated Fusion. |
|
|
347
|
+
| 152 | `vspec` | `VSpecAttention` | `ssm.vspec` | ✓ | ✓ | ✓ | VSpec++ Attention: Variational Spectral Token-Adaptive Attention Module. |
|
|
348
|
+
| 153 | `vspec_attention` | `VSpecAttention` | `ssm.vspec` | ✓ | ✓ | ✓ | VSpec++ Attention: Variational Spectral Token-Adaptive Attention Module. |
|
|
349
|
+
| 154 | `wgqa` | `WeightedGroupedQueryAttention` | `modern.wgqa_attention` | ✓ | ✓ | ✓ | Weighted Grouped-Query Attention (WGQA) with learnable per-KV-head importance we |
|
|
350
|
+
| 155 | `wgqa_attention` | `WeightedGroupedQueryAttention` | `modern.wgqa_attention` | ✓ | ✓ | ✓ | Weighted Grouped-Query Attention (WGQA) with learnable per-KV-head importance we |
|
|
351
|
+
| 156 | `x_attention` | `XAttention` | `fast_kernels.xattention` | ✓ | ✓ | ✓ | |
|
|
352
|
+
| 157 | `xattention` | `XAttention` | `fast_kernels.xattention` | ✓ | ✓ | ✓ | |
|
|
353
|
+
| 158 | `zeros` | `ZeroSAttention` | `dense.zeros_attention` | ✓ | ✓ | ✓ | |
|
|
354
|
+
| 159 | `zeros_attention` | `ZeroSAttention` | `dense.zeros_attention` | ✓ | ✓ | ✓ | |
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## Compression Engine Registry (73)
|
|
360
|
+
|
|
361
|
+
| # | Key | Class | Subpackage | Description |
|
|
362
|
+
|---:|---|---|---|---|
|
|
363
|
+
| 1 | `a3_compressor` | `A3Compressor` | `low_rank.a3_compressor` | A3: Activation-aware factorized SVD compressor. |
|
|
364
|
+
| 2 | `aa_svd_compressor` | `AASVDCompressor` | `svd.aa_svd_compressor` | |
|
|
365
|
+
| 3 | `aatc_xkv_compressor` | `AATC_XKVCompressor` | `kv_cache.aatc_xkv_compressor` | |
|
|
366
|
+
| 4 | `adaptive_ranks` | `AdaptiveRanksCompressor` | `svd.adaptive_ranks` | |
|
|
367
|
+
| 5 | `adasvd_compressor` | `AdaSVDCompressor` | `svd.adasvd_compressor` | |
|
|
368
|
+
| 6 | `admm_compressor` | `ADMMCompressor` | `pruning.admm_compressor` | ADMM-based joint structured pruning + uniform quantization engine. |
|
|
369
|
+
| 7 | `admm_pruner` | `ADMMPruner` | `pruning.admm_pruner` | Production-hardened ADMM Pruner with Layer-Wise Reconstruction Distillation, |
|
|
370
|
+
| 8 | `armor_pruner` | `ARMORPruner` | `pruning.armor_pruner` | Production-hardened ARMOR Pruner. |
|
|
371
|
+
| 9 | `ast_pruner` | `ASTPruner` | `pruning.ast_pruner` | AST Pruner: vectorized semi-structured 2:4 / N:M pruning with empirical |
|
|
372
|
+
| 10 | `astro_quantizer` | `AstroQuantizer` | `quantization.astro_quantizer` | AstroQuantizer: Uniform min-max / symmetric quantization engine with Fisher-adap |
|
|
373
|
+
| 11 | `bonsai_pruner` | `bonsai_factory` | `pruning.bonsai_pruner` | Factory for Bonsai pruner with progressive sparsity. |
|
|
374
|
+
| 12 | `cachenotes_compressor` | `CacheNotesCompressor` | `kv_cache.cachenotes_compressor` | |
|
|
375
|
+
| 13 | `come_compressor` | `CoMeCompressor` | `low_rank.come_compressor` | CoMe Compressor: Layer shedding with learnable low-rank interpolation |
|
|
376
|
+
| 14 | `compot_compressor` | `compot_compressor_factory` | `low_rank.compot_compressor` | Factory function for COMPOT compression. |
|
|
377
|
+
| 15 | `coopq_quantizer` | `coopq_factory` | `quantization.coopq_quantizer` | CoopQ compressor factory function. |
|
|
378
|
+
| 16 | `cr_compressor` | `CRCompressor` | `low_rank.cr_compressor` | CR (Column-Row / Interpolative Decomposition) Compressor. |
|
|
379
|
+
| 17 | `cur_compressor` | `CURCompressor` | `low_rank.cur_compressor` | |
|
|
380
|
+
| 18 | `cur_moe_compressor` | `cur_moe_factory` | `low_rank.cur_moe_compressor` | Factory function for CUR-MoE compressor. |
|
|
381
|
+
| 19 | `delta_kv` | `delta_kv_factory` | `kv_cache.delta_kv` | DeltaKV compressor factory. |
|
|
382
|
+
| 20 | `direct_svd` | `DirectSVDCompressor` | `svd.direct_svd` | |
|
|
383
|
+
| 21 | `dobi_svd` | `dobi_factory` | `svd.dobi_svd` | Dobi factory function. |
|
|
384
|
+
| 22 | `drone_compressor` | `DRONECompressor` | `low_rank.drone_compressor` | DRONE Compressor. |
|
|
385
|
+
| 23 | `dynamic_rank` | `dynamic_entropy_svd_factory` | `svd.dynamic_rank` | Dynamic Entropy SVD factory function. |
|
|
386
|
+
| 24 | `enlighten_compressor` | `ENLightenCompressor` | `low_rank.enlighten_compressor` | |
|
|
387
|
+
| 25 | `entropy_budget_allocation` | `EntropyBudgetCompressor` | `svd.entropy_budget_allocation` | |
|
|
388
|
+
| 26 | `erc_svd` | `ERCCompressor` | `svd.erc_svd` | |
|
|
389
|
+
| 27 | `faq_quantizer` | `FAQQuantizer` | `quantization.faq_quantizer` | FAQQuantizer: Feature-Activation-Aware Quantization. |
|
|
390
|
+
| 28 | `flap` | `FLAPCompressor` | `pruning.flap` | FLAP Compressor: Fluctuation-based Adaptive Structured Pruning. |
|
|
391
|
+
| 29 | `flat_llm` | `FLATLLMCompressor` | `experimental.flat_llm` | FLAT-LLM compressor: Activation-aware output-channel pruning. |
|
|
392
|
+
| 30 | `frandi_compressor` | `frandi_factory` | `low_rank.frandi_compressor` | Factory function for FRanDI compressor. |
|
|
393
|
+
| 31 | `fwsvd_compressor` | `FWSVDCompressor` | `svd.fwsvd_compressor` | Fisher-Weighted SVD Compressor. |
|
|
394
|
+
| 32 | `gfws` | `GFWSCompressor` | `svd.gfws_d_compressor` | |
|
|
395
|
+
| 33 | `grecodec_compressor` | `grecodec_compressor_factory` | `low_rank.grecodec_compressor` | Factory function for GreCoDeC compressor. |
|
|
396
|
+
| 34 | `hashed_net_compressor` | `hashed_net_factory` | `experimental.hashed_net_compressor` | |
|
|
397
|
+
| 35 | `huffman_coder` | `HuffmanCompressor` | `quantization.huffman_coder` | HuffmanCompressor: Model-wide entropy compression profiler and simulator. |
|
|
398
|
+
| 36 | `hybrid_svd_layer` | `HybridSVDCompressor` | `svd.hybrid_svd_layer` | Weight-based SVD compressor for Linear / Conv1D layers. |
|
|
399
|
+
| 37 | `hybridkv_compressor` | `HybridKVCompressor` | `kv_cache.hybridkv_compressor` | HybridKV Compressor: Classifies projection heads into static/dynamic types |
|
|
400
|
+
| 38 | `kmeans_quantize` | `kmeans_factory` | `quantization.kmeans_quantize` | |
|
|
401
|
+
| 39 | `kronecker_compressor` | `kronecker_factory` | `tensor_decomp.kronecker_compressor` | Kronecker compressor factory. |
|
|
402
|
+
| 40 | `kronecker_tt_lora` | `kronecker_tt_lora_factory` | `tensor_decomp.kronecker_tt_lora` | Factory for Kronecker-TT-LoRA compressor. |
|
|
403
|
+
| 41 | `kvtc_compressor` | `KVTCCompressor` | `kv_cache.kvtc_compressor` | KVTC: KV Cache Transform Coding compressor (Static Weight PCA + Quantization). |
|
|
404
|
+
| 42 | `liftr` | `liftr_compressor_entry` | `experimental.liftr` | Factory function for LIFTR compressor. |
|
|
405
|
+
| 43 | `lillama_compressor` | `lillama_factory` | `experimental.lillama_compressor` | Factory function for LiLLaMA compressor. |
|
|
406
|
+
| 44 | `lsc_compressor` | `lsc_factory` | `low_rank.lsc_compressor` | LSC Fourier spectral compressor factory. |
|
|
407
|
+
| 45 | `mamba_shedder` | `mamba_shedder_factory` | `pruning.mamba_shedder` | |
|
|
408
|
+
| 46 | `mgie_budget` | `MGIESVDBudgetCompressor` | `low_rank.mgie_svd_compressor` | MGIE-SVD Budget Compressor: Global Entropy-Proportional Rank Allocation. |
|
|
409
|
+
| 47 | `mlorq_compressor` | `MLoRQCompressor` | `low_rank.mlorq_compressor` | MLoRQ Compressor: Multi-Layer Optimal Rank and Quantization under Memory Budget. |
|
|
410
|
+
| 48 | `modegpt_compressor` | `MoDeGPTCompressor` | `low_rank.modegpt_compressor` | MoDeGPT: Modular Decomposition of Transformer Projection Blocks. |
|
|
411
|
+
| 49 | `nmf_compressor` | `NMFCompressor` | `low_rank.nmf_compressor` | NMF Compressor: decomposes linear layer magnitudes into non-negative |
|
|
412
|
+
| 50 | `oats_compressor` | `OATSCompressor` | `low_rank.oats_compressor` | OATS Compressor: Outlier-aware low-rank + structured sparse matrix decomposition |
|
|
413
|
+
| 51 | `optimal_subspace_projection` | `OptimalSubspaceProjectionCompressor` | `svd.optimal_subspace_projection` | Optimal Subspace Projection Compressor via activation-aware randomized SVD. |
|
|
414
|
+
| 52 | `proxsparse` | `ProxSparsePruner` | `pruning.proxsparse` | ProxSparse: proximal gradient sparsity with structured / 2:4 / percentile |
|
|
415
|
+
| 53 | `residual_svd_compressor` | `ResidualSVDCompressor` | `svd.residual_svd_compressor` | |
|
|
416
|
+
| 54 | `roast_hashed_linear` | `ROASTCompressor` | `experimental.roast_hashed_linear` | Replace eligible linear and Conv1D layers with ROASTLinear (hardware-aware weigh |
|
|
417
|
+
| 55 | `rotational_slicegpt_int4` | `RotationalSliceGPTINT4Compressor` | `quantization.rotational_slicegpt_int4` | Rotational-SliceGPT-INT4 hybrid compression engine. |
|
|
418
|
+
| 56 | `rpca_compressor` | `RPCACompressor` | `low_rank.rpca_compressor` | |
|
|
419
|
+
| 57 | `saes_svd_v2` | `SAESSVDCompressorV2` | `svd.saes_svd_v2` | |
|
|
420
|
+
| 58 | `salr` | `SALRCompressor` | `low_rank.salr` | |
|
|
421
|
+
| 59 | `sdrm_compressor` | `sdrm_compressor_factory` | `low_rank.sdrm_compressor` | SDRM compressor factory returning (compressed_model, stats) when requested. |
|
|
422
|
+
| 60 | `slicegpt` | `PCAActivationAwareSVDCompressor` | `quantization.slicegpt` | Per-Layer Activation-Aware Low-Rank Compression (PCA-ASVD). |
|
|
423
|
+
| 61 | `slicegpt_pca` | `SliceGPTPCACompressor` | `quantization.slicegpt_pca` | Production-hardened SliceGPT PCA-based compressor that performs activation-aware |
|
|
424
|
+
| 62 | `slim_compressor` | `SLiMCompressor` | `low_rank.slim_compressor` | |
|
|
425
|
+
| 63 | `soka_compressor` | `soka_factory` | `low_rank.soka_compressor` | Factory function for SoKA compressor. |
|
|
426
|
+
| 64 | `sparsegpt` | `sparsegpt_factory` | `pruning.sparsegpt` | Factory function for SparseGPT compressor. |
|
|
427
|
+
| 65 | `subspace_projection` | `SubspaceProjectionCompressor` | `svd.subspace_projection` | Subspace Projection Compression Engine. |
|
|
428
|
+
| 66 | `svd_linear` | `SVDLinearCompressor` | `svd.svd_linear` | Compresses model by replacing Linear/Conv1D layers with SVDLinearLayer. |
|
|
429
|
+
| 67 | `svd_llm_compressor` | `SVDLLMCompressor` | `low_rank.svd_llm_compressor` | SVD-LLM (ICLR 2025) Compressor with Cholesky activation whitening, |
|
|
430
|
+
| 68 | `swift_svd` | `SwiftSVDCompressor` | `svd.swift_svd` | |
|
|
431
|
+
| 69 | `swift_svd_act` | `SwiftSVDActivationCompressor` | `svd.swift_svd_act` | Swift-SVD Activation-Aware Compressor. |
|
|
432
|
+
| 70 | `tomoe_compressor` | `tomoe_compressor_factory` | `low_rank.tomoe_compressor` | Factory function for ToMoE compressor. |
|
|
433
|
+
| 71 | `tt_compressor` | `TTCompressor` | `tensor_decomp.tt_compressor` | Replaces Linear/Conv1D with TTLinearLayer when TT succeeds; otherwise |
|
|
434
|
+
| 72 | `uniql_compressor` | `UniQLCompressor` | `low_rank.uniql_compressor` | UniQL: Joint Truncated SVD + Uniform Quantization compressor. |
|
|
435
|
+
| 73 | `zerokv_neo_compressor` | `ZeroKVNeoCompressor` | `kv_cache.zerokv_neo_compressor` | ZeroKV-Neo Compressor: L2-norm weight pruning preserving attention sinks and hea |
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## Fused Triton Kernels
|
|
441
|
+
|
|
442
|
+
NeuralOps implements 21 custom Triton kernels with automatic fallback:
|
|
443
|
+
- **Sliding Window Attention** (`sliding_window.py`)
|
|
444
|
+
- **Paged Attention & KV Cache** (`paged_attention.py`)
|
|
445
|
+
- **Flash-Decoding Split-KV** (`linear_attn.py`)
|
|
446
|
+
- **Fused RoPE & Rotary Embeddings** (`varlen_attention.py`)
|
|
447
|
+
- **State Space & Selective Scan** (`selective_scan.py`, `state_update.py`)
|
|
448
|
+
|
|
449
|
+
All kernels automatically fall back to native PyTorch ops when running on non-CUDA hardware or CPU.
|
|
450
|
+
|
|
451
|
+
---
|
|
452
|
+
|
|
453
|
+
## Supported Architectures
|
|
454
|
+
|
|
455
|
+
| Architecture | Family | Self-Attention Module |
|
|
456
|
+
|:---|:---|:---|
|
|
457
|
+
| `distilbert` | Encoder | `MultiHeadSelfAttention` |
|
|
458
|
+
| `roberta` | Encoder | `RobertaSelfAttention` |
|
|
459
|
+
| `bert` | Encoder | `BertSelfAttention` |
|
|
460
|
+
| `gpt2` | Decoder | `GPT2Attention` (Fused Conv1D) |
|
|
461
|
+
| `llama` | Decoder | `LlamaAttention` (GQA + RoPE) |
|
|
462
|
+
| `qwen` | Decoder | `Qwen2Attention` |
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
## Performance and Tradeoffs
|
|
467
|
+
|
|
468
|
+

|
|
469
|
+
|
|
470
|
+
See [docs/REPRODUCIBILITY.md](docs/REPRODUCIBILITY.md) for benchmark setup and reproduction details.
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
## API Reference
|
|
475
|
+
|
|
476
|
+
```python
|
|
477
|
+
from neuralops.core.registry import ATTENTION_REGISTRY, COMPRESSOR_REGISTRY
|
|
478
|
+
|
|
479
|
+
# Registry lookups
|
|
480
|
+
attention_cls = ATTENTION_REGISTRY.get("cosformer")
|
|
481
|
+
compressor_cls = COMPRESSOR_REGISTRY.get("slicegpt")
|
|
482
|
+
|
|
483
|
+
# Check registered counts
|
|
484
|
+
print(len(ATTENTION_REGISTRY)) # 159
|
|
485
|
+
print(len(COMPRESSOR_REGISTRY)) # 73
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
Detailed guides:
|
|
489
|
+
- [API Reference](docs/API_REFERENCE.md)
|
|
490
|
+
- [Architecture Details](docs/ARCHITECTURE.md)
|
|
491
|
+
- [Troubleshooting](docs/TROUBLESHOOTING.md)
|
|
492
|
+
- [Migration Guide](docs/MIGRATION_GUIDE.md)
|
|
493
|
+
|
|
494
|
+
---
|
|
495
|
+
|
|
496
|
+
## Benchmarking CLI
|
|
497
|
+
|
|
498
|
+
```bash
|
|
499
|
+
# Verify system & hardware setup
|
|
500
|
+
python -m neuralops.benchmarks verify
|
|
501
|
+
|
|
502
|
+
# List all supported attention & compressor modules
|
|
503
|
+
python -m neuralops.benchmarks list
|
|
504
|
+
|
|
505
|
+
# Run a benchmark sweep
|
|
506
|
+
python -m neuralops.benchmarks run --module svd_linear_attention --model distilbert-base-uncased --dataset sst2
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
## FAQ
|
|
512
|
+
|
|
513
|
+
**Q: Does NeuralOps require an NVIDIA GPU?**
|
|
514
|
+
A: No. PyTorch CPU fallbacks ensure 100% of the attention mechanisms and compression engines run seamlessly on macOS (including Apple Silicon MPS) and CPU-only environments.
|
|
515
|
+
|
|
516
|
+
**Q: Are deprecated module names supported?**
|
|
517
|
+
A: Yes. All 657 legacy aliases map automatically to their canonical implementations and emit informative deprecation warnings.
|
|
518
|
+
|
|
519
|
+
---
|
|
520
|
+
|
|
521
|
+
## Contributing
|
|
522
|
+
|
|
523
|
+
Contributions are welcome! Please review [CONTRIBUTING.md](CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) before submitting pull requests.
|
|
524
|
+
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
## Citation and License
|
|
528
|
+
|
|
529
|
+
```bibtex
|
|
530
|
+
@software{neuralops2026,
|
|
531
|
+
title = {NeuralOps: SVD Linear Attention & Model Compression Framework},
|
|
532
|
+
author = {Majs, Taha},
|
|
533
|
+
year = {2026},
|
|
534
|
+
url = {https://github.com/tahamajs/SVD_linear_Attention}
|
|
535
|
+
}
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
Distributed under the **MIT License**. See [LICENSE](LICENSE) for details.
|