Skip to content

Commit ee2f1b9

Browse files
committed
[NE16] wire --enable-3x3 flag in generateNetwork.py
The --enable-3x3 flag was parsed by the runner script but never passed to generateNetwork.py, so NE16Engine.enable3x3 was always False. DW 3x3 and Dense 3x3 convolutions silently fell back to the PULP cluster instead of dispatching to NE16. Add the flag and set it on the engine.
1 parent 2d75f76 commit ee2f1b9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

DeeployTest/generateNetwork.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ def generateNetwork(args):
8484

8585
platform, signProp = mapPlatform(args.platform)
8686

87+
# Enable NE16 3x3 convolutions (DW and Dense) if requested
88+
if hasattr(args, 'enable_3x3') and args.enable_3x3:
89+
from Deeploy.Targets.NE16.Engine import NE16Engine
90+
for engine in platform.engines:
91+
if isinstance(engine, NE16Engine):
92+
engine.enable3x3 = True
93+
8794
clusters = [engine for engine in platform.engines if isinstance(engine, PULPClusterEngine)]
8895
for cluster in clusters:
8996
cluster.n_cores = args.cores
@@ -192,6 +199,11 @@ def generateNetwork(args):
192199
help = '(Optional) mapping of input names to offsets. '
193200
'If not specified, offsets are set to 0. '
194201
'Example: --input-offset-map input_0=0 input_1=128 ...')
202+
parser.add_argument('--enable-3x3',
203+
action = 'store_true',
204+
dest = 'enable_3x3',
205+
default = False,
206+
help = 'Enable NE16 3x3 convolutions (DW and Dense)\n')
195207
parser.add_argument('--shouldFail', action = 'store_true')
196208
parser.add_argument(
197209
"--cores",

0 commit comments

Comments
 (0)