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

CI: Download cached remote files in benchmarks.yml #2923

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Dec 27, 2023

Description of proposed changes

Make the benchmark GitHub Actions workflow more reliable by pre-downloading some cached files.

Current benchmark tests at 94e4598 takes 12min26s to run. In this PR, it also takes 12min26s 😅

Patches #2908.

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

Make the benchmark GitHub Actions workflow faster by pre-downloading some cached files.
@weiji14 weiji14 added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Dec 27, 2023
@weiji14 weiji14 added this to the 0.11.0 milestone Dec 27, 2023
@weiji14 weiji14 self-assigned this Dec 27, 2023
Copy link

codspeed-hq bot commented Dec 27, 2023

CodSpeed Performance Report

Merging #2923 will improve performances by 8.13%

Comparing pytest/mark-benchmark-part-2 (7657005) with main (fbc4e97)

Summary

⚡ 1 improvements
✅ 63 untouched benchmarks

Benchmarks breakdown

Benchmark main pytest/mark-benchmark-part-2 Change
test_grdsample_dataarray_out 109.7 ms 101.4 ms +8.13%

@weiji14
Copy link
Member Author

weiji14 commented Dec 27, 2023

Hmm, the benchmark CI actually got slower 😅 Running the benchmarks themselves consistently takes 10m30s, but the setup with the cache download adds a few seconds...

@weiji14
Copy link
Member Author

weiji14 commented Dec 27, 2023

Maybe we can just close this PR. CodSpeed should only be counting CPU cycles according to https://codspeed.io/blog/pinpoint-performance-regressions-with-ci-integrated-differential-profiling, and not execution time. I.e. we won't removing any variance in the benchmarking due to network latency.

@weiji14 weiji14 closed this Dec 27, 2023
@weiji14 weiji14 deleted the pytest/mark-benchmark-part-2 branch December 27, 2023 07:50
@seisman
Copy link
Member

seisman commented Dec 27, 2023

Maybe we can just close this PR. CodSpeed should only be counting CPU cycles according to https://codspeed.io/blog/pinpoint-performance-regressions-with-ci-integrated-differential-profiling, and not execution time. I.e. we won't removing any variance in the benchmarking due to network latency.

But tests may fail due to unstable internet connections, so caching is still useful.

@weiji14 weiji14 restored the pytest/mark-benchmark-part-2 branch December 27, 2023 08:17
@weiji14
Copy link
Member Author

weiji14 commented Dec 27, 2023

Mm, true, let me reopen this then.

@weiji14 weiji14 reopened this Dec 27, 2023
@weiji14
Copy link
Member Author

weiji14 commented Dec 27, 2023

Btw, I'm seeing lots of warnings at in the benchmarks CI at https://github.com/GenericMappingTools/pygmt/actions/runs/7335964733/job/19974594560#step:8:178 that look like this:

  pygmt/tests/test_basemap.py::test_basemap
    /usr/share/miniconda/lib/python3.12/site-packages/_pytest/python.py:198: PytestReturnNotNoneWarning: Expected None, but pygmt/tests/test_basemap.py::test_basemap returned <pygmt.figure.Figure object at 0x33085dd0>, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?
      warnings.warn(

Looking at matplotlib/pytest-mpl#183, it seems like installing pytest-mpl should fix it, but we already install it at this line:

geopandas pytest pytest-benchmark pytest-mpl

So not sure what's up with that warning. I also tried reproducing this locally, but can't seem to get the same PytestReturnNotNoneWarning for some reason.

@weiji14 weiji14 marked this pull request as ready for review December 27, 2023 21:10
@weiji14
Copy link
Member Author

weiji14 commented Dec 27, 2023

Gonna ignore the PytestReturnNotNoneWarning mentioned at #2923 (comment) for now, but we'll need to fix it properly before pytest 8.0 comes out.

@weiji14 weiji14 merged commit 6ed1aa2 into main Dec 27, 2023
18 of 25 checks passed
@weiji14 weiji14 deleted the pytest/mark-benchmark-part-2 branch December 27, 2023 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants