Skip to content

fix: misc module cleanup — deprecate cpu_optimizer, remove dead imports#36

Closed
nathanhubens wants to merge 1 commit into
masterfrom
fix/misc-cleanup
Closed

fix: misc module cleanup — deprecate cpu_optimizer, remove dead imports#36
nathanhubens wants to merge 1 commit into
masterfrom
fix/misc-cleanup

Conversation

@nathanhubens
Copy link
Copy Markdown
Collaborator

Summary

Phase 1 of misc module revamp.

Changes

  • cpu_optimizer: Replace broken accelerate_model_for_cpu with optimize_for_cpu
    • New API: optimize_for_cpu(model, sample, backend="compile") using torch.compile
    • Old function deprecated with shim (backward compatible for fasterrecipes)
    • 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)
  • Remove unused import torch.nn.functional as F from bn_folding and fc_decomposer
  • Add conv_decomposer.ipynb and cpu_optimizer.ipynb to _quarto.yml sidebar (were invisible)
  • Add cpu_optimizer to misc/all.py exports (was missing)
  • Fix rank_ratiopercent_removed doc bug in fc_decomposer tutorial

Test plan

  • nbdev-test full suite passes (including new cpu_optimizer tests)
  • Backward compat: accelerate_model_for_cpu still works (emits DeprecationWarning)

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
@nathanhubens
Copy link
Copy Markdown
Collaborator Author

Included in #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant