feat: decomposer UX — energy_threshold, layers/exclude, HOOI convergence#37
Closed
nathanhubens wants to merge 2 commits into
Closed
feat: decomposer UX — energy_threshold, layers/exclude, HOOI convergence#37nathanhubens wants to merge 2 commits into
nathanhubens wants to merge 2 commits into
Conversation
Phase 1 of misc module revamp: - Remove unused `import F` from bn_folding and fc_decomposer - Replace cpu_optimizer with optimize_for_cpu (torch.compile backend) - Old accelerate_model_for_cpu deprecated with shim - Fixed bug: torch.jit.script doesn't use example_input (was dead param) - Removed dependency on deprecated optimize_for_mobile - Added tests (was skip_exec with zero coverage) - Add conv_decomposer.ipynb and cpu_optimizer.ipynb to _quarto.yml sidebar - Add cpu_optimizer to misc/all.py exports - Fix rank_ratio → percent_removed doc bug in fc_decomposer tutorial
Phase 2 of misc module revamp: FC_Decomposer + Conv_Decomposer: - Add energy_threshold: auto rank selection via singular value energy retention (e.g., 0.99 keeps 99% of energy). Mutually exclusive with percent_removed. - Add layers/exclude: per-layer control using exact layer names (matching Sparsifier dict-based pattern, not regex) - Shared helpers: _rank_from_energy, _should_decompose Conv_Decomposer: - Expose n_iter (default 10, was hardcoded 5) and tol (1e-4) for HOOI - Early stopping: HOOI exits when factor matrices converge within tol Traversal refactored from recursive _modules to named_modules() + parent replacement (cleaner, handles nested modules correctly). All backward compatible — new params have defaults matching old behavior.
4 tasks
Collaborator
Author
|
Included in #38 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 2 of misc module revamp. Three UX improvements for both decomposers.
1.
energy_threshold— automatic rank selection2.
layers/exclude— per-layer control3. HOOI convergence (Conv_Decomposer)
All backward compatible — defaults match old behavior.
Test plan
nbdev-testsuite passes