Skip to content

Commit 7fa93a7

Browse files
authored
docs: Add logging guidance for debug partition (#15979)
### Summary This PR adds instructions for enabling internal debug logging in the partitioner. The logging can help users quickly identify why certain nodes are not delegated. Fixes #15914
1 parent e38734e commit 7fa93a7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/source/backends/xnnpack/xnnpack-troubleshooting.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,27 @@ The XNNPACK backend is built by default for Python, Android, iOS, and in most CM
2323
* Use [op-level profiling](/tutorials/devtools-integration-tutorial) to understand which operators are taking the most time. <!-- @lint-ignore linter doesn't like this link for some reason -->
2424
* The XNNPACK backend provides operator-level timing for delegated operators.
2525
* See general performance troubleshooting tips in [Performance Troubleshooting](/using-executorch-faqs.md#inference-is-slow-performance-troubleshooting).
26+
27+
28+
## Debugging Why Nodes Are Not Partitioned
29+
30+
* To debug cases where operators are not delegated to XNNPACK,
31+
you can enable internal debug logs before **to_edge_transform_and_lower** from the partitioner. This will print diagnostic messages explaining why specific nodes fail
32+
to partition.
33+
34+
``` python
35+
36+
# caption: Enable internal partition debug logging
37+
38+
import logging
39+
40+
logger = logging.getLogger("executorch.backends.xnnpack.partition")
41+
logger.setLevel(logging.DEBUG)
42+
43+
if not logger.handlers:
44+
ch = logging.StreamHandler()
45+
ch.setLevel(logging.DEBUG)
46+
formatter = logging.Formatter("[%(levelname)s] %(name)s: %(message)s")
47+
ch.setFormatter(formatter)
48+
logger.addHandler(ch)
49+
```

0 commit comments

Comments
 (0)