Skip to content

Commit 39bb0a0

Browse files
committed
added nn_inference_engines platform parameter to API and UI
1 parent 059448f commit 39bb0a0

File tree

8 files changed

+166
-91
lines changed

8 files changed

+166
-91
lines changed

src/server/datamanager/serializers/knowledgepack.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ class GenerateKnowledgePackSerializerVersion2(serializers.ModelSerializer):
298298
hardware_accelerator = serializers.CharField(
299299
write_only=True, default=None, allow_blank=True
300300
)
301+
nn_inference_engine = serializers.CharField(
302+
write_only=True, default="tf_micro", allow_blank=True
303+
)
301304

302305
class Meta:
303306
model = KnowledgePack
@@ -324,6 +327,7 @@ class Meta:
324327
"float_options",
325328
"application",
326329
"hardware_accelerator",
330+
"nn_inference_engine",
327331
)
328332

329333

src/server/library/fixtures/platforms_v2.yml

Lines changed: 99 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
3cc7739d-b218-4946-9366-3ab2293d42d6,
1111
b003c819-90cc-4ec0-9c67-1986a74e90da,
1212
5192eb71-8831-474e-97b3-5f0a825303cb,
13-
a7aa7320-c6a3-4f00-a429-b300ff38613e
13+
a7aa7320-c6a3-4f00-a429-b300ff38613e,
1414
]
1515
can_build_binary: false
1616
codegen_file_location: ["arm-none-eabi"]
@@ -27,11 +27,7 @@
2727
"description": "Use the ARM CMSIS library intrinsic functions to accelerate ops",
2828
},
2929
"cpu_only":
30-
{
31-
"display_name": "CPU Only",
32-
"kernel": "",
33-
"description": "Use CPU based ops only",
34-
},
30+
{ "display_name": "CPU Only", "kernel": "", "description": "Use CPU based ops only" },
3531
}
3632
default_selections:
3733
{
@@ -55,6 +51,11 @@
5551
"codegen_app_name": "arduino",
5652
},
5753
}
54+
nn_inference_engines:
55+
{
56+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
57+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
58+
}
5859
platform_type: "compiler"
5960
documentation: "https://sensiml.com/documentation/firmware/arm-cortex-generic/cortex-arm-generic-platforms.html"
6061
manufacturer: ARM
@@ -86,6 +87,11 @@
8687
"codegen_app_name": "testdata_runner",
8788
},
8889
}
90+
nn_inference_engines:
91+
{
92+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
93+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
94+
}
8995
platform_type: "compiler"
9096
documentation: "https://sensiml.com/documentation/firmware/x86-processors/x86-platforms.html"
9197
manufacturer: x86 GCC
@@ -119,9 +125,7 @@
119125
"uses_sensiml_interface": False,
120126
"uses_simple_streaming": True,
121127
"app_environment":
122-
{
123-
"SML_APP_CONFIG_FILE": "/build/sensiml_recognition_motion/app_sensor_imu.h",
124-
},
128+
{ "SML_APP_CONFIG_FILE": "/build/sensiml_recognition_motion/app_sensor_imu.h" },
125129
}
126130
supported_compilers: [2e8bdcf0-557a-41bd-a41d-64e443ec97a9]
127131
hardware_accelerators:
@@ -139,11 +143,7 @@
139143
"kernel": "siliconlabs",
140144
},
141145
"cpu_only":
142-
{
143-
"display_name": "CPU Only",
144-
"kernel": "",
145-
"description": "Use CPU based ops only",
146-
},
146+
{ "display_name": "CPU Only", "kernel": "", "description": "Use CPU based ops only" },
147147
}
148148
default_selections:
149149
{
@@ -152,6 +152,11 @@
152152
"float": "Hard FP",
153153
"hardware_accelerator": "siliconlabs",
154154
}
155+
nn_inference_engines:
156+
{
157+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
158+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
159+
}
155160
platform_type: "devkit"
156161
documentation: "https://sensiml.com/documentation/firmware/silicon-labs-xg24/silicon-labs-xg24.html"
157162
manufacturer: Silicon Labs
@@ -161,11 +166,7 @@
161166
uuid: ef8777a0-17c4-414a-88f8-09734308bacf
162167
name: Raspberry Pi
163168
description: Build libraries for Raspberry Pi devices.
164-
processors:
165-
[
166-
1b8bcfbd-7a6e-4292-8ccc-bf808e7658fc,
167-
e3d6cdb6-3d30-4efe-9201-592d20668c58,
168-
]
169+
processors: [1b8bcfbd-7a6e-4292-8ccc-bf808e7658fc, e3d6cdb6-3d30-4efe-9201-592d20668c58]
169170
can_build_binary: false
170171
codegen_file_location: ["arm-none-linux-gnueabihf"]
171172
permissions: { "developer": true, "enterprise": true, "starter": true }
@@ -203,11 +204,12 @@
203204
"description": "Use the ARM CMSIS library intrinsic functions to accelerate ops",
204205
},
205206
"cpu_only":
206-
{
207-
"display_name": "CPU Only",
208-
"kernel": "",
209-
"description": "Use CPU based ops only",
210-
},
207+
{ "display_name": "CPU Only", "kernel": "", "description": "Use CPU based ops only" },
208+
}
209+
nn_inference_engines:
210+
{
211+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
212+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
211213
}
212214
platform_type: "devkit"
213215
documentation: "https://sensiml.com/documentation/firmware/raspberry-pi/raspberry-pi.html"
@@ -219,11 +221,7 @@
219221
name: TensorfLow Lite Micro
220222
docker_image: "sensiml_tensorflow"
221223
description: Build a TensorFlow Lite for Microcontrollers inference library
222-
processors:
223-
[
224-
241a03d2-3e13-4087-9d7b-07a3f96e6dff,
225-
530e1a45-22d3-429b-ae03-90b28040c54d,
226-
]
224+
processors: [241a03d2-3e13-4087-9d7b-07a3f96e6dff, 530e1a45-22d3-429b-ae03-90b28040c54d]
227225
can_build_binary: false
228226
platform_versions: ["0a4bec2a"]
229227
docker_image_version: "v4.0"
@@ -233,67 +231,64 @@
233231
codegen_parameters: {}
234232
supported_compilers: []
235233
hardware_accelerators:
234+
{
235+
"cmsis_nn":
236+
{
237+
"display_name": "CMSIS",
238+
"kernel": "cmsis_nn",
239+
"description": "Use the ARM CMSIS library intrinsic functions to accelerate ops",
240+
},
241+
"cpu_only":
242+
{ "display_name": "CPU Only", "kernel": "", "description": "Use CPU based ops only" },
243+
"siliconlabs":
236244
{
237-
"cmsis_nn":
238-
{
239-
"display_name": "CMSIS",
240-
"kernel": "cmsis_nn",
241-
"description": "Use the ARM CMSIS library intrinsic functions to accelerate ops",
242-
},
243-
"cpu_only":
244-
{
245-
"display_name": "CPU Only",
246-
"kernel": "",
247-
"description": "Use CPU based ops only",
248-
},
249-
"siliconlabs":
250-
{
251-
"display_name": "Silicon Labs MVP AI Accelerator",
252-
"description": "Use the Silicon Labs Matrix Vector Processor (MVP) to accelerate NN",
253-
"kernel": "siliconlabs",
254-
},
255-
}
245+
"display_name": "Silicon Labs MVP AI Accelerator",
246+
"description": "Use the Silicon Labs Matrix Vector Processor (MVP) to accelerate NN",
247+
"kernel": "siliconlabs",
248+
},
249+
}
256250
default_selections: {}
251+
nn_inference_engines:
252+
{
253+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
254+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
255+
}
257256
platform_type: "compiler"
258257
documentation: "https://www.tensorflow.org/lite/microcontrollers"
259258
manufacturer: null
260259
model: library.PlatformDescriptionVersion2
261260

262-
263261
- fields:
264262
uuid: f3823aa1-0501-4ae2-8868-e8519eb1811f
265263
name: NNoM
266264
docker_image: "nnom"
267-
description: Build a NNoM inference library
268-
processors:
269-
[
270-
241a03d2-3e13-4087-9d7b-07a3f96e6dff,
271-
530e1a45-22d3-429b-ae03-90b28040c54d,
272-
]
265+
description: Build a NNoM inference library
266+
processors: [241a03d2-3e13-4087-9d7b-07a3f96e6dff, 530e1a45-22d3-429b-ae03-90b28040c54d]
273267
can_build_binary: false
274268
platform_versions: [""]
275269
docker_image_version: "v0.4.3"
276270
codegen_file_location: ["nnom"]
277-
permissions: { "developer": false, "enterprise": false, "starter": false }
271+
permissions: { "developer": true, "enterprise": true, "starter": true }
278272
supported_source_drivers: {}
279273
codegen_parameters: {}
280274
supported_compilers: []
281275
hardware_accelerators:
276+
{
277+
"cmsis_nn":
282278
{
283-
"cmsis_nn":
284-
{
285-
"display_name": "CMSIS",
286-
"kernel": "cmsis_nn",
287-
"description": "Use the ARM CMSIS library intrinsic functions to accelerate ops",
288-
},
289-
"cpu_only":
290-
{
291-
"display_name": "CPU Only",
292-
"kernel": "",
293-
"description": "Use CPU based ops only",
294-
},
295-
}
279+
"display_name": "CMSIS",
280+
"kernel": "cmsis_nn",
281+
"description": "Use the ARM CMSIS library intrinsic functions to accelerate ops",
282+
},
283+
"cpu_only":
284+
{ "display_name": "CPU Only", "kernel": "", "description": "Use CPU based ops only" },
285+
}
296286
default_selections: {}
287+
nn_inference_engines:
288+
{
289+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
290+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
291+
}
297292
platform_type: "compiler"
298293
documentation: "https://github.com/majianjia/nnom"
299294
manufacturer: null
@@ -321,11 +316,7 @@
321316
"codegen_app_location": "platforms/quickthingplus",
322317
},
323318
}
324-
codegen_parameters:
325-
{
326-
"codegen_class": "QuickLogicS3CodeGenerator",
327-
"board": "quickthingplus",
328-
}
319+
codegen_parameters: { "codegen_class": "QuickLogicS3CodeGenerator", "board": "quickthingplus" }
329320
supported_compilers: [2e8bdcf0-557a-41bd-a41d-64e443ec97a9]
330321
hardware_accelerators:
331322
{
@@ -336,11 +327,7 @@
336327
"description": "Use the ARM CMSIS library intrinsic functions to accelerate ops",
337328
},
338329
"cpu_only":
339-
{
340-
"display_name": "CPU Only",
341-
"kernel": "",
342-
"description": "Use CPU based ops only",
343-
},
330+
{ "display_name": "CPU Only", "kernel": "", "description": "Use CPU based ops only" },
344331
}
345332
default_selections:
346333
{
@@ -349,6 +336,11 @@
349336
"float": "Hard FP",
350337
"hardware_accelerator": "cmsis_nn",
351338
}
339+
nn_inference_engines:
340+
{
341+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
342+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
343+
}
352344
platform_type: "devkit"
353345
documentation: "https://sensiml.com/documentation/firmware/sparkfun-thing-plus-quicklogic-eos-s3/sparkfun-thing-plus-quicklogic-eos-s3.html"
354346
manufacturer: QuickLogic
@@ -401,11 +393,7 @@
401393
"description": "Use the ARM CMSIS library intrinsic functions to accelerate ops",
402394
},
403395
"cpu_only":
404-
{
405-
"display_name": "CPU Only",
406-
"kernel": "",
407-
"description": "Use CPU based ops only",
408-
},
396+
{ "display_name": "CPU Only", "kernel": "", "description": "Use CPU based ops only" },
409397
}
410398
default_selections:
411399
{
@@ -414,6 +402,11 @@
414402
"float": "Soft FP",
415403
"hardware_accelerator": "cmsis_nn",
416404
}
405+
nn_inference_engines:
406+
{
407+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
408+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
409+
}
417410
platform_type: "devkit"
418411
documentation: "https://sensiml.com/documentation/firmware/arduino-nano33/arduino-nano33.html"
419412
manufacturer: Arduino
@@ -445,6 +438,11 @@
445438
"codegen_app_name": "testdata_runner",
446439
},
447440
}
441+
nn_inference_engines:
442+
{
443+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
444+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
445+
}
448446
platform_type: "compiler"
449447
documentation: "https://sensiml.com/documentation/firmware/x86-processors/x86-platforms.html"
450448
manufacturer: MinGW
@@ -483,11 +481,7 @@
483481
"description": "Use the ARM CMSIS library intrinsic functions to accelerate ops",
484482
},
485483
"cpu_only":
486-
{
487-
"display_name": "CPU Only",
488-
"kernel": "",
489-
"description": "Use CPU based ops only",
490-
},
484+
{ "display_name": "CPU Only", "kernel": "", "description": "Use CPU based ops only" },
491485
}
492486
default_selections:
493487
{
@@ -506,6 +500,11 @@
506500
"codegen_app_location": "platforms/bosch/nicla-sense-me",
507501
},
508502
}
503+
nn_inference_engines:
504+
{
505+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
506+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
507+
}
509508
platform_type: "devkit"
510509
documentation: "https://sensiml.com/documentation/firmware/arduino-nicla-sense-me/arduino-nicla-sense-me.html"
511510
manufacturer: Arduino
@@ -515,8 +514,7 @@
515514
applications:
516515
AI Model Runner:
517516
codegen_app_name: testdata_runner
518-
description:
519-
A Library that implements SensiML Simple Streaming interface
517+
description: A Library that implements SensiML Simple Streaming interface
520518
for reporting Knowledge Pack results
521519
supported_outputs:
522520
- - Serial
@@ -543,6 +541,11 @@
543541
developer: true
544542
enterprise: true
545543
starter: true
544+
nn_inference_engines:
545+
{
546+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
547+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
548+
}
546549
platform_type: compiler
547550
processors:
548551
- cf65817e-154f-42b1-83e0-dc70f276d945
@@ -576,6 +579,11 @@
576579
developer: true
577580
enterprise: true
578581
starter: true
582+
nn_inference_engines:
583+
{
584+
"nnom": { "value": "nnom", "display_name": "Neural Network on Microcontrollers" },
585+
"tf_micro": { "value": "tf_micro", "display_name": "TensorFlow Lite for Microcontrollers" },
586+
}
579587
platform_type: devkit
580588
processors:
581589
- cf65817e-154f-42b1-83e0-dc70f276d945

0 commit comments

Comments
 (0)