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

Template Benchmarks #957

Merged
merged 8 commits into from
Sep 17, 2024
Merged

Template Benchmarks #957

merged 8 commits into from
Sep 17, 2024

Conversation

philipc2
Copy link
Member

@philipc2 philipc2 commented Sep 15, 2024

Closes #959

Overview

  • Creates template benchmarks for the mpas_ocean benchmark module, which can be re-used to avoid needing to always create setup, teardown and other configurations
  • Templates DatasetBenchmark and GridBenchmark are used for benchmarks that require a UxDataset or Grid respectively.

@philipc2 philipc2 self-assigned this Sep 15, 2024
@philipc2 philipc2 added the run-benchmark Run ASV benchmark workflow label Sep 15, 2024
Copy link

github-actions bot commented Sep 16, 2024

ASV Benchmarking

Benchmark Comparison Results

Benchmarks that have improved:

Change Before [3f8929d] After [26dac3d] Ratio Benchmark (Parameter)
- 407M 354M 0.87 mpas_ocean.Integrate.peakmem_integrate('480km')

Benchmarks that have stayed the same:

Change Before [3f8929d] After [26dac3d] Ratio Benchmark (Parameter)
failed failed n/a face_bounds.Bounds.time_bounds
383M 383M 1.00 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
385M 385M 1.00 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
384M 388M 1.01 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
382M 386M 1.01 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.56±0.01s 1.57±0.01s 1.00 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
223±1ms 221±0.3ms 0.99 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
2.02±0s 2.03±0.02s 1.01 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
7.51±0.2ms 7.59±0.2ms 1.01 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.76±0s 1.75±0.01s 0.99 import.Imports.timeraw_import_uxarray
646±9ms 658±10ms 1.02 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('120km')
41.5±0.5ms 41.5±0.3ms 1.00 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('480km')
2.05±0.09ms 1.91±0.1ms 0.93 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('120km')
516±20μs 521±8μs 1.01 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('480km')
297±0.8ns 305±3ns 1.02 mpas_ocean.ConstructTreeStructures.time_ball_tree('480km')
816±6ns 822±5ns 1.01 mpas_ocean.ConstructTreeStructures.time_kd_tree('120km')
283±3ns 281±3ns 0.99 mpas_ocean.ConstructTreeStructures.time_kd_tree('480km')
399M 399M 1.00 mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('120km', False)
389M 389M 1.00 mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('120km', True)
362M 362M 1.00 mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('480km', False)
361M 361M 1.00 mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('480km', True)
1.04±0s 1.03±0s 0.99 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', False)
57.8±0.3ms 57.6±0.3ms 1.00 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', True)
78.7±0.6ms 77.5±0.5ms 0.99 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', False)
5.66±0.1ms 5.73±0.07ms 1.01 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', True)
263M 264M 1.00 mpas_ocean.Gradient.peakmem_gradient('120km')
241M 241M 1.00 mpas_ocean.Gradient.peakmem_gradient('480km')
2.73±0ms 2.73±0.01ms 1.00 mpas_ocean.Gradient.time_gradient('120km')
293±3μs 290±2μs 0.99 mpas_ocean.Gradient.time_gradient('480km')
244±3μs 232±20μs 0.95 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('120km')
126±1μs 123±0.8μs 0.98 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('480km')
370M 371M 1.00 mpas_ocean.Integrate.peakmem_integrate('120km')
174±1ms 174±2ms 1.00 mpas_ocean.Integrate.time_integrate('120km')
11.8±0.05ms 11.9±0.01ms 1.01 mpas_ocean.Integrate.time_integrate('480km')
345±1ms 346±0.7ms 1.00 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'exclude')
349±4ms 348±2ms 1.00 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'include')
344±2ms 349±1ms 1.01 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'split')
22.5±0.3ms 22.8±0.2ms 1.01 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'exclude')
23.1±0.4ms 23.4±0.3ms 1.01 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'include')
22.9±0.3ms 22.4±0.5ms 0.98 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'split')
54.7±0.1ms 55.0±0.2ms 1.01 mpas_ocean.RemapDownsample.time_inverse_distance_weighted_remapping
44.4±0.1ms 44.4±0.06ms 1.00 mpas_ocean.RemapDownsample.time_nearest_neighbor_remapping
359±0.4ms 359±0.5ms 1.00 mpas_ocean.RemapUpsample.time_inverse_distance_weighted_remapping
266±2ms 264±0.3ms 0.99 mpas_ocean.RemapUpsample.time_nearest_neighbor_remapping
237M 237M 1.00 quad_hexagon.QuadHexagon.peakmem_open_dataset
236M 236M 1.00 quad_hexagon.QuadHexagon.peakmem_open_grid
6.67±0.1ms 6.77±0.04ms 1.01 quad_hexagon.QuadHexagon.time_open_dataset
5.60±0.04ms 5.71±0.1ms 1.02 quad_hexagon.QuadHexagon.time_open_grid

Benchmarks that have got worse:

Change Before [3f8929d] After [26dac3d] Ratio Benchmark (Parameter)
+ 1.21±0μs 1.42±0.01μs 1.17 mpas_ocean.ConstructTreeStructures.time_ball_tree('120km')

@philipc2 philipc2 changed the title DRAFT: Template Benchmarks Template Benchmarks Sep 16, 2024
@philipc2 philipc2 marked this pull request as ready for review September 16, 2024 18:24
@philipc2 philipc2 assigned rajeeja and erogluorhan and unassigned rajeeja and erogluorhan Sep 16, 2024
@rajeeja
Copy link
Contributor

rajeeja commented Sep 17, 2024

seems to work, thanks for the cleanup.
Does this also fix asv profile issue?

@philipc2
Copy link
Member Author

seems to work, thanks for the cleanup. Does this also fix asv profile issue?

Unfortunately no, still trying to figure out how to call parametrized benchmarks. Might raise an issue on the asv repo

@philipc2 philipc2 merged commit 92f38db into main Sep 17, 2024
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-benchmark Run ASV benchmark workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Template Classes for ASV Benchmarks
3 participants