pytorch / pytorch/executorch

[Request Impl] Apply Segment Serialization in Bundled Program

Open
#9,771 7 comments 0 reactions 1 assignee View on GitHub

@dillondesilva is already working on this.

Since Apr 1, 2025.

good first issue module: devtools
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

🚀 The feature, motivation and pitch

BundledProgram is a primary way for users to bundle representative input and (optional) its expected outputs with serialized ExecuTorch program (.pte file). It is a critical way to run representative input on device in a unified way.

However we realize the serialization is pretty slow nowadays. The key reason is we try to reserialize the pte file again into bundled program, which has been serialized and is unnecessary here.

To make the pte data a part of serialized bundled program, while not reserialize it, we can use the new introduced NameData to handle that, which makes inserialized data as separate data blobs append after serialized flabuffer data.

https://github.com/pytorch/executorch/discussions/8187 here's the design doc for NameDataBlob, and https://github.com/pytorch/executorch/blob/48de2642468533d7d1cc89f2f3d1e518a8909edb/exir/_serialize/_program.py#L381 is the code pointer for pte serialization, in which include the NameData serialization.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.