feat(examples): add scripts to run all examples and compare outputs across runs#782
Open
PabloCarmona wants to merge 2 commits into
Open
feat(examples): add scripts to run all examples and compare outputs across runs#782PabloCarmona wants to merge 2 commits into
PabloCarmona wants to merge 2 commits into
Conversation
99eb8c5 to
1c7d672
Compare
Signed-off-by: Pablo Carmona Gonzalez <pablocarmonagonzalez@gmail.com>
Signed-off-by: Pablo Carmona Gonzalez <pablocarmonagonzalez@gmail.com>
593f7e1 to
fe5b348
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
There was no easy way to smoke-test that all the example scripts still work after a change, or to compare numeric outputs (loss curves, accuracy, injected noise levels, etc.) between runs to catch regressions.
examples/run_examples.py, a runner that executes every example script inexamples/(in numeric order) with the current environment's Python, stops immediately on the first failure/crash/timeout and prints the error, and otherwise writes a timestamped report (report.md+metrics.json+ full per-example logs) underexamples/run_results/.examples/compare_runs.py, a helper that diffs the captured metrics (loss/accuracy/noise/etc. values) between two runs — defaults to the two most recent — to make regressions easy to spot across kit changes.examples/run_results/output directory in.gitignore.How to use it
Run every example, in order, stopping at the first failure:
Preview which examples would run (and in what order) without executing anything:
Run only a subset, or skip known slow/environment-specific ones (e.g. the ones needing a local ImageNet copy, multiple GPUs, or long downloads):
Cap how long any single example is allowed to run, and keep going past failures instead of stopping:
Use a specific Python interpreter instead of the current environment's:
Each run produces
examples/run_results/run_<timestamp>/withreport.md(human-readable summary),metrics.json(machine-readable), andlogs/*.log(full stdout/stderr per example). To compare two runs (defaults to the two most recent):Details
sys.executableby default (--pythonto override).MPLBACKEND=Aggso examples that callplt.show()don't hang waiting on a GUI.--only/--excludeglob filters,--timeout,--continue-on-error, and--list(preview execution order without running).examples/run_results/history.jsonlfor lightweight trend tracking.Test plan
python examples/run_examples.py --listto confirm all 36 examples are discovered in the correct order.python examples/run_examples.py --only "01_simple_layer.py" "02_multiple_layer.py"to confirm the runner executes, logs, stops on failure, and producesreport.md/metrics.jsoncorrectly.aihwkitenvironment.