diff --git "a/applied/_index/APPLIED_RUNS_INDEX.json" "b/applied/_index/APPLIED_RUNS_INDEX.json" --- "a/applied/_index/APPLIED_RUNS_INDEX.json" +++ "b/applied/_index/APPLIED_RUNS_INDEX.json" @@ -461,131 +461,139 @@ } }, { - "key": "opt02_seenn_bayes/default", - "tag": "default", - "script": "opt02_seenn_bayes.py", - "hf_folder": "applied/opt02_seenn_bayes", - "phase": 1, + "key": "opt07_sfa_integer_train/storm_reg_0", + "tag": "storm_reg_0", + "script": "opt07_sfa_integer_train.py", + "hf_folder": "applied/opt07_sfa_integer_train", + "phase": 5, "status": "ok", - "duration_s": 586.1, + "duration_s": 620.6, "optimization_summary": { - "optimization": "seenn_early_exit_bayesian_fusion", - "research_section": "2. Temporal-dimension reduction", - "reference": "SEENN: Towards Temporal Spiking Early-Exit Neural Networks, arXiv:2304.01230 (NeurIPS 2023); BayesianSpikeFusion, Front. Neurosci. 2024 (PMC11330889)", - "script": "opt02_seenn_bayes.py", + "optimization": "sfa_integer_train", + "research_section": "3. Training-Time Approximation for Fewer Timesteps (SFA) / spike-storm suppression", + "reference": "Yao et al., Scaling Spike-driven Transformer with Efficient Spike Firing Approximation Training, arXiv:2411.16061", + "script": "opt07_sfa_integer_train.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.9278571428571428, - "test_target_acc": 0.9278571428571428, - "best_val_acc": 0.9307142857142857 + "test_acc": 0.93, + "test_target_acc": 0.93, + "best_val_acc": 0.9335714285714286 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 3638362.4326298703, - "dense_macs_per_inference": 123955200.0, - "event_fraction_of_dense": 0.029352237200455246, - "syn_ops_per_inference_dense_fanout": 65214980.21915584, + "syn_ops_per_inference": 5285655.101461039, + "dense_macs_per_inference": 122675200.0, + "event_fraction_of_dense": 0.04308658230401123, + "syn_ops_per_inference_dense_fanout": 66862272.88798702, "weight_sparsity": 0.7324707846410685, - "effective_ticks": 7.985, + "effective_ticks": 4.083571428571428, "num_ticks": 100, "membrane_bytes_per_inference": 451200, "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 174.30670261383057, - "infer_ms_per_sample": 0.6237456846476799, - "peak_vram_mb": 10914.396672, - "syn_ops_per_inference_early_exit": 1846599.2897727273 + "train_ms_per_step": 104.8419256499983, + "infer_ms_per_sample": 0.6984454099999482, + "peak_vram_mb": 2830.736384 }, "optimization_specific": { - "seenn_enabled": true, - "bayes_fusion_enabled": true, - "conf_threshold": 0.9, - "conf_temp": 2.0, - "anytime_fracs": "0.25,0.5,1.0", - "anytime_weights": "0.3,0.3,1.0", - "ic_loss_weight": 0.3, - "ic_layer": 0, - "mean_exit_tick": 7.985, - "mean_exit_ms": 399.25000000000006, - "ticks_saved_frac": 0.92015, - "exit_tick_histogram": { - "counts": [ - 1040, - 316, - 39, - 4, - 1, - 0, - 0, - 0, - 0, - 0 - ], - "edges": [ - 0.0, - 10.0, - 20.0, - 30.0, - 40.0, - 50.0, - 60.0, - 70.0, - 80.0, - 90.0, - 100.0 - ] - }, - "acc_fc_only": 0.9278571428571428, - "acc_ic_only": 0.935, - "acc_fused": 0.9378571428571428, - "acc_early_exit": 0.3578571428571429, - "syn_ops_saved_frac": 0.49246417200994075, - "syn_per_inference_early_exit": 1846599.2897727273, - "anytime_acc": { - "0.25": 0.6228571428571429, - "0.5": 0.8078571428571428, - "0.75": 0.8885714285714286, - "1.0": 0.9278571428571428 - }, - "pareto": [ + "sfa_levels_D": 4, + "soft_reset": true, + "storm_reg": 0.0, + "trained_T": 100, + "infer_mode": "graded", + "min_ticks_within_1pct_of_full": 100, + "speedup_at_min_ticks": 1.0, + "full_T_acc": 0.93, + "t_sweep_rows": [ { - "conf": 0.5, - "mean_ticks": 4.405, - "acc": 0.22785714285714287, - "syn_ops": 1715995.05762987 + "T": 4, + "acc": 0.12142857142857143, + "syn_per_inference": 2814512.5584415584, + "dense_per_inference": 4907008.0, + "infer_mode": "graded", + "ticks_speedup_vs_trained_T": 25.0 }, { - "conf": 0.7, - "mean_ticks": 5.097857142857142, - "acc": 0.25285714285714284, - "syn_ops": 1744549.8368506492 + "T": 8, + "acc": 0.2307142857142857, + "syn_per_inference": 3556388.2735389615, + "dense_per_inference": 9814016.0, + "infer_mode": "graded", + "ticks_speedup_vs_trained_T": 12.5 }, { - "conf": 0.8, - "mean_ticks": 5.984285714285714, - "acc": 0.28285714285714286, - "syn_ops": 1779479.5024350649 + "T": 16, + "acc": 0.5378571428571428, + "syn_per_inference": 4167199.856331169, + "dense_per_inference": 19628032.0, + "infer_mode": "graded", + "ticks_speedup_vs_trained_T": 6.25 }, { - "conf": 0.9, - "mean_ticks": 7.984285714285714, - "acc": 0.3578571428571429, - "syn_ops": 1846555.8522727273 + "T": 25, + "acc": 0.7707142857142857, + "syn_per_inference": 4437607.62012987, + "dense_per_inference": 30668800.0, + "infer_mode": "graded", + "ticks_speedup_vs_trained_T": 4.0 }, { - "conf": 0.95, - "mean_ticks": 10.01142857142857, - "acc": 0.42857142857142855, - "syn_ops": 1902723.0324675327 + "T": 50, + "acc": 0.8842857142857142, + "syn_per_inference": 4779261.4342532465, + "dense_per_inference": 61337600.0, + "infer_mode": "graded", + "ticks_speedup_vs_trained_T": 2.0 }, { - "conf": 0.99, - "mean_ticks": 14.458571428571428, - "acc": 0.5621428571428572, - "syn_ops": 2004484.2800324673 + "T": 100, + "acc": 0.93, + "syn_per_inference": 5285655.101461039, + "dense_per_inference": 122675200.0, + "infer_mode": "graded", + "ticks_speedup_vs_trained_T": 1.0 } - ] + ], + "storm_ratio_peak_over_mean": 4.048530718036778, + "tick_activity_cv": 0.5872231855348422, + "mean_integer_activation": 0.10196488050743936, + "frac_activations_gt1": 0.02114660758525133, + "max_activation": 4.0, + "per_layer_activity": [ + { + "layer": 0, + "mean_integer_activation": 0.18338739359751344, + "peak_tick_activation": 0.6446411237120628, + "storm_ratio": 3.515187773085857, + "tick_activity_cv": 0.5872231855348422, + "frac_activations_gt1": 0.02114660758525133, + "max_activation": 4.0 + }, + { + "layer": 1, + "mean_integer_activation": 0.04924224853515625, + "peak_tick_activation": 0.12945556640625, + "storm_ratio": 2.6289531907509436, + "tick_activity_cv": 0.3385586560128827, + "frac_activations_gt1": 0.0011788940100814216, + "max_activation": 4.0 + }, + { + "layer": 2, + "mean_integer_activation": 0.07326499938964844, + "peak_tick_activation": 0.2966156005859375, + "storm_ratio": 4.048530718036778, + "tick_activity_cv": 0.5675882158492334, + "frac_activations_gt1": 0.0014440917584579438, + "max_activation": 4.0 + } + ], + "expanded_vs_graded_agreement": 1.0, + "expanded_acc": 0.8984375, + "graded_acc": 0.8984375, + "syn_ratio_expanded_over_graded": 1.000382822740147, + "expansion_caveat": "exact only at beta=1 (IAF); with beta<1 the expanded mode applies decay per sub-tick and drifts" }, "config": { "method": "harmonic_matched", @@ -625,187 +633,159 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "baseline": false, - "bench": true, - "bench_warmup": 10, - "bench_iters": 50, - "bench_train_steps": 20, - "anytime_fracs": "0.25,0.5,1.0", - "anytime_weights": "0.3,0.3,1.0", - "ic_layer": 0, - "ic_loss_weight": 0.3, - "bayes_fusion": true, - "fusion_prior_weight": 1.0, - "conf_threshold": 0.9, - "conf_temp": 2.0, - "conf_sweep": "0.5,0.7,0.8,0.9,0.95,0.99", - "hub_dir": "/kaggle/working/hub/opt02_seenn_bayes/default", + "hub_dir": "/kaggle/working/hub/opt07_sfa_integer_train/storm_reg_0", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, "no_resume": true, "selftest": false, + "baseline": false, + "bench": true, + "bench_warmup": 10, + "bench_iters": 50, + "bench_train_steps": 20, + "sfa_levels": 4, + "soft_reset": true, + "storm_reg": 0.0, + "infer_mode": "graded", + "t_sweep": "4,8,16,25,50,100", "sampling_rate": 250.0 } }, "zip": { - "name": "default.zip", + "name": "storm_reg_0.zip", "files": 81, - "bytes": 12636571, - "MB": 12.6, - "sha256": "1c64c6704af63b5eec37b2f1d2e824ba1c5c3c28328c5b1c03089bd12b4cc747" + "bytes": 12259837, + "MB": 12.3, + "sha256": "194904e94dac6ff6cfd7ba1ce7a3b3ffeb09cd84de849835a09aaac3268a4a08" } }, { - "key": "opt02_seenn_bayes/conf_sweep_fine", - "tag": "conf_sweep_fine", - "script": "opt02_seenn_bayes.py", - "hf_folder": "applied/opt02_seenn_bayes", - "phase": 7, + "key": "opt08_mint_quant/u_bits_0", + "tag": "u_bits_0", + "script": "opt08_mint_quant.py", + "hf_folder": "applied/opt08_mint_quant", + "phase": 5, "status": "ok", - "duration_s": 909.8, + "duration_s": 341.5, "optimization_summary": { - "optimization": "seenn_early_exit_bayesian_fusion", - "research_section": "2. Temporal-dimension reduction", - "reference": "SEENN: Towards Temporal Spiking Early-Exit Neural Networks, arXiv:2304.01230 (NeurIPS 2023); BayesianSpikeFusion, Front. Neurosci. 2024 (PMC11330889)", - "script": "opt02_seenn_bayes.py", + "optimization": "mint_quant", + "research_section": "4. Membrane-Potential Memory-Wall Optimizations (multiplier-less integer quantization)", + "reference": "Yin et al., MINT: Multiplier-less INTeger Quantization for Energy Efficient Spiking Neural Networks, arXiv:2305.09850 (ASP-DAC 2024)", + "script": "opt08_mint_quant.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.9342857142857143, - "test_target_acc": 0.9342857142857143, - "best_val_acc": 0.9285714285714286 + "test_acc": 0.9407142857142857, + "test_target_acc": 0.9407142857142857, + "best_val_acc": 0.9421428571428572 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 3615247.340909091, - "dense_macs_per_inference": 123955200.0, - "event_fraction_of_dense": 0.02916575779724522, - "syn_ops_per_inference_dense_fanout": 65191865.127435066, - "weight_sparsity": 0.7324707846410685, - "effective_ticks": 8.057142857142857, + "syn_ops_per_inference": 2152696.525466721, + "dense_macs_per_inference": 122675200.0, + "event_fraction_of_dense": 0.0175479357316452, + "syn_ops_per_inference_dense_fanout": 64922516.865259744, + "weight_sparsity": 0.8335865765859767, + "effective_ticks": 12.575, "num_ticks": 100, "membrane_bytes_per_inference": 451200, - "weight_bytes": 4907008, + "weight_bytes": 613376, "input_raster_bytes": null, - "train_ms_per_step": 180.51012754440308, - "infer_ms_per_sample": 0.6378180717104044, - "peak_vram_mb": 10915.470336, - "syn_ops_per_inference_early_exit": 1822430.1501623376 + "train_ms_per_step": 99.00966735000338, + "infer_ms_per_sample": 0.6622065121874954, + "peak_vram_mb": 2833.092608 }, "optimization_specific": { - "seenn_enabled": true, - "bayes_fusion_enabled": true, - "conf_threshold": 0.9, - "conf_temp": 2.0, - "anytime_fracs": "0.25,0.5,1.0", - "anytime_weights": "0.3,0.3,1.0", - "ic_loss_weight": 0.3, - "ic_layer": 0, - "mean_exit_tick": 8.057142857142857, - "mean_exit_ms": 402.85714285714283, - "ticks_saved_frac": 0.9194285714285715, - "exit_tick_histogram": { - "counts": [ - 1022, - 331, - 39, - 5, - 3, - 0, - 0, - 0, - 0, - 0 - ], - "edges": [ - 0.0, - 10.0, - 20.0, - 30.0, - 40.0, - 50.0, - 60.0, - 70.0, - 80.0, - 90.0, - 100.0 - ] - }, - "acc_fc_only": 0.9342857142857143, - "acc_ic_only": 0.9292857142857143, - "acc_fused": 0.94, - "acc_early_exit": 0.37714285714285717, - "syn_ops_saved_frac": 0.49590443521242755, - "syn_per_inference_early_exit": 1822430.1501623376, - "anytime_acc": { - "0.25": 0.615, - "0.5": 0.8142857142857143, - "0.75": 0.895, - "1.0": 0.9342857142857143 + "w_bits": 4, + "u_bits": 0, + "leak_shift": 0, + "beta_eff": 1.0, + "qat": true, + "batchnorm": true, + "membrane_memory_reduction_x": 1.0, + "weight_memory_reduction_x": 8.0, + "membrane_bytes_per_inference": 451200.0, + "working_set_bytes": 617888.0, + "baseline_working_set_bytes": 4911520.0, + "l2_cache_fits": true, + "baseline_l2_cache_fits": false, + "l2_budget_bytes": 2097152, + "membrane_saturation_frac": null, + "acc_vs_ubits": { + "2": 0.8964285714285715, + "4": 0.9521428571428572, + "8": 0.9521428571428572, + "0": 0.9407142857142857 }, - "pareto": [ - { - "conf": 0.3, - "mean_ticks": 2.82, - "acc": 0.17142857142857143, - "syn_ops": 1600944.0178571427 - }, - { - "conf": 0.4, - "mean_ticks": 3.285, - "acc": 0.18571428571428572, - "syn_ops": 1629355.7386363635 - }, + "bits_sweep_rows": [ { - "conf": 0.5, - "mean_ticks": 4.3757142857142854, - "acc": 0.24285714285714285, - "syn_ops": 1687021.986201299 + "u_bits": 2, + "acc": 0.8964285714285715, + "target_acc": 0.8964285714285715, + "membrane_bytes_per_neuron_per_tick": 0.25, + "membrane_memory_reduction_x": 16.0, + "membrane_saturation_frac": 0.09132064494680851, + "acc_drop_vs_fp32": 0.04428571428571426 }, { - "conf": 0.6, - "mean_ticks": 4.670714285714285, - "acc": 0.2507142857142857, - "syn_ops": 1699344.8084415584 + "u_bits": 4, + "acc": 0.9521428571428572, + "target_acc": 0.9521428571428572, + "membrane_bytes_per_neuron_per_tick": 0.5, + "membrane_memory_reduction_x": 8.0, + "membrane_saturation_frac": 0.2783921348625886, + "acc_drop_vs_fp32": -0.011428571428571455 }, { - "conf": 0.7, - "mean_ticks": 5.075714285714286, - "acc": 0.26285714285714284, - "syn_ops": 1716703.7767857143 + "u_bits": 8, + "acc": 0.9521428571428572, + "target_acc": 0.9521428571428572, + "membrane_bytes_per_neuron_per_tick": 1.0, + "membrane_memory_reduction_x": 4.0, + "membrane_saturation_frac": 0.32464220412234046, + "acc_drop_vs_fp32": -0.011428571428571455 }, { - "conf": 0.8, - "mean_ticks": 5.987857142857143, - "acc": 0.2914285714285714, - "syn_ops": 1753268.2150974027 - }, + "u_bits": 0, + "acc": 0.9407142857142857, + "target_acc": 0.9407142857142857, + "membrane_bytes_per_neuron_per_tick": 4.0, + "membrane_memory_reduction_x": 1.0, + "membrane_saturation_frac": null, + "acc_drop_vs_fp32": 0.0 + } + ], + "fp32_membrane_acc": 0.9407142857142857, + "per_layer_scales": [ { - "conf": 0.9, - "mean_ticks": 8.057142857142857, - "acc": 0.37714285714285717, - "syn_ops": 1822430.0933441557 + "layer": 0, + "weight_scale": 0.034521830933434625, + "membrane_scale": 1.0, + "shared_scale_gauge_factor": 28.967177376200326 }, { - "conf": 0.95, - "mean_ticks": 10.176428571428572, - "acc": 0.45, - "syn_ops": 1882071.5430194808 + "layer": 1, + "weight_scale": 0.02071961760520935, + "membrane_scale": 1.0, + "shared_scale_gauge_factor": 48.263438981063956 }, { - "conf": 0.99, - "mean_ticks": 14.704285714285714, - "acc": 0.5742857142857143, - "syn_ops": 1981175.7142857143 + "layer": 2, + "weight_scale": 0.013957016170024872, + "membrane_scale": 1.0, + "shared_scale_gauge_factor": 71.64855208433981 }, { - "conf": 0.999, - "mean_ticks": 19.547142857142855, - "acc": 0.68, - "syn_ops": 2074480.44237013 + "layer": 3, + "weight_scale": 0.0242827194077628, + "membrane_scale": 1.0, + "shared_scale_gauge_factor": 41.18154903524997 } - ] + ], + "shared_scale_note": "weight grid and membrane grid are the same grid up to a per-layer positive scalar that BatchNorm absorbs exactly; exact only with --batchnorm on", + "multiplier_less_compare": false, + "wall_clock_caveat": "this reference kernel computes in fp32 registers, so the traffic win does not appear in train_ms_per_step; a fixed-point core is where it becomes energy" }, "config": { "method": "harmonic_matched", @@ -845,163 +825,160 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "baseline": false, - "bench": true, - "bench_warmup": 10, - "bench_iters": 50, - "bench_train_steps": 20, - "anytime_fracs": "0.25,0.5,1.0", - "anytime_weights": "0.3,0.3,1.0", - "ic_layer": 0, - "ic_loss_weight": 0.3, - "bayes_fusion": true, - "fusion_prior_weight": 1.0, - "conf_threshold": 0.9, - "conf_temp": 2.0, - "conf_sweep": "0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95,0.99,0.999", - "hub_dir": "/kaggle/working/hub/opt02_seenn_bayes/conf_sweep_fine", + "hub_dir": "/kaggle/working/hub/opt08_mint_quant/u_bits_0", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, "no_resume": true, "selftest": false, - "sampling_rate": 250.0 - } - }, - "zip": { - "name": "conf_sweep_fine.zip", - "files": 81, - "bytes": 12637373, - "MB": 12.6, - "sha256": "e33a7b3b8947f0b0a5fd13a441d22f8068a82f8246738956132681351836f98c" + "baseline": false, + "bench": true, + "bench_warmup": 10, + "bench_iters": 50, + "bench_train_steps": 20, + "w_bits": 4, + "u_bits": 0, + "leak_shift": 0, + "qat": true, + "bits_sweep": "2,4,8,0", + "l2_bytes": 2097152, + "sampling_rate": 250.0 + } + }, + "zip": { + "name": "u_bits_0.zip", + "files": 81, + "bytes": 12238321, + "MB": 12.2, + "sha256": "de8d0ec3134b59a7b9e26917542d60cf181033520d851a5638465f805487afa4" } }, { - "key": "opt02_seenn_bayes/conf_temp_16", - "tag": "conf_temp_16", - "script": "opt02_seenn_bayes.py", - "hf_folder": "applied/opt02_seenn_bayes", - "phase": 7, + "key": "opt08_mint_quant/u_bits_3", + "tag": "u_bits_3", + "script": "opt08_mint_quant.py", + "hf_folder": "applied/opt08_mint_quant", + "phase": 5, "status": "ok", - "duration_s": 613.7, + "duration_s": 341.6, "optimization_summary": { - "optimization": "seenn_early_exit_bayesian_fusion", - "research_section": "2. Temporal-dimension reduction", - "reference": "SEENN: Towards Temporal Spiking Early-Exit Neural Networks, arXiv:2304.01230 (NeurIPS 2023); BayesianSpikeFusion, Front. Neurosci. 2024 (PMC11330889)", - "script": "opt02_seenn_bayes.py", + "optimization": "mint_quant", + "research_section": "4. Membrane-Potential Memory-Wall Optimizations (multiplier-less integer quantization)", + "reference": "Yin et al., MINT: Multiplier-less INTeger Quantization for Energy Efficient Spiking Neural Networks, arXiv:2305.09850 (ASP-DAC 2024)", + "script": "opt08_mint_quant.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.9278571428571428, - "test_target_acc": 0.9278571428571428, - "best_val_acc": 0.9278571428571428 + "test_acc": 0.9578571428571429, + "test_target_acc": 0.9578571428571429, + "best_val_acc": 0.9628571428571429 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 3658814.530844156, - "dense_macs_per_inference": 123955200.0, - "event_fraction_of_dense": 0.02951723308779427, - "syn_ops_per_inference_dense_fanout": 65235432.31737013, - "weight_sparsity": 0.7324707846410685, - "effective_ticks": 4.197857142857143, + "syn_ops_per_inference": 1648163.6732954546, + "dense_macs_per_inference": 122675200.0, + "event_fraction_of_dense": 0.013435182280489085, + "syn_ops_per_inference_dense_fanout": 64593181.90016234, + "weight_sparsity": 0.8624946199394825, + "effective_ticks": 11.785714285714286, "num_ticks": 100, - "membrane_bytes_per_inference": 451200, - "weight_bytes": 4907008, + "membrane_bytes_per_inference": 0, + "weight_bytes": 613376, "input_raster_bytes": null, - "train_ms_per_step": 187.19353675842285, - "infer_ms_per_sample": 0.6553214698580642, - "peak_vram_mb": 10914.399232, - "syn_ops_per_inference_early_exit": 1722971.6599025973 + "train_ms_per_step": 98.38904980000507, + "infer_ms_per_sample": 0.6557833990625284, + "peak_vram_mb": 2840.912896 }, "optimization_specific": { - "seenn_enabled": true, - "bayes_fusion_enabled": true, - "conf_threshold": 0.9, - "conf_temp": 16.0, - "anytime_fracs": "0.25,0.5,1.0", - "anytime_weights": "0.3,0.3,1.0", - "ic_loss_weight": 0.3, - "ic_layer": 0, - "mean_exit_tick": 4.197857142857143, - "mean_exit_ms": 209.89285714285717, - "ticks_saved_frac": 0.9580214285714286, - "exit_tick_histogram": { - "counts": [ - 1368, - 26, - 3, - 2, - 1, - 0, - 0, - 0, - 0, - 0 - ], - "edges": [ - 0.0, - 10.0, - 20.0, - 30.0, - 40.0, - 50.0, - 60.0, - 70.0, - 80.0, - 90.0, - 100.0 - ] - }, - "acc_fc_only": 0.9278571428571428, - "acc_ic_only": 0.935, - "acc_fused": 0.94, - "acc_early_exit": 0.2257142857142857, - "syn_ops_saved_frac": 0.5290901888090305, - "syn_per_inference_early_exit": 1722971.6599025973, - "anytime_acc": { - "0.25": 0.6042857142857143, - "0.5": 0.8057142857142857, - "0.75": 0.8885714285714286, - "1.0": 0.9278571428571428 + "w_bits": 4, + "u_bits": 3, + "leak_shift": 0, + "beta_eff": 1.0, + "qat": true, + "batchnorm": true, + "membrane_memory_reduction_x": 10.666666666666666, + "weight_memory_reduction_x": 8.0, + "membrane_bytes_per_inference": 42300.0, + "working_set_bytes": 613799.0, + "baseline_working_set_bytes": 4911520.0, + "l2_cache_fits": true, + "baseline_l2_cache_fits": false, + "l2_budget_bytes": 2097152, + "membrane_saturation_frac": 0.14972666638962767, + "acc_vs_ubits": { + "2": 0.5942857142857143, + "4": 0.9564285714285714, + "8": 0.955, + "0": 0.9528571428571428 }, - "pareto": [ + "bits_sweep_rows": [ { - "conf": 0.5, - "mean_ticks": 2.979285714285714, - "acc": 0.18857142857142858, - "syn_ops": 1660596.797077922 + "u_bits": 2, + "acc": 0.5942857142857143, + "target_acc": 0.5942857142857143, + "membrane_bytes_per_neuron_per_tick": 0.25, + "membrane_memory_reduction_x": 16.0, + "membrane_saturation_frac": 0.019098722850177306, + "acc_drop_vs_fp32": 0.35857142857142854 }, { - "conf": 0.7, - "mean_ticks": 4.196428571428571, - "acc": 0.2257142857142857, - "syn_ops": 1722894.4212662338 + "u_bits": 4, + "acc": 0.9564285714285714, + "target_acc": 0.9564285714285714, + "membrane_bytes_per_neuron_per_tick": 0.5, + "membrane_memory_reduction_x": 8.0, + "membrane_saturation_frac": 0.20831449468085106, + "acc_drop_vs_fp32": -0.0035714285714285587 }, { - "conf": 0.8, - "mean_ticks": 4.196428571428571, - "acc": 0.2257142857142857, - "syn_ops": 1722894.1939935065 + "u_bits": 8, + "acc": 0.955, + "target_acc": 0.955, + "membrane_bytes_per_neuron_per_tick": 1.0, + "membrane_memory_reduction_x": 4.0, + "membrane_saturation_frac": 0.2674735427748227, + "acc_drop_vs_fp32": -0.002142857142857113 }, { - "conf": 0.9, - "mean_ticks": 4.197857142857143, - "acc": 0.2257142857142857, - "syn_ops": 1722971.7207792208 + "u_bits": 0, + "acc": 0.9528571428571428, + "target_acc": 0.9528571428571428, + "membrane_bytes_per_neuron_per_tick": 4.0, + "membrane_memory_reduction_x": 1.0, + "membrane_saturation_frac": null, + "acc_drop_vs_fp32": 0.0 + } + ], + "fp32_membrane_acc": 0.9528571428571428, + "per_layer_scales": [ + { + "layer": 0, + "weight_scale": 0.03138868297849383, + "membrane_scale": 0.3333333333333333, + "shared_scale_gauge_factor": 10.619538690480226 }, { - "conf": 0.95, - "mean_ticks": 4.199285714285714, - "acc": 0.2257142857142857, - "syn_ops": 1723035.8133116884 + "layer": 1, + "weight_scale": 0.019679610218320574, + "membrane_scale": 0.3333333333333333, + "shared_scale_gauge_factor": 16.93800485047307 }, { - "conf": 0.99, - "mean_ticks": 4.243571428571428, - "acc": 0.22642857142857142, - "syn_ops": 1724673.6931818181 + "layer": 2, + "weight_scale": 0.009625924485070365, + "membrane_scale": 0.3333333333333333, + "shared_scale_gauge_factor": 34.62870853083538 + }, + { + "layer": 3, + "weight_scale": 0.015539673822266715, + "membrane_scale": 0.3333333333333333, + "shared_scale_gauge_factor": 21.45047168594374 } - ] + ], + "shared_scale_note": "weight grid and membrane grid are the same grid up to a per-layer positive scalar that BatchNorm absorbs exactly; exact only with --batchnorm on", + "multiplier_less_compare": true, + "wall_clock_caveat": "this reference kernel computes in fp32 registers, so the traffic win does not appear in train_ms_per_step; a fixed-point core is where it becomes energy" }, "config": { "method": "harmonic_matched", @@ -1041,568 +1018,160 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "baseline": false, - "bench": true, - "bench_warmup": 10, - "bench_iters": 50, - "bench_train_steps": 20, - "anytime_fracs": "0.25,0.5,1.0", - "anytime_weights": "0.3,0.3,1.0", - "ic_layer": 0, - "ic_loss_weight": 0.3, - "bayes_fusion": true, - "fusion_prior_weight": 1.0, - "conf_threshold": 0.9, - "conf_temp": 16.0, - "conf_sweep": "0.5,0.7,0.8,0.9,0.95,0.99", - "hub_dir": "/kaggle/working/hub/opt02_seenn_bayes/conf_temp_16", + "hub_dir": "/kaggle/working/hub/opt08_mint_quant/u_bits_3", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, "no_resume": true, "selftest": false, + "baseline": false, + "bench": true, + "bench_warmup": 10, + "bench_iters": 50, + "bench_train_steps": 20, + "w_bits": 4, + "u_bits": 3, + "leak_shift": 0, + "qat": true, + "bits_sweep": "2,4,8,0", + "l2_bytes": 2097152, "sampling_rate": 250.0 } }, "zip": { - "name": "conf_temp_16.zip", + "name": "u_bits_3.zip", "files": 81, - "bytes": 12637814, - "MB": 12.6, - "sha256": "d302c2ff3a0a7090de4ff36762170bca52ef860f9f4f098a3fde82a954059161" + "bytes": 12230314, + "MB": 12.2, + "sha256": "59408685a190f6abc9f857e49ce34938251b9d14b3cc1bd8192fc8a52b9a9882" } }, { - "key": "opt06_uticket_prune/prune_readout", - "tag": "prune_readout", - "script": "opt06_uticket_prune.py", - "hf_folder": "applied/opt06_uticket_prune", - "phase": 9, + "key": "opt08_mint_quant/u_bits_4", + "tag": "u_bits_4", + "script": "opt08_mint_quant.py", + "hf_folder": "applied/opt08_mint_quant", + "phase": 5, "status": "ok", - "duration_s": 582.6, + "duration_s": 344.8, "optimization_summary": { - "optimization": "uticket_workload_balanced_pruning", - "research_section": "3. Spike sparsity & MAC->AC restructuring", - "reference": "u-Ticket: Workload-Balanced Pruning for Sparse SNNs, arXiv:2302.06746", - "script": "opt06_uticket_prune.py", + "optimization": "mint_quant", + "research_section": "4. Membrane-Potential Memory-Wall Optimizations (multiplier-less integer quantization)", + "reference": "Yin et al., MINT: Multiplier-less INTeger Quantization for Energy Efficient Spiking Neural Networks, arXiv:2305.09850 (ASP-DAC 2024)", + "script": "opt08_mint_quant.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.4135714285714286, - "test_target_acc": 0.4135714285714286, - "best_val_acc": 0.9335714285714286 + "test_acc": 0.965, + "test_target_acc": 0.965, + "best_val_acc": 0.9628571428571429 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 104257.90097402596, + "syn_ops_per_inference": 1883576.624797078, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.0008498694191982239, - "syn_ops_per_inference_dense_fanout": 65062433.861201294, - "weight_sparsity": 0.9917057400354758, - "effective_ticks": 11.177142857142858, + "event_fraction_of_dense": 0.015354176107290455, + "syn_ops_per_inference_dense_fanout": 64875275.42613637, + "weight_sparsity": 0.854853303683222, + "effective_ticks": 12.19, "num_ticks": 100, - "membrane_bytes_per_inference": 451200, - "weight_bytes": 4907008, + "membrane_bytes_per_inference": 0, + "weight_bytes": 613376, "input_raster_bytes": null, - "train_ms_per_step": 94.6925303999933, - "infer_ms_per_sample": 0.6165744149999597, - "peak_vram_mb": 2836.776448, - "weight_bytes_nonzero": 40703 + "train_ms_per_step": 99.37113355001657, + "infer_ms_per_sample": 0.6619073024999977, + "peak_vram_mb": 2841.84576 }, "optimization_specific": { - "pruning_enabled": true, - "balance_enabled": true, - "rounds": 5, - "final_sparsity": 0.9917049248747913, - "nnz_per_layer": { - "layer0": 640, - "layer1": 5120, - "layer2": 4096, - "readout": 320 + "w_bits": 4, + "u_bits": 4, + "leak_shift": 0, + "beta_eff": 1.0, + "qat": true, + "batchnorm": true, + "membrane_memory_reduction_x": 8.0, + "weight_memory_reduction_x": 8.0, + "membrane_bytes_per_inference": 56400.0, + "working_set_bytes": 613940.0, + "baseline_working_set_bytes": 4911520.0, + "l2_cache_fits": true, + "baseline_l2_cache_fits": false, + "l2_budget_bytes": 2097152, + "membrane_saturation_frac": 0.2496060505319149, + "acc_vs_ubits": { + "2": 0.7471428571428571, + "4": 0.965, + "8": 0.9657142857142857, + "0": 0.9592857142857143 }, - "pe_stats_per_layer": { - "layer0": { - "mean_nnz": 2.0, - "max_nnz": 2.0, - "min_nnz": 2.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 1.0 - }, - "layer1": { - "mean_nnz": 10.0, - "max_nnz": 10.0, - "min_nnz": 10.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 1.0 + "bits_sweep_rows": [ + { + "u_bits": 2, + "acc": 0.7471428571428571, + "target_acc": 0.7471428571428571, + "membrane_bytes_per_neuron_per_tick": 0.25, + "membrane_memory_reduction_x": 16.0, + "membrane_saturation_frac": 0.032914381094858156, + "acc_drop_vs_fp32": 0.2121428571428572 }, - "layer2": { - "mean_nnz": 16.0, - "max_nnz": 16.0, - "min_nnz": 16.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 1.0 + { + "u_bits": 4, + "acc": 0.965, + "target_acc": 0.965, + "membrane_bytes_per_neuron_per_tick": 0.5, + "membrane_memory_reduction_x": 8.0, + "membrane_saturation_frac": 0.2418986868351064, + "acc_drop_vs_fp32": -0.005714285714285672 }, - "readout": { - "mean_nnz": 8.0, - "max_nnz": 8.0, - "min_nnz": 8.0, - "total_nnz": 320, - "numel": 10240, - "sparsity": 0.96875, - "utilization": 1.0 - } - }, - "pe_utilization_final": 1.0, - "pe_utilization_lth": 0.5667460317460318, - "pe_utilization_uticket": 1.0, - "latency_proxy_dense": 3968, - "latency_proxy_final": 36, - "latency_reduction_frac": 0.9909274193548387, - "rounds_history": [ { - "round": 1, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 36.0, - "max_nnz": 47.0, - "min_nnz": 25.0, - "total_nnz": 11520, - "numel": 921600, - "sparsity": 0.9875, - "utilization": 0.7659574468085106 - }, - "uticket": { - "mean_nnz": 36.0, - "max_nnz": 36.0, - "min_nnz": 36.0, - "total_nnz": 11520, - "numel": 921600, - "sparsity": 0.9875, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 160.0, - "max_nnz": 180.0, - "min_nnz": 123.0, - "total_nnz": 81920, - "numel": 163840, - "sparsity": 0.5, - "utilization": 0.8888888888888888 - }, - "uticket": { - "mean_nnz": 160.0, - "max_nnz": 160.0, - "min_nnz": 160.0, - "total_nnz": 81920, - "numel": 163840, - "sparsity": 0.5, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 256.0, - "max_nnz": 288.0, - "min_nnz": 210.0, - "total_nnz": 65536, - "numel": 131072, - "sparsity": 0.5, - "utilization": 0.8888888888888888 - }, - "uticket": { - "mean_nnz": 256.0, - "max_nnz": 256.0, - "min_nnz": 256.0, - "total_nnz": 65536, - "numel": 131072, - "sparsity": 0.5, - "utilization": 1.0 - } - }, - "readout": { - "lth": { - "mean_nnz": 128.0, - "max_nnz": 143.0, - "min_nnz": 117.0, - "total_nnz": 5120, - "numel": 10240, - "sparsity": 0.5, - "utilization": 0.8951048951048951 - }, - "uticket": { - "mean_nnz": 128.0, - "max_nnz": 128.0, - "min_nnz": 128.0, - "total_nnz": 5120, - "numel": 10240, - "sparsity": 0.5, - "utilization": 1.0 - } - } - }, - "latency_proxy": 580, - "sparsity": 0.8662353923205343 + "u_bits": 8, + "acc": 0.9657142857142857, + "target_acc": 0.9657142857142857, + "membrane_bytes_per_neuron_per_tick": 1.0, + "membrane_memory_reduction_x": 4.0, + "membrane_saturation_frac": 0.296513671875, + "acc_drop_vs_fp32": -0.00642857142857145 }, { - "round": 2, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 18.0, - "max_nnz": 28.0, - "min_nnz": 10.0, - "total_nnz": 5760, - "numel": 921600, - "sparsity": 0.99375, - "utilization": 0.6428571428571429 - }, - "uticket": { - "mean_nnz": 18.0, - "max_nnz": 18.0, - "min_nnz": 18.0, - "total_nnz": 5760, - "numel": 921600, - "sparsity": 0.99375, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 80.0, - "max_nnz": 104.0, - "min_nnz": 33.0, - "total_nnz": 40960, - "numel": 163840, - "sparsity": 0.75, - "utilization": 0.7692307692307693 - }, - "uticket": { - "mean_nnz": 80.0, - "max_nnz": 80.0, - "min_nnz": 80.0, - "total_nnz": 40960, - "numel": 163840, - "sparsity": 0.75, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 128.0, - "max_nnz": 161.0, - "min_nnz": 93.0, - "total_nnz": 32768, - "numel": 131072, - "sparsity": 0.75, - "utilization": 0.7950310559006211 - }, - "uticket": { - "mean_nnz": 128.0, - "max_nnz": 128.0, - "min_nnz": 128.0, - "total_nnz": 32768, - "numel": 131072, - "sparsity": 0.75, - "utilization": 1.0 - } - }, - "readout": { - "lth": { - "mean_nnz": 64.0, - "max_nnz": 74.0, - "min_nnz": 56.0, - "total_nnz": 2560, - "numel": 10240, - "sparsity": 0.75, - "utilization": 0.8648648648648649 - }, - "uticket": { - "mean_nnz": 64.0, - "max_nnz": 64.0, - "min_nnz": 64.0, - "total_nnz": 2560, - "numel": 10240, - "sparsity": 0.75, - "utilization": 1.0 - } - } - }, - "latency_proxy": 290, - "sparsity": 0.9331176961602671 + "u_bits": 0, + "acc": 0.9592857142857143, + "target_acc": 0.9592857142857143, + "membrane_bytes_per_neuron_per_tick": 4.0, + "membrane_memory_reduction_x": 1.0, + "membrane_saturation_frac": null, + "acc_drop_vs_fp32": 0.0 + } + ], + "fp32_membrane_acc": 0.9592857142857143, + "per_layer_scales": [ + { + "layer": 0, + "weight_scale": 0.03545519496713366, + "membrane_scale": 0.14285714285714285, + "shared_scale_gauge_factor": 4.0292302154753035 }, { - "round": 3, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 9.0, - "max_nnz": 18.0, - "min_nnz": 1.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 9.0, - "max_nnz": 9.0, - "min_nnz": 9.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 40.0, - "max_nnz": 64.0, - "min_nnz": 2.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 0.625 - }, - "uticket": { - "mean_nnz": 40.0, - "max_nnz": 40.0, - "min_nnz": 40.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 64.0, - "max_nnz": 85.0, - "min_nnz": 38.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 0.7529411764705882 - }, - "uticket": { - "mean_nnz": 64.0, - "max_nnz": 64.0, - "min_nnz": 64.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 1.0 - } - }, - "readout": { - "lth": { - "mean_nnz": 32.0, - "max_nnz": 38.0, - "min_nnz": 26.0, - "total_nnz": 1280, - "numel": 10240, - "sparsity": 0.875, - "utilization": 0.8421052631578947 - }, - "uticket": { - "mean_nnz": 32.0, - "max_nnz": 32.0, - "min_nnz": 32.0, - "total_nnz": 1280, - "numel": 10240, - "sparsity": 0.875, - "utilization": 1.0 - } - } - }, - "latency_proxy": 145, - "sparsity": 0.9665588480801336 + "layer": 1, + "weight_scale": 0.020786042724336897, + "membrane_scale": 0.14285714285714285, + "shared_scale_gauge_factor": 6.872743636280589 }, { - "round": 4, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 4.5, - "max_nnz": 9.0, - "min_nnz": 0.0, - "total_nnz": 1440, - "numel": 921600, - "sparsity": 0.9984375, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 4.0, - "max_nnz": 4.0, - "min_nnz": 4.0, - "total_nnz": 1280, - "numel": 921600, - "sparsity": 0.9986111111111111, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 20.0, - "max_nnz": 33.0, - "min_nnz": 0.0, - "total_nnz": 10240, - "numel": 163840, - "sparsity": 0.9375, - "utilization": 0.6060606060606061 - }, - "uticket": { - "mean_nnz": 20.0, - "max_nnz": 20.0, - "min_nnz": 20.0, - "total_nnz": 10240, - "numel": 163840, - "sparsity": 0.9375, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 32.0, - "max_nnz": 45.0, - "min_nnz": 12.0, - "total_nnz": 8192, - "numel": 131072, - "sparsity": 0.9375, - "utilization": 0.7111111111111111 - }, - "uticket": { - "mean_nnz": 32.0, - "max_nnz": 32.0, - "min_nnz": 32.0, - "total_nnz": 8192, - "numel": 131072, - "sparsity": 0.9375, - "utilization": 1.0 - } - }, - "readout": { - "lth": { - "mean_nnz": 16.0, - "max_nnz": 28.0, - "min_nnz": 11.0, - "total_nnz": 640, - "numel": 10240, - "sparsity": 0.9375, - "utilization": 0.5714285714285714 - }, - "uticket": { - "mean_nnz": 16.0, - "max_nnz": 16.0, - "min_nnz": 16.0, - "total_nnz": 640, - "numel": 10240, - "sparsity": 0.9375, - "utilization": 1.0 - } - } - }, - "latency_proxy": 72, - "sparsity": 0.9834098497495827 + "layer": 2, + "weight_scale": 0.010473860161645072, + "membrane_scale": 0.14285714285714285, + "shared_scale_gauge_factor": 13.639397571898177 }, { - "round": 5, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 2.0, - "max_nnz": 4.0, - "min_nnz": 0.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 2.0, - "max_nnz": 2.0, - "min_nnz": 2.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 10.0, - "max_nnz": 18.0, - "min_nnz": 0.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 0.5555555555555556 - }, - "uticket": { - "mean_nnz": 10.0, - "max_nnz": 10.0, - "min_nnz": 10.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 16.0, - "max_nnz": 25.0, - "min_nnz": 0.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 0.64 - }, - "uticket": { - "mean_nnz": 16.0, - "max_nnz": 16.0, - "min_nnz": 16.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 1.0 - } - }, - "readout": { - "lth": { - "mean_nnz": 8.0, - "max_nnz": 14.0, - "min_nnz": 3.0, - "total_nnz": 320, - "numel": 10240, - "sparsity": 0.96875, - "utilization": 0.5714285714285714 - }, - "uticket": { - "mean_nnz": 8.0, - "max_nnz": 8.0, - "min_nnz": 8.0, - "total_nnz": 320, - "numel": 10240, - "sparsity": 0.96875, - "utilization": 1.0 - } - } - }, - "latency_proxy": 36, - "sparsity": 0.9917049248747913 + "layer": 3, + "weight_scale": 0.017392768391541073, + "membrane_scale": 0.14285714285714285, + "shared_scale_gauge_factor": 8.213594273274003 } ], - "latency_proxy_lth": 61, - "latency_reduction_vs_lth_frac": 0.4098360655737705 + "shared_scale_note": "weight grid and membrane grid are the same grid up to a per-layer positive scalar that BatchNorm absorbs exactly; exact only with --batchnorm on", + "multiplier_less_compare": true, + "wall_clock_caveat": "this reference kernel computes in fp32 registers, so the traffic win does not appear in train_ms_per_step; a fixed-point core is where it becomes energy" }, "config": { "method": "harmonic_matched", @@ -1642,7 +1211,7 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt06_uticket_prune/prune_readout", + "hub_dir": "/kaggle/working/hub/opt08_mint_quant/u_bits_4", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, @@ -1653,310 +1222,149 @@ "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "prune_rounds": 5, - "prune_rate": 0.5, - "rewind_epoch": 1, - "balance": true, - "balance_iters": 2, - "prune_readout": true, + "w_bits": 4, + "u_bits": 4, + "leak_shift": 0, + "qat": true, + "bits_sweep": "2,4,8,0", + "l2_bytes": 2097152, "sampling_rate": 250.0 } }, "zip": { - "name": "prune_readout.zip", + "name": "u_bits_4.zip", "files": 81, - "bytes": 8103773, - "MB": 8.1, - "sha256": "71a4d931df327896a7f5538c47ae56a8c6d2a773250c37ea42d325f453d2355a" + "bytes": 12211406, + "MB": 12.2, + "sha256": "fa14fb4378b6e3737d3d49ed8bf58b569e33a530256e925d6c0ec6d07495a44d" } }, { - "key": "opt06_uticket_prune/prune_rounds_3", - "tag": "prune_rounds_3", - "script": "opt06_uticket_prune.py", - "hf_folder": "applied/opt06_uticket_prune", - "phase": 9, + "key": "opt08_mint_quant/u_bits_8", + "tag": "u_bits_8", + "script": "opt08_mint_quant.py", + "hf_folder": "applied/opt08_mint_quant", + "phase": 5, "status": "ok", - "duration_s": 320.7, + "duration_s": 346.7, "optimization_summary": { - "optimization": "uticket_workload_balanced_pruning", - "research_section": "3. Spike sparsity & MAC->AC restructuring", - "reference": "u-Ticket: Workload-Balanced Pruning for Sparse SNNs, arXiv:2302.06746", - "script": "opt06_uticket_prune.py", + "optimization": "mint_quant", + "research_section": "4. Membrane-Potential Memory-Wall Optimizations (multiplier-less integer quantization)", + "reference": "Yin et al., MINT: Multiplier-less INTeger Quantization for Energy Efficient Spiking Neural Networks, arXiv:2305.09850 (ASP-DAC 2024)", + "script": "opt08_mint_quant.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.9057142857142857, - "test_target_acc": 0.9057142857142857, - "best_val_acc": 0.9407142857142857 + "test_acc": 0.9664285714285714, + "test_target_acc": 0.9664285714285714, + "best_val_acc": 0.9628571428571429 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 550376.6811079546, + "syn_ops_per_inference": 2087678.7174310065, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.004486454320905567, - "syn_ops_per_inference_dense_fanout": 65058668.56331169, - "weight_sparsity": 0.9592550083472454, - "effective_ticks": 13.450714285714286, + "event_fraction_of_dense": 0.017017936122631194, + "syn_ops_per_inference_dense_fanout": 65242462.345779225, + "weight_sparsity": 0.8476187526085142, + "effective_ticks": 12.227857142857143, "num_ticks": 100, - "membrane_bytes_per_inference": 451200, - "weight_bytes": 4907008, + "membrane_bytes_per_inference": 112800, + "weight_bytes": 613376, "input_raster_bytes": null, - "train_ms_per_step": 94.40872569999783, - "infer_ms_per_sample": 0.6202037340624855, - "peak_vram_mb": 2837.544448, - "weight_bytes_nonzero": 160314 + "train_ms_per_step": 100.49617395000041, + "infer_ms_per_sample": 0.6706169215624413, + "peak_vram_mb": 2844.865024 }, "optimization_specific": { - "pruning_enabled": true, - "balance_enabled": true, - "rounds": 3, - "final_sparsity": 0.9673295454545454, - "nnz_per_layer": { - "layer0": 2880, - "layer1": 20480, - "layer2": 16384 + "w_bits": 4, + "u_bits": 8, + "leak_shift": 0, + "beta_eff": 1.0, + "qat": true, + "batchnorm": true, + "membrane_memory_reduction_x": 4.0, + "weight_memory_reduction_x": 8.0, + "membrane_bytes_per_inference": 112800.0, + "working_set_bytes": 614504.0, + "baseline_working_set_bytes": 4911520.0, + "l2_cache_fits": true, + "baseline_l2_cache_fits": false, + "l2_budget_bytes": 2097152, + "membrane_saturation_frac": 0.32682918467420213, + "acc_vs_ubits": { + "2": 0.8592857142857143, + "4": 0.965, + "8": 0.9664285714285714, + "0": 0.9521428571428572 }, - "pe_stats_per_layer": { - "layer0": { - "mean_nnz": 9.0, - "max_nnz": 9.0, - "min_nnz": 9.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 1.0 - }, - "layer1": { - "mean_nnz": 40.0, - "max_nnz": 40.0, - "min_nnz": 40.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 1.0 + "bits_sweep_rows": [ + { + "u_bits": 2, + "acc": 0.8592857142857143, + "target_acc": 0.8592857142857143, + "membrane_bytes_per_neuron_per_tick": 0.25, + "membrane_memory_reduction_x": 16.0, + "membrane_saturation_frac": 0.050917691710992904, + "acc_drop_vs_fp32": 0.09285714285714286 }, - "layer2": { - "mean_nnz": 64.0, - "max_nnz": 64.0, - "min_nnz": 64.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 1.0 - } - }, - "pe_utilization_final": 1.0, - "pe_utilization_lth": 0.623062015503876, - "pe_utilization_uticket": 1.0, - "latency_proxy_dense": 3712, - "latency_proxy_final": 113, - "latency_reduction_frac": 0.9695581896551724, - "rounds_history": [ { - "round": 1, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 36.0, - "max_nnz": 49.0, - "min_nnz": 25.0, - "total_nnz": 11520, - "numel": 921600, - "sparsity": 0.9875, - "utilization": 0.7346938775510204 - }, - "uticket": { - "mean_nnz": 36.0, - "max_nnz": 36.0, - "min_nnz": 36.0, - "total_nnz": 11520, - "numel": 921600, - "sparsity": 0.9875, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 160.0, - "max_nnz": 190.0, - "min_nnz": 93.0, - "total_nnz": 81920, - "numel": 163840, - "sparsity": 0.5, - "utilization": 0.8421052631578947 - }, - "uticket": { - "mean_nnz": 160.0, - "max_nnz": 160.0, - "min_nnz": 160.0, - "total_nnz": 81920, - "numel": 163840, - "sparsity": 0.5, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 256.0, - "max_nnz": 297.0, - "min_nnz": 193.0, - "total_nnz": 65536, - "numel": 131072, - "sparsity": 0.5, - "utilization": 0.8619528619528619 - }, - "uticket": { - "mean_nnz": 256.0, - "max_nnz": 256.0, - "min_nnz": 256.0, - "total_nnz": 65536, - "numel": 131072, - "sparsity": 0.5, - "utilization": 1.0 - } - } - }, - "latency_proxy": 452, - "sparsity": 0.8693181818181819 + "u_bits": 4, + "acc": 0.965, + "target_acc": 0.965, + "membrane_bytes_per_neuron_per_tick": 0.5, + "membrane_memory_reduction_x": 8.0, + "membrane_saturation_frac": 0.26607622728280145, + "acc_drop_vs_fp32": -0.01285714285714279 }, { - "round": 2, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 18.0, - "max_nnz": 29.0, - "min_nnz": 8.0, - "total_nnz": 5760, - "numel": 921600, - "sparsity": 0.99375, - "utilization": 0.6206896551724138 - }, - "uticket": { - "mean_nnz": 18.0, - "max_nnz": 18.0, - "min_nnz": 18.0, - "total_nnz": 5760, - "numel": 921600, - "sparsity": 0.99375, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 80.0, - "max_nnz": 115.0, - "min_nnz": 28.0, - "total_nnz": 40960, - "numel": 163840, - "sparsity": 0.75, - "utilization": 0.6956521739130435 - }, - "uticket": { - "mean_nnz": 80.0, - "max_nnz": 80.0, - "min_nnz": 80.0, - "total_nnz": 40960, - "numel": 163840, - "sparsity": 0.75, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 128.0, - "max_nnz": 157.0, - "min_nnz": 99.0, - "total_nnz": 32768, - "numel": 131072, - "sparsity": 0.75, - "utilization": 0.8152866242038217 - }, - "uticket": { - "mean_nnz": 128.0, - "max_nnz": 128.0, - "min_nnz": 128.0, - "total_nnz": 32768, - "numel": 131072, - "sparsity": 0.75, - "utilization": 1.0 - } - } - }, - "latency_proxy": 226, - "sparsity": 0.9346590909090909 + "u_bits": 8, + "acc": 0.9664285714285714, + "target_acc": 0.9664285714285714, + "membrane_bytes_per_neuron_per_tick": 1.0, + "membrane_memory_reduction_x": 4.0, + "membrane_saturation_frac": 0.3181812389184397, + "acc_drop_vs_fp32": -0.014285714285714235 }, { - "round": 3, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 9.0, - "max_nnz": 18.0, - "min_nnz": 1.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 9.0, - "max_nnz": 9.0, - "min_nnz": 9.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 40.0, - "max_nnz": 64.0, - "min_nnz": 6.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 0.625 - }, - "uticket": { - "mean_nnz": 40.0, - "max_nnz": 40.0, - "min_nnz": 40.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 64.0, - "max_nnz": 86.0, - "min_nnz": 45.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 0.7441860465116279 - }, - "uticket": { - "mean_nnz": 64.0, - "max_nnz": 64.0, - "min_nnz": 64.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 1.0 - } - } - }, - "latency_proxy": 113, - "sparsity": 0.9673295454545454 - } - ], - "latency_proxy_lth": 168, - "latency_reduction_vs_lth_frac": 0.32738095238095233 + "u_bits": 0, + "acc": 0.9521428571428572, + "target_acc": 0.9521428571428572, + "membrane_bytes_per_neuron_per_tick": 4.0, + "membrane_memory_reduction_x": 1.0, + "membrane_saturation_frac": null, + "acc_drop_vs_fp32": 0.0 + } + ], + "fp32_membrane_acc": 0.9521428571428572, + "per_layer_scales": [ + { + "layer": 0, + "weight_scale": 0.04109285133225577, + "membrane_scale": 0.007874015748031496, + "shared_scale_gauge_factor": 0.19161521998963355 + }, + { + "layer": 1, + "weight_scale": 0.020464909928185598, + "membrane_scale": 0.007874015748031496, + "shared_scale_gauge_factor": 0.38475692175839443 + }, + { + "layer": 2, + "weight_scale": 0.01011819179568972, + "membrane_scale": 0.007874015748031496, + "shared_scale_gauge_factor": 0.7782038438316392 + }, + { + "layer": 3, + "weight_scale": 0.01918845304421016, + "membrane_scale": 0.007874015748031496, + "shared_scale_gauge_factor": 0.41035177405337353 + } + ], + "shared_scale_note": "weight grid and membrane grid are the same grid up to a per-layer positive scalar that BatchNorm absorbs exactly; exact only with --batchnorm on", + "multiplier_less_compare": true, + "wall_clock_caveat": "this reference kernel computes in fp32 registers, so the traffic win does not appear in train_ms_per_step; a fixed-point core is where it becomes energy" }, "config": { "method": "harmonic_matched", @@ -1996,7 +1404,7 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt06_uticket_prune/prune_rounds_3", + "hub_dir": "/kaggle/working/hub/opt08_mint_quant/u_bits_8", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, @@ -2007,645 +1415,265 @@ "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "prune_rounds": 3, - "prune_rate": 0.5, - "rewind_epoch": 1, - "balance": true, - "balance_iters": 2, - "prune_readout": false, + "w_bits": 4, + "u_bits": 8, + "leak_shift": 0, + "qat": true, + "bits_sweep": "2,4,8,0", + "l2_bytes": 2097152, "sampling_rate": 250.0 } }, "zip": { - "name": "prune_rounds_3.zip", + "name": "u_bits_8.zip", "files": 81, - "bytes": 8378826, - "MB": 8.4, - "sha256": "4f95cb87dd3ae4936d31d4c1e94317cb6a26fbeb7da655363811df3a91cd6bf8" + "bytes": 12213011, + "MB": 12.2, + "sha256": "63dd1fe2bcaf39fb5ab00bb833afca7ab94b1ab1e3556da5782d622e248c8bd7" } }, { - "key": "opt06_uticket_prune/prune_rounds_8", - "tag": "prune_rounds_8", - "script": "opt06_uticket_prune.py", - "hf_folder": "applied/opt06_uticket_prune", - "phase": 9, + "key": "opt09_srif_softreset/lam_init_0.1", + "tag": "lam_init_0.1", + "script": "opt09_srif_softreset.py", + "hf_folder": "applied/opt09_srif_softreset", + "phase": 5, "status": "ok", - "duration_s": 322.7, + "duration_s": 363.2, "optimization_summary": { - "optimization": "uticket_workload_balanced_pruning", - "research_section": "3. Spike sparsity & MAC->AC restructuring", - "reference": "u-Ticket: Workload-Balanced Pruning for Sparse SNNs, arXiv:2302.06746", - "script": "opt06_uticket_prune.py", + "optimization": "srif_softreset", + "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", + "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", + "script": "opt09_srif_softreset.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.18428571428571427, - "test_target_acc": 0.18428571428571427, - "best_val_acc": 0.9142857142857143 + "test_acc": 0.8864285714285715, + "test_target_acc": 0.8864285714285715, + "best_val_acc": 0.8864285714285715 }, "efficiency": { - "spikes_per_inference": null, - "syn_ops_per_inference": 129797.51948051948, + "spikes_per_inference": 14075.5703125, + "syn_ops_per_inference": 5061701.517045454, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.0010580583482278365, - "syn_ops_per_inference_dense_fanout": 65036167.55113637, - "weight_sparsity": 0.9907585233201168, - "effective_ticks": 16.09857142857143, + "event_fraction_of_dense": 0.04126100073238482, + "syn_ops_per_inference_dense_fanout": 66638319.30357143, + "weight_sparsity": 0.7324707846410685, + "effective_ticks": 21.771428571428572, "num_ticks": 100, "membrane_bytes_per_inference": 451200, "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 94.60634120000577, - "infer_ms_per_sample": 0.6177368868750222, - "peak_vram_mb": 2839.143424, - "weight_bytes_nonzero": 4453 + "train_ms_per_step": 104.55192480001188, + "infer_ms_per_sample": 0.7019145781249847, + "peak_vram_mb": 2834.965504, + "discarded_charge_per_reset": -0.5145500630598341 }, "optimization_specific": { - "pruning_enabled": true, - "balance_enabled": true, - "rounds": 8, - "final_sparsity": 0.9990924873737373, - "nnz_per_layer": { - "layer0": 80, - "layer1": 512, - "layer2": 512 + "reset_mode": "srif", + "learn_reset": true, + "lam_init": 0.1, + "v_reset_init": 0.0, + "u_bits": 0, + "u_scale": 1.0, + "u_headroom_requested": 2.0, + "u_headroom_actual": 0.0, + "u_threshold_level": 0, + "u_levels_above_threshold": null, + "reset_family": { + "reset_mode": "srif", + "learn_reset": true, + "num_spiking_sites": 4, + "extra_params": 8, + "extra_params_frac_of_weights": 6.5212854757929885e-06, + "extra_flops_per_tick_per_neuron": 0, + "learned_lam_per_layer": [ + 0.34666571021080017, + 0.329329252243042, + 0.33023813366889954, + 0.4990707039833069 + ], + "learned_v_reset_per_layer": [ + 0.5600309371948242, + 0.6936066150665283, + 0.6635518074035645, + 1.1929576396942139 + ] }, - "pe_stats_per_layer": { - "layer0": { - "mean_nnz": 0.25, - "max_nnz": 1.0, - "min_nnz": 0.0, - "total_nnz": 80, - "numel": 921600, - "sparsity": 0.9999131944444445, - "utilization": 0.25 - }, - "layer1": { - "mean_nnz": 1.0, - "max_nnz": 1.0, - "min_nnz": 1.0, - "total_nnz": 512, - "numel": 163840, - "sparsity": 0.996875, - "utilization": 1.0 - }, - "layer2": { - "mean_nnz": 2.0, - "max_nnz": 2.0, - "min_nnz": 2.0, - "total_nnz": 512, - "numel": 131072, - "sparsity": 0.99609375, - "utilization": 1.0 - } + "reset_stats": { + "reset_mode": "srif", + "learn_reset": true, + "discarded_charge_per_reset": -0.5145500630598341, + "spikes_per_inference": 14075.5703125, + "syn_per_inference": 5154236.75, + "lam_per_site": [ + 0.34666571021080017, + 0.329329252243042, + 0.33023813366889954, + 0.4990707039833069 + ], + "v_reset_per_site": [ + 0.5600309371948242, + 0.6936066150665283, + 0.6635518074035645, + 1.1929576396942139 + ], + "u_bits": 0, + "membrane_saturation_frac": null, + "batches": 4, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null }, - "pe_utilization_final": 0.75, - "pe_utilization_lth": 0.4166666666666667, - "pe_utilization_uticket": 0.75, - "latency_proxy_dense": 3712, - "latency_proxy_final": 4, - "latency_reduction_frac": 0.9989224137931034, - "rounds_history": [ - { - "round": 1, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 36.0, - "max_nnz": 49.0, - "min_nnz": 24.0, - "total_nnz": 11520, - "numel": 921600, - "sparsity": 0.9875, - "utilization": 0.7346938775510204 - }, - "uticket": { - "mean_nnz": 36.0, - "max_nnz": 36.0, - "min_nnz": 36.0, - "total_nnz": 11520, - "numel": 921600, - "sparsity": 0.9875, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 160.0, - "max_nnz": 194.0, - "min_nnz": 134.0, - "total_nnz": 81920, - "numel": 163840, - "sparsity": 0.5, - "utilization": 0.8247422680412371 - }, - "uticket": { - "mean_nnz": 160.0, - "max_nnz": 160.0, - "min_nnz": 160.0, - "total_nnz": 81920, - "numel": 163840, - "sparsity": 0.5, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 256.0, - "max_nnz": 289.0, - "min_nnz": 203.0, - "total_nnz": 65536, - "numel": 131072, - "sparsity": 0.5, - "utilization": 0.8858131487889274 - }, - "uticket": { - "mean_nnz": 256.0, - "max_nnz": 256.0, - "min_nnz": 256.0, - "total_nnz": 65536, - "numel": 131072, - "sparsity": 0.5, - "utilization": 1.0 - } - } + "reset_x_bits_sweep": { + "rows": [ + { + "reset_mode": "hard", + "u_bits": 0, + "acc": 0.6842857142857143, + "target_acc": 0.6842857142857143, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.15835896317720594, + "spikes_per_inference": 6790.640625, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 }, - "latency_proxy": 452, - "sparsity": 0.8693181818181819 - }, - { - "round": 2, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 18.0, - "max_nnz": 25.0, - "min_nnz": 9.0, - "total_nnz": 5760, - "numel": 921600, - "sparsity": 0.99375, - "utilization": 0.72 - }, - "uticket": { - "mean_nnz": 18.0, - "max_nnz": 18.0, - "min_nnz": 18.0, - "total_nnz": 5760, - "numel": 921600, - "sparsity": 0.99375, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 80.0, - "max_nnz": 102.0, - "min_nnz": 41.0, - "total_nnz": 40960, - "numel": 163840, - "sparsity": 0.75, - "utilization": 0.7843137254901961 - }, - "uticket": { - "mean_nnz": 80.0, - "max_nnz": 80.0, - "min_nnz": 80.0, - "total_nnz": 40960, - "numel": 163840, - "sparsity": 0.75, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 128.0, - "max_nnz": 158.0, - "min_nnz": 80.0, - "total_nnz": 32768, - "numel": 131072, - "sparsity": 0.75, - "utilization": 0.810126582278481 - }, - "uticket": { - "mean_nnz": 128.0, - "max_nnz": 128.0, - "min_nnz": 128.0, - "total_nnz": 32768, - "numel": 131072, - "sparsity": 0.75, - "utilization": 1.0 - } - } + { + "reset_mode": "hard", + "u_bits": 4, + "acc": 0.6864285714285714, + "target_acc": 0.6864285714285714, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.059665275456522254, + "spikes_per_inference": 7909.4375, + "membrane_saturation_frac": 0.22161569148936172, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.002142857142857113 }, - "latency_proxy": 226, - "sparsity": 0.9346590909090909 - }, - { - "round": 3, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 9.0, - "max_nnz": 15.0, - "min_nnz": 4.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 0.6 - }, - "uticket": { - "mean_nnz": 9.0, - "max_nnz": 9.0, - "min_nnz": 9.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 40.0, - "max_nnz": 57.0, - "min_nnz": 11.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 0.7017543859649122 - }, - "uticket": { - "mean_nnz": 40.0, - "max_nnz": 40.0, - "min_nnz": 40.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 64.0, - "max_nnz": 84.0, - "min_nnz": 32.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 0.7619047619047619 - }, - "uticket": { - "mean_nnz": 64.0, - "max_nnz": 64.0, - "min_nnz": 64.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 1.0 - } - } + { + "reset_mode": "hard", + "u_bits": 2, + "acc": 0.16214285714285714, + "target_acc": 0.16214285714285714, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 2683.109375, + "membrane_saturation_frac": 0.19872880651595745, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.5221428571428571 }, - "latency_proxy": 113, - "sparsity": 0.9673295454545454 - }, - { - "round": 4, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 4.5, - "max_nnz": 9.0, - "min_nnz": 0.0, - "total_nnz": 1440, - "numel": 921600, - "sparsity": 0.9984375, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 4.0, - "max_nnz": 4.0, - "min_nnz": 4.0, - "total_nnz": 1280, - "numel": 921600, - "sparsity": 0.9986111111111111, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 20.0, - "max_nnz": 34.0, - "min_nnz": 1.0, - "total_nnz": 10240, - "numel": 163840, - "sparsity": 0.9375, - "utilization": 0.5882352941176471 - }, - "uticket": { - "mean_nnz": 20.0, - "max_nnz": 20.0, - "min_nnz": 20.0, - "total_nnz": 10240, - "numel": 163840, - "sparsity": 0.9375, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 32.0, - "max_nnz": 45.0, - "min_nnz": 18.0, - "total_nnz": 8192, - "numel": 131072, - "sparsity": 0.9375, - "utilization": 0.7111111111111111 - }, - "uticket": { - "mean_nnz": 32.0, - "max_nnz": 32.0, - "min_nnz": 32.0, - "total_nnz": 8192, - "numel": 131072, - "sparsity": 0.9375, - "utilization": 1.0 - } - } + { + "reset_mode": "soft", + "u_bits": 0, + "acc": 0.7814285714285715, + "target_acc": 0.7814285714285715, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 8097.6796875, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 }, - "latency_proxy": 56, - "sparsity": 0.9837962962962963 - }, - { - "round": 5, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 2.0, - "max_nnz": 4.0, - "min_nnz": 0.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 2.0, - "max_nnz": 2.0, - "min_nnz": 2.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 10.0, - "max_nnz": 17.0, - "min_nnz": 0.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 0.5882352941176471 - }, - "uticket": { - "mean_nnz": 10.0, - "max_nnz": 10.0, - "min_nnz": 10.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 16.0, - "max_nnz": 26.0, - "min_nnz": 9.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 0.6153846153846154 - }, - "uticket": { - "mean_nnz": 16.0, - "max_nnz": 16.0, - "min_nnz": 16.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 1.0 - } - } + { + "reset_mode": "soft", + "u_bits": 4, + "acc": 0.7571428571428571, + "target_acc": 0.7571428571428571, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 8502.828125, + "membrane_saturation_frac": 0.2330075354609929, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": 0.024285714285714355 }, - "latency_proxy": 28, - "sparsity": 0.9918981481481481 - }, - { - "round": 6, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 1.0, - "max_nnz": 2.0, - "min_nnz": 0.0, - "total_nnz": 320, - "numel": 921600, - "sparsity": 0.9996527777777777, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 1.0, - "max_nnz": 1.0, - "min_nnz": 1.0, - "total_nnz": 320, - "numel": 921600, - "sparsity": 0.9996527777777777, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 5.0, - "max_nnz": 10.0, - "min_nnz": 0.0, - "total_nnz": 2560, - "numel": 163840, - "sparsity": 0.984375, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 5.0, - "max_nnz": 5.0, - "min_nnz": 5.0, - "total_nnz": 2560, - "numel": 163840, - "sparsity": 0.984375, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 8.0, - "max_nnz": 14.0, - "min_nnz": 3.0, - "total_nnz": 2048, - "numel": 131072, - "sparsity": 0.984375, - "utilization": 0.5714285714285714 - }, - "uticket": { - "mean_nnz": 8.0, - "max_nnz": 8.0, - "min_nnz": 8.0, - "total_nnz": 2048, - "numel": 131072, - "sparsity": 0.984375, - "utilization": 1.0 - } - } + { + "reset_mode": "soft", + "u_bits": 2, + "acc": 0.16214285714285714, + "target_acc": 0.16214285714285714, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 2683.109375, + "membrane_saturation_frac": 0.19872880651595745, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.6192857142857143 }, - "latency_proxy": 14, - "sparsity": 0.9959490740740741 - }, - { - "round": 7, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 0.5, - "max_nnz": 1.0, - "min_nnz": 0.0, - "total_nnz": 160, - "numel": 921600, - "sparsity": 0.9998263888888889, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 0.5, - "max_nnz": 1.0, - "min_nnz": 0.0, - "total_nnz": 160, - "numel": 921600, - "sparsity": 0.9998263888888889, - "utilization": 0.5 - } - }, - "layer1": { - "lth": { - "mean_nnz": 2.5, - "max_nnz": 5.0, - "min_nnz": 0.0, - "total_nnz": 1280, - "numel": 163840, - "sparsity": 0.9921875, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 2.0, - "max_nnz": 2.0, - "min_nnz": 2.0, - "total_nnz": 1024, - "numel": 163840, - "sparsity": 0.99375, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 4.0, - "max_nnz": 7.0, - "min_nnz": 1.0, - "total_nnz": 1024, - "numel": 131072, - "sparsity": 0.9921875, - "utilization": 0.5714285714285714 - }, - "uticket": { - "mean_nnz": 4.0, - "max_nnz": 4.0, - "min_nnz": 4.0, - "total_nnz": 1024, - "numel": 131072, - "sparsity": 0.9921875, - "utilization": 1.0 - } + { + "reset_mode": "trained", + "u_bits": 0, + "acc": 0.8864285714285715, + "target_acc": 0.8864285714285715, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": -0.51547552848815, + "spikes_per_inference": 13885.140625, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "trained", + "u_bits": 4, + "acc": 0.9092857142857143, + "target_acc": 0.9092857142857143, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": -0.5824071496424404, + "spikes_per_inference": 17677.2734375, + "membrane_saturation_frac": 0.3281896193484043, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.022857142857142798 + }, + { + "reset_mode": "trained", + "u_bits": 2, + "acc": 0.06642857142857143, + "target_acc": 0.06642857142857143, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": -0.6881111096608943, + "spikes_per_inference": 24211.9453125, + "membrane_saturation_frac": 0.4429418079565603, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.8200000000000001 + } + ], + "by_mode": { + "hard": { + "fp32_acc": 0.6842857142857143, + "acc_by_bits": { + "0": 0.6842857142857143, + "4": 0.6864285714285714, + "2": 0.16214285714285714 } }, - "latency_proxy": 7, - "sparsity": 0.9981849747474747 - }, - { - "round": 8, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 0.25, - "max_nnz": 1.0, - "min_nnz": 0.0, - "total_nnz": 80, - "numel": 921600, - "sparsity": 0.9999131944444445, - "utilization": 0.25 - }, - "uticket": { - "mean_nnz": 0.25, - "max_nnz": 1.0, - "min_nnz": 0.0, - "total_nnz": 80, - "numel": 921600, - "sparsity": 0.9999131944444445, - "utilization": 0.25 - } - }, - "layer1": { - "lth": { - "mean_nnz": 1.0, - "max_nnz": 2.0, - "min_nnz": 0.0, - "total_nnz": 512, - "numel": 163840, - "sparsity": 0.996875, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 1.0, - "max_nnz": 1.0, - "min_nnz": 1.0, - "total_nnz": 512, - "numel": 163840, - "sparsity": 0.996875, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 2.0, - "max_nnz": 4.0, - "min_nnz": 0.0, - "total_nnz": 512, - "numel": 131072, - "sparsity": 0.99609375, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 2.0, - "max_nnz": 2.0, - "min_nnz": 2.0, - "total_nnz": 512, - "numel": 131072, - "sparsity": 0.99609375, - "utilization": 1.0 - } + "soft": { + "fp32_acc": 0.7814285714285715, + "acc_by_bits": { + "0": 0.7814285714285715, + "4": 0.7571428571428571, + "2": 0.16214285714285714 } }, - "latency_proxy": 4, - "sparsity": 0.9990924873737373 + "trained": { + "fp32_acc": 0.8864285714285715, + "acc_by_bits": { + "0": 0.8864285714285715, + "4": 0.9092857142857143, + "2": 0.06642857142857143 + } + } } - ], - "latency_proxy_lth": 7, - "latency_reduction_vs_lth_frac": 0.4285714285714286 + }, + "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", + "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", + "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" }, "config": { "method": "harmonic_matched", @@ -2685,455 +1713,278 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt06_uticket_prune/prune_rounds_8", + "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/lam_init_0.1", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, "no_resume": true, "selftest": false, + "reset_mode": "srif", + "learn_reset": true, + "lam_init": 0.1, + "v_reset_init": 0.0, + "u_bits": 0, + "u_headroom": 2.0, + "reset_sweep": "hard,soft,trained", + "bits_sweep": "0,4,2", "baseline": false, "bench": true, "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "prune_rounds": 8, - "prune_rate": 0.5, - "rewind_epoch": 1, - "balance": true, - "balance_iters": 2, - "prune_readout": false, "sampling_rate": 250.0 } }, "zip": { - "name": "prune_rounds_8.zip", + "name": "lam_init_0.1.zip", "files": 81, - "bytes": 7983037, - "MB": 8.0, - "sha256": "477e6120957d9a5697e3cc386ecc6dce0c2c61b98a383a8e903d9e83590962cc" + "bytes": 12307403, + "MB": 12.3, + "sha256": "f0bde8116a705a1c90f84adf38d925dec0ca1bf7025cb8bb4df284bd28d75a88" } }, { - "key": "opt06_uticket_prune/rewind_epoch_0", - "tag": "rewind_epoch_0", - "script": "opt06_uticket_prune.py", - "hf_folder": "applied/opt06_uticket_prune", - "phase": 9, + "key": "opt09_srif_softreset/lam_init_0.5", + "tag": "lam_init_0.5", + "script": "opt09_srif_softreset.py", + "hf_folder": "applied/opt09_srif_softreset", + "phase": 5, "status": "ok", - "duration_s": 321.6, + "duration_s": 362.7, "optimization_summary": { - "optimization": "uticket_workload_balanced_pruning", - "research_section": "3. Spike sparsity & MAC->AC restructuring", - "reference": "u-Ticket: Workload-Balanced Pruning for Sparse SNNs, arXiv:2302.06746", - "script": "opt06_uticket_prune.py", + "optimization": "srif_softreset", + "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", + "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", + "script": "opt09_srif_softreset.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.7814285714285715, - "test_target_acc": 0.7814285714285715, - "best_val_acc": 0.9264285714285714 + "test_acc": 0.8707142857142857, + "test_target_acc": 0.8707142857142857, + "best_val_acc": 0.8821428571428571 }, "efficiency": { - "spikes_per_inference": null, - "syn_ops_per_inference": 216478.7705965909, + "spikes_per_inference": 10510.55078125, + "syn_ops_per_inference": 4706841.721590909, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.0017646498281363382, - "syn_ops_per_inference_dense_fanout": 65202982.11444805, - "weight_sparsity": 0.983618530884808, - "effective_ticks": 12.964285714285714, + "event_fraction_of_dense": 0.038368323194834075, + "syn_ops_per_inference_dense_fanout": 66283459.508116886, + "weight_sparsity": 0.7324707846410685, + "effective_ticks": 16.917142857142856, "num_ticks": 100, "membrane_bytes_per_inference": 451200, "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 94.85441450001417, - "infer_ms_per_sample": 0.6180852540624926, - "peak_vram_mb": 2837.810688, - "weight_bytes_nonzero": 39755 + "train_ms_per_step": 104.18545079999149, + "infer_ms_per_sample": 0.688990259687472, + "peak_vram_mb": 2832.164352, + "discarded_charge_per_reset": -0.4861374069439148 }, "optimization_specific": { - "pruning_enabled": true, - "balance_enabled": true, - "rounds": 5, - "final_sparsity": 0.9918981481481481, - "nnz_per_layer": { - "layer0": 640, - "layer1": 5120, - "layer2": 4096 + "reset_mode": "srif", + "learn_reset": true, + "lam_init": 0.5, + "v_reset_init": 0.0, + "u_bits": 0, + "u_scale": 1.0, + "u_headroom_requested": 2.0, + "u_headroom_actual": 0.0, + "u_threshold_level": 0, + "u_levels_above_threshold": null, + "reset_family": { + "reset_mode": "srif", + "learn_reset": true, + "num_spiking_sites": 4, + "extra_params": 8, + "extra_params_frac_of_weights": 6.5212854757929885e-06, + "extra_flops_per_tick_per_neuron": 0, + "learned_lam_per_layer": [ + 0.42542359232902527, + 0.46086835861206055, + 0.48474565148353577, + 0.740869402885437 + ], + "learned_v_reset_per_layer": [ + 0.588733434677124, + 0.6110309362411499, + 0.563993513584137, + 1.0104514360427856 + ] }, - "pe_stats_per_layer": { - "layer0": { - "mean_nnz": 2.0, - "max_nnz": 2.0, - "min_nnz": 2.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 1.0 - }, - "layer1": { - "mean_nnz": 10.0, - "max_nnz": 10.0, - "min_nnz": 10.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 1.0 - }, - "layer2": { - "mean_nnz": 16.0, - "max_nnz": 16.0, - "min_nnz": 16.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 1.0 - } + "reset_stats": { + "reset_mode": "srif", + "learn_reset": true, + "discarded_charge_per_reset": -0.4861374069439148, + "spikes_per_inference": 10510.55078125, + "syn_per_inference": 4809386.59375, + "lam_per_site": [ + 0.42542359232902527, + 0.46086835861206055, + 0.48474565148353577, + 0.740869402885437 + ], + "v_reset_per_site": [ + 0.588733434677124, + 0.6110309362411499, + 0.563993513584137, + 1.0104514360427856 + ], + "u_bits": 0, + "membrane_saturation_frac": null, + "batches": 4, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null }, - "pe_utilization_final": 1.0, - "pe_utilization_lth": 0.5554385964912281, - "pe_utilization_uticket": 1.0, - "latency_proxy_dense": 3712, - "latency_proxy_final": 28, - "latency_reduction_frac": 0.9924568965517241, - "rounds_history": [ - { - "round": 1, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 36.0, - "max_nnz": 46.0, - "min_nnz": 27.0, - "total_nnz": 11520, - "numel": 921600, - "sparsity": 0.9875, - "utilization": 0.782608695652174 - }, - "uticket": { - "mean_nnz": 36.0, - "max_nnz": 36.0, - "min_nnz": 36.0, - "total_nnz": 11520, - "numel": 921600, - "sparsity": 0.9875, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 160.0, - "max_nnz": 189.0, - "min_nnz": 123.0, - "total_nnz": 81920, - "numel": 163840, - "sparsity": 0.5, - "utilization": 0.8465608465608465 - }, - "uticket": { - "mean_nnz": 160.0, - "max_nnz": 160.0, - "min_nnz": 160.0, - "total_nnz": 81920, - "numel": 163840, - "sparsity": 0.5, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 256.0, - "max_nnz": 292.0, - "min_nnz": 197.0, - "total_nnz": 65536, - "numel": 131072, - "sparsity": 0.5, - "utilization": 0.8767123287671232 - }, - "uticket": { - "mean_nnz": 256.0, - "max_nnz": 256.0, - "min_nnz": 256.0, - "total_nnz": 65536, - "numel": 131072, - "sparsity": 0.5, - "utilization": 1.0 - } - } - }, - "latency_proxy": 452, - "sparsity": 0.8693181818181819 - }, - { - "round": 2, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 18.0, - "max_nnz": 27.0, - "min_nnz": 9.0, - "total_nnz": 5760, - "numel": 921600, - "sparsity": 0.99375, - "utilization": 0.6666666666666666 - }, - "uticket": { - "mean_nnz": 18.0, - "max_nnz": 18.0, - "min_nnz": 18.0, - "total_nnz": 5760, - "numel": 921600, - "sparsity": 0.99375, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 80.0, - "max_nnz": 110.0, - "min_nnz": 32.0, - "total_nnz": 40960, - "numel": 163840, - "sparsity": 0.75, - "utilization": 0.7272727272727273 - }, - "uticket": { - "mean_nnz": 80.0, - "max_nnz": 80.0, - "min_nnz": 80.0, - "total_nnz": 40960, - "numel": 163840, - "sparsity": 0.75, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 128.0, - "max_nnz": 161.0, - "min_nnz": 90.0, - "total_nnz": 32768, - "numel": 131072, - "sparsity": 0.75, - "utilization": 0.7950310559006211 - }, - "uticket": { - "mean_nnz": 128.0, - "max_nnz": 128.0, - "min_nnz": 128.0, - "total_nnz": 32768, - "numel": 131072, - "sparsity": 0.75, - "utilization": 1.0 - } - } + "reset_x_bits_sweep": { + "rows": [ + { + "reset_mode": "hard", + "u_bits": 0, + "acc": 0.5607142857142857, + "target_acc": 0.5607142857142857, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.14522441932037566, + "spikes_per_inference": 6385.7578125, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 }, - "latency_proxy": 226, - "sparsity": 0.9346590909090909 - }, - { - "round": 3, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 9.0, - "max_nnz": 17.0, - "min_nnz": 3.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 0.5294117647058824 - }, - "uticket": { - "mean_nnz": 9.0, - "max_nnz": 9.0, - "min_nnz": 9.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 40.0, - "max_nnz": 63.0, - "min_nnz": 3.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 0.6349206349206349 - }, - "uticket": { - "mean_nnz": 40.0, - "max_nnz": 40.0, - "min_nnz": 40.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 64.0, - "max_nnz": 81.0, - "min_nnz": 40.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 0.7901234567901234 - }, - "uticket": { - "mean_nnz": 64.0, - "max_nnz": 64.0, - "min_nnz": 64.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 1.0 - } - } + { + "reset_mode": "hard", + "u_bits": 4, + "acc": 0.71, + "target_acc": 0.71, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.05066428686952293, + "spikes_per_inference": 7130.9140625, + "membrane_saturation_frac": 0.17117339871453902, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.14928571428571424 }, - "latency_proxy": 113, - "sparsity": 0.9673295454545454 - }, - { - "round": 4, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 4.5, - "max_nnz": 9.0, - "min_nnz": 0.0, - "total_nnz": 1440, - "numel": 921600, - "sparsity": 0.9984375, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 4.0, - "max_nnz": 4.0, - "min_nnz": 4.0, - "total_nnz": 1280, - "numel": 921600, - "sparsity": 0.9986111111111111, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 20.0, - "max_nnz": 34.0, - "min_nnz": 0.0, - "total_nnz": 10240, - "numel": 163840, - "sparsity": 0.9375, - "utilization": 0.5882352941176471 - }, - "uticket": { - "mean_nnz": 20.0, - "max_nnz": 20.0, - "min_nnz": 20.0, - "total_nnz": 10240, - "numel": 163840, - "sparsity": 0.9375, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 32.0, - "max_nnz": 44.0, - "min_nnz": 20.0, - "total_nnz": 8192, - "numel": 131072, - "sparsity": 0.9375, - "utilization": 0.7272727272727273 - }, - "uticket": { - "mean_nnz": 32.0, - "max_nnz": 32.0, - "min_nnz": 32.0, - "total_nnz": 8192, - "numel": 131072, - "sparsity": 0.9375, - "utilization": 1.0 - } + { + "reset_mode": "hard", + "u_bits": 2, + "acc": 0.32357142857142857, + "target_acc": 0.32357142857142857, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 2256.09375, + "membrane_saturation_frac": 0.13216942320478722, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.23714285714285716 + }, + { + "reset_mode": "soft", + "u_bits": 0, + "acc": 0.7485714285714286, + "target_acc": 0.7485714285714286, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 7258.03125, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "soft", + "u_bits": 4, + "acc": 0.7742857142857142, + "target_acc": 0.7742857142857142, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 7553.2734375, + "membrane_saturation_frac": 0.18284456726507092, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.02571428571428569 + }, + { + "reset_mode": "soft", + "u_bits": 2, + "acc": 0.32357142857142857, + "target_acc": 0.32357142857142857, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 2256.1015625, + "membrane_saturation_frac": 0.13216949246453902, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.425 + }, + { + "reset_mode": "trained", + "u_bits": 0, + "acc": 0.8707142857142857, + "target_acc": 0.8707142857142857, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": -0.4863823495393781, + "spikes_per_inference": 10391.765625, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "trained", + "u_bits": 4, + "acc": 0.9028571428571428, + "target_acc": 0.9028571428571428, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": -0.548379950693327, + "spikes_per_inference": 12341.2890625, + "membrane_saturation_frac": 0.3302675504210993, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.03214285714285714 + }, + { + "reset_mode": "trained", + "u_bits": 2, + "acc": 0.145, + "target_acc": 0.145, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": -0.606366216730921, + "spikes_per_inference": 18285.546875, + "membrane_saturation_frac": 0.337806405141844, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.7257142857142856 + } + ], + "by_mode": { + "hard": { + "fp32_acc": 0.5607142857142857, + "acc_by_bits": { + "0": 0.5607142857142857, + "4": 0.71, + "2": 0.32357142857142857 } }, - "latency_proxy": 56, - "sparsity": 0.9837962962962963 - }, - { - "round": 5, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 2.0, - "max_nnz": 4.0, - "min_nnz": 0.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 2.0, - "max_nnz": 2.0, - "min_nnz": 2.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 10.0, - "max_nnz": 19.0, - "min_nnz": 0.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 0.5263157894736842 - }, - "uticket": { - "mean_nnz": 10.0, - "max_nnz": 10.0, - "min_nnz": 10.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 16.0, - "max_nnz": 25.0, - "min_nnz": 5.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 0.64 - }, - "uticket": { - "mean_nnz": 16.0, - "max_nnz": 16.0, - "min_nnz": 16.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 1.0 - } + "soft": { + "fp32_acc": 0.7485714285714286, + "acc_by_bits": { + "0": 0.7485714285714286, + "4": 0.7742857142857142, + "2": 0.32357142857142857 } }, - "latency_proxy": 28, - "sparsity": 0.9918981481481481 + "trained": { + "fp32_acc": 0.8707142857142857, + "acc_by_bits": { + "0": 0.8707142857142857, + "4": 0.9028571428571428, + "2": 0.145 + } + } } - ], - "latency_proxy_lth": 48, - "latency_reduction_vs_lth_frac": 0.41666666666666663 + }, + "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", + "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", + "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" }, "config": { "method": "harmonic_matched", @@ -3173,455 +2024,278 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt06_uticket_prune/rewind_epoch_0", + "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/lam_init_0.5", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, "no_resume": true, "selftest": false, + "reset_mode": "srif", + "learn_reset": true, + "lam_init": 0.5, + "v_reset_init": 0.0, + "u_bits": 0, + "u_headroom": 2.0, + "reset_sweep": "hard,soft,trained", + "bits_sweep": "0,4,2", "baseline": false, "bench": true, "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "prune_rounds": 5, - "prune_rate": 0.5, - "rewind_epoch": 0, - "balance": true, - "balance_iters": 2, - "prune_readout": false, "sampling_rate": 250.0 } }, "zip": { - "name": "rewind_epoch_0.zip", + "name": "lam_init_0.5.zip", "files": 81, - "bytes": 8131993, - "MB": 8.1, - "sha256": "2759d4be6c9db943f9a4bdcb3c0501243b30044c7b1df1e065f9089899f000db" + "bytes": 12268812, + "MB": 12.3, + "sha256": "b35cda80713daa0bc18b2908550166cba40b17bbfa0eeffefce594f89c5a011f" } }, { - "key": "opt06_uticket_prune/rewind_epoch_5", - "tag": "rewind_epoch_5", - "script": "opt06_uticket_prune.py", - "hf_folder": "applied/opt06_uticket_prune", - "phase": 9, + "key": "opt09_srif_softreset/lam_init_0.99", + "tag": "lam_init_0.99", + "script": "opt09_srif_softreset.py", + "hf_folder": "applied/opt09_srif_softreset", + "phase": 5, "status": "ok", - "duration_s": 321.7, + "duration_s": 360.8, "optimization_summary": { - "optimization": "uticket_workload_balanced_pruning", - "research_section": "3. Spike sparsity & MAC->AC restructuring", - "reference": "u-Ticket: Workload-Balanced Pruning for Sparse SNNs, arXiv:2302.06746", - "script": "opt06_uticket_prune.py", + "optimization": "srif_softreset", + "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", + "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", + "script": "opt09_srif_softreset.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.77, - "test_target_acc": 0.77, - "best_val_acc": 0.9257142857142857 + "test_acc": 0.8371428571428572, + "test_target_acc": 0.8371428571428572, + "best_val_acc": 0.8692857142857143 }, "efficiency": { - "spikes_per_inference": null, - "syn_ops_per_inference": 216033.23041801946, + "spikes_per_inference": 9121.7265625, + "syn_ops_per_inference": 4526709.357954546, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.001761017959767088, - "syn_ops_per_inference_dense_fanout": 65245333.36607143, - "weight_sparsity": 0.983618530884808, - "effective_ticks": 13.376428571428571, + "event_fraction_of_dense": 0.03689995498645648, + "syn_ops_per_inference_dense_fanout": 66103327.14448052, + "weight_sparsity": 0.7324707846410685, + "effective_ticks": 14.662857142857144, "num_ticks": 100, "membrane_bytes_per_inference": 451200, "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 95.69244695001089, - "infer_ms_per_sample": 0.6242595653125704, - "peak_vram_mb": 2837.865472, - "weight_bytes_nonzero": 39755 + "train_ms_per_step": 104.05160694999722, + "infer_ms_per_sample": 0.6848713053125266, + "peak_vram_mb": 2829.587456, + "discarded_charge_per_reset": -0.3675518972181794 }, "optimization_specific": { - "pruning_enabled": true, - "balance_enabled": true, - "rounds": 5, - "final_sparsity": 0.9918981481481481, - "nnz_per_layer": { - "layer0": 640, - "layer1": 5120, - "layer2": 4096 + "reset_mode": "srif", + "learn_reset": true, + "lam_init": 0.99, + "v_reset_init": 0.0, + "u_bits": 0, + "u_scale": 1.0, + "u_headroom_requested": 2.0, + "u_headroom_actual": 0.0, + "u_threshold_level": 0, + "u_levels_above_threshold": null, + "reset_family": { + "reset_mode": "srif", + "learn_reset": true, + "num_spiking_sites": 4, + "extra_params": 8, + "extra_params_frac_of_weights": 6.5212854757929885e-06, + "extra_flops_per_tick_per_neuron": 0, + "learned_lam_per_layer": [ + 0.8137291669845581, + 0.8217479586601257, + 0.803193211555481, + 0.890302300453186 + ], + "learned_v_reset_per_layer": [ + 0.3964306116104126, + 0.4692990481853485, + 0.36490488052368164, + 0.8738293647766113 + ] }, - "pe_stats_per_layer": { - "layer0": { - "mean_nnz": 2.0, - "max_nnz": 2.0, - "min_nnz": 2.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 1.0 - }, - "layer1": { - "mean_nnz": 10.0, - "max_nnz": 10.0, - "min_nnz": 10.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 1.0 - }, - "layer2": { - "mean_nnz": 16.0, - "max_nnz": 16.0, - "min_nnz": 16.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 1.0 - } + "reset_stats": { + "reset_mode": "srif", + "learn_reset": true, + "discarded_charge_per_reset": -0.3675518972181794, + "spikes_per_inference": 9121.7265625, + "syn_per_inference": 4624103.46875, + "lam_per_site": [ + 0.8137291669845581, + 0.8217479586601257, + 0.803193211555481, + 0.890302300453186 + ], + "v_reset_per_site": [ + 0.3964306116104126, + 0.4692990481853485, + 0.36490488052368164, + 0.8738293647766113 + ], + "u_bits": 0, + "membrane_saturation_frac": null, + "batches": 4, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null }, - "pe_utilization_final": 1.0, - "pe_utilization_lth": 0.5739893211289092, - "pe_utilization_uticket": 1.0, - "latency_proxy_dense": 3712, - "latency_proxy_final": 28, - "latency_reduction_frac": 0.9924568965517241, - "rounds_history": [ - { - "round": 1, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 36.0, - "max_nnz": 46.0, - "min_nnz": 24.0, - "total_nnz": 11520, - "numel": 921600, - "sparsity": 0.9875, - "utilization": 0.782608695652174 - }, - "uticket": { - "mean_nnz": 36.0, - "max_nnz": 36.0, - "min_nnz": 36.0, - "total_nnz": 11520, - "numel": 921600, - "sparsity": 0.9875, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 160.0, - "max_nnz": 189.0, - "min_nnz": 126.0, - "total_nnz": 81920, - "numel": 163840, - "sparsity": 0.5, - "utilization": 0.8465608465608465 - }, - "uticket": { - "mean_nnz": 160.0, - "max_nnz": 160.0, - "min_nnz": 160.0, - "total_nnz": 81920, - "numel": 163840, - "sparsity": 0.5, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 256.0, - "max_nnz": 288.0, - "min_nnz": 214.0, - "total_nnz": 65536, - "numel": 131072, - "sparsity": 0.5, - "utilization": 0.8888888888888888 - }, - "uticket": { - "mean_nnz": 256.0, - "max_nnz": 256.0, - "min_nnz": 256.0, - "total_nnz": 65536, - "numel": 131072, - "sparsity": 0.5, - "utilization": 1.0 - } - } + "reset_x_bits_sweep": { + "rows": [ + { + "reset_mode": "hard", + "u_bits": 0, + "acc": 0.79, + "target_acc": 0.79, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.16616223328734864, + "spikes_per_inference": 6908.4453125, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 }, - "latency_proxy": 452, - "sparsity": 0.8693181818181819 - }, - { - "round": 2, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 18.0, - "max_nnz": 28.0, - "min_nnz": 10.0, - "total_nnz": 5760, - "numel": 921600, - "sparsity": 0.99375, - "utilization": 0.6428571428571429 - }, - "uticket": { - "mean_nnz": 18.0, - "max_nnz": 18.0, - "min_nnz": 18.0, - "total_nnz": 5760, - "numel": 921600, - "sparsity": 0.99375, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 80.0, - "max_nnz": 103.0, - "min_nnz": 31.0, - "total_nnz": 40960, - "numel": 163840, - "sparsity": 0.75, - "utilization": 0.7766990291262136 - }, - "uticket": { - "mean_nnz": 80.0, - "max_nnz": 80.0, - "min_nnz": 80.0, - "total_nnz": 40960, - "numel": 163840, - "sparsity": 0.75, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 128.0, - "max_nnz": 155.0, - "min_nnz": 99.0, - "total_nnz": 32768, - "numel": 131072, - "sparsity": 0.75, - "utilization": 0.8258064516129032 - }, - "uticket": { - "mean_nnz": 128.0, - "max_nnz": 128.0, - "min_nnz": 128.0, - "total_nnz": 32768, - "numel": 131072, - "sparsity": 0.75, - "utilization": 1.0 - } - } + { + "reset_mode": "hard", + "u_bits": 4, + "acc": 0.8585714285714285, + "target_acc": 0.8585714285714285, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.06637943740236554, + "spikes_per_inference": 7634.6875, + "membrane_saturation_frac": 0.16316371620124115, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.0685714285714285 }, - "latency_proxy": 226, - "sparsity": 0.9346590909090909 - }, - { - "round": 3, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 9.0, - "max_nnz": 17.0, - "min_nnz": 2.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 0.5294117647058824 - }, - "uticket": { - "mean_nnz": 9.0, - "max_nnz": 9.0, - "min_nnz": 9.0, - "total_nnz": 2880, - "numel": 921600, - "sparsity": 0.996875, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 40.0, - "max_nnz": 63.0, - "min_nnz": 0.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 0.6349206349206349 - }, - "uticket": { - "mean_nnz": 40.0, - "max_nnz": 40.0, - "min_nnz": 40.0, - "total_nnz": 20480, - "numel": 163840, - "sparsity": 0.875, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 64.0, - "max_nnz": 83.0, - "min_nnz": 44.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 0.7710843373493976 - }, - "uticket": { - "mean_nnz": 64.0, - "max_nnz": 64.0, - "min_nnz": 64.0, - "total_nnz": 16384, - "numel": 131072, - "sparsity": 0.875, - "utilization": 1.0 - } - } + { + "reset_mode": "hard", + "u_bits": 2, + "acc": 0.7228571428571429, + "target_acc": 0.7228571428571429, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 6319.0546875, + "membrane_saturation_frac": 0.1936854499113475, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.06714285714285717 }, - "latency_proxy": 113, - "sparsity": 0.9673295454545454 - }, - { - "round": 4, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 4.5, - "max_nnz": 9.0, - "min_nnz": 0.0, - "total_nnz": 1440, - "numel": 921600, - "sparsity": 0.9984375, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 4.0, - "max_nnz": 4.0, - "min_nnz": 4.0, - "total_nnz": 1280, - "numel": 921600, - "sparsity": 0.9986111111111111, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 20.0, - "max_nnz": 33.0, - "min_nnz": 0.0, - "total_nnz": 10240, - "numel": 163840, - "sparsity": 0.9375, - "utilization": 0.6060606060606061 - }, - "uticket": { - "mean_nnz": 20.0, - "max_nnz": 20.0, - "min_nnz": 20.0, - "total_nnz": 10240, - "numel": 163840, - "sparsity": 0.9375, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 32.0, - "max_nnz": 43.0, - "min_nnz": 19.0, - "total_nnz": 8192, - "numel": 131072, - "sparsity": 0.9375, - "utilization": 0.7441860465116279 - }, - "uticket": { - "mean_nnz": 32.0, - "max_nnz": 32.0, - "min_nnz": 32.0, - "total_nnz": 8192, - "numel": 131072, - "sparsity": 0.9375, - "utilization": 1.0 - } + { + "reset_mode": "soft", + "u_bits": 0, + "acc": 0.8414285714285714, + "target_acc": 0.8414285714285714, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 7679.484375, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "soft", + "u_bits": 4, + "acc": 0.8692857142857143, + "target_acc": 0.8692857142857143, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 8084.046875, + "membrane_saturation_frac": 0.18212551252216314, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.027857142857142914 + }, + { + "reset_mode": "soft", + "u_bits": 2, + "acc": 0.7228571428571429, + "target_acc": 0.7228571428571429, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 6319.0546875, + "membrane_saturation_frac": 0.1936854499113475, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.11857142857142855 + }, + { + "reset_mode": "trained", + "u_bits": 0, + "acc": 0.8371428571428572, + "target_acc": 0.8371428571428572, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": -0.3687197298662461, + "spikes_per_inference": 9087.9609375, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "trained", + "u_bits": 4, + "acc": 0.9014285714285715, + "target_acc": 0.9014285714285715, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": -0.4008518399443033, + "spikes_per_inference": 9850.1484375, + "membrane_saturation_frac": 0.32428080673758863, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.06428571428571428 + }, + { + "reset_mode": "trained", + "u_bits": 2, + "acc": 0.6264285714285714, + "target_acc": 0.6264285714285714, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": -0.4210314479921704, + "spikes_per_inference": 12215.1015625, + "membrane_saturation_frac": 0.3508273077349291, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.21071428571428574 + } + ], + "by_mode": { + "hard": { + "fp32_acc": 0.79, + "acc_by_bits": { + "0": 0.79, + "4": 0.8585714285714285, + "2": 0.7228571428571429 } }, - "latency_proxy": 56, - "sparsity": 0.9837962962962963 - }, - { - "round": 5, - "layers": { - "layer0": { - "lth": { - "mean_nnz": 2.0, - "max_nnz": 4.0, - "min_nnz": 0.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 0.5 - }, - "uticket": { - "mean_nnz": 2.0, - "max_nnz": 2.0, - "min_nnz": 2.0, - "total_nnz": 640, - "numel": 921600, - "sparsity": 0.9993055555555556, - "utilization": 1.0 - } - }, - "layer1": { - "lth": { - "mean_nnz": 10.0, - "max_nnz": 19.0, - "min_nnz": 0.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 0.5263157894736842 - }, - "uticket": { - "mean_nnz": 10.0, - "max_nnz": 10.0, - "min_nnz": 10.0, - "total_nnz": 5120, - "numel": 163840, - "sparsity": 0.96875, - "utilization": 1.0 - } - }, - "layer2": { - "lth": { - "mean_nnz": 16.0, - "max_nnz": 23.0, - "min_nnz": 7.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 0.6956521739130435 - }, - "uticket": { - "mean_nnz": 16.0, - "max_nnz": 16.0, - "min_nnz": 16.0, - "total_nnz": 4096, - "numel": 131072, - "sparsity": 0.96875, - "utilization": 1.0 - } + "soft": { + "fp32_acc": 0.8414285714285714, + "acc_by_bits": { + "0": 0.8414285714285714, + "4": 0.8692857142857143, + "2": 0.7228571428571429 } }, - "latency_proxy": 28, - "sparsity": 0.9918981481481481 + "trained": { + "fp32_acc": 0.8371428571428572, + "acc_by_bits": { + "0": 0.8371428571428572, + "4": 0.9014285714285715, + "2": 0.6264285714285714 + } + } } - ], - "latency_proxy_lth": 46, - "latency_reduction_vs_lth_frac": 0.3913043478260869 + }, + "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", + "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", + "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" }, "config": { "method": "harmonic_matched", @@ -3661,168 +2335,278 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt06_uticket_prune/rewind_epoch_5", + "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/lam_init_0.99", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, "no_resume": true, "selftest": false, + "reset_mode": "srif", + "learn_reset": true, + "lam_init": 0.99, + "v_reset_init": 0.0, + "u_bits": 0, + "u_headroom": 2.0, + "reset_sweep": "hard,soft,trained", + "bits_sweep": "0,4,2", "baseline": false, "bench": true, "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "prune_rounds": 5, - "prune_rate": 0.5, - "rewind_epoch": 5, - "balance": true, - "balance_iters": 2, - "prune_readout": false, "sampling_rate": 250.0 } }, "zip": { - "name": "rewind_epoch_5.zip", + "name": "lam_init_0.99.zip", "files": 81, - "bytes": 8032799, - "MB": 8.0, - "sha256": "1d7273c1361cb8ae29ebdbf7f2044317537adba581891a63ec662bd9b3b8d948" + "bytes": 12263834, + "MB": 12.3, + "sha256": "f20a40634372d3bda7cef0078c215a40efee8ac042ebc720492deb9c4543d6cc" } }, { - "key": "opt07_sfa_integer_train/hard_reset_D1", - "tag": "hard_reset_D1", - "script": "opt07_sfa_integer_train.py", - "hf_folder": "applied/opt07_sfa_integer_train", - "phase": 9, + "key": "opt09_srif_softreset/reset_hard", + "tag": "reset_hard", + "script": "opt09_srif_softreset.py", + "hf_folder": "applied/opt09_srif_softreset", + "phase": 5, "status": "ok", - "duration_s": 333.6, + "duration_s": 349.5, "optimization_summary": { - "optimization": "sfa_integer_train", - "research_section": "3. Training-Time Approximation for Fewer Timesteps (SFA) / spike-storm suppression", - "reference": "Yao et al., Scaling Spike-driven Transformer with Efficient Spike Firing Approximation Training, arXiv:2411.16061", - "script": "opt07_sfa_integer_train.py", + "optimization": "srif_softreset", + "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", + "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", + "script": "opt09_srif_softreset.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.9457142857142857, - "test_target_acc": 0.9457142857142857, - "best_val_acc": 0.9464285714285714 + "test_acc": 0.9407142857142857, + "test_target_acc": 0.9407142857142857, + "best_val_acc": 0.9471428571428572 }, "efficiency": { - "spikes_per_inference": null, - "syn_ops_per_inference": 3248166.6850649347, + "spikes_per_inference": 7627.40234375, + "syn_ops_per_inference": 3272123.518668831, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.02647777778283577, - "syn_ops_per_inference_dense_fanout": 64824784.47159091, + "event_fraction_of_dense": 0.026673064471619618, + "syn_ops_per_inference_dense_fanout": 64848741.3051948, "weight_sparsity": 0.7324707846410685, - "effective_ticks": 12.107142857142858, + "effective_ticks": 12.062857142857142, "num_ticks": 100, "membrane_bytes_per_inference": 451200, "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 93.90855915000884, - "infer_ms_per_sample": 0.6246371478124502, - "peak_vram_mb": 2828.755968 + "train_ms_per_step": 100.3461672999947, + "infer_ms_per_sample": 0.6541350159373849, + "peak_vram_mb": 2828.251648, + "discarded_charge_per_reset": 0.2713630626355262 }, "optimization_specific": { - "sfa_levels_D": 1, - "soft_reset": false, - "storm_reg": 0.001, - "trained_T": 100, - "infer_mode": "graded", - "min_ticks_within_1pct_of_full": 100, - "speedup_at_min_ticks": 1.0, - "full_T_acc": 0.9457142857142857, - "t_sweep_rows": [ - { - "T": 4, - "acc": 0.28214285714285714, - "syn_per_inference": 1865061.2053571427, - "dense_per_inference": 4907008.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 25.0 - }, - { - "T": 8, - "acc": 0.5857142857142857, - "syn_per_inference": 2043636.288961039, - "dense_per_inference": 9814016.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 12.5 - }, - { - "T": 16, - "acc": 0.8035714285714286, - "syn_per_inference": 2325766.0089285714, - "dense_per_inference": 19628032.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 6.25 - }, - { - "T": 25, - "acc": 0.8757142857142857, - "syn_per_inference": 2540783.9699675324, - "dense_per_inference": 30668800.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 4.0 - }, - { - "T": 50, - "acc": 0.93, - "syn_per_inference": 2887393.0584415584, - "dense_per_inference": 61337600.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 2.0 - }, - { - "T": 100, - "acc": 0.9457142857142857, - "syn_per_inference": 3248166.713474026, - "dense_per_inference": 122675200.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 1.0 - } - ], - "storm_ratio_peak_over_mean": 4.402592156354595, - "tick_activity_cv": 0.7492657914512895, - "mean_integer_activation": 0.07816793096872668, - "frac_activations_gt1": 0.0, - "max_activation": 1.0, - "per_layer_activity": [ - { - "layer": 0, - "mean_integer_activation": 0.064309815550223, - "peak_tick_activation": 0.28312988951802254, - "storm_ratio": 4.402592156354595, - "tick_activity_cv": 0.7492657914512895, - "frac_activations_gt1": 0.0, - "max_activation": 1.0 - }, - { - "layer": 1, - "mean_integer_activation": 0.036434059143066404, - "peak_tick_activation": 0.07265853881835938, - "storm_ratio": 1.9942477046833988, - "tick_activity_cv": 0.22539867053210047, - "frac_activations_gt1": 0.0, - "max_activation": 1.0 - }, - { - "layer": 2, - "mean_integer_activation": 0.13375991821289063, - "peak_tick_activation": 0.158294677734375, - "storm_ratio": 1.183423852595627, - "tick_activity_cv": 0.12266443917391988, - "frac_activations_gt1": 0.0, - "max_activation": 1.0 + "reset_mode": "hard", + "learn_reset": false, + "lam_init": 0.9, + "v_reset_init": 0.0, + "u_bits": 0, + "u_scale": 1.0, + "u_headroom_requested": 2.0, + "u_headroom_actual": 0.0, + "u_threshold_level": 0, + "u_levels_above_threshold": null, + "reset_family": { + "reset_mode": "hard", + "learn_reset": false, + "num_spiking_sites": 4, + "extra_params": 0, + "extra_params_frac_of_weights": 0.0, + "extra_flops_per_tick_per_neuron": 0, + "learned_lam_per_layer": [ + 0.0, + 0.0, + 0.0, + 0.0 + ], + "learned_v_reset_per_layer": [ + 0.0, + 0.0, + 0.0, + 0.0 + ] + }, + "reset_stats": { + "reset_mode": "hard", + "learn_reset": false, + "discarded_charge_per_reset": 0.2713630626355262, + "spikes_per_inference": 7627.40234375, + "syn_per_inference": 3337387.15625, + "lam_per_site": [ + 0.0, + 0.0, + 0.0, + 0.0 + ], + "v_reset_per_site": [ + 0.0, + 0.0, + 0.0, + 0.0 + ], + "u_bits": 0, + "membrane_saturation_frac": null, + "batches": 4, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null + }, + "reset_x_bits_sweep": { + "rows": [ + { + "reset_mode": "hard", + "u_bits": 0, + "acc": 0.9407142857142857, + "target_acc": 0.9407142857142857, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.2736259544984989, + "spikes_per_inference": 7585.875, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "hard", + "u_bits": 4, + "acc": 0.9585714285714285, + "target_acc": 0.9585714285714285, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.16008536543109247, + "spikes_per_inference": 9070.0546875, + "membrane_saturation_frac": 0.29968112810283687, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.017857142857142794 + }, + { + "reset_mode": "hard", + "u_bits": 2, + "acc": 0.895, + "target_acc": 0.895, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 9282.828125, + "membrane_saturation_frac": 0.524759530141844, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.04571428571428571 + }, + { + "reset_mode": "soft", + "u_bits": 0, + "acc": 0.8385714285714285, + "target_acc": 0.8385714285714285, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 10120.0625, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "soft", + "u_bits": 4, + "acc": 0.9571428571428572, + "target_acc": 0.9571428571428572, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 10759.703125, + "membrane_saturation_frac": 0.33632909463652483, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.11857142857142866 + }, + { + "reset_mode": "soft", + "u_bits": 2, + "acc": 0.895, + "target_acc": 0.895, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 9282.828125, + "membrane_saturation_frac": 0.524759530141844, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": -0.056428571428571495 + }, + { + "reset_mode": "trained", + "u_bits": 0, + "acc": 0.9407142857142857, + "target_acc": 0.9407142857142857, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.2736259550797889, + "spikes_per_inference": 7585.875, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "trained", + "u_bits": 4, + "acc": 0.9585714285714285, + "target_acc": 0.9585714285714285, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.16008443018764404, + "spikes_per_inference": 9070.0703125, + "membrane_saturation_frac": 0.29968078180407803, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.017857142857142794 + }, + { + "reset_mode": "trained", + "u_bits": 2, + "acc": 0.895, + "target_acc": 0.895, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 9282.828125, + "membrane_saturation_frac": 0.524759530141844, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.04571428571428571 + } + ], + "by_mode": { + "hard": { + "fp32_acc": 0.9407142857142857, + "acc_by_bits": { + "0": 0.9407142857142857, + "4": 0.9585714285714285, + "2": 0.895 + } + }, + "soft": { + "fp32_acc": 0.8385714285714285, + "acc_by_bits": { + "0": 0.8385714285714285, + "4": 0.9571428571428572, + "2": 0.895 + } + }, + "trained": { + "fp32_acc": 0.9407142857142857, + "acc_by_bits": { + "0": 0.9407142857142857, + "4": 0.9585714285714285, + "2": 0.895 + } + } } - ], - "expanded_vs_graded_agreement": null, - "expanded_acc": null, - "graded_acc": null, - "syn_ratio_expanded_over_graded": null, - "expansion_caveat": "exact only at beta=1 (IAF); with beta<1 the expanded mode applies decay per sub-tick and drifts" + }, + "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", + "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", + "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" }, "config": { "method": "harmonic_matched", @@ -3862,167 +2646,278 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt07_sfa_integer_train/hard_reset_D1", + "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/reset_hard", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, "no_resume": true, "selftest": false, + "reset_mode": "hard", + "learn_reset": true, + "lam_init": 0.9, + "v_reset_init": 0.0, + "u_bits": 0, + "u_headroom": 2.0, + "reset_sweep": "hard,soft,trained", + "bits_sweep": "0,4,2", "baseline": false, "bench": true, "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "sfa_levels": 4, - "soft_reset": false, - "storm_reg": 0.001, - "infer_mode": "graded", - "t_sweep": "4,8,16,25,50,100", "sampling_rate": 250.0 } }, "zip": { - "name": "hard_reset_D1.zip", + "name": "reset_hard.zip", "files": 81, - "bytes": 12247474, - "MB": 12.2, - "sha256": "14ec9f04c11682c9afbfa8aa48edc10a0d1b46c0b71aa2f5fc9f393b5519c9ad" + "bytes": 12252182, + "MB": 12.3, + "sha256": "a69135a81c5f43ecd4495a977c9705cda35004b34ed7b0310f97c97a13239a9c" } }, { - "key": "opt07_sfa_integer_train/infer_expanded", - "tag": "infer_expanded", - "script": "opt07_sfa_integer_train.py", - "hf_folder": "applied/opt07_sfa_integer_train", - "phase": 9, + "key": "opt09_srif_softreset/reset_soft", + "tag": "reset_soft", + "script": "opt09_srif_softreset.py", + "hf_folder": "applied/opt09_srif_softreset", + "phase": 5, "status": "ok", - "duration_s": 361.5, + "duration_s": 359.0, "optimization_summary": { - "optimization": "sfa_integer_train", - "research_section": "3. Training-Time Approximation for Fewer Timesteps (SFA) / spike-storm suppression", - "reference": "Yao et al., Scaling Spike-driven Transformer with Efficient Spike Firing Approximation Training, arXiv:2411.16061", - "script": "opt07_sfa_integer_train.py", + "optimization": "srif_softreset", + "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", + "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", + "script": "opt09_srif_softreset.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.9264285714285714, - "test_target_acc": 0.9264285714285714, - "best_val_acc": 0.93 + "test_acc": 0.9, + "test_target_acc": 0.9, + "best_val_acc": 0.9007142857142857 }, "efficiency": { - "spikes_per_inference": null, - "syn_ops_per_inference": 5329171.874188311, + "spikes_per_inference": 7061.50390625, + "syn_ops_per_inference": 3783191.9512987016, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.043441313926435916, - "syn_ops_per_inference_dense_fanout": 66905789.66071429, + "event_fraction_of_dense": 0.030839093405176446, + "syn_ops_per_inference_dense_fanout": 65359809.73782468, "weight_sparsity": 0.7324707846410685, - "effective_ticks": 4.7178571428571425, + "effective_ticks": 12.35, "num_ticks": 100, "membrane_bytes_per_inference": 451200, "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 98.45181450000382, - "infer_ms_per_sample": 0.660058239062522, - "peak_vram_mb": 2832.446464 + "train_ms_per_step": 101.67684595003266, + "infer_ms_per_sample": 0.6660571796874137, + "peak_vram_mb": 2828.717056, + "discarded_charge_per_reset": 0.0 }, "optimization_specific": { - "sfa_levels_D": 4, - "soft_reset": true, - "storm_reg": 0.001, - "trained_T": 100, - "infer_mode": "expanded", - "min_ticks_within_1pct_of_full": 100, - "speedup_at_min_ticks": 1.0, - "full_T_acc": 0.9264285714285714, - "t_sweep_rows": [ - { - "T": 4, - "acc": 0.16, - "syn_per_inference": 2778669.6290584416, - "dense_per_inference": 4907008.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 25.0 - }, - { - "T": 8, - "acc": 0.2892857142857143, - "syn_per_inference": 3495133.1233766233, - "dense_per_inference": 9814016.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 12.5 - }, - { - "T": 16, - "acc": 0.5628571428571428, - "syn_per_inference": 4105260.607142857, - "dense_per_inference": 19628032.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 6.25 - }, - { - "T": 25, - "acc": 0.765, - "syn_per_inference": 4387251.887987013, - "dense_per_inference": 30668800.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 4.0 - }, - { - "T": 50, - "acc": 0.8835714285714286, - "syn_per_inference": 4760043.469155844, - "dense_per_inference": 61337600.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 2.0 - }, - { - "T": 100, - "acc": 0.9264285714285714, - "syn_per_inference": 5327084.303571429, - "dense_per_inference": 122675200.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 1.0 - } - ], - "storm_ratio_peak_over_mean": 3.6731897953532338, - "tick_activity_cv": 0.5687552774544564, - "mean_integer_activation": 0.10272448336705566, - "frac_activations_gt1": 0.021054688608273864, - "max_activation": 4.0, - "per_layer_activity": [ - { - "layer": 0, - "mean_integer_activation": 0.18541565285995604, - "peak_tick_activation": 0.640545666217804, - "storm_ratio": 3.454647201234981, - "tick_activity_cv": 0.5687552774544564, - "frac_activations_gt1": 0.021054688608273864, - "max_activation": 4.0 - }, - { - "layer": 1, - "mean_integer_activation": 0.04947120666503906, - "peak_tick_activation": 0.12639999389648438, - "storm_ratio": 2.555021444136521, - "tick_activity_cv": 0.3229986629594537, - "frac_activations_gt1": 0.00117851253162371, - "max_activation": 4.0 - }, - { - "layer": 2, - "mean_integer_activation": 0.07328659057617187, - "peak_tick_activation": 0.269195556640625, - "storm_ratio": 3.6731897953532338, - "tick_activity_cv": 0.5266420152224381, - "frac_activations_gt1": 0.0013648986277985387, - "max_activation": 4.0 + "reset_mode": "soft", + "learn_reset": false, + "lam_init": 0.9, + "v_reset_init": 0.0, + "u_bits": 0, + "u_scale": 1.0, + "u_headroom_requested": 2.0, + "u_headroom_actual": 0.0, + "u_threshold_level": 0, + "u_levels_above_threshold": null, + "reset_family": { + "reset_mode": "soft", + "learn_reset": false, + "num_spiking_sites": 4, + "extra_params": 0, + "extra_params_frac_of_weights": 0.0, + "extra_flops_per_tick_per_neuron": 0, + "learned_lam_per_layer": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "learned_v_reset_per_layer": [ + 0.0, + 0.0, + 0.0, + 0.0 + ] + }, + "reset_stats": { + "reset_mode": "soft", + "learn_reset": false, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 7061.50390625, + "syn_per_inference": 3876494.84375, + "lam_per_site": [ + 1.0, + 1.0, + 1.0, + 1.0 + ], + "v_reset_per_site": [ + 0.0, + 0.0, + 0.0, + 0.0 + ], + "u_bits": 0, + "membrane_saturation_frac": null, + "batches": 4, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null + }, + "reset_x_bits_sweep": { + "rows": [ + { + "reset_mode": "hard", + "u_bits": 0, + "acc": 0.9128571428571428, + "target_acc": 0.9128571428571428, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.21926213387947063, + "spikes_per_inference": 5913.0546875, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "hard", + "u_bits": 4, + "acc": 0.9207142857142857, + "target_acc": 0.9207142857142857, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.10935388205594965, + "spikes_per_inference": 6869.609375, + "membrane_saturation_frac": 0.26135215813386525, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.007857142857142896 + }, + { + "reset_mode": "hard", + "u_bits": 2, + "acc": 0.8114285714285714, + "target_acc": 0.8114285714285714, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 6691.359375, + "membrane_saturation_frac": 0.3808665087544326, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.10142857142857142 + }, + { + "reset_mode": "soft", + "u_bits": 0, + "acc": 0.9, + "target_acc": 0.9, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 7075.0078125, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "soft", + "u_bits": 4, + "acc": 0.9221428571428572, + "target_acc": 0.9221428571428572, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 7529.5234375, + "membrane_saturation_frac": 0.2994438441932624, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.02214285714285713 + }, + { + "reset_mode": "soft", + "u_bits": 2, + "acc": 0.8114285714285714, + "target_acc": 0.8114285714285714, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 6691.359375, + "membrane_saturation_frac": 0.3808665087544326, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.08857142857142863 + }, + { + "reset_mode": "trained", + "u_bits": 0, + "acc": 0.9, + "target_acc": 0.9, + "grid_headroom": 0.0, + "grid_levels_above_thresh": null, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 7075.0078125, + "membrane_saturation_frac": null, + "membrane_memory_reduction_x": 1.0, + "acc_drop_vs_fp32": 0.0 + }, + { + "reset_mode": "trained", + "u_bits": 4, + "acc": 0.9221428571428572, + "target_acc": 0.9221428571428572, + "grid_headroom": 1.75, + "grid_levels_above_thresh": 3, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 7529.5, + "membrane_saturation_frac": 0.2994437056737589, + "membrane_memory_reduction_x": 8.0, + "acc_drop_vs_fp32": -0.02214285714285713 + }, + { + "reset_mode": "trained", + "u_bits": 2, + "acc": 0.8114285714285714, + "target_acc": 0.8114285714285714, + "grid_headroom": 1.0, + "grid_levels_above_thresh": 0, + "discarded_charge_per_reset": 0.0, + "spikes_per_inference": 6691.3515625, + "membrane_saturation_frac": 0.38086643949468085, + "membrane_memory_reduction_x": 16.0, + "acc_drop_vs_fp32": 0.08857142857142863 + } + ], + "by_mode": { + "hard": { + "fp32_acc": 0.9128571428571428, + "acc_by_bits": { + "0": 0.9128571428571428, + "4": 0.9207142857142857, + "2": 0.8114285714285714 + } + }, + "soft": { + "fp32_acc": 0.9, + "acc_by_bits": { + "0": 0.9, + "4": 0.9221428571428572, + "2": 0.8114285714285714 + } + }, + "trained": { + "fp32_acc": 0.9, + "acc_by_bits": { + "0": 0.9, + "4": 0.9221428571428572, + "2": 0.8114285714285714 + } + } } - ], - "expanded_vs_graded_agreement": 1.0, - "expanded_acc": 0.9140625, - "graded_acc": 0.9140625, - "syn_ratio_expanded_over_graded": 1.0003622535345824, - "expansion_caveat": "exact only at beta=1 (IAF); with beta<1 the expanded mode applies decay per sub-tick and drifts" + }, + "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", + "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", + "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" }, "config": { "method": "harmonic_matched", @@ -4062,167 +2957,179 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt07_sfa_integer_train/infer_expanded", + "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/reset_soft", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, "no_resume": true, "selftest": false, + "reset_mode": "soft", + "learn_reset": true, + "lam_init": 0.9, + "v_reset_init": 0.0, + "u_bits": 0, + "u_headroom": 2.0, + "reset_sweep": "hard,soft,trained", + "bits_sweep": "0,4,2", "baseline": false, "bench": true, "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "sfa_levels": 4, - "soft_reset": true, - "storm_reg": 0.001, - "infer_mode": "expanded", - "t_sweep": "4,8,16,25,50,100", "sampling_rate": 250.0 } }, "zip": { - "name": "infer_expanded.zip", + "name": "reset_soft.zip", "files": 81, - "bytes": 12257806, + "bytes": 12259539, "MB": 12.3, - "sha256": "ce5e194365b062cb3866b982931e820ee73fb98483e8b12a4970e99e56ca8bcf" + "sha256": "83b8c6f6d711b8e67f69bfa9f1aca2667dcb2e86b5da015289b78990df349886" } }, { - "key": "opt07_sfa_integer_train/storm_reg_1e-2", - "tag": "storm_reg_1e-2", - "script": "opt07_sfa_integer_train.py", - "hf_folder": "applied/opt07_sfa_integer_train", - "phase": 9, + "key": "opt10_parallel_lif_scan/lif_psn", + "tag": "lif_psn", + "script": "opt10_parallel_lif_scan.py", + "hf_folder": "applied/opt10_parallel_lif_scan", + "phase": 5, "status": "ok", - "duration_s": 352.7, + "duration_s": 375.8, "optimization_summary": { - "optimization": "sfa_integer_train", - "research_section": "3. Training-Time Approximation for Fewer Timesteps (SFA) / spike-storm suppression", - "reference": "Yao et al., Scaling Spike-driven Transformer with Efficient Spike Firing Approximation Training, arXiv:2411.16061", - "script": "opt07_sfa_integer_train.py", + "optimization": "parallel_lif_scan", + "research_section": "4. Membrane-Potential Memory Wall (reset-mechanism removal) / 6. Feasibility & Limitations", + "reference": "Fang et al., Parallel Spiking Neurons, NeurIPS 2023, arXiv:2304.12760; Hillis-Steele parallel prefix scan", + "script": "opt10_parallel_lif_scan.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.9271428571428572, - "test_target_acc": 0.9271428571428572, - "best_val_acc": 0.9257142857142857 + "test_acc": 0.6728571428571428, + "test_target_acc": 0.6728571428571428, + "best_val_acc": 0.6742857142857143 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 5481484.731331169, + "syn_ops_per_inference": 5364184.111201298, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.04468290845526372, - "syn_ops_per_inference_dense_fanout": 67058102.51785714, + "event_fraction_of_dense": 0.04372671991732068, + "syn_ops_per_inference_dense_fanout": 66940801.89772727, "weight_sparsity": 0.7324707846410685, - "effective_ticks": 3.505714285714286, + "effective_ticks": 66.995, "num_ticks": 100, "membrane_bytes_per_inference": 451200, "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 98.8862052499826, - "infer_ms_per_sample": 0.6657202099999893, - "peak_vram_mb": 2833.100288 + "train_ms_per_step": 111.53997934998188, + "infer_ms_per_sample": 0.6946524631251805, + "peak_vram_mb": 2848.864256 }, "optimization_specific": { - "sfa_levels_D": 4, - "soft_reset": true, - "storm_reg": 0.01, - "trained_T": 100, - "infer_mode": "graded", - "min_ticks_within_1pct_of_full": 100, - "speedup_at_min_ticks": 1.0, - "full_T_acc": 0.9271428571428572, - "t_sweep_rows": [ - { - "T": 4, - "acc": 0.21571428571428572, - "syn_per_inference": 2678610.4642857146, - "dense_per_inference": 4907008.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 25.0 - }, - { - "T": 8, - "acc": 0.3557142857142857, - "syn_per_inference": 3344226.649350649, - "dense_per_inference": 9814016.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 12.5 - }, - { - "T": 16, - "acc": 0.6378571428571429, - "syn_per_inference": 3941638.6444805195, - "dense_per_inference": 19628032.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 6.25 - }, + "lif_mode": "psn", + "scan_reset_correction": null, + "psn_init_beta": 0.95, + "training_T": 100, + "sequential_depth": 1, + "sequential_depth_baseline": 100, + "depth_reduction_x": 100.0, + "speedup_vs_sequential_at_T": 0.8282461522014676, + "speedup_vs_sequential_at_T_fwdbwd": 0.46832826669673444, + "scan_crossover_T": null, + "scan_ever_wins": false, + "t_scaling": [ { "T": 25, - "acc": 0.7914285714285715, - "syn_per_inference": 4239864.0032467535, - "dense_per_inference": 30668800.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 4.0 + "sequential_ms": 0.047486660005233716, + "scan_ms": 0.35886933999790926, + "psn_ms": 0.1867125799981295, + "sequential_fwdbwd_ms": 0.44958435999433277, + "scan_fwdbwd_ms": 0.8667966000029992, + "psn_fwdbwd_ms": 0.9562194599857321, + "scan_speedup_x": 0.13232297862366946, + "scan_speedup_fwdbwd_x": 0.5186734234914825, + "psn_speedup_x": 0.2543302652971184, + "psn_speedup_fwdbwd_x": 0.4701685949803208, + "depth_sequential": 25, + "depth_scan": 5, + "depth_psn": 1 }, { "T": 50, - "acc": 0.8857142857142857, - "syn_per_inference": 4694799.851461039, - "dense_per_inference": 61337600.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 2.0 + "sequential_ms": 0.10497237999516074, + "scan_ms": 0.5832207599996764, + "psn_ms": 0.18213854000350693, + "sequential_fwdbwd_ms": 0.46797631999652367, + "scan_fwdbwd_ms": 1.0461150199989788, + "psn_fwdbwd_ms": 0.9000249800010351, + "scan_speedup_x": 0.17998738590035612, + "scan_speedup_fwdbwd_x": 0.4473469083705351, + "psn_speedup_x": 0.5763326091948446, + "psn_speedup_fwdbwd_x": 0.5199592571263805, + "depth_sequential": 50, + "depth_scan": 6, + "depth_psn": 1 }, { "T": 100, - "acc": 0.9271428571428572, - "syn_per_inference": 5481484.731331169, - "dense_per_inference": 122675200.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 1.0 - } - ], - "storm_ratio_peak_over_mean": 3.003345709243902, - "tick_activity_cv": 0.46190065268000957, - "mean_integer_activation": 0.10574525063236555, - "frac_activations_gt1": 0.020694764563813806, - "max_activation": 4.0, - "per_layer_activity": [ - { - "layer": 0, - "mean_integer_activation": 0.19540179803967475, - "peak_tick_activation": 0.5868591517210007, - "storm_ratio": 3.003345709243902, - "tick_activity_cv": 0.46190065268000957, - "frac_activations_gt1": 0.020694764563813806, - "max_activation": 4.0 + "sequential_ms": 0.21007429999372107, + "scan_ms": 1.4438162800070131, + "psn_ms": 0.2536375199997565, + "sequential_fwdbwd_ms": 0.469644699987839, + "scan_fwdbwd_ms": 2.3666256199976488, + "psn_fwdbwd_ms": 1.0028109199993196, + "scan_speedup_x": 0.14549932903700233, + "scan_speedup_fwdbwd_x": 0.19844486429091626, + "psn_speedup_x": 0.8282461522014676, + "psn_speedup_fwdbwd_x": 0.46832826669673444, + "depth_sequential": 100, + "depth_scan": 7, + "depth_psn": 1 }, { - "layer": 1, - "mean_integer_activation": 0.04897125244140625, - "peak_tick_activation": 0.11265945434570312, - "storm_ratio": 2.3005222192448387, - "tick_activity_cv": 0.26290936311848917, - "frac_activations_gt1": 0.0010063552690553479, - "max_activation": 4.0 + "T": 200, + "sequential_ms": 0.4098386199984816, + "scan_ms": 3.1044099400060077, + "psn_ms": 0.7010216799972113, + "sequential_fwdbwd_ms": 0.9069426599853614, + "scan_fwdbwd_ms": 4.853608979992714, + "psn_fwdbwd_ms": 2.7156057200045325, + "scan_speedup_x": 0.13201820246642054, + "scan_speedup_fwdbwd_x": 0.18685944082514921, + "psn_speedup_x": 0.5846304496604326, + "psn_speedup_fwdbwd_x": 0.33397435176408735, + "depth_sequential": 200, + "depth_scan": 8, + "depth_psn": 1 }, { - "layer": 2, - "mean_integer_activation": 0.07286270141601563, - "peak_tick_activation": 0.21881866455078125, - "storm_ratio": 3.0031643117569575, - "tick_activity_cv": 0.36416396678259205, - "frac_activations_gt1": 0.0011422729294281453, - "max_activation": 4.0 + "T": 400, + "sequential_ms": 0.834148579997418, + "scan_ms": 6.508244939996075, + "psn_ms": 2.357299859995692, + "sequential_fwdbwd_ms": 1.808994260009058, + "scan_fwdbwd_ms": 10.193051079986617, + "psn_fwdbwd_ms": 8.919711580001604, + "scan_speedup_x": 0.1281679758042298, + "scan_speedup_fwdbwd_x": 0.17747328506583263, + "psn_speedup_x": 0.35385764626437577, + "psn_speedup_fwdbwd_x": 0.2028086047159759, + "depth_sequential": 400, + "depth_scan": 9, + "depth_psn": 1 } ], - "expanded_vs_graded_agreement": 0.9921875, - "expanded_acc": 0.90625, - "graded_acc": 0.90625, - "syn_ratio_expanded_over_graded": 1.0003618800383918, - "expansion_caveat": "exact only at beta=1 (IAF); with beta<1 the expanded mode applies decay per sub-tick and drifts" + "accuracy_cost_of_reset_removal": { + "firing_rate_hard_reset": 0.026105469092726707, + "firing_rate_reset_free": 0.36106836795806885, + "firing_rate_reset_corrected": 0.00894628930836916, + "spike_agreement_reset_free": 0.6650371551513672, + "spike_agreement_reset_corrected": 0.9814648628234863, + "spike_storm_ratio_reset_free": 13.831138857361761 + }, + "psn_extra_params": 40000, + "deploy_neuron_is_hard_reset": true, + "train_deploy_neuron_mismatch": true, + "event_driven_acc_under_hard_reset": 0.6071428571428571, + "dense_forward_acc_under_train_neuron": 0.6728571428571428 }, "config": { "method": "harmonic_matched", @@ -4262,7 +3169,7 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt07_sfa_integer_train/storm_reg_1e-2", + "hub_dir": "/kaggle/working/hub/opt10_parallel_lif_scan/lif_psn", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, @@ -4273,180 +3180,164 @@ "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "sfa_levels": 4, - "soft_reset": true, - "storm_reg": 0.01, - "infer_mode": "graded", - "t_sweep": "4,8,16,25,50,100", + "lif_mode": "psn", + "scan_reset_correction": true, + "psn_init_beta": 0.95, + "t_scaling": "25,50,100,200,400", "sampling_rate": 250.0 } }, "zip": { - "name": "storm_reg_1e-2.zip", + "name": "lif_psn.zip", "files": 81, - "bytes": 12255265, - "MB": 12.3, - "sha256": "c2a25d9ee33de9bba942a4027d5d7df8d62fa45eb05f8d3d39e831de2f724632" + "bytes": 12871074, + "MB": 12.9, + "sha256": "2d568b45116713734022c53bff7f45c018bb357f65db82eec12b1b2debb2ace3" } }, { - "key": "opt07_sfa_integer_train/t_sweep_ultra_low", - "tag": "t_sweep_ultra_low", - "script": "opt07_sfa_integer_train.py", - "hf_folder": "applied/opt07_sfa_integer_train", - "phase": 9, + "key": "opt10_parallel_lif_scan/no_reset_correction", + "tag": "no_reset_correction", + "script": "opt10_parallel_lif_scan.py", + "hf_folder": "applied/opt10_parallel_lif_scan", + "phase": 5, "status": "ok", - "duration_s": 351.0, + "duration_s": 458.2, "optimization_summary": { - "optimization": "sfa_integer_train", - "research_section": "3. Training-Time Approximation for Fewer Timesteps (SFA) / spike-storm suppression", - "reference": "Yao et al., Scaling Spike-driven Transformer with Efficient Spike Firing Approximation Training, arXiv:2411.16061", - "script": "opt07_sfa_integer_train.py", + "optimization": "parallel_lif_scan", + "research_section": "4. Membrane-Potential Memory Wall (reset-mechanism removal) / 6. Feasibility & Limitations", + "reference": "Fang et al., Parallel Spiking Neurons, NeurIPS 2023, arXiv:2304.12760; Hillis-Steele parallel prefix scan", + "script": "opt10_parallel_lif_scan.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.925, - "test_target_acc": 0.925, - "best_val_acc": 0.9285714285714286 + "test_acc": 0.04857142857142857, + "test_target_acc": 0.04857142857142857, + "best_val_acc": 0.05785714285714286 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 5325856.609577922, + "syn_ops_per_inference": 3529375.9862012984, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.04341428919274574, - "syn_ops_per_inference_dense_fanout": 66902474.39610389, + "event_fraction_of_dense": 0.028770085446783854, + "syn_ops_per_inference_dense_fanout": 65105993.77272727, "weight_sparsity": 0.7324707846410685, - "effective_ticks": 3.922142857142857, + "effective_ticks": 60.33857142857143, "num_ticks": 100, "membrane_bytes_per_inference": 451200, "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 98.89879284999097, - "infer_ms_per_sample": 0.6661157987500133, - "peak_vram_mb": 2832.45568 + "train_ms_per_step": 133.88359884997953, + "infer_ms_per_sample": 0.9220662971873139, + "peak_vram_mb": 2842.995712 }, "optimization_specific": { - "sfa_levels_D": 4, - "soft_reset": true, - "storm_reg": 0.001, - "trained_T": 100, - "infer_mode": "graded", - "min_ticks_within_1pct_of_full": 100, - "speedup_at_min_ticks": 1.0, - "full_T_acc": 0.925, - "t_sweep_rows": [ - { - "T": 2, - "acc": 0.07642857142857143, - "syn_per_inference": 2239954.340909091, - "dense_per_inference": 2453504.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 50.0 - }, - { - "T": 3, - "acc": 0.1357142857142857, - "syn_per_inference": 2528104.3733766233, - "dense_per_inference": 3680256.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 33.333333333333336 - }, + "lif_mode": "scan", + "scan_reset_correction": false, + "psn_init_beta": null, + "training_T": 100, + "sequential_depth": 7, + "sequential_depth_baseline": 100, + "depth_reduction_x": 14.285714285714286, + "speedup_vs_sequential_at_T": 0.44273409052930973, + "speedup_vs_sequential_at_T_fwdbwd": 0.3133512102055894, + "scan_crossover_T": null, + "scan_ever_wins": false, + "t_scaling": [ { - "T": 4, - "acc": 0.1657142857142857, - "syn_per_inference": 2779257.885551948, - "dense_per_inference": 4907008.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 25.0 + "T": 25, + "sequential_ms": 0.04875462000200059, + "scan_ms": 0.1519915199969546, + "psn_ms": 0.20973310000044876, + "sequential_fwdbwd_ms": 0.4938448800021433, + "scan_fwdbwd_ms": 0.6737840400091955, + "psn_fwdbwd_ms": 0.870483080016129, + "scan_speedup_x": 0.32077197466659635, + "scan_speedup_fwdbwd_x": 0.7329423831342214, + "psn_speedup_x": 0.23246030312762397, + "psn_speedup_fwdbwd_x": 0.5673227789711811, + "depth_sequential": 25, + "depth_scan": 5, + "depth_psn": 1 }, { - "T": 6, - "acc": 0.23142857142857143, - "syn_per_inference": 3189504.724837662, - "dense_per_inference": 7360512.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 16.666666666666668 + "T": 50, + "sequential_ms": 0.10095507999722031, + "scan_ms": 0.18419874000755954, + "psn_ms": 0.17746965999322128, + "sequential_fwdbwd_ms": 0.4963683999994828, + "scan_fwdbwd_ms": 0.5889917600143235, + "psn_fwdbwd_ms": 0.8840760800012504, + "scan_speedup_x": 0.5480769303474992, + "scan_speedup_fwdbwd_x": 0.8427425198400259, + "psn_speedup_x": 0.5688582487906746, + "psn_speedup_fwdbwd_x": 0.5614543942855922, + "depth_sequential": 50, + "depth_scan": 6, + "depth_psn": 1 }, { - "T": 8, - "acc": 0.30642857142857144, - "syn_per_inference": 3490675.0357142854, - "dense_per_inference": 9814016.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 12.5 + "T": 100, + "sequential_ms": 0.20691507999799796, + "scan_ms": 0.4673574599837593, + "psn_ms": 0.2676070800043817, + "sequential_fwdbwd_ms": 0.4709668000032252, + "scan_fwdbwd_ms": 1.5029997800047568, + "psn_fwdbwd_ms": 1.0105730600116658, + "scan_speedup_x": 0.44273409052930973, + "scan_speedup_fwdbwd_x": 0.3133512102055894, + "psn_speedup_x": 0.7732048045762093, + "psn_speedup_fwdbwd_x": 0.4660393381135536, + "depth_sequential": 100, + "depth_scan": 7, + "depth_psn": 1 }, { - "T": 12, - "acc": 0.4342857142857143, - "syn_per_inference": 3871810.025162338, - "dense_per_inference": 14721024.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 8.333333333333334 + "T": 200, + "sequential_ms": 0.4051269800038426, + "scan_ms": 1.256868359996588, + "psn_ms": 0.7601375800004462, + "sequential_fwdbwd_ms": 0.9002240200061351, + "scan_fwdbwd_ms": 3.076623799988738, + "psn_fwdbwd_ms": 2.704943259996071, + "scan_speedup_x": 0.32233047859120456, + "scan_speedup_fwdbwd_x": 0.29260126636523787, + "psn_speedup_x": 0.5329653350431705, + "psn_speedup_fwdbwd_x": 0.33280698834601163, + "depth_sequential": 200, + "depth_scan": 8, + "depth_psn": 1 }, { - "T": 16, - "acc": 0.5678571428571428, - "syn_per_inference": 4094637.9375, - "dense_per_inference": 19628032.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 6.25 - }, - { - "T": 25, - "acc": 0.7721428571428571, - "syn_per_inference": 4374663.069805195, - "dense_per_inference": 30668800.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 4.0 - }, - { - "T": 100, - "acc": 0.925, - "syn_per_inference": 5325856.666396104, - "dense_per_inference": 122675200.0, - "infer_mode": "graded", - "ticks_speedup_vs_trained_T": 1.0 - } - ], - "storm_ratio_peak_over_mean": 3.6839613211418474, - "tick_activity_cv": 0.5593002627242345, - "mean_integer_activation": 0.10257062120983997, - "frac_activations_gt1": 0.020979859633371234, - "max_activation": 4.0, - "per_layer_activity": [ - { - "layer": 0, - "mean_integer_activation": 0.18541919242590665, - "peak_tick_activation": 0.6322021558880806, - "storm_ratio": 3.409583159201322, - "tick_activity_cv": 0.5593002627242345, - "frac_activations_gt1": 0.020979859633371234, - "max_activation": 4.0 - }, - { - "layer": 1, - "mean_integer_activation": 0.049783668518066405, - "peak_tick_activation": 0.12538528442382812, - "storm_ratio": 2.518602749781809, - "tick_activity_cv": 0.3183053742457197, - "frac_activations_gt1": 0.0011735152947949246, - "max_activation": 4.0 - }, - { - "layer": 2, - "mean_integer_activation": 0.07250900268554687, - "peak_tick_activation": 0.267120361328125, - "storm_ratio": 3.6839613211418474, - "tick_activity_cv": 0.5338615572684136, - "frac_activations_gt1": 0.0013800048400298692, - "max_activation": 4.0 + "T": 400, + "sequential_ms": 0.8259307399930549, + "scan_ms": 2.8340323000156786, + "psn_ms": 2.3835564000000886, + "sequential_fwdbwd_ms": 1.8020790400078113, + "scan_fwdbwd_ms": 6.508221060012147, + "psn_fwdbwd_ms": 8.992884800009051, + "scan_speedup_x": 0.29143307223015263, + "scan_speedup_fwdbwd_x": 0.27689272128142, + "psn_speedup_x": 0.34651193485206566, + "psn_speedup_fwdbwd_x": 0.20038942787368938, + "depth_sequential": 400, + "depth_scan": 9, + "depth_psn": 1 } ], - "expanded_vs_graded_agreement": 1.0, - "expanded_acc": 0.90234375, - "graded_acc": 0.90234375, - "syn_ratio_expanded_over_graded": 1.0003646028320816, - "expansion_caveat": "exact only at beta=1 (IAF); with beta<1 the expanded mode applies decay per sub-tick and drifts" + "accuracy_cost_of_reset_removal": { + "firing_rate_hard_reset": 0.026105469092726707, + "firing_rate_reset_free": 0.36106836795806885, + "firing_rate_reset_corrected": 0.00894628930836916, + "spike_agreement_reset_free": 0.6650371551513672, + "spike_agreement_reset_corrected": 0.9814648628234863, + "spike_storm_ratio_reset_free": 13.831138857361761 + }, + "psn_extra_params": 0, + "deploy_neuron_is_hard_reset": true, + "train_deploy_neuron_mismatch": true, + "event_driven_acc_under_hard_reset": 0.02642857142857143, + "dense_forward_acc_under_train_neuron": 0.04857142857142857 }, "config": { "method": "harmonic_matched", @@ -4486,7 +3377,7 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt07_sfa_integer_train/t_sweep_ultra_low", + "hub_dir": "/kaggle/working/hub/opt10_parallel_lif_scan/no_reset_correction", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, @@ -4497,168 +3388,208 @@ "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "sfa_levels": 4, - "soft_reset": true, - "storm_reg": 0.001, - "infer_mode": "graded", - "t_sweep": "2,3,4,6,8,12,16,25", + "lif_mode": "scan", + "scan_reset_correction": false, + "psn_init_beta": 0.95, + "t_scaling": "25,50,100,200,400", "sampling_rate": 250.0 } }, "zip": { - "name": "t_sweep_ultra_low.zip", + "name": "no_reset_correction.zip", "files": 81, - "bytes": 12258005, + "bytes": 12328296, "MB": 12.3, - "sha256": "9b40b0bf29d963e1cd4165e4b8d4e3a1993bf7be7ddbb241165fc0976c82fe13" + "sha256": "daf4a467ce360d3149cf7c82d0b17e315f67db18776d77938a4a85a0493839ec" } }, { - "key": "opt08_mint_quant/bits_sweep_fine", - "tag": "bits_sweep_fine", - "script": "opt08_mint_quant.py", - "hf_folder": "applied/opt08_mint_quant", - "phase": 9, + "key": "original/async_margin_4", + "tag": "async_margin_4", + "script": "train_ssvep_event_snn.py", + "hf_folder": "applied/original", + "phase": 5, + "status": "ok", + "duration_s": 326.9, + "optimization_summary": null, + "zip": { + "name": "async_margin_4.zip", + "files": 79, + "bytes": 12226993, + "MB": 12.2, + "sha256": "d111acebe5dbf4d2fc1ba7996062a9198d51e592aeb2baa5b3cec5bc3fca050a" + } + }, + { + "key": "original/beta_0.9_lif", + "tag": "beta_0.9_lif", + "script": "train_ssvep_event_snn.py", + "hf_folder": "applied/original", + "phase": 6, + "status": "ok", + "duration_s": 329.6, + "optimization_summary": null, + "zip": { + "name": "beta_0.9_lif.zip", + "files": 79, + "bytes": 12221236, + "MB": 12.2, + "sha256": "5eb22a502f8f87cbb1c44cad0f5a72a4b7c68eee2817c501479362b3d8eae0e3" + } + }, + { + "key": "original/export_int8", + "tag": "export_int8", + "script": "train_ssvep_event_snn.py", + "hf_folder": "applied/original", + "phase": 6, + "status": "ok", + "duration_s": 375.8, + "optimization_summary": null, + "zip": { + "name": "export_int8.zip", + "files": 82, + "bytes": 12500858, + "MB": 12.5, + "sha256": "1abedd0b9a8f2337bb33394789bcef71213b9480839083d338c988c5fa33a694" + } + }, + { + "key": "original/native_ticks", + "tag": "native_ticks", + "script": "train_ssvep_event_snn.py", + "hf_folder": "applied/original", + "phase": 6, + "status": "failed", + "duration_s": 13.4, + "optimization_summary": null, + "zip": { + "name": "FAILED_native_ticks.zip", + "files": 4, + "bytes": 45700, + "MB": 0.0, + "sha256": "009b1794f9626fdebb5935d2d68c531e7b1c6e6820e0bc8fd9dc59d824b3690b" + } + }, + { + "key": "original/no_augment", + "tag": "no_augment", + "script": "train_ssvep_event_snn.py", + "hf_folder": "applied/original", + "phase": 6, + "status": "ok", + "duration_s": 344.8, + "optimization_summary": null, + "zip": { + "name": "no_augment.zip", + "files": 79, + "bytes": 12231036, + "MB": 12.2, + "sha256": "ba6100e6f95280022ca681783d828a2d0543a723305699fdf58959e104c7530f" + } + }, + { + "key": "original/readout_integrator", + "tag": "readout_integrator", + "script": "train_ssvep_event_snn.py", + "hf_folder": "applied/original", + "phase": 6, + "status": "ok", + "duration_s": 358.8, + "optimization_summary": null, + "zip": { + "name": "readout_integrator.zip", + "files": 79, + "bytes": 12252874, + "MB": 12.3, + "sha256": "b779dcef554b523f759aa00b639f62b3619a121529b1bffdf4c8139deca6d68e" + } + }, + { + "key": "opt01_ttfs_dta/dta_aggressive", + "tag": "dta_aggressive", + "script": "opt01_ttfs_dta.py", + "hf_folder": "applied/opt01_ttfs_dta", + "phase": 6, "status": "ok", - "duration_s": 323.5, + "duration_s": 319.2, "optimization_summary": { - "optimization": "mint_quant", - "research_section": "4. Membrane-Potential Memory-Wall Optimizations (multiplier-less integer quantization)", - "reference": "Yin et al., MINT: Multiplier-less INTeger Quantization for Energy Efficient Spiking Neural Networks, arXiv:2305.09850 (ASP-DAC 2024)", - "script": "opt08_mint_quant.py", + "optimization": "ttfs_dta", + "research_section": "2. Temporal-Dimension Reduction (TTFS coding / DTA-TTFS)", + "reference": "Software-Level Optimizations for Spiking Neural Network Inference on ARM Architectures: A Deep-Dive into the Jetson Nano Ecosystem (research.md SS2)", + "script": "opt01_ttfs_dta.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.22428571428571428, - "test_target_acc": 0.22428571428571428, - "best_val_acc": 0.49357142857142855 + "test_acc": 0.11071428571428571, + "test_target_acc": 0.11071428571428571, + "best_val_acc": 0.4042857142857143 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 737711.1282467532, + "syn_ops_per_inference": 1672292.695616883, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.006013531082458013, - "syn_ops_per_inference_dense_fanout": 63661272.290584415, - "weight_sparsity": 0.9789982001252087, - "effective_ticks": 27.373571428571427, + "event_fraction_of_dense": 0.013631872584001354, + "syn_ops_per_inference_dense_fanout": 61255206.297077924, + "weight_sparsity": 0.7324707846410685, + "effective_ticks": 100.0, "num_ticks": 100, - "membrane_bytes_per_inference": 0, - "weight_bytes": 613376, + "membrane_bytes_per_inference": 451200, + "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 88.68454749999728, - "infer_ms_per_sample": 0.6045492706249433, - "peak_vram_mb": 2835.119104 + "train_ms_per_step": 96.12080785000217, + "infer_ms_per_sample": 0.6161109312500912, + "peak_vram_mb": 2908.82304 }, "optimization_specific": { - "w_bits": 4, - "u_bits": 2, - "leak_shift": 0, - "beta_eff": 1.0, - "qat": true, - "batchnorm": true, - "membrane_memory_reduction_x": 16.0, - "weight_memory_reduction_x": 8.0, - "membrane_bytes_per_inference": 28200.0, - "working_set_bytes": 613658.0, - "baseline_working_set_bytes": 4911520.0, - "l2_cache_fits": true, - "baseline_l2_cache_fits": false, - "l2_budget_bytes": 2097152, - "membrane_saturation_frac": 0.018447992852393617, - "acc_vs_ubits": { - "0": 0.18428571428571427, - "2": 0.22428571428571428, - "3": 0.21571428571428572, - "4": 0.21428571428571427, - "6": 0.21571428571428572, - "8": 0.21214285714285713 - }, - "bits_sweep_rows": [ - { - "u_bits": 0, - "acc": 0.18428571428571427, - "target_acc": 0.18428571428571427, - "membrane_bytes_per_neuron_per_tick": 4.0, - "membrane_memory_reduction_x": 1.0, - "membrane_saturation_frac": null, - "acc_drop_vs_fp32": 0.0 - }, - { - "u_bits": 2, - "acc": 0.22428571428571428, - "target_acc": 0.22428571428571428, - "membrane_bytes_per_neuron_per_tick": 0.25, - "membrane_memory_reduction_x": 16.0, - "membrane_saturation_frac": 0.016339829898049645, - "acc_drop_vs_fp32": -0.04000000000000001 - }, - { - "u_bits": 3, - "acc": 0.21571428571428572, - "target_acc": 0.21571428571428572, - "membrane_bytes_per_neuron_per_tick": 0.375, - "membrane_memory_reduction_x": 10.666666666666666, - "membrane_saturation_frac": 0.07418640569592198, - "acc_drop_vs_fp32": -0.031428571428571445 - }, - { - "u_bits": 4, - "acc": 0.21428571428571427, - "target_acc": 0.21428571428571427, - "membrane_bytes_per_neuron_per_tick": 0.5, - "membrane_memory_reduction_x": 8.0, - "membrane_saturation_frac": 0.1724607297207447, - "acc_drop_vs_fp32": -0.03 - }, - { - "u_bits": 6, - "acc": 0.21571428571428572, - "target_acc": 0.21571428571428572, - "membrane_bytes_per_neuron_per_tick": 0.75, - "membrane_memory_reduction_x": 5.333333333333333, - "membrane_saturation_frac": 0.3710663923980496, - "acc_drop_vs_fp32": -0.031428571428571445 - }, - { - "u_bits": 8, - "acc": 0.21214285714285713, - "target_acc": 0.21214285714285713, - "membrane_bytes_per_neuron_per_tick": 1.0, - "membrane_memory_reduction_x": 4.0, - "membrane_saturation_frac": 0.37882293051861704, - "acc_drop_vs_fp32": -0.027857142857142858 - } - ], - "fp32_membrane_acc": 0.18428571428571427, - "per_layer_scales": [ + "ttfs": true, + "dta": true, + "readout": "ttfs", + "ttfs_halt_k": 1, + "dta_target_rate": 0.02, + "dta_momentum": 0.3, + "spikes_per_neuron_per_inference": 0.25650899189463017, + "ttfs_budget_respected": true, + "frac_neurons_that_ever_fire": 0.25650899189463017, + "mean_first_spike_tick": 10.689887651544513, + "per_layer_ttfs": [ { "layer": 0, - "weight_scale": 0.03549237549304962, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 28.17506537976945 + "neurons": 320, + "spikes_per_neuron_per_inference": 0.8740625, + "frac_neurons_that_ever_fire": 0.8740625, + "mean_first_spike_tick": 7.994496654578885 }, { "layer": 1, - "weight_scale": 0.03008062924657549, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 33.24398541675601 + "neurons": 512, + "spikes_per_neuron_per_inference": 0.012979910714285715, + "frac_neurons_that_ever_fire": 0.012979910714285715, + "mean_first_spike_tick": 90.16046861564918 }, { "layer": 2, - "weight_scale": 0.027376641120229448, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 36.52749055694305 + "neurons": 256, + "spikes_per_neuron_per_inference": 0.009171316964285714, + "frac_neurons_that_ever_fire": 0.009171316964285714, + "mean_first_spike_tick": 85.47246729540615 }, { "layer": 3, - "weight_scale": 0.02388627827167511, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 41.865040196982996 + "neurons": 40, + "spikes_per_neuron_per_inference": 0.016214285714285716, + "frac_neurons_that_ever_fire": 0.016214285714285716, + "mean_first_spike_tick": 88.06497797356828 } ], - "shared_scale_note": "weight grid and membrane grid are the same grid up to a per-layer positive scalar that BatchNorm absorbs exactly; exact only with --batchnorm on", - "multiplier_less_compare": true, - "wall_clock_caveat": "this reference kernel computes in fp32 registers, so the traffic win does not appear in train_ms_per_step; a fixed-point core is where it becomes energy" + "mean_halt_tick": 96.15, + "effective_ticks": 96.15, + "ticks_saved_frac": 0.03849999999999998, + "num_ticks": 100, + "dta_thr_min": 10.0, + "dta_thr_max": 90.773681640625, + "dta_thr_mean": 45.99387741088867, + "base_thresh": 10.0 }, "config": { "method": "harmonic_matched", @@ -4686,11 +3617,11 @@ "no_batchnorm": false, "binary_input": false, "beta": 1.0, - "thresh": 1.0, + "thresh": 10.0, "window": 0.5, "gain": 1.0, "alpha": 0.9, - "readout": "spikecount", + "readout": "ttfs", "fake_quant": 0, "amp": false, "spike_reg": 0.0, @@ -4698,7 +3629,7 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt08_mint_quant/bits_sweep_fine", + "hub_dir": "/kaggle/working/hub/opt01_ttfs_dta/dta_aggressive", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, @@ -4709,149 +3640,112 @@ "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "w_bits": 4, - "u_bits": 2, - "leak_shift": 0, - "qat": true, - "bits_sweep": "0,2,3,4,6,8", - "l2_bytes": 2097152, + "ttfs": true, + "ttfs_halt_k": 1, + "dta": true, + "dta_target_rate": 0.02, + "dta_readout_rate": 0.95, + "ttfs_logit_scale": 10.0, + "dta_momentum": 0.3, + "dta_min": 0.2, + "dta_max": 10.0, + "dta_windup_patience": 200, "sampling_rate": 250.0 } }, "zip": { - "name": "bits_sweep_fine.zip", - "files": 81, - "bytes": 12373116, + "name": "dta_aggressive.zip", + "files": 80, + "bytes": 12436385, "MB": 12.4, - "sha256": "2fe3f4aad883a9ccc3ebe2dd4259aaa6e4053f00e53278a241e2f51f70d48e6c" + "sha256": "e9e42992f9e855fd020082670c2b1a22f72e258066e21af39ca66533b499eeac" } }, { - "key": "opt08_mint_quant/l2_jetson_nano", - "tag": "l2_jetson_nano", - "script": "opt08_mint_quant.py", - "hf_folder": "applied/opt08_mint_quant", - "phase": 9, + "key": "opt01_ttfs_dta/dta_min_0.05", + "tag": "dta_min_0.05", + "script": "opt01_ttfs_dta.py", + "hf_folder": "applied/opt01_ttfs_dta", + "phase": 6, "status": "ok", - "duration_s": 321.2, + "duration_s": 320.3, "optimization_summary": { - "optimization": "mint_quant", - "research_section": "4. Membrane-Potential Memory-Wall Optimizations (multiplier-less integer quantization)", - "reference": "Yin et al., MINT: Multiplier-less INTeger Quantization for Energy Efficient Spiking Neural Networks, arXiv:2305.09850 (ASP-DAC 2024)", - "script": "opt08_mint_quant.py", + "optimization": "ttfs_dta", + "research_section": "2. Temporal-Dimension Reduction (TTFS coding / DTA-TTFS)", + "reference": "Software-Level Optimizations for Spiking Neural Network Inference on ARM Architectures: A Deep-Dive into the Jetson Nano Ecosystem (research.md SS2)", + "script": "opt01_ttfs_dta.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.22642857142857142, - "test_target_acc": 0.22642857142857142, - "best_val_acc": 0.48142857142857143 + "test_acc": 0.08571428571428572, + "test_target_acc": 0.08571428571428572, + "best_val_acc": 0.13 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 819585.7610592532, + "syn_ops_per_inference": 1581627.8814935065, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.006680940899703064, - "syn_ops_per_inference_dense_fanout": 63636744.434253246, - "weight_sparsity": 0.9802144198664441, - "effective_ticks": 35.24857142857143, + "event_fraction_of_dense": 0.012892808664616047, + "syn_ops_per_inference_dense_fanout": 55808345.17451298, + "weight_sparsity": 0.7324707846410685, + "effective_ticks": 100.0, "num_ticks": 100, - "membrane_bytes_per_inference": 0, - "weight_bytes": 613376, + "membrane_bytes_per_inference": 451200, + "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 88.0644066500281, - "infer_ms_per_sample": 0.6020276593750395, - "peak_vram_mb": 2835.111424 + "train_ms_per_step": 96.69574274998922, + "infer_ms_per_sample": 0.6199013459374214, + "peak_vram_mb": 2909.029376 }, "optimization_specific": { - "w_bits": 4, - "u_bits": 2, - "leak_shift": 0, - "beta_eff": 1.0, - "qat": true, - "batchnorm": true, - "membrane_memory_reduction_x": 16.0, - "weight_memory_reduction_x": 8.0, - "membrane_bytes_per_inference": 28200.0, - "working_set_bytes": 613658.0, - "baseline_working_set_bytes": 4911520.0, - "l2_cache_fits": false, - "baseline_l2_cache_fits": false, - "l2_budget_bytes": 262144, - "membrane_saturation_frac": 0.019173973570478724, - "acc_vs_ubits": { - "2": 0.22642857142857142, - "4": 0.2057142857142857, - "8": 0.20642857142857143, - "0": 0.155 - }, - "bits_sweep_rows": [ - { - "u_bits": 2, - "acc": 0.22642857142857142, - "target_acc": 0.22642857142857142, - "membrane_bytes_per_neuron_per_tick": 0.25, - "membrane_memory_reduction_x": 16.0, - "membrane_saturation_frac": 0.01658403978280142, - "acc_drop_vs_fp32": -0.07142857142857142 - }, - { - "u_bits": 4, - "acc": 0.2057142857142857, - "target_acc": 0.2057142857142857, - "membrane_bytes_per_neuron_per_tick": 0.5, - "membrane_memory_reduction_x": 8.0, - "membrane_saturation_frac": 0.18061516511524822, - "acc_drop_vs_fp32": -0.05071428571428571 - }, - { - "u_bits": 8, - "acc": 0.20642857142857143, - "target_acc": 0.20642857142857143, - "membrane_bytes_per_neuron_per_tick": 1.0, - "membrane_memory_reduction_x": 4.0, - "membrane_saturation_frac": 0.39453422816932626, - "acc_drop_vs_fp32": -0.051428571428571435 - }, - { - "u_bits": 0, - "acc": 0.155, - "target_acc": 0.155, - "membrane_bytes_per_neuron_per_tick": 4.0, - "membrane_memory_reduction_x": 1.0, - "membrane_saturation_frac": null, - "acc_drop_vs_fp32": 0.0 - } - ], - "fp32_membrane_acc": 0.155, - "per_layer_scales": [ + "ttfs": true, + "dta": true, + "readout": "ttfs", + "ttfs_halt_k": 1, + "dta_target_rate": 0.05, + "dta_momentum": 0.1, + "spikes_per_neuron_per_inference": 0.4362202380952381, + "ttfs_budget_respected": true, + "frac_neurons_that_ever_fire": 0.4362202380952381, + "mean_first_spike_tick": 12.423218010710153, + "per_layer_ttfs": [ { "layer": 0, - "weight_scale": 0.02853875287941524, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 35.040073552803754 + "neurons": 320, + "spikes_per_neuron_per_inference": 0.8765401785714285, + "frac_neurons_that_ever_fire": 0.8765401785714285, + "mean_first_spike_tick": 8.579041992411316 }, { "layer": 1, - "weight_scale": 0.03575079781668527, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 27.97140374677987 + "neurons": 512, + "spikes_per_neuron_per_inference": 0.3682268415178571, + "frac_neurons_that_ever_fire": 0.3682268415178571, + "mean_first_spike_tick": 13.764833582753983 }, { "layer": 2, - "weight_scale": 0.03166966778891427, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 31.57595484313992 + "neurons": 256, + "spikes_per_neuron_per_inference": 0.058203125, + "frac_neurons_that_ever_fire": 0.058203125, + "mean_first_spike_tick": 31.648657718120806 }, { "layer": 3, - "weight_scale": 0.022976822086742947, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 43.52211964843367 + "neurons": 40, + "spikes_per_neuron_per_inference": 0.2032857142857143, + "frac_neurons_that_ever_fire": 0.2032857142857143, + "mean_first_spike_tick": 78.69290231904428 } ], - "shared_scale_note": "weight grid and membrane grid are the same grid up to a per-layer positive scalar that BatchNorm absorbs exactly; exact only with --batchnorm on", - "multiplier_less_compare": true, - "wall_clock_caveat": "this reference kernel computes in fp32 registers, so the traffic win does not appear in train_ms_per_step; a fixed-point core is where it becomes energy" + "mean_halt_tick": 85.77071428571429, + "effective_ticks": 85.77071428571429, + "ticks_saved_frac": 0.1422928571428571, + "num_ticks": 100, + "dta_thr_min": 10.0, + "dta_thr_max": 31.3689022064209, + "dta_thr_mean": 15.342226028442383, + "base_thresh": 10.0 }, "config": { "method": "harmonic_matched", @@ -4879,11 +3773,11 @@ "no_batchnorm": false, "binary_input": false, "beta": 1.0, - "thresh": 1.0, + "thresh": 10.0, "window": 0.5, "gain": 1.0, "alpha": 0.9, - "readout": "spikecount", + "readout": "ttfs", "fake_quant": 0, "amp": false, "spike_reg": 0.0, @@ -4891,7 +3785,7 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt08_mint_quant/l2_jetson_nano", + "hub_dir": "/kaggle/working/hub/opt01_ttfs_dta/dta_min_0.05", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, @@ -4902,149 +3796,112 @@ "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "w_bits": 4, - "u_bits": 2, - "leak_shift": 0, - "qat": true, - "bits_sweep": "2,4,8,0", - "l2_bytes": 262144, + "ttfs": true, + "ttfs_halt_k": 1, + "dta": true, + "dta_target_rate": 0.05, + "dta_readout_rate": 0.95, + "ttfs_logit_scale": 10.0, + "dta_momentum": 0.1, + "dta_min": 0.05, + "dta_max": 5.0, + "dta_windup_patience": 200, "sampling_rate": 250.0 } }, "zip": { - "name": "l2_jetson_nano.zip", - "files": 81, - "bytes": 12361956, - "MB": 12.4, - "sha256": "d29263c2d6d2174c1049eacdc639e439ab6721dbf1819649dee4622ebabc2743" + "name": "dta_min_0.05.zip", + "files": 80, + "bytes": 12574836, + "MB": 12.6, + "sha256": "f43877535e192dd9f2b911710406ea77514186660183db05411c19c484621d8e" } }, { - "key": "opt08_mint_quant/leak_shift_2", - "tag": "leak_shift_2", - "script": "opt08_mint_quant.py", - "hf_folder": "applied/opt08_mint_quant", - "phase": 9, + "key": "opt01_ttfs_dta/dta_only", + "tag": "dta_only", + "script": "opt01_ttfs_dta.py", + "hf_folder": "applied/opt01_ttfs_dta", + "phase": 6, "status": "ok", - "duration_s": 308.1, + "duration_s": 337.9, "optimization_summary": { - "optimization": "mint_quant", - "research_section": "4. Membrane-Potential Memory-Wall Optimizations (multiplier-less integer quantization)", - "reference": "Yin et al., MINT: Multiplier-less INTeger Quantization for Energy Efficient Spiking Neural Networks, arXiv:2305.09850 (ASP-DAC 2024)", - "script": "opt08_mint_quant.py", + "optimization": "ttfs_dta", + "research_section": "2. Temporal-Dimension Reduction (TTFS coding / DTA-TTFS)", + "reference": "Software-Level Optimizations for Spiking Neural Network Inference on ARM Architectures: A Deep-Dive into the Jetson Nano Ecosystem (research.md SS2)", + "script": "opt01_ttfs_dta.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.025, - "test_target_acc": 0.025, - "best_val_acc": 0.6871428571428572 + "test_acc": 0.6742857142857143, + "test_target_acc": 0.6742857142857143, + "best_val_acc": 0.6571428571428571 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 8857.618810876624, + "syn_ops_per_inference": 3206207.6014610385, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 7.22038261268506e-05, - "syn_ops_per_inference_dense_fanout": 63155950.40909091, - "weight_sparsity": 0.9982718593489148, - "effective_ticks": 100.0, + "event_fraction_of_dense": 0.02613574382973118, + "syn_ops_per_inference_dense_fanout": 64782825.38798702, + "weight_sparsity": 0.7324707846410685, + "effective_ticks": 88.025, "num_ticks": 100, - "membrane_bytes_per_inference": 0, - "weight_bytes": 613376, + "membrane_bytes_per_inference": 451200, + "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 83.6030630499863, - "infer_ms_per_sample": 0.5862654068749862, - "peak_vram_mb": 2832.311808 + "train_ms_per_step": 100.90107790001639, + "infer_ms_per_sample": 0.6546642981248851, + "peak_vram_mb": 2914.382848 }, "optimization_specific": { - "w_bits": 4, - "u_bits": 2, - "leak_shift": 2, - "beta_eff": 0.75, - "qat": true, - "batchnorm": true, - "membrane_memory_reduction_x": 16.0, - "weight_memory_reduction_x": 8.0, - "membrane_bytes_per_inference": 28200.0, - "working_set_bytes": 613658.0, - "baseline_working_set_bytes": 4911520.0, - "l2_cache_fits": true, - "baseline_l2_cache_fits": false, - "l2_budget_bytes": 2097152, - "membrane_saturation_frac": 0.0, - "acc_vs_ubits": { - "2": 0.025, - "4": 0.025714285714285714, - "8": 0.03, - "0": 0.024285714285714285 - }, - "bits_sweep_rows": [ - { - "u_bits": 2, - "acc": 0.025, - "target_acc": 0.025, - "membrane_bytes_per_neuron_per_tick": 0.25, - "membrane_memory_reduction_x": 16.0, - "membrane_saturation_frac": 0.0, - "acc_drop_vs_fp32": -0.0007142857142857159 - }, - { - "u_bits": 4, - "acc": 0.025714285714285714, - "target_acc": 0.025714285714285714, - "membrane_bytes_per_neuron_per_tick": 0.5, - "membrane_memory_reduction_x": 8.0, - "membrane_saturation_frac": 3.0197251773049646e-05, - "acc_drop_vs_fp32": -0.0014285714285714284 - }, - { - "u_bits": 8, - "acc": 0.03, - "target_acc": 0.03, - "membrane_bytes_per_neuron_per_tick": 1.0, - "membrane_memory_reduction_x": 4.0, - "membrane_saturation_frac": 0.0005447279476950355, - "acc_drop_vs_fp32": -0.005714285714285713 - }, - { - "u_bits": 0, - "acc": 0.024285714285714285, - "target_acc": 0.024285714285714285, - "membrane_bytes_per_neuron_per_tick": 4.0, - "membrane_memory_reduction_x": 1.0, - "membrane_saturation_frac": null, - "acc_drop_vs_fp32": 0.0 - } - ], - "fp32_membrane_acc": 0.024285714285714285, - "per_layer_scales": [ + "ttfs": false, + "dta": true, + "readout": "ttfs", + "ttfs_halt_k": 1, + "dta_target_rate": 0.05, + "dta_momentum": 0.1, + "spikes_per_neuron_per_inference": 6.18145896656535, + "ttfs_budget_respected": false, + "frac_neurons_that_ever_fire": 0.659125506585613, + "mean_first_spike_tick": 19.138416030112662, + "per_layer_ttfs": [ { "layer": 0, - "weight_scale": 0.005439152142831257, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 183.8521838956075 + "neurons": 320, + "spikes_per_neuron_per_inference": 5.745680803571428, + "frac_neurons_that_ever_fire": 0.6952366071428572, + "mean_first_spike_tick": 18.81047048473991 }, { "layer": 1, - "weight_scale": 0.0023113220397915158, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 432.65282067322875 + "neurons": 512, + "spikes_per_neuron_per_inference": 4.710100446428571, + "frac_neurons_that_ever_fire": 0.5154185267857143, + "mean_first_spike_tick": 25.280761776902008 }, { "layer": 2, - "weight_scale": 0.008123405277729034, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 123.10108455890783 + "neurons": 256, + "spikes_per_neuron_per_inference": 6.6330078125, + "frac_neurons_that_ever_fire": 0.8487081473214285, + "mean_first_spike_tick": 15.31439589449564 }, { "layer": 3, - "weight_scale": 0.016667025429861888, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 59.99870848029819 + "neurons": 40, + "spikes_per_neuron_per_inference": 25.611160714285713, + "frac_neurons_that_ever_fire": 0.9963571428571428, + "mean_first_spike_tick": 1.1446698688077999 } ], - "shared_scale_note": "weight grid and membrane grid are the same grid up to a per-layer positive scalar that BatchNorm absorbs exactly; exact only with --batchnorm on", - "multiplier_less_compare": true, - "wall_clock_caveat": "this reference kernel computes in fp32 registers, so the traffic win does not appear in train_ms_per_step; a fixed-point core is where it becomes energy" + "mean_halt_tick": 100.0, + "effective_ticks": 100.0, + "ticks_saved_frac": 0.0, + "num_ticks": 100, + "dta_thr_min": 1.0, + "dta_thr_max": 5.0, + "dta_thr_mean": 2.1204841136932373, + "base_thresh": 1.0 }, "config": { "method": "harmonic_matched", @@ -5076,7 +3933,7 @@ "window": 0.5, "gain": 1.0, "alpha": 0.9, - "readout": "spikecount", + "readout": "ttfs", "fake_quant": 0, "amp": false, "spike_reg": 0.0, @@ -5084,7 +3941,7 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt08_mint_quant/leak_shift_2", + "hub_dir": "/kaggle/working/hub/opt01_ttfs_dta/dta_only", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, @@ -5095,149 +3952,112 @@ "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "w_bits": 4, - "u_bits": 2, - "leak_shift": 2, - "qat": true, - "bits_sweep": "2,4,8,0", - "l2_bytes": 2097152, + "ttfs": false, + "ttfs_halt_k": 1, + "dta": true, + "dta_target_rate": 0.05, + "dta_readout_rate": 0.95, + "ttfs_logit_scale": 10.0, + "dta_momentum": 0.1, + "dta_min": 0.2, + "dta_max": 5.0, + "dta_windup_patience": 200, "sampling_rate": 250.0 } }, "zip": { - "name": "leak_shift_2.zip", - "files": 81, - "bytes": 12398575, - "MB": 12.4, - "sha256": "f3265cdd1b2d111f678c285a1c19cf7387d1102687a0b4cf493deb9a791519cc" + "name": "dta_only.zip", + "files": 80, + "bytes": 12340231, + "MB": 12.3, + "sha256": "1640d438f904c741d308350e45a4c63554c2e4f0012049282112c2872188bb3f" } }, { - "key": "opt08_mint_quant/no_qat", - "tag": "no_qat", - "script": "opt08_mint_quant.py", - "hf_folder": "applied/opt08_mint_quant", - "phase": 9, + "key": "opt01_ttfs_dta/ttfs_halt_k4", + "tag": "ttfs_halt_k4", + "script": "opt01_ttfs_dta.py", + "hf_folder": "applied/opt01_ttfs_dta", + "phase": 6, "status": "ok", - "duration_s": 328.8, + "duration_s": 320.1, "optimization_summary": { - "optimization": "mint_quant", - "research_section": "4. Membrane-Potential Memory-Wall Optimizations (multiplier-less integer quantization)", - "reference": "Yin et al., MINT: Multiplier-less INTeger Quantization for Energy Efficient Spiking Neural Networks, arXiv:2305.09850 (ASP-DAC 2024)", - "script": "opt08_mint_quant.py", + "optimization": "ttfs_dta", + "research_section": "2. Temporal-Dimension Reduction (TTFS coding / DTA-TTFS)", + "reference": "Software-Level Optimizations for Spiking Neural Network Inference on ARM Architectures: A Deep-Dive into the Jetson Nano Ecosystem (research.md SS2)", + "script": "opt01_ttfs_dta.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.8814285714285715, - "test_target_acc": 0.8814285714285715, - "best_val_acc": 0.9071428571428571 + "test_acc": 0.07214285714285715, + "test_target_acc": 0.07214285714285715, + "best_val_acc": 0.08285714285714285 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 2369107.872970779, + "syn_ops_per_inference": 1514583.3303571427, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.01931203595323895, - "syn_ops_per_inference_dense_fanout": 65155147.9375, - "weight_sparsity": 0.8282806956907346, - "effective_ticks": 10.586428571428572, + "event_fraction_of_dense": 0.012346287842670261, + "syn_ops_per_inference_dense_fanout": 54680959.98133116, + "weight_sparsity": 0.7324707846410685, + "effective_ticks": 100.0, "num_ticks": 100, - "membrane_bytes_per_inference": 0, - "weight_bytes": 613376, + "membrane_bytes_per_inference": 451200, + "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 93.63406789998407, - "infer_ms_per_sample": 0.6351243703124965, - "peak_vram_mb": 2828.762112 + "train_ms_per_step": 96.25736990001315, + "infer_ms_per_sample": 0.6170809678121714, + "peak_vram_mb": 2908.852736 }, "optimization_specific": { - "w_bits": 4, - "u_bits": 2, - "leak_shift": 0, - "beta_eff": 1.0, - "qat": false, - "batchnorm": true, - "membrane_memory_reduction_x": 16.0, - "weight_memory_reduction_x": 8.0, - "membrane_bytes_per_inference": 28200.0, - "working_set_bytes": 613658.0, - "baseline_working_set_bytes": 4911520.0, - "l2_cache_fits": true, - "baseline_l2_cache_fits": false, - "l2_budget_bytes": 2097152, - "membrane_saturation_frac": 0.10079070395611703, - "acc_vs_ubits": { - "2": 0.8814285714285715, - "4": 0.9357142857142857, - "8": 0.9421428571428572, - "0": 0.9278571428571428 - }, - "bits_sweep_rows": [ - { - "u_bits": 2, - "acc": 0.8814285714285715, - "target_acc": 0.8814285714285715, - "membrane_bytes_per_neuron_per_tick": 0.25, - "membrane_memory_reduction_x": 16.0, - "membrane_saturation_frac": 0.09545739140070922, - "acc_drop_vs_fp32": 0.046428571428571375 - }, - { - "u_bits": 4, - "acc": 0.9357142857142857, - "target_acc": 0.9357142857142857, - "membrane_bytes_per_neuron_per_tick": 0.5, - "membrane_memory_reduction_x": 8.0, - "membrane_saturation_frac": 0.2861436862810284, - "acc_drop_vs_fp32": -0.007857142857142896 - }, - { - "u_bits": 8, - "acc": 0.9421428571428572, - "target_acc": 0.9421428571428572, - "membrane_bytes_per_neuron_per_tick": 1.0, - "membrane_memory_reduction_x": 4.0, - "membrane_saturation_frac": 0.3314320146276596, - "acc_drop_vs_fp32": -0.014285714285714346 - }, - { - "u_bits": 0, - "acc": 0.9278571428571428, - "target_acc": 0.9278571428571428, - "membrane_bytes_per_neuron_per_tick": 4.0, - "membrane_memory_reduction_x": 1.0, - "membrane_saturation_frac": null, - "acc_drop_vs_fp32": 0.0 - } - ], - "fp32_membrane_acc": 0.9278571428571428, - "per_layer_scales": [ + "ttfs": true, + "dta": true, + "readout": "ttfs", + "ttfs_halt_k": 4, + "dta_target_rate": 0.05, + "dta_momentum": 0.1, + "spikes_per_neuron_per_inference": 0.31332700101317124, + "ttfs_budget_respected": true, + "frac_neurons_that_ever_fire": 0.31332700101317124, + "mean_first_spike_tick": 17.079404857661387, + "per_layer_ttfs": [ { "layer": 0, - "weight_scale": 0.03091752529144287, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 32.34411520888358 + "neurons": 320, + "spikes_per_neuron_per_inference": 0.8797075892857142, + "frac_neurons_that_ever_fire": 0.8797075892857142, + "mean_first_spike_tick": 8.255665310865776 }, { "layer": 1, - "weight_scale": 0.01778849107878549, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 56.21612286117947 + "neurons": 512, + "spikes_per_neuron_per_inference": 0.06015625, + "frac_neurons_that_ever_fire": 0.06015625, + "mean_first_spike_tick": 47.935157699443415 }, { "layer": 2, - "weight_scale": 0.01220501959323883, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 81.93350222509812 + "neurons": 256, + "spikes_per_neuron_per_inference": 0.09152622767857142, + "frac_neurons_that_ever_fire": 0.09152622767857142, + "mean_first_spike_tick": 35.197329512544584 }, { "layer": 3, - "weight_scale": 0.018680229783058167, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 53.53253207339769 + "neurons": 40, + "spikes_per_neuron_per_inference": 0.44239285714285714, + "frac_neurons_that_ever_fire": 0.44239285714285714, + "mean_first_spike_tick": 79.75369338822959 } ], - "shared_scale_note": "weight grid and membrane grid are the same grid up to a per-layer positive scalar that BatchNorm absorbs exactly; exact only with --batchnorm on", - "multiplier_less_compare": true, - "wall_clock_caveat": "this reference kernel computes in fp32 registers, so the traffic win does not appear in train_ms_per_step; a fixed-point core is where it becomes energy" + "mean_halt_tick": 82.34214285714286, + "effective_ticks": 82.34214285714286, + "ticks_saved_frac": 0.17657857142857136, + "num_ticks": 100, + "dta_thr_min": 10.0, + "dta_thr_max": 50.0, + "dta_thr_mean": 29.45870590209961, + "base_thresh": 10.0 }, "config": { "method": "harmonic_matched", @@ -5265,11 +4085,11 @@ "no_batchnorm": false, "binary_input": false, "beta": 1.0, - "thresh": 1.0, + "thresh": 10.0, "window": 0.5, "gain": 1.0, "alpha": 0.9, - "readout": "spikecount", + "readout": "ttfs", "fake_quant": 0, "amp": false, "spike_reg": 0.0, @@ -5277,7 +4097,7 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt08_mint_quant/no_qat", + "hub_dir": "/kaggle/working/hub/opt01_ttfs_dta/ttfs_halt_k4", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, @@ -5288,342 +4108,112 @@ "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "w_bits": 4, - "u_bits": 2, - "leak_shift": 0, - "qat": false, - "bits_sweep": "2,4,8,0", - "l2_bytes": 2097152, + "ttfs": true, + "ttfs_halt_k": 4, + "dta": true, + "dta_target_rate": 0.05, + "dta_readout_rate": 0.95, + "ttfs_logit_scale": 10.0, + "dta_momentum": 0.1, + "dta_min": 0.2, + "dta_max": 5.0, + "dta_windup_patience": 200, "sampling_rate": 250.0 } }, "zip": { - "name": "no_qat.zip", - "files": 81, - "bytes": 12241785, - "MB": 12.2, - "sha256": "23aa8a4da5964260deb080b490dd81651bc1ec81a1e96263826a88013a927a7d" + "name": "ttfs_halt_k4.zip", + "files": 80, + "bytes": 12565089, + "MB": 12.6, + "sha256": "8566a061f28f35077705291adc228e3c3088738bbc7e69ea0b108618887fe7fa" } }, { - "key": "opt08_mint_quant/w_bits_2", - "tag": "w_bits_2", - "script": "opt08_mint_quant.py", - "hf_folder": "applied/opt08_mint_quant", - "phase": 10, + "key": "opt01_ttfs_dta/ttfs_only", + "tag": "ttfs_only", + "script": "opt01_ttfs_dta.py", + "hf_folder": "applied/opt01_ttfs_dta", + "phase": 6, "status": "ok", - "duration_s": 313.7, + "duration_s": 316.6, "optimization_summary": { - "optimization": "mint_quant", - "research_section": "4. Membrane-Potential Memory-Wall Optimizations (multiplier-less integer quantization)", - "reference": "Yin et al., MINT: Multiplier-less INTeger Quantization for Energy Efficient Spiking Neural Networks, arXiv:2305.09850 (ASP-DAC 2024)", - "script": "opt08_mint_quant.py", + "optimization": "ttfs_dta", + "research_section": "2. Temporal-Dimension Reduction (TTFS coding / DTA-TTFS)", + "reference": "Software-Level Optimizations for Spiking Neural Network Inference on ARM Architectures: A Deep-Dive into the Jetson Nano Ecosystem (research.md SS2)", + "script": "opt01_ttfs_dta.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.03214285714285714, - "test_target_acc": 0.03214285714285714, - "best_val_acc": 0.23142857142857143 + "test_acc": 0.26571428571428574, + "test_target_acc": 0.26571428571428574, + "best_val_acc": 0.2764285714285714 }, "efficiency": { "spikes_per_inference": null, - "syn_ops_per_inference": 64874.41061282468, + "syn_ops_per_inference": 1293802.3214285714, "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.0005288306896000551, - "syn_ops_per_inference_dense_fanout": 63605566.99918831, - "weight_sparsity": 0.9991204416214524, - "effective_ticks": 84.10142857142857, + "event_fraction_of_dense": 0.010546567859099243, + "syn_ops_per_inference_dense_fanout": 43842927.71022727, + "weight_sparsity": 0.7324707846410685, + "effective_ticks": 100.0, "num_ticks": 100, - "membrane_bytes_per_inference": 0, - "weight_bytes": 306688, + "membrane_bytes_per_inference": 451200, + "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 85.21973990000333, - "infer_ms_per_sample": 0.5962876021874308, - "peak_vram_mb": 2835.795968 + "train_ms_per_step": 95.39970539999558, + "infer_ms_per_sample": 0.6148795821877684, + "peak_vram_mb": 2909.192192 }, "optimization_specific": { - "w_bits": 2, - "u_bits": 2, - "leak_shift": 0, - "beta_eff": 1.0, - "qat": true, - "batchnorm": true, - "membrane_memory_reduction_x": 16.0, - "weight_memory_reduction_x": 16.0, - "membrane_bytes_per_inference": 28200.0, - "working_set_bytes": 306970.0, - "baseline_working_set_bytes": 4911520.0, - "l2_cache_fits": true, - "baseline_l2_cache_fits": false, - "l2_budget_bytes": 2097152, - "membrane_saturation_frac": 0.008376689937943263, - "acc_vs_ubits": { - "2": 0.03214285714285714, - "4": 0.03785714285714286, - "8": 0.03357142857142857, - "0": 0.03428571428571429 - }, - "bits_sweep_rows": [ - { - "u_bits": 2, - "acc": 0.03214285714285714, - "target_acc": 0.03214285714285714, - "membrane_bytes_per_neuron_per_tick": 0.25, - "membrane_memory_reduction_x": 16.0, - "membrane_saturation_frac": 0.007398326684397164, - "acc_drop_vs_fp32": 0.0021428571428571477 - }, - { - "u_bits": 4, - "acc": 0.03785714285714286, - "target_acc": 0.03785714285714286, - "membrane_bytes_per_neuron_per_tick": 0.5, - "membrane_memory_reduction_x": 8.0, - "membrane_saturation_frac": 0.05461069093528369, - "acc_drop_vs_fp32": -0.0035714285714285726 - }, - { - "u_bits": 8, - "acc": 0.03357142857142857, - "target_acc": 0.03357142857142857, - "membrane_bytes_per_neuron_per_tick": 1.0, - "membrane_memory_reduction_x": 4.0, - "membrane_saturation_frac": 0.1291535073138298, - "acc_drop_vs_fp32": 0.0007142857142857159 - }, - { - "u_bits": 0, - "acc": 0.03428571428571429, - "target_acc": 0.03428571428571429, - "membrane_bytes_per_neuron_per_tick": 4.0, - "membrane_memory_reduction_x": 1.0, - "membrane_saturation_frac": null, - "acc_drop_vs_fp32": 0.0 - } - ], - "fp32_membrane_acc": 0.03428571428571429, - "per_layer_scales": [ + "ttfs": true, + "dta": false, + "readout": "ttfs", + "ttfs_halt_k": 1, + "dta_target_rate": null, + "dta_momentum": null, + "spikes_per_neuron_per_inference": 0.6298676545086119, + "ttfs_budget_respected": true, + "frac_neurons_that_ever_fire": 0.6298676545086119, + "mean_first_spike_tick": 14.875147659515003, + "per_layer_ttfs": [ { "layer": 0, - "weight_scale": 0.1566811352968216, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 6.382389290871355 + "neurons": 320, + "spikes_per_neuron_per_inference": 0.8336785714285714, + "frac_neurons_that_ever_fire": 0.8336785714285714, + "mean_first_spike_tick": 11.4879273229662 }, { "layer": 1, - "weight_scale": 0.1379482001066208, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 7.249097844169735 + "neurons": 512, + "spikes_per_neuron_per_inference": 0.51552734375, + "frac_neurons_that_ever_fire": 0.51552734375, + "mean_first_spike_tick": 16.81680783698211 }, { "layer": 2, - "weight_scale": 0.07789017260074615, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 12.83859011490264 + "neurons": 256, + "spikes_per_neuron_per_inference": 0.6524330357142857, + "frac_neurons_that_ever_fire": 0.6524330357142857, + "mean_first_spike_tick": 11.979994183858496 }, { "layer": 3, - "weight_scale": 0.1205046996474266, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 8.298431537739242 + "neurons": 40, + "spikes_per_neuron_per_inference": 0.31851785714285713, + "frac_neurons_that_ever_fire": 0.31851785714285713, + "mean_first_spike_tick": 83.52817177776532 } ], - "shared_scale_note": "weight grid and membrane grid are the same grid up to a per-layer positive scalar that BatchNorm absorbs exactly; exact only with --batchnorm on", - "multiplier_less_compare": true, - "wall_clock_caveat": "this reference kernel computes in fp32 registers, so the traffic win does not appear in train_ms_per_step; a fixed-point core is where it becomes energy" - }, - "config": { - "method": "harmonic_matched", - "data_root": "/kaggle/working/data", - "subjects": "", - "blocks": "", - "limit": 0, - "drop_rest": true, - "resplit": "block", - "test_blocks": "6", - "class_weight": false, - "epochs": 60, - "batch_size": 64, - "lr": 0.002, - "weight_decay": 0.0005, - "grad_clip": 5.0, - "num_bins": 100, - "window_sec": 5.0, - "hidden": "512,256", - "freq_groups": 8, - "dropout": 0.3, - "spike_drop": 0.1, - "time_jitter": 2, - "label_smoothing": 0.05, - "no_batchnorm": false, - "binary_input": false, - "beta": 1.0, - "thresh": 1.0, - "window": 0.5, - "gain": 1.0, - "alpha": 0.9, - "readout": "spikecount", - "fake_quant": 0, - "amp": false, - "spike_reg": 0.0, - "event_eval": true, - "decision_margin": 2.0, - "export": false, - "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt08_mint_quant/w_bits_2", - "repo_id": "UWU-R-13/SSVEP-SNN", - "push_hf": false, - "keep_epoch_weights": 1, - "no_resume": true, - "selftest": false, - "baseline": false, - "bench": true, - "bench_warmup": 10, - "bench_iters": 50, - "bench_train_steps": 20, - "w_bits": 2, - "u_bits": 2, - "leak_shift": 0, - "qat": true, - "bits_sweep": "2,4,8,0", - "l2_bytes": 2097152, - "sampling_rate": 250.0 - } - }, - "zip": { - "name": "w_bits_2.zip", - "files": 81, - "bytes": 12361927, - "MB": 12.4, - "sha256": "2bbbd0d38983d52dddfea5a1ba1805c017e7f9fd0cf0c7815896dc8b4f1b95ce" - } - }, - { - "key": "opt08_mint_quant/w_bits_8", - "tag": "w_bits_8", - "script": "opt08_mint_quant.py", - "hf_folder": "applied/opt08_mint_quant", - "phase": 10, - "status": "ok", - "duration_s": 321.1, - "optimization_summary": { - "optimization": "mint_quant", - "research_section": "4. Membrane-Potential Memory-Wall Optimizations (multiplier-less integer quantization)", - "reference": "Yin et al., MINT: Multiplier-less INTeger Quantization for Energy Efficient Spiking Neural Networks, arXiv:2305.09850 (ASP-DAC 2024)", - "script": "opt08_mint_quant.py", - "baseline_mode": false, - "method": "harmonic_matched", - "accuracy": { - "test_acc": 0.17714285714285713, - "test_target_acc": 0.17714285714285713, - "best_val_acc": 0.5 - }, - "efficiency": { - "spikes_per_inference": null, - "syn_ops_per_inference": 1656847.0116680192, - "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.013505965441002087, - "syn_ops_per_inference_dense_fanout": 63575177.9935065, - "weight_sparsity": 0.9049547096723706, - "effective_ticks": 34.494285714285716, + "mean_halt_tick": 60.29142857142857, + "effective_ticks": 60.29142857142857, + "ticks_saved_frac": 0.39708571428571426, "num_ticks": 100, - "membrane_bytes_per_inference": 0, - "weight_bytes": 1226752, - "input_raster_bytes": null, - "train_ms_per_step": 88.07029660001717, - "infer_ms_per_sample": 0.5999964265623703, - "peak_vram_mb": 2834.582528 - }, - "optimization_specific": { - "w_bits": 8, - "u_bits": 2, - "leak_shift": 0, - "beta_eff": 1.0, - "qat": true, - "batchnorm": true, - "membrane_memory_reduction_x": 16.0, - "weight_memory_reduction_x": 4.0, - "membrane_bytes_per_inference": 28200.0, - "working_set_bytes": 1227034.0, - "baseline_working_set_bytes": 4911520.0, - "l2_cache_fits": true, - "baseline_l2_cache_fits": false, - "l2_budget_bytes": 2097152, - "membrane_saturation_frac": 0.017583977449024825, - "acc_vs_ubits": { - "2": 0.17714285714285713, - "4": 0.19642857142857142, - "8": 0.19642857142857142, - "0": 0.16357142857142856 - }, - "bits_sweep_rows": [ - { - "u_bits": 2, - "acc": 0.17714285714285713, - "target_acc": 0.17714285714285713, - "membrane_bytes_per_neuron_per_tick": 0.25, - "membrane_memory_reduction_x": 16.0, - "membrane_saturation_frac": 0.015716422872340426, - "acc_drop_vs_fp32": -0.013571428571428568 - }, - { - "u_bits": 4, - "acc": 0.19642857142857142, - "target_acc": 0.19642857142857142, - "membrane_bytes_per_neuron_per_tick": 0.5, - "membrane_memory_reduction_x": 8.0, - "membrane_saturation_frac": 0.1619908715647163, - "acc_drop_vs_fp32": -0.03285714285714286 - }, - { - "u_bits": 8, - "acc": 0.19642857142857142, - "target_acc": 0.19642857142857142, - "membrane_bytes_per_neuron_per_tick": 1.0, - "membrane_memory_reduction_x": 4.0, - "membrane_saturation_frac": 0.3510126468306738, - "acc_drop_vs_fp32": -0.03285714285714286 - }, - { - "u_bits": 0, - "acc": 0.16357142857142856, - "target_acc": 0.16357142857142856, - "membrane_bytes_per_neuron_per_tick": 4.0, - "membrane_memory_reduction_x": 1.0, - "membrane_saturation_frac": null, - "acc_drop_vs_fp32": 0.0 - } - ], - "fp32_membrane_acc": 0.16357142857142856, - "per_layer_scales": [ - { - "layer": 0, - "weight_scale": 0.0016182805374851377, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 617.9398298604231 - }, - { - "layer": 1, - "weight_scale": 0.0015527149589042964, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 644.0332105164167 - }, - { - "layer": 2, - "weight_scale": 0.0011796849215124537, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 847.6839720201876 - }, - { - "layer": 3, - "weight_scale": 0.0008578119198168356, - "membrane_scale": 1.0, - "shared_scale_gauge_factor": 1165.7567083161132 - } - ], - "shared_scale_note": "weight grid and membrane grid are the same grid up to a per-layer positive scalar that BatchNorm absorbs exactly; exact only with --batchnorm on", - "multiplier_less_compare": true, - "wall_clock_caveat": "this reference kernel computes in fp32 registers, so the traffic win does not appear in train_ms_per_step; a fixed-point core is where it becomes energy" + "dta_thr_min": 10.0, + "dta_thr_max": 10.0, + "dta_thr_mean": 10.0, + "base_thresh": 10.0 }, "config": { "method": "harmonic_matched", @@ -5651,11 +4241,11 @@ "no_batchnorm": false, "binary_input": false, "beta": 1.0, - "thresh": 1.0, + "thresh": 10.0, "window": 0.5, "gain": 1.0, "alpha": 0.9, - "readout": "spikecount", + "readout": "ttfs", "fake_quant": 0, "amp": false, "spike_reg": 0.0, @@ -5663,7 +4253,7 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt08_mint_quant/w_bits_8", + "hub_dir": "/kaggle/working/hub/opt01_ttfs_dta/ttfs_only", "repo_id": "UWU-R-13/SSVEP-SNN", "push_hf": false, "keep_epoch_weights": 1, @@ -5674,1593 +4264,153 @@ "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, - "w_bits": 8, - "u_bits": 2, - "leak_shift": 0, - "qat": true, - "bits_sweep": "2,4,8,0", - "l2_bytes": 2097152, + "ttfs": true, + "ttfs_halt_k": 1, + "dta": false, + "dta_target_rate": 0.05, + "dta_readout_rate": 0.95, + "ttfs_logit_scale": 10.0, + "dta_momentum": 0.1, + "dta_min": 0.2, + "dta_max": 5.0, + "dta_windup_patience": 200, "sampling_rate": 250.0 } }, "zip": { - "name": "w_bits_8.zip", - "files": 81, - "bytes": 12364242, - "MB": 12.4, - "sha256": "56ab4c27abf4fa9bb3d03b40fdebdc1a39a01711c51366a348fc10f4df048451" + "name": "ttfs_only.zip", + "files": 80, + "bytes": 12347385, + "MB": 12.3, + "sha256": "b444fc5f0e734ae6e0a5aaa2ed2af9132268522c12281393acf624235cde95ad" } }, { - "key": "opt09_srif_softreset/no_learn_reset", - "tag": "no_learn_reset", - "script": "opt09_srif_softreset.py", - "hf_folder": "applied/opt09_srif_softreset", - "phase": 10, + "key": "opt02_seenn_bayes/anytime_off", + "tag": "anytime_off", + "script": "opt02_seenn_bayes.py", + "hf_folder": "applied/opt02_seenn_bayes", + "phase": 6, "status": "ok", - "duration_s": 338.9, + "duration_s": 382.2, "optimization_summary": { - "optimization": "srif_softreset", - "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", - "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", - "script": "opt09_srif_softreset.py", + "optimization": "seenn_early_exit_bayesian_fusion", + "research_section": "2. Temporal-dimension reduction", + "reference": "SEENN: Towards Temporal Spiking Early-Exit Neural Networks, arXiv:2304.01230 (NeurIPS 2023); BayesianSpikeFusion, Front. Neurosci. 2024 (PMC11330889)", + "script": "opt02_seenn_bayes.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.9157142857142857, - "test_target_acc": 0.9157142857142857, - "best_val_acc": 0.9135714285714286 + "test_acc": 0.9442857142857143, + "test_target_acc": 0.9442857142857143, + "best_val_acc": 0.9507142857142857 }, "efficiency": { - "spikes_per_inference": 6883.3984375, - "syn_ops_per_inference": 3723144.671266234, - "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.03034961158625569, - "syn_ops_per_inference_dense_fanout": 65299762.45779221, + "spikes_per_inference": null, + "syn_ops_per_inference": 3667148.5641233767, + "dense_macs_per_inference": 123955200.0, + "event_fraction_of_dense": 0.029584467324673566, + "syn_ops_per_inference_dense_fanout": 65243766.35064935, "weight_sparsity": 0.7324707846410685, - "effective_ticks": 12.082142857142857, + "effective_ticks": 8.816428571428572, "num_ticks": 100, "membrane_bytes_per_inference": 451200, "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 95.2910739500112, - "infer_ms_per_sample": 0.6323959431250614, - "peak_vram_mb": 2829.398528, - "discarded_charge_per_reset": 0.038193207689203236 + "train_ms_per_step": 97.18796014785767, + "infer_ms_per_sample": 0.6453391894623263, + "peak_vram_mb": 10759.186944, + "syn_ops_per_inference_early_exit": 2023700.4034090908 }, "optimization_specific": { - "reset_mode": "srif", - "learn_reset": false, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 0, - "u_scale": 1.0, - "u_headroom_requested": 2.0, - "u_headroom_actual": 0.0, - "u_threshold_level": 0, - "u_levels_above_threshold": null, - "reset_family": { - "reset_mode": "srif", - "learn_reset": false, - "num_spiking_sites": 4, - "extra_params": 0, - "extra_params_frac_of_weights": 0.0, - "extra_flops_per_tick_per_neuron": 0, - "learned_lam_per_layer": [ - 0.8999999761581421, - 0.8999999761581421, - 0.8999999761581421, - 0.8999999761581421 + "seenn_enabled": true, + "bayes_fusion_enabled": true, + "conf_threshold": 0.9, + "conf_temp": 2.0, + "anytime_fracs": "1.0", + "anytime_weights": "1.0", + "ic_loss_weight": 0.3, + "ic_layer": 0, + "mean_exit_tick": 8.816428571428572, + "mean_exit_ms": 440.82142857142867, + "ticks_saved_frac": 0.9118357142857143, + "exit_tick_histogram": { + "counts": [ + 926, + 426, + 42, + 4, + 2, + 0, + 0, + 0, + 0, + 0 ], - "learned_v_reset_per_layer": [ - 0.0, - 0.0, + "edges": [ 0.0, - 0.0 - ] - }, - "reset_stats": { - "reset_mode": "srif", - "learn_reset": false, - "discarded_charge_per_reset": 0.038193207689203236, - "spikes_per_inference": 6883.3984375, - "syn_per_inference": 3811349.5, - "lam_per_site": [ - 0.8999999761581421, - 0.8999999761581421, - 0.8999999761581421, - 0.8999999761581421 - ], - "v_reset_per_site": [ - 0.0, - 0.0, - 0.0, - 0.0 - ], - "u_bits": 0, - "membrane_saturation_frac": null, - "batches": 4, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null - }, - "reset_x_bits_sweep": { - "rows": [ - { - "reset_mode": "hard", - "u_bits": 0, - "acc": 0.9264285714285714, - "target_acc": 0.9264285714285714, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.22403764747430177, - "spikes_per_inference": 5916.7890625, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "hard", - "u_bits": 4, - "acc": 0.94, - "target_acc": 0.94, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": 0.11177482137016213, - "spikes_per_inference": 6947.1171875, - "membrane_saturation_frac": 0.2622705424423759, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.013571428571428568 - }, - { - "reset_mode": "hard", - "u_bits": 2, - "acc": 0.8428571428571429, - "target_acc": 0.8428571428571429, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 6449.640625, - "membrane_saturation_frac": 0.3889967032358156, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.08357142857142852 - }, - { - "reset_mode": "soft", - "u_bits": 0, - "acc": 0.9014285714285715, - "target_acc": 0.9014285714285715, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 7159.375, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "soft", - "u_bits": 4, - "acc": 0.9421428571428572, - "target_acc": 0.9421428571428572, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 7629.8828125, - "membrane_saturation_frac": 0.30001184341755316, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.0407142857142857 - }, - { - "reset_mode": "soft", - "u_bits": 2, - "acc": 0.8428571428571429, - "target_acc": 0.8428571428571429, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 6449.640625, - "membrane_saturation_frac": 0.3889967032358156, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.05857142857142861 - }, - { - "reset_mode": "trained", - "u_bits": 0, - "acc": 0.9157142857142857, - "target_acc": 0.9157142857142857, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.03844964373905227, - "spikes_per_inference": 6912.2421875, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "trained", - "u_bits": 4, - "acc": 0.9428571428571428, - "target_acc": 0.9428571428571428, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": 0.013396262930022496, - "spikes_per_inference": 7548.390625, - "membrane_saturation_frac": 0.2957444730718085, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.027142857142857135 - }, - { - "reset_mode": "trained", - "u_bits": 2, - "acc": 0.8428571428571429, - "target_acc": 0.8428571428571429, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 6449.640625, - "membrane_saturation_frac": 0.3889967032358156, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.07285714285714284 - } - ], - "by_mode": { - "hard": { - "fp32_acc": 0.9264285714285714, - "acc_by_bits": { - "0": 0.9264285714285714, - "4": 0.94, - "2": 0.8428571428571429 - } - }, - "soft": { - "fp32_acc": 0.9014285714285715, - "acc_by_bits": { - "0": 0.9014285714285715, - "4": 0.9421428571428572, - "2": 0.8428571428571429 - } - }, - "trained": { - "fp32_acc": 0.9157142857142857, - "acc_by_bits": { - "0": 0.9157142857142857, - "4": 0.9428571428571428, - "2": 0.8428571428571429 - } - } - } - }, - "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", - "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", - "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" - }, - "config": { - "method": "harmonic_matched", - "data_root": "/kaggle/working/data", - "subjects": "", - "blocks": "", - "limit": 0, - "drop_rest": true, - "resplit": "block", - "test_blocks": "6", - "class_weight": false, - "epochs": 60, - "batch_size": 64, - "lr": 0.002, - "weight_decay": 0.0005, - "grad_clip": 5.0, - "num_bins": 100, - "window_sec": 5.0, - "hidden": "512,256", - "freq_groups": 8, - "dropout": 0.3, - "spike_drop": 0.1, - "time_jitter": 2, - "label_smoothing": 0.05, - "no_batchnorm": false, - "binary_input": false, - "beta": 1.0, - "thresh": 1.0, - "window": 0.5, - "gain": 1.0, - "alpha": 0.9, - "readout": "spikecount", - "fake_quant": 0, - "amp": false, - "spike_reg": 0.0, - "event_eval": true, - "decision_margin": 2.0, - "export": false, - "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/no_learn_reset", - "repo_id": "UWU-R-13/SSVEP-SNN", - "push_hf": false, - "keep_epoch_weights": 1, - "no_resume": true, - "selftest": false, - "reset_mode": "srif", - "learn_reset": false, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 0, - "u_headroom": 2.0, - "reset_sweep": "hard,soft,trained", - "bits_sweep": "0,4,2", - "baseline": false, - "bench": true, - "bench_warmup": 10, - "bench_iters": 50, - "bench_train_steps": 20, - "sampling_rate": 250.0 - } - }, - "zip": { - "name": "no_learn_reset.zip", - "files": 81, - "bytes": 12252281, - "MB": 12.3, - "sha256": "600844de2ff500a224c3e08c679649a712a823e9b59de96b2ebad2d66308f326" - } - }, - { - "key": "opt09_srif_softreset/reset_x_bits_full", - "tag": "reset_x_bits_full", - "script": "opt09_srif_softreset.py", - "hf_folder": "applied/opt09_srif_softreset", - "phase": 10, - "status": "ok", - "duration_s": 352.8, - "optimization_summary": { - "optimization": "srif_softreset", - "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", - "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", - "script": "opt09_srif_softreset.py", - "baseline_mode": false, - "method": "harmonic_matched", - "accuracy": { - "test_acc": 0.8478571428571429, - "test_target_acc": 0.8478571428571429, - "best_val_acc": 0.8692857142857143 - }, - "efficiency": { - "spikes_per_inference": 9121.73828125, - "syn_ops_per_inference": 4522878.1777597405, - "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.03686872471175707, - "syn_ops_per_inference_dense_fanout": 66099495.96428571, - "weight_sparsity": 0.7324707846410685, - "effective_ticks": 15.272142857142857, - "num_ticks": 100, - "membrane_bytes_per_inference": 451200, - "weight_bytes": 4907008, - "input_raster_bytes": null, - "train_ms_per_step": 97.55348075000256, - "infer_ms_per_sample": 0.6508080149998818, - "peak_vram_mb": 2830.13888, - "discarded_charge_per_reset": -0.40509077622122347 - }, - "optimization_specific": { - "reset_mode": "srif", - "learn_reset": true, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 0, - "u_scale": 1.0, - "u_headroom_requested": 2.0, - "u_headroom_actual": 0.0, - "u_threshold_level": 0, - "u_levels_above_threshold": null, - "reset_family": { - "reset_mode": "srif", - "learn_reset": true, - "num_spiking_sites": 4, - "extra_params": 8, - "extra_params_frac_of_weights": 6.5212854757929885e-06, - "extra_flops_per_tick_per_neuron": 0, - "learned_lam_per_layer": [ - 0.7039555907249451, - 0.7162760496139526, - 0.6912680864334106, - 0.8535905480384827 - ], - "learned_v_reset_per_layer": [ - 0.4652628004550934, - 0.5016207695007324, - 0.4343704283237457, - 0.916726291179657 - ] - }, - "reset_stats": { - "reset_mode": "srif", - "learn_reset": true, - "discarded_charge_per_reset": -0.40509077622122347, - "spikes_per_inference": 9121.73828125, - "syn_per_inference": 4631522.0, - "lam_per_site": [ - 0.7039555907249451, - 0.7162760496139526, - 0.6912680864334106, - 0.8535905480384827 - ], - "v_reset_per_site": [ - 0.4652628004550934, - 0.5016207695007324, - 0.4343704283237457, - 0.916726291179657 - ], - "u_bits": 0, - "membrane_saturation_frac": null, - "batches": 4, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null - }, - "reset_x_bits_sweep": { - "rows": [ - { - "reset_mode": "hard", - "u_bits": 0, - "acc": 0.7407142857142857, - "target_acc": 0.7407142857142858, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.15744831227474765, - "spikes_per_inference": 6255.1328125, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "hard", - "u_bits": 8, - "acc": 0.8028571428571428, - "target_acc": 0.8028571428571428, - "grid_headroom": 1.984375, - "grid_levels_above_thresh": 63, - "discarded_charge_per_reset": 0.1512959886308234, - "spikes_per_inference": 6588.09375, - "membrane_saturation_frac": 0.10686842032358157, - "membrane_memory_reduction_x": 4.0, - "acc_drop_vs_fp32": -0.062142857142857166 - }, - { - "reset_mode": "hard", - "u_bits": 4, - "acc": 0.8342857142857143, - "target_acc": 0.8342857142857143, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": 0.05941473367507645, - "spikes_per_inference": 6960.21875, - "membrane_saturation_frac": 0.16326490469858157, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.09357142857142864 - }, - { - "reset_mode": "hard", - "u_bits": 3, - "acc": 0.8107142857142857, - "target_acc": 0.8107142857142857, - "grid_headroom": 1.5, - "grid_levels_above_thresh": 1, - "discarded_charge_per_reset": 0.01613670709751149, - "spikes_per_inference": 7805.390625, - "membrane_saturation_frac": 0.18435373725620569, - "membrane_memory_reduction_x": 10.666666666666666, - "acc_drop_vs_fp32": -0.07000000000000006 - }, - { - "reset_mode": "hard", - "u_bits": 2, - "acc": 0.4085714285714286, - "target_acc": 0.4085714285714286, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 2916.671875, - "membrane_saturation_frac": 0.1515874335106383, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.3321428571428571 - }, - { - "reset_mode": "soft", - "u_bits": 0, - "acc": 0.8307142857142857, - "target_acc": 0.8307142857142857, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 7030.25, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "soft", - "u_bits": 8, - "acc": 0.87, - "target_acc": 0.87, - "grid_headroom": 1.984375, - "grid_levels_above_thresh": 63, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 7334.640625, - "membrane_saturation_frac": 0.1289720467641844, - "membrane_memory_reduction_x": 4.0, - "acc_drop_vs_fp32": -0.03928571428571426 - }, - { - "reset_mode": "soft", - "u_bits": 4, - "acc": 0.8657142857142857, - "target_acc": 0.8657142857142858, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 7372.984375, - "membrane_saturation_frac": 0.180172733820922, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.03499999999999992 - }, - { - "reset_mode": "soft", - "u_bits": 3, - "acc": 0.8271428571428572, - "target_acc": 0.8271428571428572, - "grid_headroom": 1.5, - "grid_levels_above_thresh": 1, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 7913.796875, - "membrane_saturation_frac": 0.1904026761968085, - "membrane_memory_reduction_x": 10.666666666666666, - "acc_drop_vs_fp32": 0.0035714285714285587 - }, - { - "reset_mode": "soft", - "u_bits": 2, - "acc": 0.4085714285714286, - "target_acc": 0.4085714285714286, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 2916.6796875, - "membrane_saturation_frac": 0.15158750277039007, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.42214285714285715 - }, - { - "reset_mode": "trained", - "u_bits": 0, - "acc": 0.8478571428571429, - "target_acc": 0.8478571428571429, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": -0.4054994834959055, - "spikes_per_inference": 9098.09375, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "trained", - "u_bits": 8, - "acc": 0.8957142857142857, - "target_acc": 0.8957142857142857, - "grid_headroom": 1.984375, - "grid_levels_above_thresh": 63, - "discarded_charge_per_reset": -0.41906449639349935, - "spikes_per_inference": 9753.5703125, - "membrane_saturation_frac": 0.23588444703014183, - "membrane_memory_reduction_x": 4.0, - "acc_drop_vs_fp32": -0.04785714285714282 - }, - { - "reset_mode": "trained", - "u_bits": 4, - "acc": 0.8957142857142857, - "target_acc": 0.8957142857142857, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": -0.4484818391381923, - "spikes_per_inference": 10158.6953125, - "membrane_saturation_frac": 0.3265235067597517, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.04785714285714282 - }, - { - "reset_mode": "trained", - "u_bits": 3, - "acc": 0.8785714285714286, - "target_acc": 0.8785714285714286, - "grid_headroom": 1.5, - "grid_levels_above_thresh": 1, - "discarded_charge_per_reset": -0.45839456771794834, - "spikes_per_inference": 11573.875, - "membrane_saturation_frac": 0.3351565962987589, - "membrane_memory_reduction_x": 10.666666666666666, - "acc_drop_vs_fp32": -0.030714285714285694 - }, - { - "reset_mode": "trained", - "u_bits": 2, - "acc": 0.44357142857142856, - "target_acc": 0.44357142857142856, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": -0.47925886040673965, - "spikes_per_inference": 12766.6015625, - "membrane_saturation_frac": 0.3268530446586879, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.4042857142857143 - } - ], - "by_mode": { - "hard": { - "fp32_acc": 0.7407142857142857, - "acc_by_bits": { - "0": 0.7407142857142857, - "8": 0.8028571428571428, - "4": 0.8342857142857143, - "3": 0.8107142857142857, - "2": 0.4085714285714286 - } - }, - "soft": { - "fp32_acc": 0.8307142857142857, - "acc_by_bits": { - "0": 0.8307142857142857, - "8": 0.87, - "4": 0.8657142857142857, - "3": 0.8271428571428572, - "2": 0.4085714285714286 - } - }, - "trained": { - "fp32_acc": 0.8478571428571429, - "acc_by_bits": { - "0": 0.8478571428571429, - "8": 0.8957142857142857, - "4": 0.8957142857142857, - "3": 0.8785714285714286, - "2": 0.44357142857142856 - } - } - } - }, - "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", - "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", - "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" - }, - "config": { - "method": "harmonic_matched", - "data_root": "/kaggle/working/data", - "subjects": "", - "blocks": "", - "limit": 0, - "drop_rest": true, - "resplit": "block", - "test_blocks": "6", - "class_weight": false, - "epochs": 60, - "batch_size": 64, - "lr": 0.002, - "weight_decay": 0.0005, - "grad_clip": 5.0, - "num_bins": 100, - "window_sec": 5.0, - "hidden": "512,256", - "freq_groups": 8, - "dropout": 0.3, - "spike_drop": 0.1, - "time_jitter": 2, - "label_smoothing": 0.05, - "no_batchnorm": false, - "binary_input": false, - "beta": 1.0, - "thresh": 1.0, - "window": 0.5, - "gain": 1.0, - "alpha": 0.9, - "readout": "spikecount", - "fake_quant": 0, - "amp": false, - "spike_reg": 0.0, - "event_eval": true, - "decision_margin": 2.0, - "export": false, - "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/reset_x_bits_full", - "repo_id": "UWU-R-13/SSVEP-SNN", - "push_hf": false, - "keep_epoch_weights": 1, - "no_resume": true, - "selftest": false, - "reset_mode": "srif", - "learn_reset": true, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 0, - "u_headroom": 2.0, - "reset_sweep": "hard,soft,trained", - "bits_sweep": "0,8,4,3,2", - "baseline": false, - "bench": true, - "bench_warmup": 10, - "bench_iters": 50, - "bench_train_steps": 20, - "sampling_rate": 250.0 - } - }, - "zip": { - "name": "reset_x_bits_full.zip", - "files": 81, - "bytes": 12269476, - "MB": 12.3, - "sha256": "44447e048efd1105904179a9e495f1c420dc4b70d30bbf5a28d57dc17386d626" - } - }, - { - "key": "opt09_srif_softreset/u_bits_2", - "tag": "u_bits_2", - "script": "opt09_srif_softreset.py", - "hf_folder": "applied/opt09_srif_softreset", - "phase": 10, - "status": "ok", - "duration_s": 303.1, - "optimization_summary": { - "optimization": "srif_softreset", - "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", - "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", - "script": "opt09_srif_softreset.py", - "baseline_mode": false, - "method": "harmonic_matched", - "accuracy": { - "test_acc": 0.025, - "test_target_acc": 0.025, - "best_val_acc": 0.025 - }, - "efficiency": { - "spikes_per_inference": 0.0, - "syn_ops_per_inference": 1578887.635551948, - "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.012870471257042566, - "syn_ops_per_inference_dense_fanout": 63155505.422077924, - "weight_sparsity": 0.7324707846410685, - "effective_ticks": 100.0, - "num_ticks": 100, - "membrane_bytes_per_inference": 0, - "weight_bytes": 4907008, - "input_raster_bytes": null, - "train_ms_per_step": 82.91583395002817, - "infer_ms_per_sample": 0.5732730162498001, - "peak_vram_mb": 2820.341248, - "discarded_charge_per_reset": 0.0 - }, - "optimization_specific": { - "reset_mode": "srif", - "learn_reset": true, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 2, - "u_scale": 1.0, - "u_headroom_requested": 2.0, - "u_headroom_actual": 1.0, - "u_threshold_level": 1, - "u_levels_above_threshold": 0, - "reset_family": { - "reset_mode": "srif", - "learn_reset": true, - "num_spiking_sites": 4, - "extra_params": 8, - "extra_params_frac_of_weights": 6.5212854757929885e-06, - "extra_flops_per_tick_per_neuron": 0, - "learned_lam_per_layer": [ - 0.5803266763687134, - 0.5803266763687134, - 0.5803266763687134, - 0.5803266763687134 - ], - "learned_v_reset_per_layer": [ - 0.0, - 0.0, - 0.0, - 0.0 - ] - }, - "reset_stats": { - "reset_mode": "srif", - "learn_reset": true, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 0.0, - "syn_per_inference": 1664173.09375, - "lam_per_site": [ - 0.5803266763687134, - 0.5803266763687134, - 0.5803266763687134, - 0.5803266763687134 - ], - "v_reset_per_site": [ - 0.0, - 0.0, - 0.0, - 0.0 - ], - "u_bits": 2, - "membrane_saturation_frac": 0.0, - "batches": 4, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0 - }, - "reset_x_bits_sweep": { - "rows": [ - { - "reset_mode": "hard", - "u_bits": 0, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 0.0, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "hard", - "u_bits": 4, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 0.0, - "membrane_saturation_frac": 0.0, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "hard", - "u_bits": 2, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 0.0, - "membrane_saturation_frac": 0.0, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "soft", - "u_bits": 0, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 0.0, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "soft", - "u_bits": 4, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 0.0, - "membrane_saturation_frac": 0.0, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "soft", - "u_bits": 2, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 0.0, - "membrane_saturation_frac": 0.0, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "trained", - "u_bits": 0, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 0.0, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "trained", - "u_bits": 4, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 0.0, - "membrane_saturation_frac": 0.0, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "trained", - "u_bits": 2, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 0.0, - "membrane_saturation_frac": 0.0, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.0 - } - ], - "by_mode": { - "hard": { - "fp32_acc": 0.025, - "acc_by_bits": { - "0": 0.025, - "4": 0.025, - "2": 0.025 - } - }, - "soft": { - "fp32_acc": 0.025, - "acc_by_bits": { - "0": 0.025, - "4": 0.025, - "2": 0.025 - } - }, - "trained": { - "fp32_acc": 0.025, - "acc_by_bits": { - "0": 0.025, - "4": 0.025, - "2": 0.025 - } - } - } - }, - "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", - "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", - "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" - }, - "config": { - "method": "harmonic_matched", - "data_root": "/kaggle/working/data", - "subjects": "", - "blocks": "", - "limit": 0, - "drop_rest": true, - "resplit": "block", - "test_blocks": "6", - "class_weight": false, - "epochs": 60, - "batch_size": 64, - "lr": 0.002, - "weight_decay": 0.0005, - "grad_clip": 5.0, - "num_bins": 100, - "window_sec": 5.0, - "hidden": "512,256", - "freq_groups": 8, - "dropout": 0.3, - "spike_drop": 0.1, - "time_jitter": 2, - "label_smoothing": 0.05, - "no_batchnorm": false, - "binary_input": false, - "beta": 1.0, - "thresh": 1.0, - "window": 0.5, - "gain": 1.0, - "alpha": 0.9, - "readout": "spikecount", - "fake_quant": 0, - "amp": false, - "spike_reg": 0.0, - "event_eval": true, - "decision_margin": 2.0, - "export": false, - "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/u_bits_2", - "repo_id": "UWU-R-13/SSVEP-SNN", - "push_hf": false, - "keep_epoch_weights": 1, - "no_resume": true, - "selftest": false, - "reset_mode": "srif", - "learn_reset": true, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 2, - "u_headroom": 2.0, - "reset_sweep": "hard,soft,trained", - "bits_sweep": "0,4,2", - "baseline": false, - "bench": true, - "bench_warmup": 10, - "bench_iters": 50, - "bench_train_steps": 20, - "sampling_rate": 250.0 - } - }, - "zip": { - "name": "u_bits_2.zip", - "files": 81, - "bytes": 10276157, - "MB": 10.3, - "sha256": "73e4f4b1f74a1efe218f865b59d03062b3c9d292f5b6a35747f4559d0736ef1f" - } - }, - { - "key": "opt09_srif_softreset/u_bits_4", - "tag": "u_bits_4", - "script": "opt09_srif_softreset.py", - "hf_folder": "applied/opt09_srif_softreset", - "phase": 10, - "status": "ok", - "duration_s": 345.7, - "optimization_summary": { - "optimization": "srif_softreset", - "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", - "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", - "script": "opt09_srif_softreset.py", - "baseline_mode": false, - "method": "harmonic_matched", - "accuracy": { - "test_acc": 0.92, - "test_target_acc": 0.92, - "best_val_acc": 0.935 - }, - "efficiency": { - "spikes_per_inference": 11915.01171875, - "syn_ops_per_inference": 4401361.720779221, - "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.035878170329285954, - "syn_ops_per_inference_dense_fanout": 65977979.5073052, - "weight_sparsity": 0.7324707846410685, - "effective_ticks": 21.25857142857143, - "num_ticks": 100, - "membrane_bytes_per_inference": 0, - "weight_bytes": 4907008, - "input_raster_bytes": null, - "train_ms_per_step": 98.06833220000044, - "infer_ms_per_sample": 0.650274362812695, - "peak_vram_mb": 2834.694656, - "discarded_charge_per_reset": -0.7078402399200352 - }, - "optimization_specific": { - "reset_mode": "srif", - "learn_reset": true, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 4, - "u_scale": 0.25, - "u_headroom_requested": 2.0, - "u_headroom_actual": 1.75, - "u_threshold_level": 4, - "u_levels_above_threshold": 3, - "reset_family": { - "reset_mode": "srif", - "learn_reset": true, - "num_spiking_sites": 4, - "extra_params": 8, - "extra_params_frac_of_weights": 6.5212854757929885e-06, - "extra_flops_per_tick_per_neuron": 0, - "learned_lam_per_layer": [ - 0.5789579153060913, - 0.5431995391845703, - 0.5589428544044495, - 0.7961611747741699 - ], - "learned_v_reset_per_layer": [ - 0.6194214224815369, - 0.877713143825531, - 0.6152849197387695, - 0.9643499255180359 - ] - }, - "reset_stats": { - "reset_mode": "srif", - "learn_reset": true, - "discarded_charge_per_reset": -0.7078402399200352, - "spikes_per_inference": 11915.01171875, - "syn_per_inference": 4434214.6875, - "lam_per_site": [ - 0.5789579153060913, - 0.5431995391845703, - 0.5589428544044495, - 0.7961611747741699 - ], - "v_reset_per_site": [ - 0.6194214224815369, - 0.877713143825531, - 0.6152849197387695, - 0.9643499255180359 - ], - "u_bits": 4, - "membrane_saturation_frac": 0.2822270126883865, - "batches": 4, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3 - }, - "reset_x_bits_sweep": { - "rows": [ - { - "reset_mode": "hard", - "u_bits": 0, - "acc": 0.295, - "target_acc": 0.295, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.08765906069564103, - "spikes_per_inference": 4919.84375, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "hard", - "u_bits": 4, - "acc": 0.7471428571428571, - "target_acc": 0.7471428571428571, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": 0.013719326346275418, - "spikes_per_inference": 5178.40625, - "membrane_saturation_frac": 0.12054306571365248, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.4521428571428571 - }, - { - "reset_mode": "hard", - "u_bits": 2, - "acc": 0.04, - "target_acc": 0.04, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 428.6640625, - "membrane_saturation_frac": 0.06521574412677306, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.255 - }, - { - "reset_mode": "soft", - "u_bits": 0, - "acc": 0.43785714285714283, - "target_acc": 0.43785714285714283, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 5315.078125, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "soft", - "u_bits": 4, - "acc": 0.7878571428571428, - "target_acc": 0.7878571428571428, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 5275.203125, - "membrane_saturation_frac": 0.1267951435062057, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.35 - }, - { - "reset_mode": "soft", - "u_bits": 2, - "acc": 0.04, - "target_acc": 0.04, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 428.6640625, - "membrane_saturation_frac": 0.06521574412677306, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.39785714285714285 - }, - { - "reset_mode": "trained", - "u_bits": 0, - "acc": 0.8771428571428571, - "target_acc": 0.8771428571428571, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": -0.672806146062752, - "spikes_per_inference": 10959.46875, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "trained", - "u_bits": 4, - "acc": 0.92, - "target_acc": 0.92, - "grid_headroom": 1.75, - "grid_levels_above_thresh": 3, - "discarded_charge_per_reset": -0.70911303501342, - "spikes_per_inference": 11931.078125, - "membrane_saturation_frac": 0.2747938137189716, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.04285714285714293 - }, - { - "reset_mode": "trained", - "u_bits": 2, - "acc": 0.03785714285714286, - "target_acc": 0.03785714285714286, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": -0.7804550254675015, - "spikes_per_inference": 6802.96875, - "membrane_saturation_frac": 0.12682423260195036, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.8392857142857143 - } - ], - "by_mode": { - "hard": { - "fp32_acc": 0.295, - "acc_by_bits": { - "0": 0.295, - "4": 0.7471428571428571, - "2": 0.04 - } - }, - "soft": { - "fp32_acc": 0.43785714285714283, - "acc_by_bits": { - "0": 0.43785714285714283, - "4": 0.7878571428571428, - "2": 0.04 - } - }, - "trained": { - "fp32_acc": 0.8771428571428571, - "acc_by_bits": { - "0": 0.8771428571428571, - "4": 0.92, - "2": 0.03785714285714286 - } - } - } - }, - "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", - "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", - "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" - }, - "config": { - "method": "harmonic_matched", - "data_root": "/kaggle/working/data", - "subjects": "", - "blocks": "", - "limit": 0, - "drop_rest": true, - "resplit": "block", - "test_blocks": "6", - "class_weight": false, - "epochs": 60, - "batch_size": 64, - "lr": 0.002, - "weight_decay": 0.0005, - "grad_clip": 5.0, - "num_bins": 100, - "window_sec": 5.0, - "hidden": "512,256", - "freq_groups": 8, - "dropout": 0.3, - "spike_drop": 0.1, - "time_jitter": 2, - "label_smoothing": 0.05, - "no_batchnorm": false, - "binary_input": false, - "beta": 1.0, - "thresh": 1.0, - "window": 0.5, - "gain": 1.0, - "alpha": 0.9, - "readout": "spikecount", - "fake_quant": 0, - "amp": false, - "spike_reg": 0.0, - "event_eval": true, - "decision_margin": 2.0, - "export": false, - "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/u_bits_4", - "repo_id": "UWU-R-13/SSVEP-SNN", - "push_hf": false, - "keep_epoch_weights": 1, - "no_resume": true, - "selftest": false, - "reset_mode": "srif", - "learn_reset": true, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 4, - "u_headroom": 2.0, - "reset_sweep": "hard,soft,trained", - "bits_sweep": "0,4,2", - "baseline": false, - "bench": true, - "bench_warmup": 10, - "bench_iters": 50, - "bench_train_steps": 20, - "sampling_rate": 250.0 - } - }, - "zip": { - "name": "u_bits_4.zip", - "files": 81, - "bytes": 12262238, - "MB": 12.3, - "sha256": "e272a8770dc758e21ec340f0e670fb3661af3f7c3d82166c465f0ded0a39437c" - } - }, - { - "key": "opt09_srif_softreset/u_headroom_1.0", - "tag": "u_headroom_1.0", - "script": "opt09_srif_softreset.py", - "hf_folder": "applied/opt09_srif_softreset", - "phase": 10, - "status": "ok", - "duration_s": 377.0, - "optimization_summary": { - "optimization": "srif_softreset", - "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", - "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", - "script": "opt09_srif_softreset.py", - "baseline_mode": false, - "method": "harmonic_matched", - "accuracy": { - "test_acc": 0.027142857142857142, - "test_target_acc": 0.027142857142857142, - "best_val_acc": 0.9271428571428572 - }, - "efficiency": { - "spikes_per_inference": 42530.8515625, - "syn_ops_per_inference": 8441536.425324677, - "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.0688120861048091, - "syn_ops_per_inference_dense_fanout": 70018154.21185066, - "weight_sparsity": 0.7324707846410685, - "effective_ticks": 100.0, - "num_ticks": 100, - "membrane_bytes_per_inference": 0, - "weight_bytes": 4907008, - "input_raster_bytes": null, - "train_ms_per_step": 109.88897699999143, - "infer_ms_per_sample": 0.7659782600001108, - "peak_vram_mb": 2864.751104, - "discarded_charge_per_reset": -1.0151342772222465 - }, - "optimization_specific": { - "reset_mode": "srif", - "learn_reset": true, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 4, - "u_scale": 0.14285714285714285, - "u_headroom_requested": 1.0, - "u_headroom_actual": 1.0, - "u_threshold_level": 7, - "u_levels_above_threshold": 0, - "reset_family": { - "reset_mode": "srif", - "learn_reset": true, - "num_spiking_sites": 4, - "extra_params": 8, - "extra_params_frac_of_weights": 6.5212854757929885e-06, - "extra_flops_per_tick_per_neuron": 0, - "learned_lam_per_layer": [ - 0.5803266763687134, - 0.5803266763687134, - 0.5803266763687134, - 0.5803266763687134 - ], - "learned_v_reset_per_layer": [ - 0.5309860706329346, - 0.9011129140853882, - 1.1452094316482544, - 1.5818078517913818 - ] - }, - "reset_stats": { - "reset_mode": "srif", - "learn_reset": true, - "discarded_charge_per_reset": -1.0151342772222465, - "spikes_per_inference": 42530.8515625, - "syn_per_inference": 8537739.03125, - "lam_per_site": [ - 0.5803266763687134, - 0.5803266763687134, - 0.5803266763687134, - 0.5803266763687134 - ], - "v_reset_per_site": [ - 0.5309860706329346, - 0.9011129140853882, - 1.1452094316482544, - 1.5818078517913818 - ], - "u_bits": 4, - "membrane_saturation_frac": 0.5931137799202127, - "batches": 4, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0 - }, - "reset_x_bits_sweep": { - "rows": [ - { - "reset_mode": "hard", - "u_bits": 0, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.1543459879080405, - "spikes_per_inference": 8712.734375, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "hard", - "u_bits": 4, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 9348.4375, - "membrane_saturation_frac": 0.37194453679078016, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "hard", - "u_bits": 2, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 4515.7578125, - "membrane_saturation_frac": 0.10904539284131205, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "soft", - "u_bits": 0, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 9918.25, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "soft", - "u_bits": 4, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 9348.4375, - "membrane_saturation_frac": 0.37194453679078016, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "soft", - "u_bits": 2, - "acc": 0.025, - "target_acc": 0.025, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 4515.7578125, - "membrane_saturation_frac": 0.10904539284131205, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "trained", - "u_bits": 0, - "acc": 0.027142857142857142, - "target_acc": 0.027142857142857142, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": -0.8385291672512332, - "spikes_per_inference": 38981.2578125, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "trained", - "u_bits": 4, - "acc": 0.027142857142857142, - "target_acc": 0.027142857142857142, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": -1.0162284200455858, - "spikes_per_inference": 42474.8671875, - "membrane_saturation_frac": 0.5922369514627659, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "trained", - "u_bits": 2, - "acc": 0.02642857142857143, - "target_acc": 0.02642857142857143, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": -0.9949134701506006, - "spikes_per_inference": 9275.1953125, - "membrane_saturation_frac": 0.1492860704787234, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.0007142857142857124 - } - ], - "by_mode": { - "hard": { - "fp32_acc": 0.025, - "acc_by_bits": { - "0": 0.025, - "4": 0.025, - "2": 0.025 - } - }, - "soft": { - "fp32_acc": 0.025, - "acc_by_bits": { - "0": 0.025, - "4": 0.025, - "2": 0.025 - } - }, - "trained": { - "fp32_acc": 0.027142857142857142, - "acc_by_bits": { - "0": 0.027142857142857142, - "4": 0.027142857142857142, - "2": 0.02642857142857143 - } - } - } + 10.0, + 20.0, + 30.0, + 40.0, + 50.0, + 60.0, + 70.0, + 80.0, + 90.0, + 100.0 + ] }, - "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", - "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", - "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" + "acc_fc_only": 0.9442857142857143, + "acc_ic_only": 0.9457142857142857, + "acc_fused": 0.9478571428571428, + "acc_early_exit": 0.3607142857142857, + "syn_ops_saved_frac": 0.4481542353621958, + "syn_per_inference_early_exit": 2023700.4034090908, + "anytime_acc": { + "0.25": 0.6385714285714286, + "0.5": 0.8514285714285714, + "0.75": 0.92, + "1.0": 0.9442857142857143 + }, + "pareto": [ + { + "conf": 0.5, + "mean_ticks": 4.968571428571429, + "acc": 0.20714285714285716, + "syn_ops": 1885785.8603896103 + }, + { + "conf": 0.7, + "mean_ticks": 5.753571428571429, + "acc": 0.24357142857142858, + "syn_ops": 1916618.163961039 + }, + { + "conf": 0.8, + "mean_ticks": 6.652142857142858, + "acc": 0.27714285714285714, + "syn_ops": 1954430.0349025973 + }, + { + "conf": 0.9, + "mean_ticks": 8.816428571428572, + "acc": 0.3607142857142857, + "syn_ops": 2023700.987012987 + }, + { + "conf": 0.95, + "mean_ticks": 11.332142857142857, + "acc": 0.4592857142857143, + "syn_ops": 2087305.1574675327 + }, + { + "conf": 0.99, + "mean_ticks": 15.734285714285715, + "acc": 0.59, + "syn_ops": 2174608.9837662335 + } + ] }, "config": { "method": "harmonic_matched", @@ -7300,278 +4450,163 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/u_headroom_1.0", - "repo_id": "UWU-R-13/SSVEP-SNN", - "push_hf": false, - "keep_epoch_weights": 1, - "no_resume": true, - "selftest": false, - "reset_mode": "srif", - "learn_reset": true, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 4, - "u_headroom": 1.0, - "reset_sweep": "hard,soft,trained", - "bits_sweep": "0,4,2", "baseline": false, "bench": true, "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, + "anytime_fracs": "1.0", + "anytime_weights": "1.0", + "ic_layer": 0, + "ic_loss_weight": 0.3, + "bayes_fusion": true, + "fusion_prior_weight": 1.0, + "conf_threshold": 0.9, + "conf_temp": 2.0, + "conf_sweep": "0.5,0.7,0.8,0.9,0.95,0.99", + "hub_dir": "/kaggle/working/hub/opt02_seenn_bayes/anytime_off", + "repo_id": "UWU-R-13/SSVEP-SNN", + "push_hf": false, + "keep_epoch_weights": 1, + "no_resume": true, + "selftest": false, "sampling_rate": 250.0 } }, "zip": { - "name": "u_headroom_1.0.zip", + "name": "anytime_off.zip", "files": 81, - "bytes": 12376323, - "MB": 12.4, - "sha256": "bdc988664ace513f808a1701b953a16837db9aae49686a1a8ebbda310392ac05" + "bytes": 12635793, + "MB": 12.6, + "sha256": "66516984c6682ff65f875d904f51d3005145706f26d93d2bfdcd15b57b1a0817" } }, { - "key": "opt09_srif_softreset/u_headroom_4.0", - "tag": "u_headroom_4.0", - "script": "opt09_srif_softreset.py", - "hf_folder": "applied/opt09_srif_softreset", - "phase": 10, + "key": "opt02_seenn_bayes/anytime_uniform", + "tag": "anytime_uniform", + "script": "opt02_seenn_bayes.py", + "hf_folder": "applied/opt02_seenn_bayes", + "phase": 6, "status": "ok", - "duration_s": 327.3, + "duration_s": 795.3, "optimization_summary": { - "optimization": "srif_softreset", - "research_section": "4. Membrane-Potential Memory Wall -- Soft Reset Integrate-and-Fire (SRIF), dynamic reset potential", - "reference": "Guo et al., 'Reducing Information Loss for Spiking Neural Networks' (SRIF), ECCV 2022; research.md S4 (stacks with MINT / SpQuant-SNN membrane quantization)", - "script": "opt09_srif_softreset.py", + "optimization": "seenn_early_exit_bayesian_fusion", + "research_section": "2. Temporal-dimension reduction", + "reference": "SEENN: Towards Temporal Spiking Early-Exit Neural Networks, arXiv:2304.01230 (NeurIPS 2023); BayesianSpikeFusion, Front. Neurosci. 2024 (PMC11330889)", + "script": "opt02_seenn_bayes.py", "baseline_mode": false, "method": "harmonic_matched", "accuracy": { - "test_acc": 0.8307142857142857, - "test_target_acc": 0.8307142857142857, - "best_val_acc": 0.9214285714285714 + "test_acc": 0.9135714285714286, + "test_target_acc": 0.9135714285714286, + "best_val_acc": 0.9128571428571428 }, "efficiency": { - "spikes_per_inference": 1344.265625, - "syn_ops_per_inference": 1891052.4415584416, - "dense_macs_per_inference": 122675200.0, - "event_fraction_of_dense": 0.015415116026372418, - "syn_ops_per_inference_dense_fanout": 63467670.228084415, + "spikes_per_inference": null, + "syn_ops_per_inference": 3733221.637987013, + "dense_macs_per_inference": 123955200.0, + "event_fraction_of_dense": 0.03011750727671782, + "syn_ops_per_inference_dense_fanout": 65309839.42451298, "weight_sparsity": 0.7324707846410685, - "effective_ticks": 30.065714285714286, + "effective_ticks": 7.942142857142857, "num_ticks": 100, - "membrane_bytes_per_inference": 0, + "membrane_bytes_per_inference": 451200, "weight_bytes": 4907008, "input_raster_bytes": null, - "train_ms_per_step": 89.94520204996661, - "infer_ms_per_sample": 0.5865823306251627, - "peak_vram_mb": 2821.165568, - "discarded_charge_per_reset": -0.30676767663002447 + "train_ms_per_step": 258.8063955307007, + "infer_ms_per_sample": 0.646195893910662, + "peak_vram_mb": 11064.903168, + "syn_ops_per_inference_early_exit": 1895163.5113636365 }, "optimization_specific": { - "reset_mode": "srif", - "learn_reset": true, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 4, - "u_scale": 0.5, - "u_headroom_requested": 4.0, - "u_headroom_actual": 3.5, - "u_threshold_level": 2, - "u_levels_above_threshold": 5, - "reset_family": { - "reset_mode": "srif", - "learn_reset": true, - "num_spiking_sites": 4, - "extra_params": 8, - "extra_params_frac_of_weights": 6.5212854757929885e-06, - "extra_flops_per_tick_per_neuron": 0, - "learned_lam_per_layer": [ - 0.5882294178009033, - 0.5828343033790588, - 0.5932866930961609, - 0.8433560729026794 + "seenn_enabled": true, + "bayes_fusion_enabled": true, + "conf_threshold": 0.9, + "conf_temp": 2.0, + "anytime_fracs": "0.25,0.5,0.75,1.0", + "anytime_weights": "1.0,1.0,1.0,1.0", + "ic_loss_weight": 0.3, + "ic_layer": 0, + "mean_exit_tick": 7.942142857142857, + "mean_exit_ms": 397.1071428571429, + "ticks_saved_frac": 0.9205785714285715, + "exit_tick_histogram": { + "counts": [ + 1044, + 293, + 51, + 9, + 3, + 0, + 0, + 0, + 0, + 0 ], - "learned_v_reset_per_layer": [ - 0.09568826854228973, - 0.24902032315731049, - 0.11872328817844391, - 0.9482309222221375 + "edges": [ + 0.0, + 10.0, + 20.0, + 30.0, + 40.0, + 50.0, + 60.0, + 70.0, + 80.0, + 90.0, + 100.0 ] }, - "reset_stats": { - "reset_mode": "srif", - "learn_reset": true, - "discarded_charge_per_reset": -0.30676767663002447, - "spikes_per_inference": 1344.265625, - "syn_per_inference": 1978610.34375, - "lam_per_site": [ - 0.5882294178009033, - 0.5828343033790588, - 0.5932866930961609, - 0.8433560729026794 - ], - "v_reset_per_site": [ - 0.09568826854228973, - 0.24902032315731049, - 0.11872328817844391, - 0.9482309222221375 - ], - "u_bits": 4, - "membrane_saturation_frac": 0.11609094498005319, - "batches": 4, - "grid_headroom": 3.5, - "grid_levels_above_thresh": 5 + "acc_fc_only": 0.9135714285714286, + "acc_ic_only": 0.9235714285714286, + "acc_fused": 0.9257142857142857, + "acc_early_exit": 0.38357142857142856, + "syn_ops_saved_frac": 0.4923517285768423, + "syn_per_inference_early_exit": 1895163.5113636365, + "anytime_acc": { + "0.25": 0.6114285714285714, + "0.5": 0.7957142857142857, + "0.75": 0.8764285714285714, + "1.0": 0.9135714285714286 }, - "reset_x_bits_sweep": { - "rows": [ - { - "reset_mode": "hard", - "u_bits": 0, - "acc": 0.645, - "target_acc": 0.645, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.11399426552829378, - "spikes_per_inference": 1360.8203125, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "hard", - "u_bits": 4, - "acc": 0.8457142857142858, - "target_acc": 0.8457142857142858, - "grid_headroom": 3.5, - "grid_levels_above_thresh": 5, - "discarded_charge_per_reset": 0.032880633416589214, - "spikes_per_inference": 788.109375, - "membrane_saturation_frac": 0.07383775210549645, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.20071428571428573 - }, - { - "reset_mode": "hard", - "u_bits": 2, - "acc": 0.21357142857142858, - "target_acc": 0.21357142857142858, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 152.6796875, - "membrane_saturation_frac": 0.04726756427304965, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.43142857142857144 - }, - { - "reset_mode": "soft", - "u_bits": 0, - "acc": 0.7114285714285714, - "target_acc": 0.7114285714285714, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 1499.1796875, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "soft", - "u_bits": 4, - "acc": 0.8435714285714285, - "target_acc": 0.8435714285714285, - "grid_headroom": 3.5, - "grid_levels_above_thresh": 5, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 821.4296875, - "membrane_saturation_frac": 0.07612069204343971, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.13214285714285712 - }, - { - "reset_mode": "soft", - "u_bits": 2, - "acc": 0.21357142857142858, - "target_acc": 0.21357142857142858, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": 0.0, - "spikes_per_inference": 152.6796875, - "membrane_saturation_frac": 0.04726756427304965, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.49785714285714283 - }, - { - "reset_mode": "trained", - "u_bits": 0, - "acc": 0.6678571428571428, - "target_acc": 0.6678571428571428, - "grid_headroom": 0.0, - "grid_levels_above_thresh": null, - "discarded_charge_per_reset": -0.3709850527872548, - "spikes_per_inference": 2268.5703125, - "membrane_saturation_frac": null, - "membrane_memory_reduction_x": 1.0, - "acc_drop_vs_fp32": 0.0 - }, - { - "reset_mode": "trained", - "u_bits": 4, - "acc": 0.8307142857142857, - "target_acc": 0.8307142857142857, - "grid_headroom": 3.5, - "grid_levels_above_thresh": 5, - "discarded_charge_per_reset": -0.32191684826040434, - "spikes_per_inference": 1345.703125, - "membrane_saturation_frac": 0.11365830008865249, - "membrane_memory_reduction_x": 8.0, - "acc_drop_vs_fp32": -0.16285714285714292 - }, - { - "reset_mode": "trained", - "u_bits": 2, - "acc": 0.16142857142857142, - "target_acc": 0.16142857142857142, - "grid_headroom": 1.0, - "grid_levels_above_thresh": 0, - "discarded_charge_per_reset": -0.7320368063795608, - "spikes_per_inference": 868.6796875, - "membrane_saturation_frac": 0.06705091976950354, - "membrane_memory_reduction_x": 16.0, - "acc_drop_vs_fp32": 0.5064285714285715 - } - ], - "by_mode": { - "hard": { - "fp32_acc": 0.645, - "acc_by_bits": { - "0": 0.645, - "4": 0.8457142857142858, - "2": 0.21357142857142858 - } - }, - "soft": { - "fp32_acc": 0.7114285714285714, - "acc_by_bits": { - "0": 0.7114285714285714, - "4": 0.8435714285714285, - "2": 0.21357142857142858 - } - }, - "trained": { - "fp32_acc": 0.6678571428571428, - "acc_by_bits": { - "0": 0.6678571428571428, - "4": 0.8307142857142857, - "2": 0.16142857142857142 - } - } + "pareto": [ + { + "conf": 0.5, + "mean_ticks": 4.28, + "acc": 0.24928571428571428, + "syn_ops": 1762351.5365259738 + }, + { + "conf": 0.7, + "mean_ticks": 4.979285714285714, + "acc": 0.27285714285714285, + "syn_ops": 1789906.663961039 + }, + { + "conf": 0.8, + "mean_ticks": 5.918571428571428, + "acc": 0.3028571428571429, + "syn_ops": 1827518.5 + }, + { + "conf": 0.9, + "mean_ticks": 7.942142857142857, + "acc": 0.38357142857142856, + "syn_ops": 1895163.6818181819 + }, + { + "conf": 0.95, + "mean_ticks": 10.063571428571429, + "acc": 0.45357142857142857, + "syn_ops": 1956706.423701299 + }, + { + "conf": 0.99, + "mean_ticks": 14.371428571428572, + "acc": 0.5792857142857143, + "syn_ops": 2056811.2378246754 } - }, - "mechanism": "V = u - s*((1-lam)*u + lam*thresh) + s*v_r; lam=0,v_r=0 is the baseline hard reset exactly, lam=1,v_r=0 discards zero charge", - "cost": "2 scalars per spiking layer; identical FMA count per tick, so the reset change is free at inference time", - "caveat": "the sweep swaps the reset on ALREADY-TRAINED weights, which under-states what training with each reset would give; and a charge-conserving reset can raise the spike count, so read spikes_per_inference next to the accuracy" + ] }, "config": { "method": "harmonic_matched", @@ -7611,34 +4646,35 @@ "decision_margin": 2.0, "export": false, "seed": 1234, - "hub_dir": "/kaggle/working/hub/opt09_srif_softreset/u_headroom_4.0", - "repo_id": "UWU-R-13/SSVEP-SNN", - "push_hf": false, - "keep_epoch_weights": 1, - "no_resume": true, - "selftest": false, - "reset_mode": "srif", - "learn_reset": true, - "lam_init": 0.9, - "v_reset_init": 0.0, - "u_bits": 4, - "u_headroom": 4.0, - "reset_sweep": "hard,soft,trained", - "bits_sweep": "0,4,2", "baseline": false, "bench": true, "bench_warmup": 10, "bench_iters": 50, "bench_train_steps": 20, + "anytime_fracs": "0.25,0.5,0.75,1.0", + "anytime_weights": "1,1,1,1", + "ic_layer": 0, + "ic_loss_weight": 0.3, + "bayes_fusion": true, + "fusion_prior_weight": 1.0, + "conf_threshold": 0.9, + "conf_temp": 2.0, + "conf_sweep": "0.5,0.7,0.8,0.9,0.95,0.99", + "hub_dir": "/kaggle/working/hub/opt02_seenn_bayes/anytime_uniform", + "repo_id": "UWU-R-13/SSVEP-SNN", + "push_hf": false, + "keep_epoch_weights": 1, + "no_resume": true, + "selftest": false, "sampling_rate": 250.0 } }, "zip": { - "name": "u_headroom_4.0.zip", + "name": "anytime_uniform.zip", "files": 81, - "bytes": 12340512, - "MB": 12.3, - "sha256": "3394974815eca792e339c4516e7ced59d4a7259d00e7f9b0a8906fdcb18cea8d" + "bytes": 12645548, + "MB": 12.6, + "sha256": "617f732f2673439369572a52f68eacbcfcdf049fae4261bf61894a789918649e" } } ] \ No newline at end of file