Repository navigation
Commit 4fd39a2
authored
NXP backend: improve mapping algorithm (pytorch#22614)
### Summary
Improve NXP Neutron operator-to-Edge profiling map
1. Improve TFLite-to-Neutron mapping algorithm
- Filter tensor I/O to dynamic (Variable) tensors only, excluding
constants
- Group Neutron subgraphs into linearly-connected execution chains based
on matching dynamic I/O tensor names
- Match each Neutron chain to a corresponding TFLite operator chain by
comparing boundary inputs and outputs
2. Fix mapping for batch > 1
- Enable `dumpMicrocode` in the converter log to include the
Microinstructions section
- Remap NeutronOperator locations and kernel counts using the actual
CALLARGS sequence from the microcode, which accounts for batch
repetitions and converter-injected helper kernels (e.g. MemCpy)
3. Fix profiling time scaling
- Neutron profiling timestamps are measured in clock cycles; divide by
the Neutron NPU frequency to convert to seconds
### Test plan
Tests included
cc @robert-kalmar @JakeStevens @digantdesai @rascani1 parent d28c77e commit 4fd39a2
6 files changed
Lines changed: 899 additions & 360 deletions
File tree
- backends/nxp
- backend
- runtime
- tests/generic_tests
- docs/source/backends/nxp
- examples/nxp
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | | - | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
0 commit comments