Skip to content

Commit 369f804

Browse files
authored
Update default segment alignment to 128
Differential Revision: D61104820 Pull Request resolved: #4994
1 parent f99e25f commit 369f804

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

exir/_serialize/_program.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def serialize_pte_binary(
348348
mutable_data: Optional[List[Buffer]] = None,
349349
extract_delegate_segments: bool = False,
350350
extract_constant_segment: bool = False,
351-
segment_alignment: int = 4096,
351+
segment_alignment: int = 128,
352352
constant_tensor_alignment: Optional[int] = None,
353353
delegate_alignment: Optional[int] = None,
354354
) -> Cord:

exir/_serialize/test/test_program.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# This source code is licensed under the BSD-style license found in the
66
# LICENSE file in the root directory of this source tree.
77

8+
# pyre-unsafe
9+
810
import copy
911
import difflib
1012
import json
@@ -36,7 +38,7 @@
3638
)
3739
from executorch.exir.tests.common import get_test_program
3840

39-
SEGMENT_ALIGNMENT: int = 4096
41+
SEGMENT_ALIGNMENT: int = 128
4042

4143
CONSTANT_TENSOR_ALIGNMENT: int = 16
4244

exir/capture/_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ExecutorchBackendConfig:
7373

7474
# When extracting segments, the starting offset of each segment will be
7575
# aligned to this value (in bytes). Must be a power of two.
76-
segment_alignment: int = 4096
76+
segment_alignment: int = 128
7777

7878
# If provided, the minimum alignment of tensor buffers in the program. Must
7979
# be a power of 2. If not provided, uses the value in the schema file.

exir/lowered_backend_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def original_module(self) -> ExportedProgram:
137137
def buffer(
138138
self,
139139
extract_delegate_segments: bool = False,
140-
segment_alignment: int = 4096,
140+
segment_alignment: int = 128,
141141
constant_tensor_alignment: Optional[int] = None,
142142
delegate_alignment: Optional[int] = None,
143143
memory_planning: MemoryPlanningPass = None, # pyre-fixme[9]

0 commit comments

Comments
 (0)