Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[executorch][weight sharing] Introduce NamedData to PTE schema #8695

Open
wants to merge 1 commit into
base: gh/lucylq/44/base
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions exir/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ class SubsegmentOffsets:
offsets: List[int]


@dataclass
class NamedData:
key: str
segment_index: int


@dataclass
class Program:
version: int
Expand All @@ -299,3 +305,4 @@ class Program:
segments: List[DataSegment]
constant_segment: SubsegmentOffsets
mutable_data_segments: Optional[List[SubsegmentOffsets]] = None
named_data: Optional[List[NamedData]] = None
14 changes: 14 additions & 0 deletions schema/program.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,16 @@ table SubsegmentOffsets {
offsets: [uint64];
}

// Attributes a name to data referenced by Program.segments. Typically used
// when data is referenced by multiple users.
table NamedData {
// The unique id of the data blob.
key: string;

// Index of the segment in Program.segments
segment_index: uint32;
}

table Program {
// Schema version.
version: uint;
Expand Down Expand Up @@ -468,6 +478,10 @@ table Program {
// constant memory, copying it over, and then being unable to release the
// constant segment. No two elements should point to the same segment.
mutable_data_segments: [SubsegmentOffsets];

// [Optional] List of blobs keyed by a name. Stored in segments attached to
// the PTE file.
named_data: [NamedData];
}

root_type Program;
Loading