Skip to content

Commit 20e82e3

Browse files
gmagogsfmfacebook-github-bot
authored andcommitted
executorch
Differential Revision: D69068797
1 parent a3455d9 commit 20e82e3

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

backends/qualcomm/utils/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,6 @@ def generate_multi_graph_program(
869869
backend_config: ExecutorchBackendConfig = None,
870870
constant_methods: Optional[Dict[str, Any]] = None,
871871
) -> ExecutorchProgramManager:
872-
873872
# compile multiple graphs in qcir into single context binary
874873
(
875874
graph_inputs,
@@ -1056,7 +1055,7 @@ def forward(
10561055
outputs_dict[graph_name],
10571056
embedding_quantize,
10581057
)
1059-
prog = torch.export.export(composite_llama_module, sample_inputs)
1058+
prog = torch.export.export(composite_llama_module, sample_inputs, strict=True)
10601059
progs_dict[graph_name] = prog
10611060
# leverage ExecutorchProgramManager for generating pte with multi-methods
10621061
edge_prog_mgr = to_edge(

devtools/visualization/visualization_utils_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
8484
def test_visualize_manual_export(server):
8585
with server():
8686
model = Linear(20, 30)
87-
exported_program = torch.export.export(model, model.get_inputs())
87+
exported_program = torch.export.export(model, model.get_inputs(), strict=True)
8888
visualize(exported_program)
8989
time.sleep(3.0)
9090

@@ -150,7 +150,7 @@ def test_visualize_to_executorch(server):
150150
def test_visualize_graph(server):
151151
with server():
152152
model = Linear(20, 30)
153-
exported_program = torch.export.export(model, model.get_inputs())
153+
exported_program = torch.export.export(model, model.get_inputs(), strict=True)
154154
exported_program = to_edge_transform_and_lower(
155155
exported_program
156156
).exported_program()

exir/emit/test/test_emit.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def forward(self, x):
265265

266266
m = TestModule()
267267
example_inputs = (torch.ones(10),)
268-
ep = torch.export.export(m, example_inputs)
268+
ep = torch.export.export(m, example_inputs, strict=True)
269269
edge = to_edge(
270270
ep,
271271
compile_config=EdgeCompileConfig(
@@ -580,7 +580,8 @@ def forward(self, x: torch.Tensor, n: torch.Tensor) -> torch.Tensor:
580580
program = (
581581
to_edge(export(f, (x, x), strict=True))
582582
# .to_edge(self.compile_config) # TODO(larryliu): fix cat
583-
.to_executorch().executorch_program
583+
.to_executorch()
584+
.executorch_program
584585
)
585586

586587
self.assertEqual(len(program.execution_plan[0].chains[0].instructions), 1)

exir/program/test/test_program.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def forward(self, a, b, c):
343343

344344
inp = (torch.randn(10), torch.randn(10), torch.tensor(3))
345345

346-
ep = export(M(), inp)
346+
ep = export(M(), inp, strict=True)
347347
edge = to_edge(ep)
348348
self.assertTrue(
349349
torch.allclose(

extension/llm/modules/test/test_kv_cache.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def forward(self, k_val: torch.Tensor, v_val: torch.Tensor):
143143
3: torch.export.Dim.STATIC,
144144
},
145145
},
146+
strict=True,
146147
)
147148
return exported_kv_cache
148149

0 commit comments

Comments
 (0)