Skip to content

Commit 882f4ab

Browse files
committed
xnnpack io
1 parent 63017e4 commit 882f4ab

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

backends/xnnpack/partition/config/gemm_configs.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def _get_weight_deps(
122122
self, node: torch.fx.Node, ep: ExportedProgram, precision: ConfigPrecisionType
123123
) -> Tuple[bool, List[torch.fx.Node]]:
124124
gemm_deps = []
125+
breakpoint()
125126
if precision == ConfigPrecisionType.FP32:
126127
# First find the weight
127128
weight_node = get_input_node(node, self.weight_idx)
@@ -272,6 +273,17 @@ def _get_weight_deps(
272273

273274
return super()._get_weight_deps(node, ep, precision)
274275

276+
def _get_bias_deps(
277+
self, node: torch.fx.Node, ep: ExportedProgram, precision: ConfigPrecisionType
278+
) -> Tuple[bool, List[torch.fx.Node]]:
279+
if precision == ConfigPrecisionType.FP32 and self.force_fp32_dynamic_linear:
280+
# if force fp32_dynamic_linear is on and we detected this as fp32, then we
281+
# do not partition the weight node
282+
breakpoint()
283+
return (True, [])
284+
285+
return super()._get_bias_deps(node, ep, precision)
286+
275287
def supported_precision_types(self):
276288
return [
277289
ConfigPrecisionType.DYNAMIC_QUANT,

examples/xnnpack/aot_compiler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
# TODO(T165162973): This pass shall eventually be folded into quantizer
9494
model = quantize(model, example_inputs)
9595

96+
breakpoint()
9697
edge = to_edge_transform_and_lower(
9798
ep,
9899
partitioner=[XnnpackPartitioner()],
@@ -110,6 +111,8 @@
110111
config=ExecutorchBackendConfig(extract_delegate_segments=False)
111112
)
112113

114+
breakpoint()
115+
113116
if args.etrecord is not None:
114117
generate_etrecord(args.etrecord, edge_copy, exec_prog)
115118
logging.info(f"Saved ETRecord to {args.etrecord}")

0 commit comments

Comments
 (0)