Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mlcommons/tiny
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master@{1day}
Choose a base ref
...
head repository: mlcommons/tiny
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 1 commit
  • 1,427 files changed
  • 5 contributors

Commits on Jul 8, 2025

  1. Merging SWW into master (#176)

    * updated demo notebook
    
    * added note about the demo notebook to readme
    
    * experimental code to save dataset from run to run
    
    * merged work from runner_dev_jeremy
    
    * compute_lfbe_f32 computes lfbe features in f32 for 1024 block length; short tests show matching to TF float
    
    * added code to measure execution time
    
    * removed DWT timing code (just using TIM16 now) and added timing measurement to run_model
    
    * updating some auto-generated files for the model
    
    * merged tims work on the runner
    
    * removed comment in auto-gen usart.c code
    
    * header file for timing left out of earlier commit
    
    * fixed interface gitignore to ignore settings files -- allow local changes
    
    * cleaning up
    
    * added help string, fixed bug where empty command (just %) prints NULL, so dumps memory to terminal
    
    * changed a couple of routines to return ai_error instead of meaningless int (0)
    
    * 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)
    
    ---------
    
    Co-authored-by: Peter Chang <[email protected]>
    Co-authored-by: TimotheeeNiven <[email protected]>
    Co-authored-by: TimotheeeNiven <[email protected]>
    Co-authored-by: Jeremy Holleman <[email protected]>
    5 people authored Jul 8, 2025
    Configuration menu
    Copy the full SHA
    904de6f View commit details
    Browse the repository at this point in the history
Loading