Use PTEFile class in serialize_pte_binary#15801
Use PTEFile class in serialize_pte_binary#15801meta-codesync[bot] merged 6 commits intogh/lucylq/126/basefrom
Conversation
Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately. Differential Revision: [D86908241](https://our.internmc.facebook.com/intern/diff/D86908241/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15801
Note: Links to docs will display an error until the docs builds have been completed. ❌ 6 New Failures, 3 Unrelated FailuresAs of commit 41d4aca with merge base b1e3e28 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately. Differential Revision: [D86908241](https://our.internmc.facebook.com/intern/diff/D86908241/) [ghstack-poisoned]
| get_common_executorch_program, | ||
| ) | ||
| from executorch.exir._serialize import _serialize_pte_binary | ||
| from executorch.exir._serialize import _PTEFile, _serialize_pte_binary |
There was a problem hiding this comment.
why _PTEFile but not PTEFile
There was a problem hiding this comment.
Is PTEFile supposed to be private only?
There was a problem hiding this comment.
Mostly following _serialize_pte_binary and _deserialize_pte_binary ...
I think those are fairly public though haha
Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately. Differential Revision: [D86908241](https://our.internmc.facebook.com/intern/diff/D86908241/) [ghstack-poisoned]
Pull Request resolved: #15801 Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately. ghstack-source-id: 323125958 @exported-using-ghexport Differential Revision: [D86908241](https://our.internmc.facebook.com/intern/diff/D86908241/)
Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately. Differential Revision: [D86908241](https://our.internmc.facebook.com/intern/diff/D86908241/) [ghstack-poisoned]
Pull Request resolved: #15801 Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately. ghstack-source-id: 323439314 @exported-using-ghexport Differential Revision: [D86908241](https://our.internmc.facebook.com/intern/diff/D86908241/)
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the serialize_pte_binary function to accept a PTEFile class instance instead of separate parameters (program, mutable_data, named_data). This change improves the API design by grouping related data into a single structured object.
Key Changes:
- Introduced
PTEFileclass to encapsulate program and segment data - Updated
serialize_pte_binaryto acceptpte_fileparameter instead of individual parameters - Refactored all call sites across the codebase to use the new API
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| exir/lowered_backend_module.py | Updated to construct _PTEFile object when calling _serialize_pte_binary |
| exir/backend/test/test_compatibility.py | Updated test cases to use _PTEFile wrapper |
| exir/_serialize/test/test_program.py | Updated test cases to use PTEFile wrapper with program and named_data |
| exir/_serialize/_serialize.py | Updated to construct PTEFile object when calling serialize_pte_binary |
| exir/_serialize/_program.py | Modified function signature to accept pte_file parameter and access fields via the object |
| devtools/bundled_program/test/test_bundle_data.py | Updated test to construct _PTEFile object for serialization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately. Differential Revision: [D86908241](https://our.internmc.facebook.com/intern/diff/D86908241/) [ghstack-poisoned]
Pull Request resolved: #15801 Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately. ghstack-source-id: 323439314 @exported-using-ghexport Differential Revision: [D86908241](https://our.internmc.facebook.com/intern/diff/D86908241/)
Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately. Differential Revision: [D86908241](https://our.internmc.facebook.com/intern/diff/D86908241/) [ghstack-poisoned]
Pull Request resolved: #15801 Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately. ghstack-source-id: 323860790 @exported-using-ghexport Differential Revision: [D86908241](https://our.internmc.facebook.com/intern/diff/D86908241/)
d4e8fda
into
gh/lucylq/126/base
Differential Revision: D86908241 Pull Request resolved: #15801
manual merge to main of: #15801 from branch gh/lucylq/126/base
manual merge to main of: pytorch#15801 from branch gh/lucylq/126/base
Stack from ghstack (oldest at bottom):
Take in a PTE file for serialization instead of program, mutable_segments, named_data segments separately.
Differential Revision: D86908241