-
Notifications
You must be signed in to change notification settings - Fork 27
Create model export automation scripts #668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Create model export automation scripts #668
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces automation for exporting trained nanoGPT models to ExecuTorch format. The implementation adds a new model_exports.executorch module with export utilities, integrates automatic export into the experiment runner and hyperparameter search scripts, and provides tooling for profiling exported models on Android devices.
Key changes:
- New ExecuTorch export module with checkpoint-to-PTE conversion and smoke testing
- Automated export hooks in experiment and hyperparameter search workflows
- Android device profiling utilities via ADB
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| optimization_and_search/run_experiments.py | Added CLI flags for ExecuTorch export and automatic export after each experiment run |
| model_exports/executorch/exporter.py | Core export logic including checkpoint preparation, ExecuTorch program generation, and smoke tests |
| model_exports/executorch/export_checkpoint.py | CLI interface for standalone checkpoint export |
| model_exports/executorch/init.py | Module initialization and public API exports |
| hyperparam_search.py | Integrated ExecuTorch export options and hooks into hyperparameter search trials |
| hardware_targets/android/profile_pte.py | Android device profiling via ADB with metric extraction |
| hardware_targets/README.md | Documentation for hardware profiling tools |
| demos/export_ckpt_to_executorch.sh | Shell script wrapper for checkpoint export |
| demos/README.md | Documentation for ExecuTorch export demo |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| '--executorch-export', | ||
| dest='executorch_export', | ||
| action='store_true', | ||
| default=True, |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting default=True with action='store_true' is redundant and can cause confusion. When action='store_true', the default is already False. To enable by default while still allowing --no-executorch-export to disable, remove the default=True from this argument - the default behavior is controlled by the --no-executorch-export flag's action='store_false'.
| default=True, |
| "--executorch_export", | ||
| dest="executorch_export", | ||
| action='store_true', | ||
| default=True, |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as in run_experiments.py: default=True with action='store_true' is redundant. Remove the default=True parameter.
| default=True, |
No description provided.