Commit 4b503b8
Streaming ww dev (#177)
* added sww_ref_l4r5zi; currently pretty similar to sww_testing
* changed I2S buffers to int16_t
* added readme to describe working of test project
* streaming processing in progress
* added linker scripts, somehow left out of earlier commits
* fixed some issues in streaming feature extraction (mostly pointer arithmetic and scaling errors
* sww_ref detects ww in streaming setup and pulses GPIO PB8, also changed stop command so we can do multiple I2S transactions w/o reboot
* PowerBoard LPM
* PowerBoard LPM
* Needed to add timer and I2C so auto-gen code is correct. Adding GPIO interrupt to capture ww detections
* Needed to add timer and I2C so auto-gen code is correct. Adding GPIO interrupt to capture ww detections
* Needed to add timer and I2C so auto-gen code is correct. Adding GPIO interrupt to capture ww detections
* removed wav capture code from streaming processing function
* changed uart1 baud rate to 115200
* added interrupt EXTI15 on pin G15
* added interrupt EXTI15 on pin G15
* added interrupt EXTI15 on pin G15
* Log File Implmentations, DO NOT RUN POWERBOARD
* Log File Implmentations, DO NOT RUN POWERBOARD
* Log File Implmentations, DO NOT RUN POWERBOARD
* interface now captures negative pulses on WW_DET_IN (G15) and can print out a list of timestamps. But timer rolls over at 64k
* changed from timer 16 to timer 2 because it has 32 bits; also filtered out repeat detections within 10ms
* removed some debug code and renamed pin PIN_WW_DETECTED => WW_DETECTED
* removed some debug code and renamed pin PIN_WW_DETECTED => WW_DETECTED
* interface -- reset timer 2 to 0 when beginning to record detections
* AutoDetect Powerboard WIP
* Powerboard WIP with Logging
* changed voltage from 3V to 3.3V
* Update README.md
* Update README.md
* Update README.md
* Add files via upload
Updated Images
* Rename LPM01A.jpg to LPM01A_old.jpg
* Rename LPM01A.JPG to LPM01A.jpg
* Updated Images
* Rename LPM01A.jpg to LPM01A._toast.jpg
* Add files via upload
* Delete benchmark/runner/img/LPM01A_old.jpg
* Delete benchmark/runner/img/LPM01A._toast.jpg
* making sww ref implementation follow common protocol
* updating runner to run streaming wakeword
* Update README.md
* changes to runner for streaming ww in progress (not fully working here)
* added variable timeout to send_command to accomodate long commands (like play wav-file)
* fixed a couple mis-spellings in doc strings
* changed EE_DEVICE_NAME to 'dut' to work with runner, though it should be able to handle other names
* commented out unneeded db print; should remove later as long as it doesn't cause problems
* in main, fixed case where all_negatives or all_positives == 0; also added model to dut_config; and added call to separate summarize function for sww
* fixed order and added delay into stream step of script; and added return detected_timestamps
* streaming ww benchmark runs in the runner, but does not yet compile false pos/neg ratios
* cleaned up a couple of errors that had gotten into demo notebook
* modified build_long_wav.py to take arguments and added a 10s easy test wav for validating setup
* made build_long_wav deliver 2-chan (stereo) wav files for compatibility with I2S
* updated build_long_wav to include sample rate and length in _ww_windows.json
* AD AUC and Accuracy Update
* Speed/No more Mode Update
* No more mode
* Powerboard WIP
* updated ref sw to use detection threshold set by #define DETECT_THRESHOLD and to issue one detection at beginning of streaming (for synchronization)
* modified play_wave to take optional timeout variable. still need to set this in a config file to match the file length
* added a pause and a variable timeout in wav play in script step
* added code to calculate detection statistics (false pos, etc.)
* removed long_wav_ww_windows.json because its info is moved into sww_data_dir/sww_long_test.json
* making PowerManager.board_timestamps_ms a list, to hold all timestamps in a test. Also printed out a caught exception and put the most recent timestamp into the data_queue along with other info
* added is_energy_mode condition to some of the results handling
* changed inference counting to count each cycle as 1 (instead of each element in the returned vector as 1)
* Powerboard WIP 2.0
* Accuracy/Performance Updates
* Accuracy/Performance Updates 2.0
* Interface/DUT Co-Working
* fixed demo notebook to work with different directory structure
* fixed processing of current measurement strings from lpm01a and fixed result handling in if mode == Energy block
* fixed issue where multiple 'stop' commands were hanging the power manager shutdown sequence; lots of debug messages still there
* now using 'events' from LPM01a based on D7 edges to measure timing. processing that info still WIP
* Old Mode Interface
* ReadMe Update
* Delete benchmark/runner/img/L4R5ZI.png
* Delete benchmark/runner/img/LPM01A.jpg
* Old Pictures
* Add files via upload
* Rename L4R5ZI.png to L4R5ZI_old.png
* Rename L4R5ZI_old.png to L4R5ZI.png
* Rename L4R5ZI.png to L4R5ZI_1.png
* Rename LPM01A.jpg to LPM01A_1.jpg
* Update README.md
* energy measurement working now. still some debug messages to remove
* fixed issue with energy mode
* some minor changes to make sww work with recent changes to results processing
* added line to strip 2nd channel out of long_wav if it is a stereo wav
* put log files in separate directory to avoid clogging main dir
* fixed clocking on SAI to fix sampling rate error -- clock div ratio was rounded 15.6=>15 so sampling freq was 16.8kHz instead of 16kHz
* fixed discrepancies wrt ref model (input scale factor and when to clip log mel energies)
* removed sww_testing_l4r5zi. all of its functionality is in sww_ref_l4r5zi
* added pin definitions to pulse D7 for timestamp and D6 for active processing (duty cycle) measurement
* SWW ref toggles D7 at init, and beginning and end of streaming
* sww power mode is mostly running now, but requires a 1sec delay after the wav stops playing before stopping power measurement
* fixed feature extractor to continue pre-emphasis filter across segment boundaries
* added 'echo' value in devices.yaml for enhanced interface board.
* reduced sleep time from 1s to 0.25s; still need to find root cause
* updated images in readme
* minor edits
* added contents for SD_card and sww_data_dir
* fixed to respect configurable DUT voltages. Also removed dut.yaml and to put all dut config in devices.yaml
* updated demo notebook because the wav file has moved to .../runner/sd_card
* updated documentation and figures
* added start time to wav playing
* removed extra prints in strww utils
* add 2 minute test
* added notes on running streaming test
* updated demo notebook to use the json test files
* Baud Changer Done
* Baud Changer Done
* Baud Changer 1.2
* Baud Changer 1.3
* Baud Changer 1.3
* Baud Changer 1.4
* Baud Changer 1.5
* Baud Changer 1.6
* New YAML files
* changed detection threshold 120=>115 to align with demo notebook
* fixed pre-emphasis so correct value is carried over from one frame to the next
* added a test command infer_wav [offset] that will run feature extraction and inference on a waveform stored in fixed_data.c as an array
* added 30s timeout for infer
* changed from_logits in add_qat() to False to be consistent w/ the initial float training and the model. softmax is needed during inference for consistent threshold
* removed two preferences files that should not be in repo
* removed sync_baud; moving to io_manager_enhanced
* added echo option to constructor
* perf_result is an output; should not be under git control
* added io.__enter__() before sync_baud to fix crashing
* added entry_count to SerialDevice enter()/exit() in case of multiple calls to __enter__()
* updated evaluate.py to deal with the json streaming test spec
* changed evaluate.py so it will choose TFLite intepreter or standard model code based on filename
* added stream_wav_uart.py
* added multiple retries on error. switched to logger for some output
* added retry option to send_cmd function.
* added db load, setptr, getptr; and extract_features_on_chunk
* changed tests_accuracy to use all test files
* added --specgram flag to evaluate to let you evaluate model on precomputed spectrogram features
* added --specgram flag to evaluate to let you evaluate model on precomputed spectrogram features
* proposed edits to rules
* changed DUT baud rate back to 115200 for SWW
* stashing some WIP in the temp branch while I go back and test an older commit
* updated reference h5 and tflite models; normalized model file names
* changed default epochs and l2 values
* added some LR scheduling to QAT phase
* fixed FP detection logic
* changed long wav file
* changed long wav file
* added pulsing of 'active' pin to run_model
* updated model; set model optimization to 'time'
* modified DUT class to take echo argument
* added echo to DUT definition
* fixed printf format error
* reverting devices.yaml; changed DUT baud rates were mistakenly commited
* WIP on adding duty cycle measurement. Added structure, but handler is not currently called
* duty cycle measurement (recording start and stop times on a 10us clock) working
* added echo mode for power manager and most of the support for duty cycle measurement
* added timeout kw arg to io_manager.send_command
* fixed an image filename typo and added a couple notes on I2S debug
* fixed logic so in performance or energy mode, anomaly detection only infers on one segment
* added message to the end of the run to indicate the logfile name
* fixed case of no loop count specified (e.g.'loop:' instead of 'loop 5:') so it uses full labels file.
* selectively allocating g_wav_record and g_act_buff, since there is not enough RAM for both
* restructured memory allocation for wav capture and activation capture to use a single pre-allocated general-purpose buffer
* updated sww reference and runner to optionally capture activation value
* updated wav capture function
* updated connection diagrams to show 'processing' pin -- used for duty cycle calculation
* was making a few edits, but now code does not work
* added check in case no DUT or interface is present
* a few local/temp edits were accidentally incorporated into the last commit; reverting those
* removed unneeded debug message
* interface board will report error if wav file does not successfully play
* fixed recording of DUT voltage.
* added line end to print_tee
* added duty cycle print out to results.txt file and some comments elsewhere
* fixed some code that relied on DUT name being l4r5zi
* removed unused dut_config argument and parse_dut_config function
* removed unused dut_voltage and dut_baud arguments. both are folded into devices.yaml file
* updated readme on runner
* Joulescope Power Update 1.0
* JS220 Partially Working
* JS220 Trigger 1.0
* updated notes in readme
* add try-except for undecodeable (corrupted) characters in serial_device._read_loop
* added condition to skip past empty lines in infer response. otherwise None's cause an error
* added print out of some debug info if power manager does not respond
* fixed error in call to get_baud_rate
* fixed error in call to print_energy_results
* in error handling in run, cast exception to string so regex would work
* auc and accuracy were backwards. fixed
* JS220 Implimentation
* JS220 Implimentation
* Cleanup
* JS vs LPM
* minor additions to runner readme
* removed some results files
* Adding JouleScope JS220 support. Requires libusb and pyusb now.
* fixed (again) bad get_baud_rate call that sneaked back in
* changed echo for LPM to False (should only be True for debugging)
* changed stopbits to 1 on DUT lpuart1 in sww ref (connects DUT to interface or host)
* added logic to convert a single result (ie no loop in script) to a list of result dicts
* fixed energy mode output; enforced 10s minimum
* added binary for interface board
* added notes on installing firmware
* added benchmark-specific devices files
* added note about DYLD_LIBRARY_PATH to resolve conflicting libusb versions on M1 macs
* median energy info was not going to results file (only terminal). Fixed
* made required number of cycles 1 for SWW, 5 for others
* improved some informational print outs
* added minor error handling to activation parsing
* updated tests scripts for energy and performance
* fixed AUC calculation (replaced with sklearn)
* fixed AUC calculation (replaced with sklearn)
* undoing two changes accidentally brought in by merging main->streaming_ww_dev: chane to interface/usart.c and sww_testing_l4r5zi came back in
* added disambiguation using check_name property when VID/PID are repeated
* added multi_class='ovr' to roc_auc_score to avoid errors in multiclass cases (all except ad)
* fixed roc_auc_score for two-class problem (person detection)
* Changed method to avoid erroneous connections when multiple devices have the same VID/PID.
Added interface property to devices_XXX.yaml files which must be "direct_usb" for non-serial devices
like the JS220.
* fixed tests_performance; they had wrong number of loops and wrong sww test
* fixed regex patterns to match new runner output
* made submission checker work with new runner output
* changed submission checker to use pandas dataframe
* updated submission checker to process SWW results
* fixed some issues with js220 support
* added retreiving name print statement for debugging help
* added duty cycle information to results.txt printout and fixed a couple of corner case failures
* removed line that calculates variable that never gets used
* added per-file info print out to results.txt
* more notes in readme
* updated L4R5zi hookup image
* updated submission checker
* updated rules
* merged master back into streaming_ww_dev
* enabled duty cycle measurement and SWW w/ only performance in submission checker
---------
Co-authored-by: TimotheeeNiven <rniven1@uncc.edu>
Co-authored-by: TimotheeeNiven <99817017+TimotheeeNiven@users.noreply.github.com>
Co-authored-by: Jeremy Holleman <jeremy@mlcommons.org>1 parent 904de6f commit 4b503b8
13 files changed
Lines changed: 766 additions & 543 deletions
File tree
- benchmark
- runner
- img
- power_manager
- tools/submission
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
183 | 190 | | |
184 | 191 | | |
185 | 192 | | |
| |||
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
196 | | - | |
| 203 | + | |
| 204 | + | |
197 | 205 | | |
198 | 206 | | |
199 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
167 | 186 | | |
168 | 187 | | |
169 | 188 | | |
| |||
272 | 291 | | |
273 | 292 | | |
274 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | 132 | | |
134 | 133 | | |
135 | | - | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
| |||
154 | 152 | | |
155 | 153 | | |
156 | 154 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | 155 | | |
161 | 156 | | |
| 157 | + | |
162 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
| |||
226 | 225 | | |
227 | 226 | | |
228 | 227 | | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
270 | 276 | | |
271 | 277 | | |
272 | 278 | | |
| |||
307 | 313 | | |
308 | 314 | | |
309 | 315 | | |
310 | | - | |
311 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
312 | 321 | | |
313 | 322 | | |
314 | 323 | | |
| |||
0 commit comments