Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
427 commits
Select commit Hold shift + click to select a range
02953c9
updated demo notebook
jeremy-syn Aug 12, 2024
c280e5d
added note about the demo notebook to readme
jeremy-syn Aug 12, 2024
900e126
merged gitignore from master branch
jeremy-syn Aug 12, 2024
02a1cbe
experimental code to save dataset from run to run
jeremy-syn Aug 26, 2024
f9ec337
Merge branch 'master' into streaming_ww_dev
Peter-Chang Sep 9, 2024
b048d4d
Merge branch 'streaming_ww_dev' of gh-syn:mlcommons/tiny into streami…
jeremy-syn Jan 19, 2025
5cfabb6
merged work from runner_dev_jeremy
jeremy-syn Jan 19, 2025
50104d0
Merge branch 'master' into streaming_ww_dev
jeremy-syn Jan 19, 2025
5c84b8e
compute_lfbe_f32 computes lfbe features in f32 for 1024 block length;…
jeremy-syn Jan 25, 2025
e674ce4
added code to measure execution time
jeremy-syn Jan 26, 2025
f708df3
removed DWT timing code (just using TIM16 now) and added timing measu…
jeremy-syn Jan 26, 2025
1b3a83e
updating some auto-generated files for the model
jeremy-syn Jan 27, 2025
a054d3b
merged tims work on the runner
jeremy-syn Jan 27, 2025
a53724b
removed comment in auto-gen usart.c code
jeremy-syn Jan 27, 2025
614dfa4
header file for timing left out of earlier commit
jeremy-syn Jan 27, 2025
e3db416
fixed interface gitignore to ignore settings files -- allow local cha…
jeremy-syn Jan 27, 2025
63402e9
Merge remote-tracking branch 'origin_jh/streaming_ww_dev' into stream…
jeremy-syn Jan 27, 2025
de9660b
cleaning up
jeremy-syn Jan 27, 2025
d876f53
added help string, fixed bug where empty command (just %) prints NULL…
jeremy-syn Feb 1, 2025
72a93fa
changed a couple of routines to return ai_error instead of meaningles…
jeremy-syn Feb 1, 2025
e01c2d5
added sww_ref_l4r5zi; currently pretty similar to sww_testing
jeremy-syn Feb 2, 2025
f3bfde3
changed I2S buffers to int16_t
jeremy-syn Feb 2, 2025
55fdb44
added readme to describe working of test project
jeremy-syn Feb 2, 2025
2e9f22d
streaming processing in progress
jeremy-syn Feb 3, 2025
c797356
added linker scripts, somehow left out of earlier commits
jeremy-syn Feb 6, 2025
f473c59
fixed some issues in streaming feature extraction (mostly pointer ari…
jeremy-syn Feb 7, 2025
95aebf3
sww_ref detects ww in streaming setup and pulses GPIO PB8, also chang…
jeremy-syn Feb 8, 2025
5c559f2
PowerBoard LPM
TimotheeeNiven Feb 10, 2025
9310b3e
PowerBoard LPM
TimotheeeNiven Feb 10, 2025
8cf13d1
Needed to add timer and I2C so auto-gen code is correct. Adding GPIO…
jeremy-syn Feb 13, 2025
b038aeb
Needed to add timer and I2C so auto-gen code is correct. Adding GPIO…
jeremy-syn Feb 13, 2025
72dbfdc
Needed to add timer and I2C so auto-gen code is correct. Adding GPIO…
jeremy-syn Feb 13, 2025
4039cdb
removed wav capture code from streaming processing function
jeremy-syn Feb 13, 2025
27e1f87
changed uart1 baud rate to 115200
jeremy-syn Feb 13, 2025
df6b844
added interrupt EXTI15 on pin G15
jeremy-syn Feb 13, 2025
26dbc0f
added interrupt EXTI15 on pin G15
jeremy-syn Feb 13, 2025
9a70fb6
added interrupt EXTI15 on pin G15
jeremy-syn Feb 13, 2025
1a016af
Log File Implmentations, DO NOT RUN POWERBOARD
TimotheeeNiven Feb 14, 2025
0c31a51
Log File Implmentations, DO NOT RUN POWERBOARD
TimotheeeNiven Feb 14, 2025
9f6592a
Log File Implmentations, DO NOT RUN POWERBOARD
TimotheeeNiven Feb 14, 2025
464563f
interface now captures negative pulses on WW_DET_IN (G15) and can pri…
jeremy-syn Feb 16, 2025
639f0af
changed from timer 16 to timer 2 because it has 32 bits; also filtere…
jeremy-syn Feb 17, 2025
a284ef4
removed some debug code and renamed pin PIN_WW_DETECTED => WW_DETECTED
jeremy-syn Feb 17, 2025
606f456
removed some debug code and renamed pin PIN_WW_DETECTED => WW_DETECTED
jeremy-syn Feb 17, 2025
f0d1362
interface -- reset timer 2 to 0 when beginning to record detections
jeremy-syn Feb 17, 2025
3f7c3e5
AutoDetect Powerboard WIP
TimotheeeNiven Feb 20, 2025
9d4b6c9
Powerboard WIP with Logging
TimotheeeNiven Feb 21, 2025
3a9014b
changed voltage from 3V to 3.3V
jeremy-syn Feb 21, 2025
6f93661
merged in work from Tim Niven's fork
jeremy-syn Feb 21, 2025
c5f20cb
Update README.md
TimotheeeNiven Feb 22, 2025
7475d3b
Update README.md
TimotheeeNiven Feb 22, 2025
b464c10
Update README.md
TimotheeeNiven Feb 22, 2025
4ed2d13
Add files via upload
TimotheeeNiven Feb 22, 2025
5a326db
Rename LPM01A.jpg to LPM01A_old.jpg
TimotheeeNiven Feb 22, 2025
7947c71
Rename LPM01A.JPG to LPM01A.jpg
TimotheeeNiven Feb 22, 2025
a109ea2
Updated Images
TimotheeeNiven Feb 22, 2025
c1d19e6
Rename LPM01A.jpg to LPM01A._toast.jpg
TimotheeeNiven Feb 22, 2025
b5041b9
Add files via upload
TimotheeeNiven Feb 22, 2025
2d7ea3a
Delete benchmark/runner/img/LPM01A_old.jpg
TimotheeeNiven Feb 22, 2025
00ce3cb
Delete benchmark/runner/img/LPM01A._toast.jpg
TimotheeeNiven Feb 22, 2025
465079b
making sww ref implementation follow common protocol
jeremy-syn Mar 3, 2025
ba76af0
updating runner to run streaming wakeword
jeremy-syn Mar 3, 2025
d263856
Merge remote-tracking branch 'tim_niven/streaming_ww_dev' into stream…
jeremy-syn Mar 3, 2025
2f845dc
Update README.md
TimotheeeNiven Mar 3, 2025
c482c46
Merge remote-tracking branch 'tim_niven/streaming_ww_dev' into stream…
jeremy-syn Mar 3, 2025
a55f9c2
changes to runner for streaming ww in progress (not fully working here)
jeremy-syn Mar 5, 2025
c2b1bcd
added variable timeout to send_command to accomodate long commands (l…
jeremy-syn Mar 5, 2025
b48235b
fixed a couple mis-spellings in doc strings
jeremy-syn Mar 5, 2025
96a0df2
changed EE_DEVICE_NAME to 'dut' to work with runner, though it should…
jeremy-syn Mar 6, 2025
e9b5036
commented out unneeded db print; should remove later as long as it do…
jeremy-syn Mar 6, 2025
e95f2e1
in main, fixed case where all_negatives or all_positives == 0; also a…
jeremy-syn Mar 6, 2025
2805e63
fixed order and added delay into stream step of script; and added ret…
jeremy-syn Mar 6, 2025
498964c
streaming ww benchmark runs in the runner, but does not yet compile f…
jeremy-syn Mar 6, 2025
3ba48d5
cleaned up a couple of errors that had gotten into demo notebook
jeremy-syn Mar 7, 2025
6133d7b
modified build_long_wav.py to take arguments and added a 10s easy tes…
jeremy-syn Mar 9, 2025
837cfbf
made build_long_wav deliver 2-chan (stereo) wav files for compatibili…
jeremy-syn Mar 9, 2025
c864dd8
updated build_long_wav to include sample rate and length in _ww_windo…
jeremy-syn Mar 10, 2025
aa50770
AD AUC and Accuracy Update
TimotheeeNiven Mar 18, 2025
fe3e069
Speed/No more Mode Update
TimotheeeNiven Mar 18, 2025
4c1dea3
No more mode
TimotheeeNiven Mar 18, 2025
e6765b9
Powerboard WIP
TimotheeeNiven Mar 18, 2025
3a25d83
Merge branch 'streaming_ww_dev' of https://github.com/TimotheeeNiven/…
TimotheeeNiven Mar 18, 2025
7796894
updated ref sw to use detection threshold set by #define DETECT_THRES…
jeremy-syn Mar 19, 2025
88d52f3
modified play_wave to take optional timeout variable. still need to s…
jeremy-syn Mar 19, 2025
3b11f81
added a pause and a variable timeout in wav play in script step
jeremy-syn Mar 19, 2025
ccd8d56
added code to calculate detection statistics (false pos, etc.)
jeremy-syn Mar 19, 2025
76dd2b2
removed long_wav_ww_windows.json because its info is moved into sww_d…
jeremy-syn Mar 19, 2025
cf5766c
merged changes from tim
jeremy-syn Mar 19, 2025
386bf8d
making PowerManager.board_timestamps_ms a list, to hold all timestamp…
jeremy-syn Mar 19, 2025
7f83583
added is_energy_mode condition to some of the results handling
jeremy-syn Mar 19, 2025
51088b7
changed inference counting to count each cycle as 1 (instead of each …
jeremy-syn Mar 20, 2025
1c0d406
Powerboard WIP 2.0
TimotheeeNiven Mar 20, 2025
8b59370
Accuracy/Performance Updates
TimotheeeNiven Mar 21, 2025
1eaaaed
Accuracy/Performance Updates 2.0
TimotheeeNiven Mar 21, 2025
6a0ac6b
Interface/DUT Co-Working
TimotheeeNiven Mar 25, 2025
752cffc
fixed demo notebook to work with different directory structure
jeremy-syn Mar 26, 2025
1af53ff
Merge remote-tracking branch 'tim_niven/streaming_ww_dev' into stream…
jeremy-syn Mar 26, 2025
426256a
fixed processing of current measurement strings from lpm01a and fixed…
jeremy-syn Mar 26, 2025
32ef6ef
fixed issue where multiple 'stop' commands were hanging the power man…
jeremy-syn Mar 27, 2025
b495c47
now using 'events' from LPM01a based on D7 edges to measure timing. …
jeremy-syn Mar 27, 2025
1377e8d
Old Mode Interface
TimotheeeNiven Mar 28, 2025
0dfea17
ReadMe Update
TimotheeeNiven Mar 28, 2025
c5553de
Delete benchmark/runner/img/L4R5ZI.png
TimotheeeNiven Mar 28, 2025
6726f3f
Delete benchmark/runner/img/LPM01A.jpg
TimotheeeNiven Mar 28, 2025
870f7e4
Old Pictures
TimotheeeNiven Mar 28, 2025
9b2b2f7
Add files via upload
TimotheeeNiven Mar 28, 2025
363d8cd
Rename L4R5ZI.png to L4R5ZI_old.png
TimotheeeNiven Mar 28, 2025
de601cb
Rename L4R5ZI_old.png to L4R5ZI.png
TimotheeeNiven Mar 28, 2025
133cf5b
Rename L4R5ZI.png to L4R5ZI_1.png
TimotheeeNiven Mar 28, 2025
6f3bacf
Rename LPM01A.jpg to LPM01A_1.jpg
TimotheeeNiven Mar 28, 2025
0eb2157
Update README.md
TimotheeeNiven Mar 28, 2025
b9a488f
energy measurement working now. still some debug messages to remove
jeremy-syn Mar 29, 2025
1d8851c
Merge remote-tracking branch 'tim_niven/streaming_ww_dev' into stream…
jeremy-syn Mar 29, 2025
bdb72e8
fixed issue with energy mode
jeremy-syn Mar 29, 2025
9057523
some minor changes to make sww work with recent changes to results pr…
jeremy-syn Mar 30, 2025
a8b2465
added line to strip 2nd channel out of long_wav if it is a stereo wav
jeremy-syn Mar 31, 2025
861b371
put log files in separate directory to avoid clogging main dir
jeremy-syn Mar 31, 2025
31e482f
fixed clocking on SAI to fix sampling rate error -- clock div ratio w…
jeremy-syn Mar 31, 2025
14cb970
fixed discrepancies wrt ref model (input scale factor and when to cli…
jeremy-syn Mar 31, 2025
e6b54a6
removed sww_testing_l4r5zi. all of its functionality is in sww_ref_l…
jeremy-syn Apr 2, 2025
d6b7a64
added pin definitions to pulse D7 for timestamp and D6 for active pro…
jeremy-syn Apr 2, 2025
92cbb59
SWW ref toggles D7 at init, and beginning and end of streaming
jeremy-syn Apr 4, 2025
381b402
sww power mode is mostly running now, but requires a 1sec delay after…
jeremy-syn Apr 4, 2025
ab4f3ea
fixed feature extractor to continue pre-emphasis filter across segmen…
jeremy-syn Apr 5, 2025
3d96081
added 'echo' value in devices.yaml for enhanced interface board.
jeremy-syn Apr 5, 2025
90a8b0a
reduced sleep time from 1s to 0.25s; still need to find root cause
jeremy-syn Apr 6, 2025
9c8d49c
updated images in readme
jeremy-syn Apr 7, 2025
9068c13
minor edits
jeremy-syn Apr 7, 2025
819d55a
added contents for SD_card and sww_data_dir
jeremy-syn Apr 7, 2025
c937ad8
fixed to respect configurable DUT voltages. Also removed dut.yaml an…
jeremy-syn Apr 10, 2025
1e960b3
updated demo notebook because the wav file has moved to .../runner/sd…
jeremy-syn Apr 12, 2025
89399b4
updated documentation and figures
jeremy-syn Apr 13, 2025
63a0a25
added start time to wav playing
jeremy-syn Apr 13, 2025
7e2f5c8
removed extra prints in strww utils
jeremy-syn Apr 14, 2025
a996c0f
add 2 minute test
jeremy-syn Apr 14, 2025
31a417c
added notes on running streaming test
jeremy-syn Apr 14, 2025
72fbf5c
updated demo notebook to use the json test files
jeremy-syn Apr 14, 2025
3f6ba02
Baud Changer Done
TimotheeeNiven Apr 14, 2025
ff13675
Baud Changer Done
TimotheeeNiven Apr 22, 2025
42db64b
Baud Changer 1.2
TimotheeeNiven Apr 22, 2025
550d819
Baud Changer 1.3
TimotheeeNiven Apr 22, 2025
a3f6b21
Baud Changer 1.3
TimotheeeNiven Apr 22, 2025
ecbe8ba
Baud Changer 1.4
TimotheeeNiven Apr 23, 2025
3cd26b9
Baud Changer 1.5
TimotheeeNiven Apr 23, 2025
5fdedaf
Baud Changer 1.6
TimotheeeNiven Apr 23, 2025
39b2b98
New YAML files
TimotheeeNiven Apr 24, 2025
75aedbb
changed detection threshold 120=>115 to align with demo notebook
jeremy-syn Apr 25, 2025
43ec0df
fixed pre-emphasis so correct value is carried over from one frame to…
jeremy-syn Apr 25, 2025
c3438c2
added a test command infer_wav [offset] that will run feature extract…
jeremy-syn Apr 25, 2025
8f255dc
Merge remote-tracking branch 'tim_niven/streaming_ww_dev' into stream…
jeremy-syn Apr 25, 2025
b210ff0
added 30s timeout for infer
jeremy-syn Apr 25, 2025
0a7aabe
changed from_logits in add_qat() to False to be consistent w/ the ini…
Apr 27, 2025
232bac4
removed two preferences files that should not be in repo
jeremy-syn Apr 30, 2025
c7c375b
removed sync_baud; moving to io_manager_enhanced
jeremy-syn May 2, 2025
8cff588
added echo option to constructor
jeremy-syn May 2, 2025
529923b
perf_result is an output; should not be under git control
jeremy-syn May 2, 2025
a4f7ce1
added io.__enter__() before sync_baud to fix crashing
jeremy-syn May 2, 2025
669e3a4
added entry_count to SerialDevice enter()/exit() in case of multiple …
jeremy-syn May 2, 2025
ab41c0d
updated evaluate.py to deal with the json streaming test spec
jeremy-syn May 9, 2025
9e0bba9
changed evaluate.py so it will choose TFLite intepreter or standard m…
jeremy-syn May 9, 2025
fba7d51
added stream_wav_uart.py
jeremy-syn May 9, 2025
30d43a0
added multiple retries on error. switched to logger for some output
jeremy-syn May 10, 2025
8c4bc21
added retry option to send_cmd function.
jeremy-syn May 11, 2025
985ccaa
added db load, setptr, getptr; and extract_features_on_chunk
jeremy-syn May 11, 2025
8d19434
changed tests_accuracy to use all test files
jeremy-syn May 11, 2025
2989079
added --specgram flag to evaluate to let you evaluate model on precom…
jeremy-syn May 11, 2025
0e6ae8b
added --specgram flag to evaluate to let you evaluate model on precom…
jeremy-syn May 11, 2025
7d1f670
Merge branch 'streaming_ww_dev' of https://github.com/mlcommons/tiny …
May 11, 2025
3631530
proposed edits to rules
jeremy-syn May 12, 2025
0a18ee0
changed DUT baud rate back to 115200 for SWW
jeremy-syn May 17, 2025
267cc31
stashing some WIP in the temp branch while I go back and test an olde…
jeremy-syn May 17, 2025
ffa620d
updated reference h5 and tflite models; normalized model file names
May 19, 2025
aae00a3
changed default epochs and l2 values
May 19, 2025
ed84d7e
added some LR scheduling to QAT phase
May 19, 2025
83cbf03
Merge branch 'streaming_ww_dev' of gh-syn:mlcommons/tiny into streami…
May 19, 2025
12a1cac
fixed FP detection logic
jeremy-syn May 19, 2025
1a78537
changed long wav file
jeremy-syn May 19, 2025
31c82f0
changed long wav file
jeremy-syn May 19, 2025
4a3186f
added pulsing of 'active' pin to run_model
jeremy-syn May 21, 2025
9893b39
updated model; set model optimization to 'time'
jeremy-syn May 23, 2025
a46dfb2
modified DUT class to take echo argument
jeremy-syn May 23, 2025
28ca45d
added echo to DUT definition
jeremy-syn May 23, 2025
b0d19eb
Merge branch 'streaming_ww_dev' of gh-syn:mlcommons/tiny into streami…
jeremy-syn May 23, 2025
43be1e6
fixed printf format error
jeremy-syn May 23, 2025
701145f
Merge branch 'tmp_17may_fix_discrep' into streaming_ww_dev
jeremy-syn May 23, 2025
a4eb6ce
reverting devices.yaml; changed DUT baud rates were mistakenly commited
jeremy-syn May 23, 2025
83cf3f2
WIP on adding duty cycle measurement. Added structure, but handler i…
jeremy-syn May 26, 2025
d8d5cfb
duty cycle measurement (recording start and stop times on a 10us cloc…
jeremy-syn May 26, 2025
29eaf03
added echo mode for power manager and most of the support for duty cy…
jeremy-syn May 26, 2025
3f179db
added timeout kw arg to io_manager.send_command
jeremy-syn May 26, 2025
766a23e
fixed an image filename typo and added a couple notes on I2S debug
jeremy-syn May 26, 2025
a30740b
fixed logic so in performance or energy mode, anomaly detection only …
jeremy-syn May 29, 2025
71bae36
added message to the end of the run to indicate the logfile name
jeremy-syn May 29, 2025
9eb4720
fixed case of no loop count specified (e.g.'loop:' instead of 'loop 5…
jeremy-syn May 29, 2025
ac20c02
selectively allocating g_wav_record and g_act_buff, since there is no…
jeremy-syn May 31, 2025
b6af719
restructured memory allocation for wav capture and activation capture…
jeremy-syn May 31, 2025
eaca25e
updated sww reference and runner to optionally capture activation value
jeremy-syn Jun 2, 2025
f1ba43b
updated wav capture function
jeremy-syn Jun 2, 2025
cd795ee
updated connection diagrams to show 'processing' pin -- used for duty…
jeremy-syn Jun 5, 2025
bbceca0
was making a few edits, but now code does not work
jeremy-syn Jun 7, 2025
20d7b7b
added check in case no DUT or interface is present
jeremy-syn Jun 7, 2025
7a9c193
a few local/temp edits were accidentally incorporated into the last c…
jeremy-syn Jun 7, 2025
d7048f1
removed unneeded debug message
jeremy-syn Jun 8, 2025
9f00286
interface board will report error if wav file does not successfully play
jeremy-syn Jun 9, 2025
665f83c
fixed recording of DUT voltage.
jeremy-syn Jun 9, 2025
144234f
added line end to print_tee
jeremy-syn Jun 9, 2025
aee2867
added duty cycle print out to results.txt file and some comments else…
jeremy-syn Jun 9, 2025
3e75a72
fixed some code that relied on DUT name being l4r5zi
jeremy-syn Jun 9, 2025
15ad842
removed unused dut_config argument and parse_dut_config function
jeremy-syn Jun 9, 2025
ae9507e
removed unused dut_voltage and dut_baud arguments. both are folded i…
jeremy-syn Jun 9, 2025
003f56d
updated readme on runner
jeremy-syn Jun 9, 2025
e5a4789
Joulescope Power Update 1.0
TimotheeeNiven Jun 12, 2025
1b1d6d2
JS220 Partially Working
TimotheeeNiven Jun 20, 2025
241aa68
JS220 Trigger 1.0
TimotheeeNiven Jun 20, 2025
99dcbc0
updated notes in readme
jeremy-syn Jun 23, 2025
ccbf466
add try-except for undecodeable (corrupted) characters in serial_devi…
jeremy-syn Jun 23, 2025
222413c
added condition to skip past empty lines in infer response. otherwise…
jeremy-syn Jun 23, 2025
0730c2f
added print out of some debug info if power manager does not respond
jeremy-syn Jun 23, 2025
b4b448e
fixed error in call to get_baud_rate
jeremy-syn Jun 23, 2025
a7fcb37
fixed error in call to print_energy_results
jeremy-syn Jun 23, 2025
5bc1b5d
in error handling in run, cast exception to string so regex would work
jeremy-syn Jun 23, 2025
6ecdaf8
auc and accuracy were backwards. fixed
jeremy-syn Jun 23, 2025
7851b99
JS220 Implimentation
TimotheeeNiven Jun 25, 2025
b42f8f6
JS220 Implimentation
TimotheeeNiven Jun 25, 2025
1e5b80d
Cleanup
TimotheeeNiven Jun 25, 2025
344c3c2
JS vs LPM
TimotheeeNiven Jun 25, 2025
d1bdb00
minor additions to runner readme
jeremy-syn Jun 25, 2025
b4cbab4
removed some results files
jeremy-syn Jun 25, 2025
5158b74
merging js220 from tim's fork
jeremy-syn Jun 25, 2025
6e16fd8
Adding JouleScope JS220 support. Requires libusb and pyusb now.
jeremy-syn Jun 26, 2025
c5af5b3
fixed (again) bad get_baud_rate call that sneaked back in
jeremy-syn Jun 26, 2025
657343a
changed echo for LPM to False (should only be True for debugging)
jeremy-syn Jun 27, 2025
7f3106b
changed stopbits to 1 on DUT lpuart1 in sww ref (connects DUT to inte…
jeremy-syn Jun 27, 2025
394cbeb
added logic to convert a single result (ie no loop in script) to a li…
jeremy-syn Jun 27, 2025
4521f63
fixed energy mode output; enforced 10s minimum
jeremy-syn Jun 29, 2025
09ba0f2
added binary for interface board
jeremy-syn Jun 30, 2025
a3777c9
added notes on installing firmware
jeremy-syn Jun 30, 2025
61489f1
added benchmark-specific devices files
jeremy-syn Jun 30, 2025
a7e5171
added note about DYLD_LIBRARY_PATH to resolve conflicting libusb vers…
jeremy-syn Jun 30, 2025
7159d07
median energy info was not going to results file (only terminal). Fixed
jeremy-syn Jul 1, 2025
a18146d
made required number of cycles 1 for SWW, 5 for others
jeremy-syn Jul 2, 2025
09f3bf8
improved some informational print outs
jeremy-syn Jul 3, 2025
f6f3293
added minor error handling to activation parsing
jeremy-syn Jul 3, 2025
3164509
updated tests scripts for energy and performance
jeremy-syn Jul 3, 2025
d38d183
fixed AUC calculation (replaced with sklearn)
jeremy-syn Jul 6, 2025
8c69ad6
fixed AUC calculation (replaced with sklearn)
jeremy-syn Jul 6, 2025
28c0ecb
Merge branch 'master' into streaming_ww_dev
jeremy-syn Jul 7, 2025
9983cb5
undoing two changes accidentally brought in by merging main->streamin…
jeremy-syn Jul 7, 2025
7a1161d
added disambiguation using check_name property when VID/PID are repeated
jeremy-syn Jul 7, 2025
6216bdf
added multi_class='ovr' to roc_auc_score to avoid errors in multiclas…
jeremy-syn Jul 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 8 additions & 3 deletions benchmark/MLPerfTiny_Rules.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ The suite includes the following benchmarks:
| Visual Wake Words | Binary image classification | Visual Wake Words Dataset | MobileNet | 80% (Top 1)
| Image Classification | Small image classification | Cifar10 | ResNet | 85% (Top 1)
| Anomaly Detection | Detecting anomalies in machine operating sounds | ToyADMOS | Deep AutoEncoder | 0.85 (AUC)
| Streaming Wakeword | Detecting wakewords in a continuous stream of audio| Custom | 1D DS-CNN | TBD
|===

==== Relaxed constraints for the Open division
Expand All @@ -189,10 +190,13 @@ The suite includes the following benchmarks:

== Benchmark Runner



=== EnergyRunner™ benchmark framework
The benchmark suite is run using the EnergyRunner™ benchmark framework, which detects the DUT, sends inputs, and reads outputs over UART.
The benchmark suite is run using the EnergyRunner™ benchmark framework from EEMBC, which detects the DUT, sends inputs, and reads outputs over UART. The EEMBC runner is being phased out. It will be permitted for teh KWS, VWW, IC, and AD benchmarks in the summer 2015 submission. After that, only the MLCommons Runner will be permitted. The EEMBC runner does not support the streaming wakeword benchmark.

The runner is available here: https://github.com/eembc/energyrunner
The EEMBC runner is available here: https://github.com/eembc/energyrunner
The MLCommons runner is available in this repository: https://github.com/mlcommons/tiny/tree/master/benchmark/runner

Note: The same code must be run for both the accuracy and performance Runner modes.

Expand Down Expand Up @@ -332,7 +336,8 @@ The following techniques are disallowed:

* Discarding non-zero weight elements, including pruning

* Caching queries or responses
* Caching queries or responses between files. However, in the streaming test, it is
permitted to store intermediate activations between frames of the same waveform.

* Coalescing identical queries

Expand Down
2 changes: 2 additions & 0 deletions benchmark/interface/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
cmake-build-*/
/STM32CubeIDE/Debug/
/STM32CubeIDE/Release/
STM32CubeIDE/.settings/
.metadata/
148 changes: 76 additions & 72 deletions benchmark/interface/.mxproject

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions benchmark/interface/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>interface</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
201 changes: 199 additions & 2 deletions benchmark/interface/Application/CLI/InterfaceMenu.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include "InterfaceMenu.hpp"
#include "../IDataSource.hpp"
#include "../Audio/WaveSink.hpp"
#include "../ResourceManager.hpp"
#include "usart.h"
#include "baud_config.h"



void CLI_Init(TX_BYTE_POOL *byte_pool, UART_HandleTypeDef *huart)
{
Expand All @@ -14,6 +19,29 @@ void CLI_Run()
CLI::InterfaceMenu::GetSingleton().Run();
}

void Record_WW_Detection()
{
CLI::InterfaceMenu::GetSingleton().RecordOneDetection();
}

void Record_Dutycycle_Start()
{
if( CLI::InterfaceMenu::InstanceInitialized() )
{
// only call this if the CLI instance is initialized
CLI::InterfaceMenu::GetSingleton().DutycycleStart();
}
}
void Record_Dutycycle_Stop()
{
if( CLI::InterfaceMenu::InstanceInitialized() )
{
// only call this if the CLI instance is initialized
CLI::InterfaceMenu::GetSingleton().DutycycleStop();
}
}


namespace CLI
{
InterfaceMenu *InterfaceMenu::instance = (InterfaceMenu *)TX_NULL;
Expand All @@ -26,8 +54,22 @@ namespace CLI
{"name", NameWrapper},
{"ls", ListWrapper},
{"play", PlayWrapper},
{"setbaud", SetBaudWrapper},
{"checkbaud", CheckBaudWrapper},
{"record_detections", RecDetsWrapper},
{"print_detections", PrintDetsWrapper},
{"print_dutycycle", PrintDutycycleWrapper},
{"", DefaultWrapper} };

bool InterfaceMenu::InstanceInitialized()
{
if( instance )
return true;
else
return false;
}


/**
* Wrap the singleton function in a static function
*/
Expand All @@ -51,6 +93,43 @@ namespace CLI
{
instance->Play(args);
}
/**
* Wrap the singleton function in a static function
*/
void InterfaceMenu::SetBaudWrapper(const std::string &args)
{
instance->SetBaud(args);
}
/**
* Wrap the singleton function in a static function
*/
void InterfaceMenu::CheckBaudWrapper(const std::string &args)
{
instance->CheckBaud(args);
}
/**
* Wrap the singleton function in a static function
*/
void InterfaceMenu::RecDetsWrapper(const std::string &args)
{
instance->RecordDetections(args);
}

/**
* Wrap the singleton function in a static function
*/
void InterfaceMenu::PrintDetsWrapper(const std::string &args)
{
instance->PrintDetections(args);
}

/**
* Wrap the singleton function in a static function
*/
void InterfaceMenu::PrintDutycycleWrapper(const std::string &args)
{
instance->PrintDutycycle(args);
}

/**
* Wrap the singleton function in a static function
Expand Down Expand Up @@ -155,14 +234,132 @@ namespace CLI
*/
void InterfaceMenu::Play(const std::string &args)
{
Audio::PlayerResult result;
IDataSource *source = file_system.OpenFile(args);
Audio::WaveSource wav(*source);
std::string *msg = new std::string("Playing ");
// if( !wav.valid_wave ) {
// std::string *msg = new std::string("Error. Not a valid wav file: ");
// msg->append(source->GetName());
// msg->append("\n");
// SendString(msg->c_str());
// }
std::string *msg = new std::string("Attempting to play ");
msg->append(source->GetName());
msg->append("\n");
SendString(msg->c_str());
player.Play(wav);
result = player.Play(wav);
if( result == Audio::ERROR ) {
SendString("Error playing file. Check that the file exists and is a 2-channel wav file.\n");
}
else {
SendString("succeeded.\n");
}

SendEnd();
delete source;
}

/**
* Set the new baud rate for the board
*/
void InterfaceMenu::SetBaud(const std::string &args)
{
int baud = std::stoi(args);
SaveBaudRateToFlash(baud); // Save permanently to Flash

SendString("set baud to: " + args + "\n");

SendEnd();
NVIC_SystemReset(); //Reset the MCU
}


/**
* Check the current baud rate
*/
void InterfaceMenu::CheckBaud(const std::string &args)
{
int currentBaud = huart3.Init.BaudRate;

SendString("baud is: " + std::to_string(currentBaud) + "\n");

SendEnd(); // End response
}




void InterfaceMenu::RecordDetections(const std::string &args)
{
// Sets the interface board into mode to capture detections,
// but the detections are recorded in an interrupt handler,
// so we can return here and proceed to playing the wav file

__HAL_TIM_SET_COUNTER(&htim2, 0);
SendString("Now recording detections");
SendEndLine();
dut.StartRecordingDetections();
SendEnd();
}

void InterfaceMenu::PrintDetections(const std::string &args)
{
uint32_t *timestamps = dut.GetDetections();
uint32_t num_timestamps = dut.GetNumDetections();

SendString("Detection Timestamps (ms)");
SendEndLine();
for(uint32_t i=0; i<num_timestamps; i++)
{
SendString(std::to_string(timestamps[i]) + ",");
SendEndLine();
}
SendEnd();
}

void InterfaceMenu::PrintDutycycle(const std::string &args)
{
uint32_t *rising_edges = dut.GetDutycycleRisingEdges();
uint32_t num_rising_edges = dut.GetNumDutycycleRisingEdges();
uint32_t *falling_edges = dut.GetDutycycleFallingEdges();
uint32_t num_falling_edges = dut.GetNumDutycycleFallingEdges();

SendString("Duty cycle start times (s)");
SendEndLine();
for(uint32_t i=0; i<num_rising_edges; i++)
{
SendString(std::to_string(rising_edges[i]) + ", ");
if( (i+1) % 8 == 0){
SendEndLine();
}
}
SendEndLine();
SendString("Duty cycle stop times (s)");
SendEndLine();
for(uint32_t i=0; i<num_falling_edges; i++)
{
SendString(std::to_string(falling_edges[i]) + ", ");
if( (i+1) % 8 == 0){
SendEndLine();
}
}
SendEnd();
}


void InterfaceMenu::RecordOneDetection()
{
dut.RecordDetection();
}

void InterfaceMenu::DutycycleStart()
{
dut.RecordDutycycleStart();
}

void InterfaceMenu::DutycycleStop()
{
dut.RecordDutycycleStop();
}

}
4 changes: 4 additions & 0 deletions benchmark/interface/Application/CLI/InterfaceMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ void CLI_Init(TX_BYTE_POOL *byte_pool, UART_HandleTypeDef *huart);
*/
void CLI_Run();

void Record_WW_Detection();
void Record_Dutycycle_Stop();
void Record_Dutycycle_Start();

#ifdef __cplusplus
}
#endif
Expand Down
36 changes: 30 additions & 6 deletions benchmark/interface/Application/CLI/InterfaceMenu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@ namespace CLI
* @return the menu instance
*/
static InterfaceMenu &GetSingleton();
void RecordOneDetection();
void DutycycleStart();
void DutycycleStop();


// Wrapper function declarations
static void ListWrapper(const std::string &args);
static void NameWrapper(const std::string &args);
static void PassthroughWrapper(const std::string &args);
static void PlayWrapper(const std::string &args);
static void SetBaudWrapper(const std::string &args);
static void CheckBaudWrapper(const std::string &args);
static void RecDetsWrapper(const std::string &args);
static void PrintDetsWrapper(const std::string &args);
static void PrintDutycycleWrapper(const std::string &args);
static void DefaultWrapper(const std::string &args);
static bool InstanceInitialized();

// Declarations for SetBaud and CheckBaud
void SetBaud(const std::string &args);
void CheckBaud(const std::string &args);

private:
/**
* Allow CLI_Init access to private constructor to create the singleton.
Expand All @@ -28,20 +50,22 @@ namespace CLI
static TX_MUTEX singleton_mutex;
static InterfaceMenu *instance;
static void InitSingleton(TX_BYTE_POOL &byte_pool, IO::Uart *uart, IO::FileSystem &file_system, Audio::WaveSink &player, Test::DeviceUnderTest &dut);
static void ListWrapper(const std::string &args);
static void NameWrapper(const std::string &args);
static void PassthroughWrapper(const std::string &args);
static void PlayWrapper(const std::string &args);
static void DefaultWrapper(const std::string &args);

InterfaceMenu(TX_BYTE_POOL &byte_pool, IO::Uart &uart, IO::FileSystem &file_system, Audio::WaveSink &player, Test::DeviceUnderTest &dut);
void List(const std::string &args);
void Name(const std::string &args);
void Passthrough(const std::string &args);
void Play(const std::string &args);
void RecordDetections(const std::string &args);
void PrintDetections(const std::string &args);
void PrintDutycycle(const std::string &args);

IO::FileSystem &file_system;
Audio::WaveSink &player;
Test::DeviceUnderTest &dut;
};
}

#endif //CLI_INTERFACEMENU_HPP
void Record_WW_Detection();

#endif // CLI_INTERFACEMENU_HPP
12 changes: 12 additions & 0 deletions benchmark/interface/Application/CLI/Menu.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "Menu.hpp"
#include "usart.h"
#include "tim.h" // jhdbg only needed for debug

#define RESPONSE_QUEUE_SIZE 20 * sizeof(ULONG)

Expand All @@ -20,6 +21,17 @@ namespace CLI
const std::string *buffer = uart.ReadUntil("%");
HandleCommand(*buffer);
delete buffer;

// HAL_GPIO_WritePin(WW_DET_IN_GPIO_Port, WW_DET_IN_Pin, GPIO_PIN_SET);
// int delay_start = __HAL_TIM_GET_COUNTER(&htim2);
// while(__HAL_TIM_GET_COUNTER(&htim2) < delay_start + 100 ){
// ;
// }
// HAL_GPIO_WritePin(WW_DET_IN_GPIO_Port, WW_DET_IN_Pin, GPIO_PIN_RESET);

// int pin_val = HAL_GPIO_ReadPin(WW_DET_IN_GPIO_Port, WW_DET_IN_Pin);
// std::string message = "pin is " + std::to_string(pin_val);
// uart.SendString(message);
}
}

Expand Down
2 changes: 2 additions & 0 deletions benchmark/interface/Application/ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ ResourceManager::ResourceManager(TX_BYTE_POOL &byte_pool): task_runner(new Tasks
dut(new Test::DeviceUnderTest(*task_runner, new IO::Uart(byte_pool, &huart3)))
{
}


Loading