Refactor pruner v5: streamline from 16 to 6 core methods
CharlesCNorton
5a44526
Removed redundant/rarely-useful methods:
- quantize, annealing, topology, structural, sensitivity
- weight_sharing, depth, gate_subst, symmetry, fanin
- exhaustive_sparse
Kept core methods:
- magnitude: greedy weight reduction
- zero: try zeroing each weight
- evolutionary: GPU-parallel genetic algorithm
- exhaustive_mag: provably optimal for small circuits
- architecture: search flat 2-layer alternatives
Added new method:
- compositional: exploits known-optimal components (XOR mag-7,
XOR3 mag-10) to reduce search space from 10^15 to ~2000 combos
Code reduced from 3751 to 1388 lines (63% reduction).
Rename OPTIMALITY_INDEX to MAGNITUDE_INDEX, add CIRCUITS_TODO, add architecture search
CharlesCNorton
329d4e4
- Rename OPTIMALITY_INDEX.md to MAGNITUDE_INDEX.md
- Change wording from "optimal" to "minimum magnitude found"
- Add CIRCUITS_TODO.md with 46 circuits to build
- Add prune_architecture method for flat 2-layer architecture search
Add optimality index and adaptive model wrapper
CharlesCNorton
41bc964
- OPTIMALITY_INDEX.md: catalog of all circuits tested with magnitude results
- prune.py: wrapper now tries multiple calling conventions (*args, list, tensor)
Add flexible safetensors file loading
CharlesCNorton
9c3e925
- Add --weights argument to specify custom .safetensors file
- Auto-discover any .safetensors file if model.safetensors not found
- Update discover_circuits to accept any .safetensors file
Remove Coq export functionality from pruner
CharlesCNorton
1721000
- Remove export_coq config option and coq_output_dir
- Remove export_coq() function
- Remove --export-coq CLI argument
- Update method count in docstring (17 -> 15)
Add magnitude-ordered exhaustive search with GPU-vectorized evaluation
CharlesCNorton
43d198d
- Exhaustive search now searches by magnitude level (0, 1, 2, ...) and stops
at first valid magnitude, finding ALL solutions at that level
- Add matrix-style weight detection for circuits using layer1.weight [H,I] format
- Add GPU-vectorized evaluation for matrix-style circuits (massive speedup)
- Add MUX/DEMUX native forward function detection
- Report full metrics for solutions: magnitude, nonzero count, max|w|, sparsity
- Fix CIRCUITS_PATH to point to threshold-logic-circuits
Add exhaustive search methods for provable optimality
CharlesCNorton
ff1ca32
- Add prune_exhaustive: searches ALL weight combinations in range
to find globally optimal magnitude (not just local improvements)
- Rewrite prune_neuron to be truly exhaustive: for each neuron,
searches all weight configs for remaining neurons to prove
whether neuron is necessary (not just greedy zeroing)
- Add config options: exhaustive_range, exhaustive_max_params
- Add method aliases: 'exh', 'brute' for exhaustive search
These methods enable provable optimality for small circuits where
evolutionary/annealing methods get stuck in local minima.