Skip to content
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

Merged
merged 15 commits into from
May 20, 2024

Conversation

stephenworsley
Copy link
Contributor

Closes #281

Copy link

codecov bot commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.85%. Comparing base (fa3541b) to head (5e51f86).

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.
📢 Have feedback on the report? Share it here.

@stephenworsley stephenworsley marked this pull request as ready for review May 9, 2024 13:27
@stephenworsley stephenworsley requested a review from pp-mo May 13, 2024 14:23
@pp-mo pp-mo self-assigned this May 13, 2024
@pp-mo
Copy link
Member

pp-mo commented May 13, 2024

@stephenworsley requested a review from @pp-mo

BTW I am actively reviewing this.
Just taking a while due to distractions + necessary learning..

Copy link
Member

@pp-mo pp-mo left a 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 !

Comment on lines 89 to 108
_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"),
]
)
Copy link
Member

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.

_asv_compare(merge_base, head_sha)


class _CSPerf(_SubParserGenerator, ABC):
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@pp-mo pp-mo left a 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 👍

Comment on lines 211 to 212
"Run the on-demand Sperf suite of benchmarks (part of the UK Met "
"Office NG-VAT project) for the ``HEAD`` of ``upstream/main`` only, "
Copy link
Member

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?

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')}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 ?

# Print completion message.
location = BENCHMARKS_DIR / ".asv"
_echo(
f'New ASV results for ".*Scalability.*".\n'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f'New ASV results for ".*Scalability.*".\n'
'New ASV results for "sperf".\n'

Probably cut+paste error ?

@pp-mo
Copy link
Member

pp-mo commented May 20, 2024

Great stuff @stephenworsley -- thanks for your patience !

@pp-mo pp-mo merged commit a50b2b8 into SciTools-incubator:main May 20, 2024
16 checks passed
stephenworsley added a commit to stephenworsley/iris-esmf-regrid that referenced this pull request May 28, 2024
* main:
  Move benchmark code from nox to bm_runner (SciTools-incubator#361)
  Bump scitools/workflows from 2024.01.0 to 2024.04.3 (SciTools-incubator#356)
  Bump peter-evans/create-pull-request from 5.0.2 to 6.0.5 (SciTools-incubator#355)
  [pre-commit.ci] pre-commit autoupdate (SciTools-incubator#336)
  Updated environment lockfiles (SciTools-incubator#344)
stephenworsley added a commit to stephenworsley/iris-esmf-regrid that referenced this pull request May 28, 2024
* main:
  Move benchmark code from nox to bm_runner (SciTools-incubator#361)
  Bump scitools/workflows from 2024.01.0 to 2024.04.3 (SciTools-incubator#356)
  Bump peter-evans/create-pull-request from 5.0.2 to 6.0.5 (SciTools-incubator#355)
  [pre-commit.ci] pre-commit autoupdate (SciTools-incubator#336)
  Updated environment lockfiles (SciTools-incubator#344)

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce bm_runner.py to iris-esmf-regrid
2 participants