armdeveloperecosystem/sme-executorch-profiling/export-model
Claude Code and agent skill by armdeveloperecosystem/sme-executorch-profiling
- community
Checking that the SKILL.md file is still in the repository.
Export a registered PyTorch model to an ExecuTorch .pte artifact for SME2 profiling. Use when Codex needs to convert toy_cnn, EfficientSAM, EdgeTAM image encoder, or another registered model to portable ExecuTorch format with XNNPACK or portable backend, choose dtype or quantization settings, save graph metadata, or prepare artifacts for profiling.
Install
npx vskill@latest install armdeveloperecosystem/sme-executorch-profiling/export-modelSKILL.md
Export Model
Operating Rules
- Run from the repository root with
.venvactivated. - Export to
model_profiling/out_<model>/artifacts/for the Learning Path examples unless the user requests another output root. - Prefer
--backend xnnpackfor SME2 profiling because the runner comparison is intended to show delegated backend behavior. - Do not assume
.etrecordexists. Check for it and use it when present, but do not fail the export solely because it was not produced. - If exporting a custom model, verify it is registered in
model_profiling/models/__init__.pybefore running the exporter.
Required Inputs
- Completed
setup-workspace. - Model name, dtype, backend, and output directory.
- For custom models: an implementation of
EagerModelBasewith stableget_eager_model()andget_example_inputs().
Procedure
- Activate the environment:
``bash source .venv/bin/activate ``
- For the built-in smoke model, export with:
``bash python model_profiling/export/export_model.py \ --model toy_cnn \ --backend xnnpack \ --dtype fp16 \ --outdir model_profiling/out_toy_cnn/artifacts ``
- For a named model, use the same shape:
```bash MODEL_NAME="<model_name>" DTYPE="fp16" OUTDIR="model_profiling/out_${MODEL_NAME}/artifacts"
python model_profiling/export/export_model.py \ --model "${MODEL_NAME}" \ --backend xnnpack \ --dtype "${DTYPE}" \ --outdir "${OUTDIR}" \ --save-graph ```
- For quantized exports, add
--quantizeonly after confirming the ExecuTorch checkout supports the model's quantization path:
``bash python model_profiling/export/export_model.py \ --model "${MODEL_NAME}" \ --backend xnnpack \ --dtype fp32 \ --quantize \ --outdir "${OUTDIR}" ``
- Validate the output:
``bash find "${OUTDIR}" -maxdepth 1 -name '*.pte' -type f -size +0 -print find "${OUTDIR}" -maxdepth 1 -name '*.etrecord' -type f -print PTE_FILE="$(find "${OUTDIR}" -maxdepth 1 -name '*.pte' -type f -size +0 | head -1)" test -n "${PTE_FILE}" ``
Success Criteria
- A non-empty
.pteexists in the selected artifact directory. - Optional
graph.jsonexists when--save-graphwas requested. - Optional
.etrecordis recorded for later analysis if the export flow produced one.
Failure Triage
Unknown model: register the model undermodel_profiling/models/or use an ExecuTorch example model name that exists in the current checkout.ImportErrorfrom model code: install the model dependency into.venvor adjust the model wrapper.- Torch export failure: inspect unsupported ops, dynamic control flow, input signatures, dtype casts, and shape constraints.
- XNNPACK partitioning failure: retry with
--backend portableto isolate export validity from delegation, then return to XNNPACK after fixing unsupported delegated ops. - Quantization failure: remove
--quantizeunless the model appears in the current ExecuTorch quantization options.
Handoff
After export succeeds, use run-profiling with the .pte path and the runner paths for the target platform.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagent_skill_ml_profiling/export-model/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/armdeveloperecosystem/sme-executorch-profiling/export-model)