Skip to content

Commit e2682a8

Browse files
JacobSzwejbkafacebook-github-bot
authored andcommitted
schema.fbs -> program.fbs
Summary: schema.flatbuffer_schema is a poor name. Program is more specific (in the context of the full path) Reviewed By: dbort Differential Revision: D47969015 fbshipit-source-id: 0fa6777b1845406438582ad85d6d2292dc56c944
1 parent 4179cc8 commit e2682a8

File tree

24 files changed

+37
-37
lines changed

24 files changed

+37
-37
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ executorch.egg-info
33
__pycache__/
44
build/lib/
55
exir/serialize/scalar_type.fbs
6-
exir/serialize/schema.fbs
6+
exir/serialize/program.fbs

backends/compile_spec_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from dataclasses import dataclass
88

99
"""
10-
Please refer to executorch/schema/schema.fbs for source of truth.
10+
Please refer to executorch/schema/program.fbs for source of truth.
1111
"""
1212

1313

docs/website/docs/contributors/program_file_format.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Example:
8484

8585
## Program data
8686

87-
See `//executorch/schema/schema.fbs` for the Program flatbuffer schema.
87+
See `//executorch/schema/program.fbs` for the Program flatbuffer schema.
8888

8989
The flatbuffer-encoded program data follows the headers. By embedding the size
9090
of this region in the extended header, clients can read only the program data

exir/scripts/TARGETS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ python_library(
2929
"__init__.py",
3030
],
3131
resources = {
32-
"//executorch/schema:schema.fbs": "schema.fbs",
32+
"//executorch/schema:program.fbs": "program.fbs",
3333
},
3434
deps = [
3535
"//libfb/py:fbpkg",

exir/serialize/TARGETS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ runtime.python_library(
3434
"_program.py",
3535
],
3636
resources = {
37+
"//executorch/schema:program.fbs": "program.fbs",
3738
"//executorch/schema:scalar_type.fbs": "scalar_type.fbs",
38-
"//executorch/schema:schema.fbs": "schema.fbs",
3939
"fbsource//third-party/flatbuffers:flatc-host": "flatbuffers-flatc",
4040
},
4141
# Currently serialization API should only be used in some dedicated targets,

exir/serialize/_flatbuffer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _prepare_schema(
135135
into out_dir. May patch the schema contents depending on the parameters to
136136
this function.
137137
"""
138-
program_schema = "schema.fbs"
138+
program_schema = "program.fbs"
139139
# Included by the root program schema; must also be present.
140140
deps = ["scalar_type.fbs"]
141141

@@ -247,7 +247,7 @@ def _program_json_to_flatbuffer(
247247
248248
Args:
249249
program_json: The JSON to convert. Must be compatible with the root
250-
table type of //executorch/schema/schema.fbs.
250+
table type of //executorch/schema/program.fbs.
251251
constant_tensor_alignment: If provided, the alignment to use for tensor
252252
data embedded in the output flatbuffer data. If not provided, uses
253253
the alignment in the schema.
@@ -280,7 +280,7 @@ def _program_json_to_flatbuffer(
280280
def _program_flatbuffer_to_json(program_flatbuffer: bytes) -> bytes:
281281
"""Converts binary flatbuffer data into Program-compatible JSON.
282282
283-
The binary is parsed using the schema in //executorch/schema/schema.fbs.
283+
The binary is parsed using the schema in //executorch/schema/program.fbs.
284284
"""
285285
with tempfile.TemporaryDirectory() as temp_dir:
286286
# No need to patch the alignment when reading. "force_align" is only

exir/serialize/test/test_flatbuffer.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_load_patch_and_write(self) -> None:
6868

6969
# Fake resource files to use when testing alignment-patching.
7070
SCHEMA_FILES: Dict[str, bytes] = {
71-
"schema.fbs": b"\n".join(
71+
"program.fbs": b"\n".join(
7272
[
7373
b"table Program {",
7474
# Space after the colon.
@@ -122,7 +122,7 @@ def call_prepare_schema(
122122
def test_unmodified(self) -> None:
123123
with tempfile.TemporaryDirectory() as out_dir:
124124
info: _SchemaInfo = self.call_prepare_schema(SCHEMA_FILES, out_dir)
125-
self.assertEqual(info.root_path, os.path.join(out_dir, "schema.fbs"))
125+
self.assertEqual(info.root_path, os.path.join(out_dir, "program.fbs"))
126126
# Files should not have been modified.
127127
for fname in SCHEMA_FILES.keys():
128128
self.assertEqual(read_file(out_dir, fname), SCHEMA_FILES[fname])
@@ -134,10 +134,10 @@ def test_update_tensor_alignment(self) -> None:
134134
info: _SchemaInfo = self.call_prepare_schema(
135135
SCHEMA_FILES, out_dir, constant_tensor_alignment=128
136136
)
137-
self.assertEqual(info.root_path, os.path.join(out_dir, "schema.fbs"))
137+
self.assertEqual(info.root_path, os.path.join(out_dir, "program.fbs"))
138138
# Only the tensor alignment lines should have been modified.
139139
self.assertEqual(
140-
read_file(out_dir, "schema.fbs"),
140+
read_file(out_dir, "program.fbs"),
141141
b"\n".join(
142142
[
143143
b"table Program {",
@@ -170,10 +170,10 @@ def test_update_delegate_alignment(self) -> None:
170170
info: _SchemaInfo = self.call_prepare_schema(
171171
SCHEMA_FILES, out_dir, delegate_alignment=256
172172
)
173-
self.assertEqual(info.root_path, os.path.join(out_dir, "schema.fbs"))
173+
self.assertEqual(info.root_path, os.path.join(out_dir, "program.fbs"))
174174
# Only the delegate alignment lines should have been modified.
175175
self.assertEqual(
176-
read_file(out_dir, "schema.fbs"),
176+
read_file(out_dir, "program.fbs"),
177177
b"\n".join(
178178
[
179179
b"table Program {",
@@ -209,10 +209,10 @@ def test_update_tensor_and_delegate_alignment(self) -> None:
209209
constant_tensor_alignment=1,
210210
delegate_alignment=2,
211211
)
212-
self.assertEqual(info.root_path, os.path.join(out_dir, "schema.fbs"))
212+
self.assertEqual(info.root_path, os.path.join(out_dir, "program.fbs"))
213213
# Only the delegate alignment lines should have been modified.
214214
self.assertEqual(
215-
read_file(out_dir, "schema.fbs"),
215+
read_file(out_dir, "program.fbs"),
216216
b"\n".join(
217217
[
218218
b"table Program {",

extension/pybindings/TARGETS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ executorch_pybindings(
3434
"//executorch/runtime/executor:executor_aten",
3535
"//executorch/runtime/core/exec_aten:lib",
3636
"//executorch/schema:bundled_program_schema",
37-
"//executorch/schema:schema",
37+
"//executorch/schema:program",
3838
"//executorch/extension/data_loader:buffer_data_loader",
3939
"//executorch/extension/data_loader:mmap_data_loader",
4040
"//executorch/util:read_file",

extension/pybindings/module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <executorch/runtime/platform/profiler.h>
2424
#include <executorch/runtime/platform/runtime.h>
2525
#include <executorch/schema/bundled_program_schema_generated.h>
26-
#include <executorch/schema/schema_generated.h>
26+
#include <executorch/schema/program_generated.h>
2727
#include <executorch/util/TestMemoryConfig.h>
2828
#include <executorch/util/bundled_program_verification.h>
2929
#include <executorch/util/read_file.h>

extension/pybindings/pybindings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <pybind11/stl.h>
1111

1212
#include <executorch/runtime/platform/assert.h>
13-
#include <executorch/schema/schema_generated.h>
13+
#include <executorch/schema/program_generated.h>
1414
#include <executorch/util/read_file.h>
1515

1616
namespace py = pybind11;

0 commit comments

Comments
 (0)