mcpbeat

Export

pytorch/export

Export a PyTorch model to .pte format for ExecuTorch. Use when converting models, lowering to edge, or generating .pte files.

7k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
4857
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/pytorch/executorch --skill export

What comes with it

27 697 bytes besides the instruction
guides/torch-export.md

The instruction itself

5 sections, as written by the author

Export

Basic pattern

from executorch.exir import to_edge_transform_and_lower
from torch.export import export

exported = export(model.eval(), example_inputs)
edge = to_edge_transform_and_lower(exported)
with open("model.pte", "wb") as f:
    f.write(edge.to_executorch().buffer)

Model-specific scripts

| Model | Script |

|-------|--------|

| Llama | examples/models/llama/export_llama.py |

| Whisper | examples/models/whisper/ |

| Parakeet | examples/models/parakeet/export_parakeet_tdt.py |

Debugging

  • Draft export: export(model, inputs, strict=False)
  • tlparse: TORCH_LOGS="+dynamo,+export" python script.py 2>&1 | tlparse

Guides

  • torch.export basics — torch.export.export(), dynamic shapes, strict mode, debugging

How to use it

Copy the folder

Take pytorch/export from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.