neuralops 1.1.1__py3-none-any.whl
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/__init__.py +235 -0
- neuralops/analysis/__init__.py +101 -0
- neuralops/analysis/comparison/__init__.py +28 -0
- neuralops/analysis/comparison/statistical_tests.py +761 -0
- neuralops/analysis/generate_all_modules_analysis.py +56 -0
- neuralops/analysis/generate_sweep_publication_artifacts.py +684 -0
- neuralops/analysis/layerwise_analyzer.py +369 -0
- neuralops/analysis/metrics.py +88 -0
- neuralops/analysis/model_comparison.py +45 -0
- neuralops/analysis/module_analysis/__init__.py +50 -0
- neuralops/analysis/module_analysis/aggregators.py +150 -0
- neuralops/analysis/module_analysis/constants.py +599 -0
- neuralops/analysis/module_analysis/main.py +290 -0
- neuralops/analysis/module_analysis/parsers.py +115 -0
- neuralops/analysis/module_analysis/reporters.py +140 -0
- neuralops/analysis/plotting.py +538 -0
- neuralops/analysis/report_generator.py +96 -0
- neuralops/analysis/utils.py +70 -0
- neuralops/attentions/__init__.py +159 -0
- neuralops/attentions/adaptive/__init__.py +125 -0
- neuralops/attentions/adaptive/adaptive_span_attention.py +1143 -0
- neuralops/attentions/adaptive/block_transformer_hiba.py +1075 -0
- neuralops/attentions/adaptive/eat.py +1048 -0
- neuralops/attentions/adaptive/infini_attention.py +708 -0
- neuralops/attentions/adaptive/lola_attention.py +917 -0
- neuralops/attentions/adaptive/progressive_token_pruning.py +905 -0
- neuralops/attentions/adaptive/sink_attention.py +41 -0
- neuralops/attentions/adaptive/span_expanded_attention.py +823 -0
- neuralops/attentions/adaptive/squeezing_heads_distill.py +1067 -0
- neuralops/attentions/adaptive/token_compressed_attention.py +1073 -0
- neuralops/attentions/dense/__init__.py +29 -0
- neuralops/attentions/dense/full_attention.py +713 -0
- neuralops/attentions/dense/zeros_attention.py +771 -0
- neuralops/attentions/experimental/__init__.py +17 -0
- neuralops/attentions/experimental/template_attention.py +864 -0
- neuralops/attentions/fast_kernels/__init__.py +65 -0
- neuralops/attentions/fast_kernels/adasplash_attention.py +945 -0
- neuralops/attentions/fast_kernels/flash_attention3.py +969 -0
- neuralops/attentions/fast_kernels/flash_attention3_fp8.py +1062 -0
- neuralops/attentions/fast_kernels/soa_attn.py +963 -0
- neuralops/attentions/fast_kernels/xattention.py +1045 -0
- neuralops/attentions/gated/__init__.py +113 -0
- neuralops/attentions/gated/decay_linear_attention.py +1033 -0
- neuralops/attentions/gated/gated_delta_net.py +1185 -0
- neuralops/attentions/gated/gated_deltanet_block.py +387 -0
- neuralops/attentions/gated/gated_linear_attention.py +916 -0
- neuralops/attentions/gated/hgrn2_gated_deltanet.py +440 -0
- neuralops/attentions/gated/hgrn2_gated_layer.py +668 -0
- neuralops/attentions/gated/hgrn2_gated_outer.py +742 -0
- neuralops/attentions/gated/hla_attention.py +638 -0
- neuralops/attentions/gated/kda_attention.py +890 -0
- neuralops/attentions/hybrid/__init__.py +185 -0
- neuralops/attentions/hybrid/fusion_attn.py +1280 -0
- neuralops/attentions/hybrid/gated_hybrid_kernel_attention.py +1367 -0
- neuralops/attentions/hybrid/granite_hybrid.py +706 -0
- neuralops/attentions/hybrid/halo_regla.py +675 -0
- neuralops/attentions/hybrid/hybrid_attention.py +856 -0
- neuralops/attentions/hybrid/hybrid_local_kernel_attention.py +1211 -0
- neuralops/attentions/hybrid/landmark_local_attention.py +1094 -0
- neuralops/attentions/hybrid/mixattention_moska.py +1020 -0
- neuralops/attentions/hybrid/optimized_hybrid_attention.py +898 -0
- neuralops/attentions/hybrid/positive_kernel_linear_attention.py +1013 -0
- neuralops/attentions/hybrid/refined_landmark_attention.py +1131 -0
- neuralops/attentions/hybrid/regla_attention.py +969 -0
- neuralops/attentions/hybrid/spectron_fp8_attention.py +1369 -0
- neuralops/attentions/hybrid/split_head_hybrid_attention.py +1305 -0
- neuralops/attentions/hybrid/tri_branch_hybrid_attention.py +1200 -0
- neuralops/attentions/linear/__init__.py +197 -0
- neuralops/attentions/linear/chela_slay.py +1266 -0
- neuralops/attentions/linear/cosformer.py +482 -0
- neuralops/attentions/linear/galerkin_attention.py +994 -0
- neuralops/attentions/linear/linformer_attention.py +1107 -0
- neuralops/attentions/linear/nasc_attention.py +980 -0
- neuralops/attentions/linear/nystrom_attention.py +919 -0
- neuralops/attentions/linear/performer_attention.py +1209 -0
- neuralops/attentions/linear/primal_attention.py +831 -0
- neuralops/attentions/linear/rala_attention.py +834 -0
- neuralops/attentions/linear/rpc_attention.py +1008 -0
- neuralops/attentions/linear/spectra_v2.py +798 -0
- neuralops/attentions/linear/spectraformer_attention.py +854 -0
- neuralops/attentions/linear/spectron.py +1265 -0
- neuralops/attentions/linear/tlinformer_attention.py +1005 -0
- neuralops/attentions/linear/tpa_attention.py +1135 -0
- neuralops/attentions/linear/triton_cosformer.py +874 -0
- neuralops/attentions/modern/__init__.py +125 -0
- neuralops/attentions/modern/alibi.py +53 -0
- neuralops/attentions/modern/cross_attention.py +82 -0
- neuralops/attentions/modern/gqa_attention.py +981 -0
- neuralops/attentions/modern/mla_attention.py +980 -0
- neuralops/attentions/modern/mqa.py +84 -0
- neuralops/attentions/modern/nha_attention.py +1023 -0
- neuralops/attentions/modern/qcqa_attention.py +966 -0
- neuralops/attentions/modern/sliding_window.py +60 -0
- neuralops/attentions/modern/unified_rope.py +801 -0
- neuralops/attentions/modern/vig_attention.py +845 -0
- neuralops/attentions/modern/wgqa_attention.py +962 -0
- neuralops/attentions/sparse/__init__.py +149 -0
- neuralops/attentions/sparse/adaptive_sparse_attention.py +1065 -0
- neuralops/attentions/sparse/bam_umoe.py +1063 -0
- neuralops/attentions/sparse/cluster_attention.py +1110 -0
- neuralops/attentions/sparse/expert_choice_moe.py +1010 -0
- neuralops/attentions/sparse/hamming_attention.py +782 -0
- neuralops/attentions/sparse/lsh_attention.py +1058 -0
- neuralops/attentions/sparse/moba_attention.py +1022 -0
- neuralops/attentions/sparse/moe_deltakv_paged.py +1222 -0
- neuralops/attentions/sparse/nsa_attention.py +810 -0
- neuralops/attentions/sparse/padre_attention.py +873 -0
- neuralops/attentions/sparse/reap_moe.py +1168 -0
- neuralops/attentions/sparse/routing_attention.py +961 -0
- neuralops/attentions/ssm/__init__.py +209 -0
- neuralops/attentions/ssm/goldfinch_ahn.py +1074 -0
- neuralops/attentions/ssm/griffin_ssd.py +736 -0
- neuralops/attentions/ssm/hymba_transx.py +1070 -0
- neuralops/attentions/ssm/jamba.py +692 -0
- neuralops/attentions/ssm/jamba_info.py +1116 -0
- neuralops/attentions/ssm/mamba_block.py +938 -0
- neuralops/attentions/ssm/mamba_svd_flash.py +1397 -0
- neuralops/attentions/ssm/nexus.py +1268 -0
- neuralops/attentions/ssm/orion.py +1194 -0
- neuralops/attentions/ssm/phantom.py +872 -0
- neuralops/attentions/ssm/samba_m3.py +925 -0
- neuralops/attentions/ssm/samba_moe.py +424 -0
- neuralops/attentions/ssm/selective_ssm.py +286 -0
- neuralops/attentions/ssm/simple_ssm.py +330 -0
- neuralops/attentions/ssm/spectral_mamba.py +984 -0
- neuralops/attentions/ssm/upi_stuffed_mamba.py +990 -0
- neuralops/attentions/ssm/vspec.py +1074 -0
- neuralops/attentions/svd/__init__.py +257 -0
- neuralops/attentions/svd/adaptive_svd_attention.py +1047 -0
- neuralops/attentions/svd/asvd_attention.py +1083 -0
- neuralops/attentions/svd/compressed_attention.py +722 -0
- neuralops/attentions/svd/compressed_mha_attention.py +752 -0
- neuralops/attentions/svd/factorised_matrix_state.py +972 -0
- neuralops/attentions/svd/fused_svd_kernel.py +1288 -0
- neuralops/attentions/svd/lora_attention.py +854 -0
- neuralops/attentions/svd/minimal_nova.py +860 -0
- neuralops/attentions/svd/minimal_svd.py +817 -0
- neuralops/attentions/svd/naive_svd.py +102 -0
- neuralops/attentions/svd/projection_factorized_attn.py +277 -0
- neuralops/attentions/svd/residual_svd_attention.py +778 -0
- neuralops/attentions/svd/salt_attention.py +1030 -0
- neuralops/attentions/svd/svd_attention.py +960 -0
- neuralops/attentions/svd/svd_compressed.py +1254 -0
- neuralops/attentions/svd/svd_linear_attention.py +1582 -0
- neuralops/attentions/svd/svd_linear_decay.py +194 -0
- neuralops/attentions/svd/svd_llm_v2_attention.py +975 -0
- neuralops/attentions/svd/svd_mamba.py +1012 -0
- neuralops/attentions/svd/svd_projection_attention.py +840 -0
- neuralops/attentions/svd/triton_svd_linear_attention.py +1183 -0
- neuralops/benchmarks/__init__.py +44 -0
- neuralops/benchmarks/__main__.py +8 -0
- neuralops/benchmarks/adapters/__init__.py +13 -0
- neuralops/benchmarks/adapters/classification.py +211 -0
- neuralops/benchmarks/adapters/perplexity.py +173 -0
- neuralops/benchmarks/adapters/ruler.py +190 -0
- neuralops/benchmarks/adapters/zeroshot.py +243 -0
- neuralops/benchmarks/api.py +120 -0
- neuralops/benchmarks/cli.py +224 -0
- neuralops/benchmarks/config.py +151 -0
- neuralops/benchmarks/core/__init__.py +48 -0
- neuralops/benchmarks/core/arguments.py +174 -0
- neuralops/benchmarks/core/data_loader.py +149 -0
- neuralops/benchmarks/core/evaluation.py +212 -0
- neuralops/benchmarks/core/kd.py +124 -0
- neuralops/benchmarks/core/model_loader.py +247 -0
- neuralops/benchmarks/core/stats.py +99 -0
- neuralops/benchmarks/core/training.py +96 -0
- neuralops/benchmarks/discovery.py +138 -0
- neuralops/benchmarks/discovery_overrides.json +13 -0
- neuralops/benchmarks/eval_suite.py +78 -0
- neuralops/benchmarks/executor.py +312 -0
- neuralops/benchmarks/gpu_live_probe.py +2 -0
- neuralops/benchmarks/harvest_gpu_benchmark_data.py +2 -0
- neuralops/benchmarks/kd_quick_test.py +20 -0
- neuralops/benchmarks/kernel_benchmark.py +51 -0
- neuralops/benchmarks/launch_parallel_sweep.py +20 -0
- neuralops/benchmarks/multi_mode_benchmark.py +20 -0
- neuralops/benchmarks/orchestrator.py +220 -0
- neuralops/benchmarks/registry.py +63 -0
- neuralops/benchmarks/result.py +108 -0
- neuralops/benchmarks/run_all_benchmarks.py +20 -0
- neuralops/benchmarks/run_all_modules_scheduler.py +20 -0
- neuralops/benchmarks/run_gpt2_sweep.py +20 -0
- neuralops/benchmarks/run_long_context_sweep.py +20 -0
- neuralops/benchmarks/run_multiseed.py +20 -0
- neuralops/benchmarks/run_multiseed_rigor.py +20 -0
- neuralops/benchmarks/run_one_module_isolated.py +20 -0
- neuralops/benchmarks/run_quality_sweep.py +20 -0
- neuralops/benchmarks/run_rank_sweeper.py +20 -0
- neuralops/benchmarks/run_ruler_benchmark.py +20 -0
- neuralops/benchmarks/run_seqlen_scaling.py +20 -0
- neuralops/benchmarks/run_seqlen_scaling_bench.py +20 -0
- neuralops/benchmarks/run_whitened_svd.py +20 -0
- neuralops/benchmarks/runner.py +51 -0
- neuralops/benchmarks/suite_runner.py +119 -0
- neuralops/benchmarks/utils/__init__.py +1 -0
- neuralops/benchmarks/utils/gpu_probe.py +255 -0
- neuralops/benchmarks/utils/harvest_data.py +38 -0
- neuralops/benchmarks/writers.py +136 -0
- neuralops/compression_engine/__init__.py +89 -0
- neuralops/compression_engine/experimental/__init__.py +65 -0
- neuralops/compression_engine/experimental/flat_llm.py +680 -0
- neuralops/compression_engine/experimental/hashed_net_compressor.py +942 -0
- neuralops/compression_engine/experimental/liftr.py +645 -0
- neuralops/compression_engine/experimental/lillama_compressor.py +708 -0
- neuralops/compression_engine/experimental/roast_hashed_linear.py +585 -0
- neuralops/compression_engine/kv_cache/__init__.py +77 -0
- neuralops/compression_engine/kv_cache/aatc_xkv_compressor.py +995 -0
- neuralops/compression_engine/kv_cache/cachenotes_compressor.py +1121 -0
- neuralops/compression_engine/kv_cache/delta_kv.py +620 -0
- neuralops/compression_engine/kv_cache/hybridkv_compressor.py +422 -0
- neuralops/compression_engine/kv_cache/kvtc_compressor.py +824 -0
- neuralops/compression_engine/kv_cache/zerokv_neo_compressor.py +500 -0
- neuralops/compression_engine/low_rank/__init__.py +293 -0
- neuralops/compression_engine/low_rank/a3_compressor.py +1304 -0
- neuralops/compression_engine/low_rank/come_compressor.py +1137 -0
- neuralops/compression_engine/low_rank/compot_compressor.py +496 -0
- neuralops/compression_engine/low_rank/cr_compressor.py +544 -0
- neuralops/compression_engine/low_rank/cur_compressor.py +508 -0
- neuralops/compression_engine/low_rank/cur_moe_compressor.py +477 -0
- neuralops/compression_engine/low_rank/dora_qlora.py +131 -0
- neuralops/compression_engine/low_rank/drone_compressor.py +305 -0
- neuralops/compression_engine/low_rank/enlighten_compressor.py +498 -0
- neuralops/compression_engine/low_rank/frandi_compressor.py +798 -0
- neuralops/compression_engine/low_rank/grecodec_compressor.py +581 -0
- neuralops/compression_engine/low_rank/lsc_compressor.py +722 -0
- neuralops/compression_engine/low_rank/mgie_svd_compressor.py +634 -0
- neuralops/compression_engine/low_rank/mlorq_compressor.py +873 -0
- neuralops/compression_engine/low_rank/modegpt_compressor.py +829 -0
- neuralops/compression_engine/low_rank/nmf_compressor.py +646 -0
- neuralops/compression_engine/low_rank/oats_compressor.py +692 -0
- neuralops/compression_engine/low_rank/rpca_compressor.py +490 -0
- neuralops/compression_engine/low_rank/salr.py +596 -0
- neuralops/compression_engine/low_rank/sdrm_compressor.py +545 -0
- neuralops/compression_engine/low_rank/slim_compressor.py +324 -0
- neuralops/compression_engine/low_rank/soka_compressor.py +360 -0
- neuralops/compression_engine/low_rank/svd_llm_compressor.py +770 -0
- neuralops/compression_engine/low_rank/tomoe_compressor.py +767 -0
- neuralops/compression_engine/low_rank/uniql_compressor.py +559 -0
- neuralops/compression_engine/pruning/__init__.py +113 -0
- neuralops/compression_engine/pruning/admm_compressor.py +541 -0
- neuralops/compression_engine/pruning/admm_pruner.py +992 -0
- neuralops/compression_engine/pruning/armor_pruner.py +971 -0
- neuralops/compression_engine/pruning/ast_pruner.py +785 -0
- neuralops/compression_engine/pruning/bonsai_pruner.py +638 -0
- neuralops/compression_engine/pruning/flap.py +582 -0
- neuralops/compression_engine/pruning/mamba_shedder.py +921 -0
- neuralops/compression_engine/pruning/proxsparse.py +709 -0
- neuralops/compression_engine/pruning/sparsegpt.py +437 -0
- neuralops/compression_engine/pruning/wanda.py +67 -0
- neuralops/compression_engine/quantization/__init__.py +101 -0
- neuralops/compression_engine/quantization/astro_quantizer.py +869 -0
- neuralops/compression_engine/quantization/awq.py +64 -0
- neuralops/compression_engine/quantization/coopq_quantizer.py +705 -0
- neuralops/compression_engine/quantization/faq_quantizer.py +851 -0
- neuralops/compression_engine/quantization/gptq.py +101 -0
- neuralops/compression_engine/quantization/huffman_coder.py +639 -0
- neuralops/compression_engine/quantization/kmeans_quantize.py +879 -0
- neuralops/compression_engine/quantization/rotational_slicegpt_int4.py +717 -0
- neuralops/compression_engine/quantization/slicegpt.py +618 -0
- neuralops/compression_engine/quantization/slicegpt_pca.py +885 -0
- neuralops/compression_engine/quantization/smoothquant.py +60 -0
- neuralops/compression_engine/svd/__init__.py +221 -0
- neuralops/compression_engine/svd/aa_svd_compressor.py +949 -0
- neuralops/compression_engine/svd/adaptive_ranks.py +1258 -0
- neuralops/compression_engine/svd/adasvd_compressor.py +1462 -0
- neuralops/compression_engine/svd/direct_svd.py +567 -0
- neuralops/compression_engine/svd/dobi_svd.py +665 -0
- neuralops/compression_engine/svd/dynamic_rank.py +1072 -0
- neuralops/compression_engine/svd/entropy_budget_allocation.py +587 -0
- neuralops/compression_engine/svd/erc_svd.py +562 -0
- neuralops/compression_engine/svd/fwsvd_compressor.py +416 -0
- neuralops/compression_engine/svd/gfws_d_compressor.py +638 -0
- neuralops/compression_engine/svd/hybrid_svd_layer.py +617 -0
- neuralops/compression_engine/svd/optimal_subspace_projection.py +731 -0
- neuralops/compression_engine/svd/residual_svd_compressor.py +457 -0
- neuralops/compression_engine/svd/saes_svd_v2.py +318 -0
- neuralops/compression_engine/svd/subspace_projection.py +660 -0
- neuralops/compression_engine/svd/svd_linear.py +458 -0
- neuralops/compression_engine/svd/swift_svd.py +530 -0
- neuralops/compression_engine/svd/swift_svd_act.py +796 -0
- neuralops/compression_engine/tensor_decomp/__init__.py +41 -0
- neuralops/compression_engine/tensor_decomp/kronecker_compressor.py +1028 -0
- neuralops/compression_engine/tensor_decomp/kronecker_tt_lora.py +897 -0
- neuralops/compression_engine/tensor_decomp/tt_compressor.py +949 -0
- neuralops/config/__init__.py +51 -0
- neuralops/config/compression_config.py +94 -0
- neuralops/config/config.py +65 -0
- neuralops/config/data_config.py +24 -0
- neuralops/config/experiment_config.py +45 -0
- neuralops/config/hardware_config.py +13 -0
- neuralops/config/loader.py +60 -0
- neuralops/config/method_config.py +61 -0
- neuralops/config/model_config.py +13 -0
- neuralops/config/sweep_config.py +15 -0
- neuralops/config/training_config.py +29 -0
- neuralops/core/__init__.py +97 -0
- neuralops/core/_attention_extractors.py +131 -0
- neuralops/core/_attention_helpers.py +256 -0
- neuralops/core/_attention_injectors.py +541 -0
- neuralops/core/_attention_surgery.py +414 -0
- neuralops/core/_attention_wrapper.py +497 -0
- neuralops/core/adapters.py +254 -0
- neuralops/core/architecture.py +202 -0
- neuralops/core/attention_mask.py +172 -0
- neuralops/core/attention_utils.py +121 -0
- neuralops/core/autograd/__init__.py +6 -0
- neuralops/core/autograd/flash_attention.py +85 -0
- neuralops/core/autograd/fused_backward.py +64 -0
- neuralops/core/base.py +190 -0
- neuralops/core/common.py +553 -0
- neuralops/core/compression_engine.py +21 -0
- neuralops/core/compression_pipeline.py +63 -0
- neuralops/core/config.py +17 -0
- neuralops/core/cuda_graph.py +50 -0
- neuralops/core/deprecated_aliases.json +659 -0
- neuralops/core/fused_norm_attention.py +50 -0
- neuralops/core/gqa_utils.py +88 -0
- neuralops/core/legacy_ensemble.py +18 -0
- neuralops/core/memory.py +87 -0
- neuralops/core/metrics.py +120 -0
- neuralops/core/model_family.py +247 -0
- neuralops/core/model_utils.py +154 -0
- neuralops/core/model_wrapper.py +236 -0
- neuralops/core/multi_mode_benchmark.py +17 -0
- neuralops/core/pruning_utils.py +490 -0
- neuralops/core/quantized_attention.py +79 -0
- neuralops/core/registry.py +408 -0
- neuralops/core/replace_attention.py +260 -0
- neuralops/core/rope.py +147 -0
- neuralops/core/selective_scan.py +253 -0
- neuralops/core/snapshot_restore.py +96 -0
- neuralops/core/svd_utils.py +65 -0
- neuralops/core/t5_compat.py +205 -0
- neuralops/core/triton_kernels/__init__.py +100 -0
- neuralops/core/triton_kernels/_common.py +615 -0
- neuralops/core/triton_kernels/_types.py +452 -0
- neuralops/core/triton_kernels/autotuner.py +58 -0
- neuralops/core/triton_kernels/block_sparse.py +44 -0
- neuralops/core/triton_kernels/elementwise.py +52 -0
- neuralops/core/triton_kernels/flash_decoding.py +91 -0
- neuralops/core/triton_kernels/fms_scan.py +545 -0
- neuralops/core/triton_kernels/fused_rope.py +60 -0
- neuralops/core/triton_kernels/gdn_scan.py +503 -0
- neuralops/core/triton_kernels/gla_scan.py +482 -0
- neuralops/core/triton_kernels/gqa.py +166 -0
- neuralops/core/triton_kernels/hgrn2_scan.py +254 -0
- neuralops/core/triton_kernels/linear_attn.py +451 -0
- neuralops/core/triton_kernels/low_rank.py +261 -0
- neuralops/core/triton_kernels/paged_attention.py +96 -0
- neuralops/core/triton_kernels/selective_scan.py +437 -0
- neuralops/core/triton_kernels/sliding_window.py +120 -0
- neuralops/core/triton_kernels/softplus.py +59 -0
- neuralops/core/triton_kernels/sparse_attn.py +291 -0
- neuralops/core/triton_kernels/state_update.py +309 -0
- neuralops/core/triton_kernels/varlen_attention.py +51 -0
- neuralops/core/triton_linear_attn.py +31 -0
- neuralops/core/triton_sparse_attn.py +36 -0
- neuralops/core/utils.py +102 -0
- neuralops/data/__init__.py +87 -0
- neuralops/data/augmentation.py +27 -0
- neuralops/data/base.py +367 -0
- neuralops/data/benchmark_datasets/__init__.py +50 -0
- neuralops/data/benchmark_datasets/loaders.py +308 -0
- neuralops/data/benchmark_datasets/manifest.py +328 -0
- neuralops/data/benchmark_datasets/synthetic.py +430 -0
- neuralops/data/benchmark_datasets.py +43 -0
- neuralops/data/cached_tensors.py +168 -0
- neuralops/data/custom.py +24 -0
- neuralops/data/custom_loader.py +106 -0
- neuralops/data/dataset_discovery.py +12 -0
- neuralops/data/dataset_loader.py +146 -0
- neuralops/data/glue.py +67 -0
- neuralops/data/glue_loader.py +212 -0
- neuralops/data/multi_choice.py +186 -0
- neuralops/data/prepare_datasets.py +496 -0
- neuralops/data/preprocessing.py +33 -0
- neuralops/data/synthetic_generator.py +397 -0
- neuralops/data/task_mapper.py +57 -0
- neuralops/data/validation.py +77 -0
- neuralops/evaluation/__init__.py +37 -0
- neuralops/evaluation/ab_testing.py +53 -0
- neuralops/evaluation/eval_all_models_datasets.py +197 -0
- neuralops/evaluation/eval_data.py +329 -0
- neuralops/evaluation/eval_patcher.py +545 -0
- neuralops/evaluation/eval_perplexity.py +384 -0
- neuralops/evaluation/eval_pipeline.py +1108 -0
- neuralops/evaluation/eval_reporter.py +169 -0
- neuralops/evaluation/eval_types.py +391 -0
- neuralops/evaluation/eval_utils.py +125 -0
- neuralops/evaluation/fairness.py +255 -0
- neuralops/evaluation/full_mnli_validation.py +343 -0
- neuralops/evaluation/label_quality.py +208 -0
- neuralops/evaluation/metrics.py +6 -0
- neuralops/evaluation/retraining.py +252 -0
- neuralops/evaluation/run_baseline_comparison.py +274 -0
- neuralops/evaluation/run_lm_eval_harness.py +388 -0
- neuralops/experiment_logging/__init__.py +21 -0
- neuralops/experiment_logging/callbacks.py +56 -0
- neuralops/experiment_logging/config.py +27 -0
- neuralops/experiment_logging/integration.py +56 -0
- neuralops/experiment_logging/logger.py +194 -0
- neuralops/experiment_logging/tracker.py +39 -0
- neuralops/experiment_utils/__init__.py +21 -0
- neuralops/experiment_utils/comparison.py +250 -0
- neuralops/experiment_utils/config.py +148 -0
- neuralops/experiment_utils/data.py +44 -0
- neuralops/experiment_utils/main.py +367 -0
- neuralops/experiment_utils/model.py +49 -0
- neuralops/experiment_utils/orchestrator.py +189 -0
- neuralops/experiment_utils/runner.py +13 -0
- neuralops/experiment_utils/tasks.py +230 -0
- neuralops/experiment_utils/train.py +86 -0
- neuralops/inference/__init__.py +20 -0
- neuralops/inference/engine.py +254 -0
- neuralops/inference/paged_cache.py +107 -0
- neuralops/integrations/__init__.py +15 -0
- neuralops/integrations/distributed_compile.py +54 -0
- neuralops/integrations/hf_automodel.py +61 -0
- neuralops/integrations/serving.py +33 -0
- neuralops/main.py +855 -0
- neuralops/py.typed +0 -0
- neuralops/results_saver/__init__.py +21 -0
- neuralops/results_saver/backends/__init__.py +9 -0
- neuralops/results_saver/backends/huggingface.py +79 -0
- neuralops/results_saver/config.py +86 -0
- neuralops/results_saver/pipeline/__init__.py +5 -0
- neuralops/results_saver/pipeline/result_writer.py +242 -0
- neuralops/results_saver/saver.py +506 -0
- neuralops/results_saver/storage/__init__.py +0 -0
- neuralops/results_saver/storage/sqlite_ops.py +127 -0
- neuralops/results_saver/writers/__init__.py +0 -0
- neuralops/results_saver/writers/csv_writer.py +108 -0
- neuralops/results_saver/writers/json_parquet_writer.py +108 -0
- neuralops/results_saver/writers/plot_writer.py +105 -0
- neuralops/runners/__init__.py +26 -0
- neuralops/runners/module_sweeps/__init__.py +0 -0
- neuralops/runners/monitor/__init__.py +47 -0
- neuralops/runners/monitor/endpoints.py +141 -0
- neuralops/runners/monitor/rendering.py +32 -0
- neuralops/runners/monitor/server.py +178 -0
- neuralops/runners/monitor/stats.py +192 -0
- neuralops/runners/monitor/telemetry.py +160 -0
- neuralops/runners/run_autonomous_48h_pipeline.py +649 -0
- neuralops/runners/run_continuous_orchestrator.py +165 -0
- neuralops/runners/run_master_pipeline.py +163 -0
- neuralops/runners/run_monitor_server.py +75 -0
- neuralops/runners/run_sweep.py +57 -0
- neuralops/runners/unified_orchestrator.py +271 -0
- neuralops/tracking/__init__.py +24 -0
- neuralops/tracking/backends.py +257 -0
- neuralops/tracking/callbacks.py +34 -0
- neuralops/tracking/tracker.py +138 -0
- neuralops/trainer/__init__.py +143 -0
- neuralops/trainer/base_trainer.py +16 -0
- neuralops/trainer/callbacks.py +100 -0
- neuralops/trainer/custom_loop_trainer.py +237 -0
- neuralops/trainer/hf_trainer.py +122 -0
- neuralops/trainer/hyperopt.py +148 -0
- neuralops/trainer/losses.py +94 -0
- neuralops/trainer/methods/__init__.py +52 -0
- neuralops/trainer/methods/fisher.py +100 -0
- neuralops/trainer/methods/gelora.py +141 -0
- neuralops/trainer/methods/llrd.py +76 -0
- neuralops/trainer/methods/lora.py +164 -0
- neuralops/trainer/methods/mixout.py +58 -0
- neuralops/trainer/methods/rdrop_r3f.py +140 -0
- neuralops/trainer/methods/registry.py +59 -0
- neuralops/trainer/metrics.py +113 -0
- neuralops/trainer/optimizers/__init__.py +53 -0
- neuralops/trainer/optimizers/factory.py +139 -0
- neuralops/trainer/optimizers/muon.py +257 -0
- neuralops/trainer/optimizers/riemannian.py +354 -0
- neuralops/trainer/optimizers/stiefel.py +165 -0
- neuralops/trainer/optimizers.py +47 -0
- neuralops/trainer/registry.py +43 -0
- neuralops/trainer/results_manager.py +179 -0
- neuralops/trainer/rl_trainer.py +177 -0
- neuralops/trainer/schedulers.py +65 -0
- neuralops/trainer/train_lra.py +426 -0
- neuralops/trainer/trainer.py +270 -0
- neuralops/trainer/trainer_factory.py +15 -0
- neuralops/trainer/trainer_svd.py +133 -0
- neuralops/trainer/unsloth_trainer.py +82 -0
- neuralops/trainer/utils.py +455 -0
- neuralops/training/__init__.py +18 -0
- neuralops/training/checkpointing.py +53 -0
- neuralops/training/trainer.py +173 -0
- neuralops/utils/__init__.py +96 -0
- neuralops/utils/architecture.py +145 -0
- neuralops/utils/attention_profiler.py +63 -0
- neuralops/utils/attention_utils.py +0 -0
- neuralops/utils/checkpoint.py +69 -0
- neuralops/utils/compat/__init__.py +53 -0
- neuralops/utils/compat/aliases.py +49 -0
- neuralops/utils/compat/architectures.py +495 -0
- neuralops/utils/compat/param_recovery.py +372 -0
- neuralops/utils/compat.py +51 -0
- neuralops/utils/config.py +47 -0
- neuralops/utils/device.py +13 -0
- neuralops/utils/helpers.py +97 -0
- neuralops/utils/hf_git_exporter.py +560 -0
- neuralops/utils/layer_norm_fix.py +193 -0
- neuralops/utils/logger.py +37 -0
- neuralops/utils/lora.py +265 -0
- neuralops/utils/metrics.py +71 -0
- neuralops/utils/model_family.py +26 -0
- neuralops/utils/paths.py +22 -0
- neuralops/utils/profiler.py +167 -0
- neuralops/utils/qwen_compat.py +270 -0
- neuralops/utils/replace_attention.py +598 -0
- neuralops/utils/results_saver.py +76 -0
- neuralops/utils/seed.py +16 -0
- neuralops-1.1.1.dist-info/METADATA +538 -0
- neuralops-1.1.1.dist-info/RECORD +519 -0
- neuralops-1.1.1.dist-info/WHEEL +5 -0
- neuralops-1.1.1.dist-info/entry_points.txt +2 -0
- neuralops-1.1.1.dist-info/licenses/LICENSE +21 -0
- neuralops-1.1.1.dist-info/top_level.txt +1 -0
neuralops/__init__.py
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"""
|
|
2
|
+
NeuralOps Core ML Framework & Efficient Transformer Toolkit.
|
|
3
|
+
|
|
4
|
+
A unified, modular, and high-performance toolkit for custom attention mechanisms,
|
|
5
|
+
model compression (SVD, quantization, pruning, distillation), distributed training,
|
|
6
|
+
hyperparameter optimization, federated learning, data loading, benchmarking,
|
|
7
|
+
and interactive visualization.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import importlib
|
|
11
|
+
from typing import Any, List
|
|
12
|
+
|
|
13
|
+
__version__ = "1.1.1"
|
|
14
|
+
|
|
15
|
+
import importlib.machinery
|
|
16
|
+
import importlib.util
|
|
17
|
+
|
|
18
|
+
# Transparent Import Hook for Cleaned Submodule Aliases
|
|
19
|
+
import sys
|
|
20
|
+
from importlib.abc import MetaPathFinder
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class _AliasLoader:
|
|
24
|
+
def __init__(self, mod):
|
|
25
|
+
"""Execute __init__ operation."""
|
|
26
|
+
self.mod = mod
|
|
27
|
+
|
|
28
|
+
def create_module(self, spec):
|
|
29
|
+
"""Execute create_module operation."""
|
|
30
|
+
return self.mod
|
|
31
|
+
|
|
32
|
+
def exec_module(self, module):
|
|
33
|
+
"""Execute exec_module operation."""
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class _ModuleAliasFinder(MetaPathFinder):
|
|
38
|
+
_ALIASES = {
|
|
39
|
+
# Attentions
|
|
40
|
+
"neuralops.attentions.gqa": "neuralops.attentions.gqa_attention",
|
|
41
|
+
"neuralops.attentions.galerkin": "neuralops.attentions.galerkin_attention",
|
|
42
|
+
"neuralops.attentions.galerkin_inject": "neuralops.attentions.galerkin_attention",
|
|
43
|
+
"neuralops.attentions.adaptive_span_inject": "neuralops.attentions.adaptive_span_attention",
|
|
44
|
+
"neuralops.attentions.adaptive_sparse_inject": "neuralops.attentions.adaptive_sparse_attention",
|
|
45
|
+
"neuralops.attentions.adasplash_inject": "neuralops.attentions.adasplash_attention",
|
|
46
|
+
"neuralops.attentions.aegis_hybrid_attention": "neuralops.attentions.aegis_hybrid",
|
|
47
|
+
"neuralops.attentions.aegis_v1": "neuralops.attentions.aegis_v2",
|
|
48
|
+
"neuralops.attentions.aegis_v3": "neuralops.attentions.aegis_v2",
|
|
49
|
+
"neuralops.attentions.aegis_v4": "neuralops.attentions.aegis_v2",
|
|
50
|
+
"neuralops.attentions.minimal_aurora": "neuralops.attentions.minimal_svd",
|
|
51
|
+
"neuralops.attentions.minimal_prism": "neuralops.attentions.minimal_svd",
|
|
52
|
+
"neuralops.attentions.minimal_svd_v2": "neuralops.attentions.minimal_svd",
|
|
53
|
+
"neuralops.attentions.cluster_inject": "neuralops.attentions.cluster_attention",
|
|
54
|
+
"neuralops.attentions.compressed_mha": "neuralops.attentions.compressed_mha_attention",
|
|
55
|
+
"neuralops.attentions.cosformer_inject": "neuralops.attentions.cosformer",
|
|
56
|
+
"neuralops.attentions.hla_inject": "neuralops.attentions.hla_attention",
|
|
57
|
+
"neuralops.attentions.kda_inject": "neuralops.attentions.kda_attention",
|
|
58
|
+
"neuralops.attentions.leka_v1_inject": "neuralops.attentions.leka_v1",
|
|
59
|
+
"neuralops.attentions.leka_v2_inject": "neuralops.attentions.leka_v2",
|
|
60
|
+
"neuralops.attentions.leka_v3_inject": "neuralops.attentions.leka_v3",
|
|
61
|
+
"neuralops.attentions.mamba_attention": "neuralops.attentions.mamba_block",
|
|
62
|
+
"neuralops.attentions.moba": "neuralops.attentions.moba_attention",
|
|
63
|
+
"neuralops.attentions.nha_compressor": "neuralops.attentions.nha_attention",
|
|
64
|
+
"neuralops.attentions.rpc": "neuralops.attentions.rpc_attention",
|
|
65
|
+
"neuralops.attentions.salt": "neuralops.attentions.salt_attention",
|
|
66
|
+
"neuralops.attentions.soa_fused_module": "neuralops.attentions.soa_attn",
|
|
67
|
+
"neuralops.attentions.SOAFusedAttention": "neuralops.attentions.soa_attn",
|
|
68
|
+
"neuralops.attentions.soa_module": "neuralops.attentions.soa_attn",
|
|
69
|
+
"neuralops.attentions.spectra_v2_attention": "neuralops.attentions.spectra_v2",
|
|
70
|
+
"neuralops.attentions.svd_compressed_attention": "neuralops.attentions.svd_compressed",
|
|
71
|
+
"neuralops.attentions.svd_llm_v2": "neuralops.attentions.svd_llm_v2_attention",
|
|
72
|
+
"neuralops.attentions.svd_proj_attn": "neuralops.attentions.svd_projection_attention",
|
|
73
|
+
"neuralops.attentions.token_compressed": "neuralops.attentions.token_compressed_attention",
|
|
74
|
+
"neuralops.attentions.tt": "neuralops.attentions.token_compressed_attention",
|
|
75
|
+
"neuralops.attentions.upi_mamba": "neuralops.attentions.upi_stuffed_mamba",
|
|
76
|
+
"neuralops.attentions.mamba": "neuralops.attentions.mamba_block",
|
|
77
|
+
"neuralops.attentions.mamba_inject": "neuralops.attentions.mamba_block",
|
|
78
|
+
"neuralops.attentions.simple_ssm": "neuralops.attentions.selective_ssm",
|
|
79
|
+
"neuralops.attentions.smart_weighted_ensemble": "neuralops.attentions.hybrid_attention",
|
|
80
|
+
"neuralops.attentions.weighted_ensemble": "neuralops.attentions.hybrid_attention",
|
|
81
|
+
"neuralops.attentions.spectron_attention": "neuralops.attentions.spectron",
|
|
82
|
+
"neuralops.attentions.squeezing_heads": "neuralops.attentions.squeezing_heads_distill",
|
|
83
|
+
"neuralops.attentions.squeezing_heads_distiller": "neuralops.attentions.squeezing_heads_distill",
|
|
84
|
+
"neuralops.attentions.spectral_mamba_attention": "neuralops.attentions.spectral_mamba",
|
|
85
|
+
"neuralops.attentions.svd_sequence_attention": "neuralops.attentions.svd_attention",
|
|
86
|
+
"neuralops.attentions.rala_compressor": "neuralops.attentions.rala_attention",
|
|
87
|
+
"neuralops.attentions.selective_scan": "neuralops.core.selective_scan",
|
|
88
|
+
"neuralops.attentions.ssm_scan": "neuralops.core.selective_scan",
|
|
89
|
+
"neuralops.attentions.legacy_ensemble": "neuralops.core.legacy_ensemble",
|
|
90
|
+
# Compressors
|
|
91
|
+
"neuralops.compression_engine.aasvd": "neuralops.compression_engine.aa_svd_compressor",
|
|
92
|
+
"neuralops.compression_engine.adasvd": "neuralops.compression_engine.adasvd_compressor",
|
|
93
|
+
"neuralops.compression_engine.cur_moe": "neuralops.compression_engine.cur_moe_compressor",
|
|
94
|
+
"neuralops.compression_engine.frandi": "neuralops.compression_engine.frandi_compressor",
|
|
95
|
+
"neuralops.compression_engine.grecodec": "neuralops.compression_engine.grecodec_compressor",
|
|
96
|
+
"neuralops.compression_engine.hybridkv": "neuralops.compression_engine.hybridkv_compressor",
|
|
97
|
+
"neuralops.compression_engine.kvtc": "neuralops.compression_engine.kvtc_compressor",
|
|
98
|
+
"neuralops.compression_engine.modegpt": "neuralops.compression_engine.modegpt_compressor",
|
|
99
|
+
"neuralops.compression_engine.oats": "neuralops.compression_engine.oats_compressor",
|
|
100
|
+
"neuralops.compression_engine.proxsparse_pruner": "neuralops.compression_engine.proxsparse",
|
|
101
|
+
"neuralops.compression_engine.rpca": "neuralops.compression_engine.rpca_compressor",
|
|
102
|
+
"neuralops.compression_engine.saes_svd": "neuralops.compression_engine.saes_svd_v2",
|
|
103
|
+
"neuralops.compression_engine.saes_svd_compressor": "neuralops.compression_engine.saes_svd_v2",
|
|
104
|
+
"neuralops.compression_engine.sdrm": "neuralops.compression_engine.sdrm_compressor",
|
|
105
|
+
"neuralops.compression_engine.slicegpt_compressor": "neuralops.compression_engine.slicegpt",
|
|
106
|
+
"neuralops.compression_engine.soka": "neuralops.compression_engine.soka_compressor",
|
|
107
|
+
"neuralops.compression_engine.swift_svd_compressor": "neuralops.compression_engine.swift_svd_act",
|
|
108
|
+
"neuralops.compression_engine.zerokv_neo": "neuralops.compression_engine.zerokv_neo_compressor",
|
|
109
|
+
"neuralops.compression_engine.cure": "neuralops.compression_engine.cur_moe_compressor",
|
|
110
|
+
"neuralops.compression_engine.dobi": "neuralops.compression_engine.dobi_svd",
|
|
111
|
+
"neuralops.compression_engine.dynamic_entropy": "neuralops.compression_engine.dynamic_rank",
|
|
112
|
+
"neuralops.compression_engine.tomoe": "neuralops.compression_engine.tomoe_compressor",
|
|
113
|
+
"neuralops.compression_engine.adaptive_compressor": "neuralops.compression_engine.adaptive_ranks",
|
|
114
|
+
"neuralops.compression_engine.padre_attention": "neuralops.attentions.padre_attention",
|
|
115
|
+
"neuralops.compression_engine.spectraformer_attention": "neuralops.attentions.spectraformer_attention",
|
|
116
|
+
"neuralops.compression_engine.tlinformer_attention": "neuralops.attentions.tlinformer_attention",
|
|
117
|
+
"neuralops.compression_engine.pruning_utils": "neuralops.core.pruning_utils",
|
|
118
|
+
"neuralops.compression_engine.cur_linear": "neuralops.compression_engine.cur_compressor",
|
|
119
|
+
"neuralops.compression_engine.kronecker_linear": "neuralops.compression_engine.kronecker_compressor",
|
|
120
|
+
"neuralops.compression_engine.tt_linear": "neuralops.compression_engine.tt_compressor",
|
|
121
|
+
"neuralops.compression_engine.hashed_linear": "neuralops.compression_engine.hashed_net_compressor",
|
|
122
|
+
"neuralops.compression_engine.come": "neuralops.compression_engine.come_compressor",
|
|
123
|
+
"neuralops.compression_engine.rala_compressor": "neuralops.attentions.rala_attention",
|
|
124
|
+
# Reorganized Benchmarks & Sweepers
|
|
125
|
+
"neuralops.run_quality_sweep": "neuralops.benchmarks.run_quality_sweep",
|
|
126
|
+
"neuralops.run_rank_sweeper": "neuralops.benchmarks.run_rank_sweeper",
|
|
127
|
+
"neuralops.run_all_benchmarks": "neuralops.benchmarks.run_all_benchmarks",
|
|
128
|
+
"neuralops.run_gpt2_sweep": "neuralops.benchmarks.run_gpt2_sweep",
|
|
129
|
+
"neuralops.run_long_context_sweep": "neuralops.benchmarks.run_long_context_sweep",
|
|
130
|
+
"neuralops.run_seqlen_scaling": "neuralops.benchmarks.run_seqlen_scaling",
|
|
131
|
+
"neuralops.run_seqlen_scaling_bench": "neuralops.benchmarks.run_seqlen_scaling_bench",
|
|
132
|
+
"neuralops.run_multiseed": "neuralops.benchmarks.run_multiseed",
|
|
133
|
+
"neuralops.run_multiseed_rigor": "neuralops.benchmarks.run_multiseed_rigor",
|
|
134
|
+
"neuralops.run_one_module_isolated": "neuralops.benchmarks.run_one_module_isolated",
|
|
135
|
+
"neuralops.run_ruler_benchmark": "neuralops.benchmarks.run_ruler_benchmark",
|
|
136
|
+
"neuralops.run_whitened_svd": "neuralops.benchmarks.run_whitened_svd",
|
|
137
|
+
"neuralops.launch_parallel_sweep": "neuralops.benchmarks.launch_parallel_sweep",
|
|
138
|
+
"neuralops.run_all_modules_scheduler": "neuralops.benchmarks.run_all_modules_scheduler",
|
|
139
|
+
"neuralops.kd_quick_test": "neuralops.benchmarks.kd_quick_test",
|
|
140
|
+
# Reorganized Evaluation & Verification
|
|
141
|
+
"neuralops.eval_all_models_datasets": "neuralops.evaluation.eval_all_models_datasets",
|
|
142
|
+
"neuralops.eval_perplexity": "neuralops.evaluation.eval_perplexity",
|
|
143
|
+
"neuralops.full_mnli_validation": "neuralops.evaluation.full_mnli_validation",
|
|
144
|
+
"neuralops.run_lm_eval_harness": "neuralops.evaluation.run_lm_eval_harness",
|
|
145
|
+
"neuralops.run_baseline_comparison": "neuralops.evaluation.run_baseline_comparison",
|
|
146
|
+
# Reorganized Trainer & Analysis
|
|
147
|
+
"neuralops.train_lra": "neuralops.trainer.train_lra",
|
|
148
|
+
"neuralops.generate_all_modules_analysis": "neuralops.analysis.generate_all_modules_analysis",
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
def find_spec(self, fullname, path, target=None):
|
|
152
|
+
"""Execute find_spec operation."""
|
|
153
|
+
if fullname in self._ALIASES:
|
|
154
|
+
canonical = self._ALIASES[fullname]
|
|
155
|
+
try:
|
|
156
|
+
mod = importlib.import_module(canonical)
|
|
157
|
+
sys.modules[fullname] = mod
|
|
158
|
+
return getattr(mod, "__spec__", None)
|
|
159
|
+
except Exception:
|
|
160
|
+
pass
|
|
161
|
+
return None
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
if not any(isinstance(finder, _ModuleAliasFinder) for finder in sys.meta_path):
|
|
165
|
+
sys.meta_path.insert(0, _ModuleAliasFinder())
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
# Symbol to (module_path, attr_name) mapping for fast, lazy resolution
|
|
169
|
+
_LAZY_EXPORTS = {
|
|
170
|
+
"ABTestResult": ("neuralops.evaluation.ab_testing", "ABTestResult"),
|
|
171
|
+
"ABTester": ("neuralops.evaluation.ab_testing", "ABTester"),
|
|
172
|
+
"ATTENTION_REGISTRY": ("neuralops.core.registry", "ATTENTION_REGISTRY"),
|
|
173
|
+
"BaseAttention": ("neuralops.core.base", "BaseAttention"),
|
|
174
|
+
"BaseCompressor": ("neuralops.core.base", "BaseCompressor"),
|
|
175
|
+
"BaseTrainer": ("neuralops.trainer.base_trainer", "BaseTrainer"),
|
|
176
|
+
"BenchmarkDatasetInfo": ("neuralops.data.benchmark_datasets", "BenchmarkDatasetInfo"),
|
|
177
|
+
"BenchmarkDatasetRegistry": ("neuralops.data.benchmark_datasets", "BenchmarkDatasetRegistry"),
|
|
178
|
+
"COMPRESSOR_REGISTRY": ("neuralops.core.registry", "COMPRESSOR_REGISTRY"),
|
|
179
|
+
"CompressionPipeline": ("neuralops.core.compression_pipeline", "CompressionPipeline"),
|
|
180
|
+
"CustomLoopTrainer": ("neuralops.trainer.custom_loop_trainer", "CustomLoopTrainer"),
|
|
181
|
+
"DataConfig": ("neuralops.data.base", "DataConfig"),
|
|
182
|
+
"ExperimentConfig": ("neuralops.data.dataset_loader", "ExperimentConfig"),
|
|
183
|
+
"FairnessEvaluator": ("neuralops.evaluation.fairness", "FairnessEvaluator"),
|
|
184
|
+
"FairnessReport": ("neuralops.evaluation.fairness", "FairnessReport"),
|
|
185
|
+
"GLUE_TASK_KEYS": ("neuralops.data.glue_loader", "GLUE_TASK_KEYS"),
|
|
186
|
+
"HuggingFaceTrainer": ("neuralops.trainer.hf_trainer", "HuggingFaceTrainer"),
|
|
187
|
+
"LabelQualityDetector": ("neuralops.evaluation.label_quality", "LabelQualityDetector"),
|
|
188
|
+
"LabelQualityReport": ("neuralops.evaluation.label_quality", "LabelQualityReport"),
|
|
189
|
+
"MultiModeBenchmarkRunner": ("neuralops.benchmarks.multi_mode_benchmark", "MultiModeBenchmarkRunner"),
|
|
190
|
+
"ResultWriter": ("neuralops.pipeline.result_writer", "ResultWriter"),
|
|
191
|
+
"ResultsSaver": ("neuralops.results_saver", "ResultsSaver"),
|
|
192
|
+
"RetrainDecision": ("neuralops.evaluation.retraining", "RetrainDecision"),
|
|
193
|
+
"RetrainPolicy": ("neuralops.evaluation.retraining", "RetrainPolicy"),
|
|
194
|
+
"RetrainingOrchestrator": ("neuralops.evaluation.retraining", "RetrainingOrchestrator"),
|
|
195
|
+
"TaskType": ("neuralops.data.base", "TaskType"),
|
|
196
|
+
"TrainerRegistry": ("neuralops.trainer.registry", "TrainerRegistry"),
|
|
197
|
+
"UnifiedTransformerConfig": ("neuralops.core.model_wrapper", "UnifiedTransformerConfig"),
|
|
198
|
+
"UnifiedTransformerModel": ("neuralops.core.model_wrapper", "UnifiedTransformerModel"),
|
|
199
|
+
"aggregate_results": ("neuralops.trainer.metrics", "aggregate_results"),
|
|
200
|
+
"compress_model": ("neuralops.core.compression_pipeline", "compress_model"),
|
|
201
|
+
"create_dataloader": ("neuralops.data.base", "create_dataloader"),
|
|
202
|
+
"detect_architecture": ("neuralops.core.architecture", "detect_architecture"),
|
|
203
|
+
"fms_scan_triton": ("neuralops.core.triton_kernels", "fms_scan_triton"),
|
|
204
|
+
"generate_synthetic_data": ("neuralops.data.synthetic_generator", "generate_synthetic_data"),
|
|
205
|
+
"get_calibration_dataloader": ("neuralops.data", "get_calibration_dataloader"),
|
|
206
|
+
"get_task_metrics": ("neuralops.trainer.metrics", "get_task_metrics"),
|
|
207
|
+
"gla_scan_triton": ("neuralops.core.triton_kernels", "gla_scan_triton"),
|
|
208
|
+
"inject_attention": ("neuralops.core.attention_utils", "inject_attention"),
|
|
209
|
+
"linear_attn": ("neuralops.core.triton_kernels", "linear_attn"),
|
|
210
|
+
"load_benchmark_dataset": ("neuralops.data.benchmark_datasets", "load_benchmark_dataset"),
|
|
211
|
+
"load_dataset": ("neuralops.data.dataset_loader", "load_dataset"),
|
|
212
|
+
"load_glue_local": ("neuralops.data.glue_loader", "load_glue_local"),
|
|
213
|
+
"preprocess_function": ("neuralops.data.base", "preprocess_function"),
|
|
214
|
+
"run_universal_generation": ("neuralops.data.synthetic_generator", "run_universal_generation"),
|
|
215
|
+
"selective_scan_fn": ("neuralops.core.triton_kernels", "selective_scan_fn"),
|
|
216
|
+
"triton_dispatch": ("neuralops.core.triton_kernels", "triton_dispatch"),
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
__all__: list[str] = ["__version__"] + sorted(list(_LAZY_EXPORTS.keys()))
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def __getattr__(name: str) -> Any:
|
|
223
|
+
"""Execute __getattr__ operation."""
|
|
224
|
+
if name in _LAZY_EXPORTS:
|
|
225
|
+
module_path, attr_name = _LAZY_EXPORTS[name]
|
|
226
|
+
module = importlib.import_module(module_path)
|
|
227
|
+
val = getattr(module, attr_name)
|
|
228
|
+
globals()[name] = val # cache attribute on module
|
|
229
|
+
return val
|
|
230
|
+
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def __dir__() -> list[str]:
|
|
234
|
+
"""Execute __dir__ operation."""
|
|
235
|
+
return sorted(list(globals().keys()) + __all__)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Analysis tools: plotting, metrics, layerwise analysis, model comparison, reporting.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .layerwise_analyzer import LayerwiseAnalyzer, estimate_intrinsic_dimension
|
|
6
|
+
from .metrics import MetricsTracker, aggregate_results, compute_metrics
|
|
7
|
+
from .model_comparison import ModelComparison, quick_compare
|
|
8
|
+
from .plotting import (
|
|
9
|
+
create_comprehensive_plots,
|
|
10
|
+
plot_accuracy_curve,
|
|
11
|
+
plot_attention_heatmap,
|
|
12
|
+
plot_confusion_matrix,
|
|
13
|
+
plot_gpu_memory,
|
|
14
|
+
plot_gradient_flow,
|
|
15
|
+
plot_loss_curve,
|
|
16
|
+
plot_lr_schedule,
|
|
17
|
+
plot_parameter_distribution,
|
|
18
|
+
plot_pareto_front,
|
|
19
|
+
plot_radar_chart,
|
|
20
|
+
plot_rank_allocation,
|
|
21
|
+
plot_tradeoff,
|
|
22
|
+
plot_training_history,
|
|
23
|
+
plot_training_time,
|
|
24
|
+
set_style,
|
|
25
|
+
)
|
|
26
|
+
from .report_generator import (
|
|
27
|
+
generate_full_report,
|
|
28
|
+
generate_html_report,
|
|
29
|
+
generate_interactive_report,
|
|
30
|
+
generate_latex_table,
|
|
31
|
+
)
|
|
32
|
+
from .utils import (
|
|
33
|
+
correlation_matrix,
|
|
34
|
+
detect_least_compressible_layers,
|
|
35
|
+
filter_results,
|
|
36
|
+
get_best_configurations,
|
|
37
|
+
statistical_tests,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
__all__ = [
|
|
41
|
+
"plot_loss_curve",
|
|
42
|
+
"plot_accuracy_curve",
|
|
43
|
+
"plot_lr_schedule",
|
|
44
|
+
"plot_training_time",
|
|
45
|
+
"plot_confusion_matrix",
|
|
46
|
+
"plot_gradient_flow",
|
|
47
|
+
"plot_gpu_memory",
|
|
48
|
+
"plot_parameter_distribution",
|
|
49
|
+
"plot_rank_allocation",
|
|
50
|
+
"plot_radar_chart",
|
|
51
|
+
"plot_attention_heatmap",
|
|
52
|
+
"create_comprehensive_plots",
|
|
53
|
+
"plot_tradeoff",
|
|
54
|
+
"plot_pareto_front",
|
|
55
|
+
"plot_training_history",
|
|
56
|
+
"set_style",
|
|
57
|
+
"MetricsTracker",
|
|
58
|
+
"compute_metrics",
|
|
59
|
+
"aggregate_results",
|
|
60
|
+
"LayerwiseAnalyzer",
|
|
61
|
+
"estimate_intrinsic_dimension",
|
|
62
|
+
"ModelComparison",
|
|
63
|
+
"quick_compare",
|
|
64
|
+
"generate_html_report",
|
|
65
|
+
"generate_latex_table",
|
|
66
|
+
"generate_full_report",
|
|
67
|
+
"generate_interactive_report",
|
|
68
|
+
"detect_least_compressible_layers",
|
|
69
|
+
"filter_results",
|
|
70
|
+
"correlation_matrix",
|
|
71
|
+
"statistical_tests",
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
# Statistical testing suite
|
|
75
|
+
from .comparison import ( # noqa: E402
|
|
76
|
+
bayesian_correlated_ttest,
|
|
77
|
+
bayesian_signed_rank_test,
|
|
78
|
+
finner_correction,
|
|
79
|
+
hochberg_correction,
|
|
80
|
+
holland_copenhaver_correction,
|
|
81
|
+
holm_correction,
|
|
82
|
+
hommel_correction,
|
|
83
|
+
mcnemar_test,
|
|
84
|
+
run_full_statistical_analysis,
|
|
85
|
+
sign_test,
|
|
86
|
+
wilcoxon_signed_rank_test,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
__all__ += [
|
|
90
|
+
"holm_correction",
|
|
91
|
+
"hochberg_correction",
|
|
92
|
+
"finner_correction",
|
|
93
|
+
"hommel_correction",
|
|
94
|
+
"holland_copenhaver_correction",
|
|
95
|
+
"wilcoxon_signed_rank_test",
|
|
96
|
+
"sign_test",
|
|
97
|
+
"mcnemar_test",
|
|
98
|
+
"bayesian_correlated_ttest",
|
|
99
|
+
"bayesian_signed_rank_test",
|
|
100
|
+
"run_full_statistical_analysis",
|
|
101
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Statistical comparison utilities for benchmark analysis."""
|
|
2
|
+
from neuralops.analysis.comparison.statistical_tests import (
|
|
3
|
+
bayesian_correlated_ttest,
|
|
4
|
+
bayesian_signed_rank_test,
|
|
5
|
+
finner_correction,
|
|
6
|
+
hochberg_correction,
|
|
7
|
+
holland_copenhaver_correction,
|
|
8
|
+
holm_correction,
|
|
9
|
+
hommel_correction,
|
|
10
|
+
mcnemar_test,
|
|
11
|
+
run_full_statistical_analysis,
|
|
12
|
+
sign_test,
|
|
13
|
+
wilcoxon_signed_rank_test,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"holm_correction",
|
|
18
|
+
"hochberg_correction",
|
|
19
|
+
"finner_correction",
|
|
20
|
+
"hommel_correction",
|
|
21
|
+
"holland_copenhaver_correction",
|
|
22
|
+
"wilcoxon_signed_rank_test",
|
|
23
|
+
"sign_test",
|
|
24
|
+
"mcnemar_test",
|
|
25
|
+
"bayesian_correlated_ttest",
|
|
26
|
+
"bayesian_signed_rank_test",
|
|
27
|
+
"run_full_statistical_analysis",
|
|
28
|
+
]
|