Skip to content

Commit f747ff9

Browse files
ydwu4facebook-github-bot
authored andcommitted
Remove exir's patch for capture_scalar_outputs
Summary: After D47841078, capture_scalar_outputs is always True in dynamo.export. Remove this config as it's not being used. Reviewed By: tugsbayasgalan Differential Revision: D47883466 fbshipit-source-id: 738c915365306c456f6c4b171434a44ac980baca
1 parent 4b1d473 commit f747ff9

File tree

5 files changed

+3
-19
lines changed

5 files changed

+3
-19
lines changed

backends/qnnpack/partition/support_patterns.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def get_dynamic_quantized_graph(f, example_inputs, dynamic_shape=False):
5050
converted_mod = _convert_to_reference_decomposed_fx(prepared_mod)
5151
if dynamic_shape:
5252
dynamo_config = ExirDynamoConfig(
53-
capture_scalar_outputs=True,
5453
guard_nn_modules=True,
5554
dynamic_shapes=True,
5655
specialize_int=True,

exir/tests/test_quant_fusion_pass.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ def forward(self, indices):
301301
m(*example_inputs)
302302
m = _convert_to_reference_decomposed_fx(m)
303303
dynamo_config = ExirDynamoConfig(
304-
capture_scalar_outputs=True,
305304
guard_nn_modules=True,
306305
dynamic_shapes=False,
307306
specialize_int=True,
@@ -364,7 +363,6 @@ def forward(self, indices):
364363
m(*example_inputs)
365364
m = _convert_to_reference_decomposed_fx(m)
366365
dynamo_config = ExirDynamoConfig(
367-
capture_scalar_outputs=True,
368366
guard_nn_modules=True,
369367
dynamic_shapes=False,
370368
specialize_int=True,

exir/tests/test_quantization.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def test_resnet(self) -> None:
4949
m_copy = copy.deepcopy(m)
5050
# program capture
5151
dynamo_config = ExirDynamoConfig(
52-
capture_scalar_outputs=True,
5352
guard_nn_modules=True,
5453
dynamic_shapes=False,
5554
specialize_int=True,

exir/tests/test_tracer.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,27 +194,16 @@ def f(x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:
194194
self.assertTrue(torch.allclose(orig_res[0], new_res[0]))
195195
self.assertTrue(torch.allclose(orig_res[1], new_res[1]))
196196

197-
def test_toggle_dynamo_capture_scalar_outputs(self) -> None:
197+
def test_dynamo_capture_scalar_outputs(self) -> None:
198198
def f(x: torch.Tensor) -> float:
199199
return x.item()
200200

201-
with self.assertRaisesRegex(
202-
ExportError,
203-
"The user code is using a feature we don't support.",
204-
):
205-
dynamo_trace(
206-
f,
207-
(torch.ones(1),),
208-
False,
209-
"real",
210-
ExirDynamoConfig(capture_scalar_outputs=False),
211-
)
212-
dynamo_trace(
201+
gm, guards = dynamo_trace(
213202
f,
214203
(torch.ones(1),),
215204
False,
216205
"real",
217-
ExirDynamoConfig(capture_scalar_outputs=True),
206+
ExirDynamoConfig(),
218207
)
219208

220209
# pyre-ignore

exir/tracer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@ class ExirDynamoConfig:
605605
Manage Exir-specific configurations of Dynamo.
606606
"""
607607

608-
capture_scalar_outputs: bool = True
609608
capture_dynamic_output_shape_ops: bool = True
610609
guard_nn_modules: bool = True
611610
dynamic_shapes: bool = True

0 commit comments

Comments
 (0)