-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move benchmark code from nox to bm_runner #361
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #361 +/- ##
=======================================
Coverage 98.85% 98.85%
=======================================
Files 36 36
Lines 3855 3855
=======================================
Hits 3811 3811
Misses 44 44 ☔ View full report in Codecov by Sentry. |
for more information, see https://pre-commit.ci
* origin/bm_runner: [pre-commit.ci] auto fixes from pre-commit.com hooks
BTW I am actively reviewing this. |
for more information, see https://pre-commit.ci
* origin/bm_runner: [pre-commit.ci] auto fixes from pre-commit.com hooks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked out the function of this now, and I'm happy it does function and contain what we need.
Just a few irrelevant references to fix I think (since you already ditched the unwanted Cperf code)
However, getting to grips with this has made me quite concerned about the future relationship of all this to the Iris benchmarking code, which it is similar to but significantly different.
- for instance, I'm pleased that we didn't change noxfile.py here (i.e. in this PR), but I'm pretty concerned at how that relates to the Iris code : a lot in common but multiple significant differences
- on the other hand, the change here to asv_delegated_conda.py just keeps it exactly the same as in Iris, so that is easy to track + could be done with simple "templating" as recently introduced into scitools/.github.
The task of generalising so these two implementations can "share and differ as required" seems attractive but is clearly already non-trivial. So, I'm hoping we can come up with better ways to do this in future, and apply it here, but not now !
benchmarks/bm_runner.py
Outdated
_echo("Installing Mule into data generation environment ...") | ||
mule_dir = data_gen_python.parents[1] / "resources" / "mule" | ||
if not mule_dir.is_dir(): | ||
_subprocess_runner( | ||
[ | ||
"git", | ||
"clone", | ||
"https://github.com/metomi/mule.git", | ||
str(mule_dir), | ||
] | ||
) | ||
_subprocess_runner( | ||
[ | ||
str(data_gen_python), | ||
"-m", | ||
"pip", | ||
"install", | ||
str(mule_dir / "mule"), | ||
] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if you actually care about this, but I suspect this bit is irrelevant to the iris-esmf-regrid benchmarking (I haven't checked it though).
IIUC it is needed in Iris because the "Cperf" benchmarks use mule.
benchmarks/bm_runner.py
Outdated
_asv_compare(merge_base, head_sha) | ||
|
||
|
||
class _CSPerf(_SubParserGenerator, ABC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't have a Cperf, this could maybe usefully all be merged into the 'Sperf' class instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was aiming for similarity with the iris structure where possible, though I agree that it doesn't make much sense in tis instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I spotted a couple more problems which I think need fixing.
I did check local operation, and it does work 👍
benchmarks/bm_runner.py
Outdated
"Run the on-demand Sperf suite of benchmarks (part of the UK Met " | ||
"Office NG-VAT project) for the ``HEAD`` of ``upstream/main`` only, " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, I only just spotted that this description is out-of-date.
The scalability benchmarks are not really anything to do with NGVAT anymore, I think ?
Not sure how I would describe them. hopefully you can come up with something?
benchmarks/bm_runner.py
Outdated
message = f"Input 'publish directory' is not a directory: {publish_dir}" | ||
raise NotADirectoryError(message) | ||
publish_subdir = ( | ||
publish_dir / f".*Scalability.*_{datetime.now().strftime('%Y%m%d_%H%M%S')}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
publish_dir / f".*Scalability.*_{datetime.now().strftime('%Y%m%d_%H%M%S')}" | |
publish_dir / f"sperf_{datetime.now().strftime('%Y%m%d_%H%M%S')}" |
Probably cut+paste error ?
benchmarks/bm_runner.py
Outdated
# Print completion message. | ||
location = BENCHMARKS_DIR / ".asv" | ||
_echo( | ||
f'New ASV results for ".*Scalability.*".\n' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f'New ASV results for ".*Scalability.*".\n' | |
'New ASV results for "sperf".\n' |
Probably cut+paste error ?
Great stuff @stephenworsley -- thanks for your patience ! |
* main: Move benchmark code from nox to bm_runner (SciTools#361) Bump scitools/workflows from 2024.01.0 to 2024.04.3 (SciTools#356) Bump peter-evans/create-pull-request from 5.0.2 to 6.0.5 (SciTools#355) [pre-commit.ci] pre-commit autoupdate (SciTools#336) Updated environment lockfiles (SciTools#344)
* main: Move benchmark code from nox to bm_runner (SciTools#361) Bump scitools/workflows from 2024.01.0 to 2024.04.3 (SciTools#356) Bump peter-evans/create-pull-request from 5.0.2 to 6.0.5 (SciTools#355) [pre-commit.ci] pre-commit autoupdate (SciTools#336) Updated environment lockfiles (SciTools#344) # Conflicts: # CHANGELOG.md
* main: Bump scitools/workflows from 2024.06.0 to 2024.06.5 (SciTools#377) Fix typo (SciTools#371) Bump scitools/workflows from 2024.04.3 to 2024.06.0 (SciTools#365) Update to v0.11.dev0. (SciTools#363) Update to v0.10.0 (SciTools#362) Extend regridder saving/loading to all regridders (SciTools#357) Ensure dtype is preserved after regridding (SciTools#239) Move benchmark code from nox to bm_runner (SciTools#361) # Conflicts: # esmf_regrid/schemes.py
Closes #281