Skip to content

Commit 4179cc8

Browse files
JacobSzwejbkafacebook-github-bot
authored andcommitted
.ff -> .pte
Summary: .pte is the file extension for executorch binaries. We should stop using .ff and encourage partners and clients to use .pte. Pytorch/pytorch has never enforced extensions like .pt or .ptl so I'm comfortable not strictly enforcing .pte Reviewed By: dbort Differential Revision: D47967450 fbshipit-source-id: 13c5fc2b51d49ae2e63996d5814108b7808ce167
1 parent 2582b91 commit 4179cc8

26 files changed

+64
-55
lines changed

.github/workflows/pull.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
# Export a test model
3838
python3 -m examples.export.export_example --model_name="linear"
3939
# Run test model
40-
buck2 run //examples/executor_runner:executor_runner -- --model_path ./linear.ff
40+
buck2 run //examples/executor_runner:executor_runner -- --model_path ./linear.pte

backends/xnnpack/test/test_xnnpack_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def save_bundled_program(representative_inputs, program, ref_output, output_path
116116
bundled_program_buffer = serialize_from_bundled_program_to_flatbuffer(
117117
bundled_program
118118
)
119-
output_path_with_postfix = f"{output_path}_bundled.ff"
119+
output_path_with_postfix = f"{output_path}_bundled.pte"
120120
print(f"saving bundled program to {output_path}...")
121121

122122
with open(output_path_with_postfix, "wb") as file:
@@ -223,7 +223,7 @@ def forward(self, *args):
223223

224224
ref_output = delegated_program(*sample_inputs)
225225
if dump_ff:
226-
filename = f"/tmp/xnnpack_test_{randint(1, 99999)}.ff"
226+
filename = f"/tmp/xnnpack_test_{randint(1, 99999)}.pte"
227227
print(f"Writing flatbuffer to {filename} ...")
228228

229229
save_bundled_program(

codegen/tools/targets.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def define_common_targets(is_fbcode = False):
143143
srcs = ["test/test_gen_oplist_real_model.py"],
144144
base_module = "",
145145
resources = {
146-
"//executorch/test/models:exported_programs[ModuleLinear.ff]": "test/ModuleLinear.ff",
146+
"//executorch/test/models:exported_programs[ModuleLinear.pte]": "test/ModuleLinear.pte",
147147
},
148148
visibility = [
149149
"//executorch/...",

codegen/tools/test/test_gen_oplist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def test_get_custom_build_selector_with_both_allowlist_and_yaml(
132132
) -> None:
133133
op_list = ["aten::add", "aten::mul"]
134134
filename = os.path.join(self.temp_dir.name, "selected_operators.yaml")
135-
gen_oplist._dump_yaml(op_list, filename, "model.ff")
135+
gen_oplist._dump_yaml(op_list, filename, "model.pte")
136136
self.assertTrue(os.path.isfile(filename))
137137
with open(filename) as f:
138138
es = yaml.safe_load(f)

codegen/tools/test/test_gen_oplist_real_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from libfb.py import parutil
1717

18-
MODEL_PATH: Final[str] = parutil.get_file_path("ModuleLinear.ff", pkg=__package__)
18+
MODEL_PATH: Final[str] = parutil.get_file_path("ModuleLinear.pte", pkg=__package__)
1919

2020

2121
class TestGenOplistRealModel(unittest.TestCase):

docs/website/docs/tutorials/00_setting_up_executorch.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ pip install .
5151

5252
Via python script:
5353
```bash
54-
# Creates the file `add.ff`
54+
# Creates the file `add.pte`
5555
python3 -m examples.export.export_example --model_name="add"
5656

57-
# Creates the delegated program `composite_model.ff`, other options are "whole" and "partition"
57+
# Creates the delegated program `composite_model.pte`, other options are "whole" and "partition"
5858
python3 -m examples.export.export_and_delegate --option "composite"
5959
```
6060

@@ -65,7 +65,7 @@ $ python3
6565
>>> from executorch.exir.tests.models import Mul
6666
>>> m = Mul()
6767
>>> print(exir.capture(m, m.get_random_inputs()).to_edge())
68-
>>> open("add.ff", "wb").write(exir.capture(m, m.get_random_inputs()).to_edge().to_executorch().buffer)
68+
>>> open("add.pte", "wb").write(exir.capture(m, m.get_random_inputs()).to_edge().to_executorch().buffer)
6969
```
7070

7171
## Runtime Setup
@@ -119,17 +119,17 @@ conda install -c conda-forge lld
119119
### Step 3: Run a binary
120120

121121
```bash
122-
# add.ff is the program generated from export_example.py during AOT Setup Step 3
123-
/tmp/buck2 run //examples/executor_runner:executor_runner -- --model_path add.ff
122+
# add.pte is the program generated from export_example.py during AOT Setup Step 3
123+
/tmp/buck2 run //examples/executor_runner:executor_runner -- --model_path add.pte
124124

125125
# To run a delegated model
126-
/tmp/buck2 run //examples/executor_runner:executor_runner -- --model_path composite_model.ff
126+
/tmp/buck2 run //examples/executor_runner:executor_runner -- --model_path composite_model.pte
127127
```
128128

129129
or execute the binary directly from the `--show-output` path shown when building.
130130

131131
```bash
132-
./buck-out/.../executor_runner --model_path add.ff
132+
./buck-out/.../executor_runner --model_path add.pte
133133
```
134134

135135
## More examples

docs/website/docs/tutorials/backend_delegate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ model_inputs = (torch.ones(1), )
202202
exec_prog = exir.capture(composite_model, model_inputs).to_edge().to_executorch()
203203

204204
# Save the flatbuffer to a local file
205-
save_path = "delegate.fft"
205+
save_path = "delegate.pte"
206206
with open(save_path, "wb") as f:
207207
f.write(exec_prog.buffer)
208208
```
@@ -257,7 +257,7 @@ exec_prog = to_backend(gm, AddMulPartitionerDemo).to_executorch(
257257
)
258258

259259
# Save the flatbuffer to a local file
260-
save_path = "delegate.fft"
260+
save_path = "delegate.pte"
261261
with open(save_path, "wb") as f:
262262
f.write(exec_prog.buffer)
263263
```

docs/website/docs/tutorials/exporting_to_executorch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ executorch_program = edge_dialect.to_executorch(executorch_backend_config)
196196
buffer = executorch_program.buffer
197197

198198
# Save it to a file and load it in the Executorch runtime
199-
with open("model.ff", "wb") as file:
199+
with open("model.pte", "wb") as file:
200200
file.write(buffer)
201201

202202
# Or you can run the Executorch runtime in python to try it out

docs/website/docs/tutorials/profiling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Here is an example of what a ExecuTorch run + profile + post-procesing workflow
5656
This runs the sample program with profiling enabled
5757
```bash
5858
cd executorch
59-
buck2 run -c executorch.prof_enabled=true examples/executor_runner:executor_runner -- --model_path add.ff
59+
buck2 run -c executorch.prof_enabled=true examples/executor_runner:executor_runner -- --model_path add.pte
6060
```
6161
Run the post-processing CLI tool that calls into the same API's listed above and prints out the profiling results in a tabulated format in the terminal.
6262

docs/website/docs/tutorials/selective_build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ load("@fbsource//xplat/executorch/codegen:codegen.bzl", "et_operator_library")
3232

3333
fb_native.export_file(
3434
name = "model_1",
35-
src = "model_1.ff", # checked in model
35+
src = "model_1.pte", # checked in model
3636
)
3737

3838
et_operator_library(

0 commit comments

Comments
 (0)