You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Serialize NamedData in PTE file
2. Add NamedDataStore to EdgeProgramManager
---
Serializing NamedData is slightly different to constant/delegate data as each segment comes with its own alignment.
**An example:**
Given NamedData = {"key": data}. Data is 250 bytes.
- BackendA requires data with alignment=3
- BackendB requires data with alignment=4
Then, data0 should be serialized with alignment of lcm(3, 4) = 12
At serialization, ExecuTorch has a 'segment_alignment' that defaults to 128. Data is now serialized to lcm(12, 128) = 384.
Inside the DataSegment, we want to store the original size of the data (250). The offset of the subsequent DataSegment would be 384 bytes after the start of this one.
**Design**
Introduce a new dataclass 'AlignedData' that stores the buffer and any alignment that's required. This is used when assembling Program.segments to ensure we get lcm(buffer_alignment, segment_alignment).
Note: The default segment_alignment can be overridden inside 'ExecutorchBackendConfig'.
Differential Revision: [D69764150](https://our.internmc.facebook.com/intern/diff/D69764150/)
[ghstack-poisoned]
0 commit comments