Skip to content

Build non-conservative zonal mean as one sparse operator - #1936

Draft
cmdupuis3 wants to merge 1 commit into
UXARRAY:mainfrom
cmdupuis3:cmd/noncon-zonal-mean
Draft

cmdupuis3 wants to merge 1 commit into
UXARRAY:mainfrom
cmdupuis3:cmd/noncon-zonal-mean

Conversation

@cmdupuis3

@cmdupuis3 cmdupuis3 commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #XXX

Overview

The per-latitude face weights depend only on the grid, so assemble them once into a sparse (n_lat, n_face) CSR operator and apply it to the data in a single xr.apply_ufunc call, as remap/apply_weights.py does. This replaces the per-latitude loop that added one dask setitem layer per latitude: the graph no longer grows with the number of latitudes, and time/lev chunks become the parallel axes. Row 1.5 of #1789.

  • _build_zonal_line_operator: geometry only. Drops the redundant re-normalization (weights already sum to 1). Keeps explicit zero weights so a NaN in a face that only touches a latitude still makes that latitude NaN, as before.
  • _apply_face_operator: generic n_face contraction, reusable by the conservative mean, zonal_anomaly and azimuthal_mean.
  • Tests: match the old per-latitude loop to rtol=1e-12 across numpy, time-chunked, grid-chunked and n_face-first layouts and both weight methods; float32 preserved; NaN locality; graph size independent of latitude count.
  • Benchmark ZonalAverageDask: at 480km, lat=(-45, 45, 1), 12 time steps, time-chunked 433 ms -> 14 ms (8,009 -> 48 tasks), grid-chunked 633 ms -> 16 ms (16,953 -> 108 tasks).

Expected Usage

import uxarray as ux

grid_path = "/path/to/grid.nc"
data_path = "/path/to/data.nc"

uxds = ux.open_dataset(grid_path, data_path)

# this is how you use this function
some_output = uxds.some_function()

# this is another way to use this function
other_output = uxds.some_function(some_param = True)

PR Checklist

General

  • An issue is created and linked
  • Added appropriate labels (if your uxarray repo permissions allow it)
  • Filled out Overview and Expected Usage (if applicable) sections

Testing & Benchmarking

  • There is adequate test coverage of changes from this PR (add new tests if needed)
  • If this PR could affect performance, ran ASV benchmarks and confirmed they show expected behavior (add a new benchmark if necessary)

Documentation and Examples

  • Docstrings updated with any function changes, and included in all new functions
  • User (public) functions added to docs/api.rst; internal (private) function names start with an underscore (_)
  • If touched any notebook files, cleared the output of all cells before committing
  • If added new notebook files, put into appropriate directories and referenced in appropriate files

AI Disclosure

AI Usage:

  • I have tested and take responsibility for all AI-generated content in my PR.

The per-latitude face weights depend only on the grid, so assemble them
once into a sparse (n_lat, n_face) CSR operator and apply it to the data
in a single xr.apply_ufunc call, as remap/apply_weights.py does. This
replaces the per-latitude loop that added one dask __setitem__ layer per
latitude: the graph no longer grows with the number of latitudes, and
time/lev chunks become the parallel axes. Row 1.5 of UXARRAY#1789.

- _build_zonal_line_operator: geometry only. Drops the redundant
  re-normalization (weights already sum to 1). Keeps explicit zero
  weights so a NaN in a face that only touches a latitude still makes
  that latitude NaN, as before.
- _apply_face_operator: generic n_face contraction, reusable by the
  conservative mean, zonal_anomaly and azimuthal_mean.
- Tests: match the old per-latitude loop to rtol=1e-12 across numpy,
  time-chunked, grid-chunked and n_face-first layouts and both weight
  methods; float32 preserved; NaN locality; graph size independent of
  latitude count.
- Benchmark ZonalAverageDask: at 480km, lat=(-45, 45, 1), 12 time steps,
  time-chunked 433 ms -> 14 ms (8,009 -> 48 tasks), grid-chunked
  633 ms -> 16 ms (16,953 -> 108 tasks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cmdupuis3 cmdupuis3 self-assigned this Dec 4, 2026
@cmdupuis3 cmdupuis3 added scalability Related to scalability & performance efforts run-benchmark Run ASV benchmark workflow labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

ASV Benchmarking

Benchmark Comparison Results

Benchmarks that have improved:

Change Before [70e73b9] After [1b4457b] Ratio Benchmark (Parameter)
- 8.17±0.1ms 6.89±0.07ms 0.84 mpas_ocean.ZonalAverage.time_zonal_average('120km')
- 4.24±0.06ms 3.30±0.2ms 0.78 mpas_ocean.ZonalAverage.time_zonal_average('480km')
- 1.71±0.03s 45.6±0.3ms 0.03 mpas_ocean.ZonalAverageDask.time_zonal_average('120km', 'grid_chunks')
- 51.4±0.6ms 34.2±0.3ms 0.67 mpas_ocean.ZonalAverageDask.time_zonal_average('120km', 'numpy')
- 1.19±0.01s 42.6±0.4ms 0.04 mpas_ocean.ZonalAverageDask.time_zonal_average('120km', 'time_chunks')
- 1.66±0.01s 26.0±0.5ms 0.02 mpas_ocean.ZonalAverageDask.time_zonal_average('480km', 'grid_chunks')
- 27.6±0.2ms 14.9±0.06ms 0.54 mpas_ocean.ZonalAverageDask.time_zonal_average('480km', 'numpy')
- 1.12±0.01s 22.4±0.3ms 0.02 mpas_ocean.ZonalAverageDask.time_zonal_average('480km', 'time_chunks')
- 17109 108 0.01 mpas_ocean.ZonalAverageDask.track_graph_tasks('120km', 'grid_chunks')
- 8009 48 0.01 mpas_ocean.ZonalAverageDask.track_graph_tasks('120km', 'time_chunks')
- 16953 108 0.01 mpas_ocean.ZonalAverageDask.track_graph_tasks('480km', 'grid_chunks')
- 8009 48 0.01 mpas_ocean.ZonalAverageDask.track_graph_tasks('480km', 'time_chunks')

Benchmarks that have stayed the same:

Change Before [70e73b9] After [1b4457b] Ratio Benchmark (Parameter)
962±20μs 981±20μs 1.02 connectivity.Connectivity.time_edge_face('120km')
412±10μs 418±8μs 1.01 connectivity.Connectivity.time_edge_face('480km')
3.51±0.02ms 3.46±0.2ms 0.99 connectivity.Connectivity.time_edge_node('120km')
1.04±0.01ms 1.05±0.04ms 1.01 connectivity.Connectivity.time_edge_node('480km')
51.2±3μs 62.4±9μs ~1.22 connectivity.Connectivity.time_face_edge('120km')
48.1±2μs 48.8±8μs 1.02 connectivity.Connectivity.time_face_edge('480km')
732±10μs 734±20μs 1.00 connectivity.Connectivity.time_face_face('120km')
330±8μs 346±10μs 1.05 connectivity.Connectivity.time_face_face('480km')
56.3±2μs 58.1±10μs 1.03 connectivity.Connectivity.time_face_node('120km')
49.6±10μs 49.2±6μs 0.99 connectivity.Connectivity.time_face_node('480km')
462±20μs 450±20μs 0.97 connectivity.Connectivity.time_n_nodes_per_face('120km')
336±10μs 345±20μs 1.03 connectivity.Connectivity.time_n_nodes_per_face('480km')
1.34±0.02ms 1.33±0.03ms 1.00 connectivity.Connectivity.time_node_edge('120km')
426±9μs 430±10μs 1.01 connectivity.Connectivity.time_node_edge('480km')
85.2±0.7ms 86.1±0.7ms 1.01 connectivity.Connectivity.time_node_face('120km')
5.31±0.05ms 5.31±0.05ms 1.00 connectivity.Connectivity.time_node_face('480km')
1.42M 1.42M 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_edge_face('120km')
105k 105k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_edge_face('480km')
6.48M 6.48M 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_edge_node('120km')
419k 419k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_edge_node('480km')
2.05k 2.05k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_edge('120km')
2.05k 2.05k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_edge('480km')
1.6M 1.6M 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_face('120km')
101k 101k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_face('480km')
2.18k 2.18k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_node('120km')
2.18k 2.18k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_node('480km')
240k 240k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_n_nodes_per_face('120km')
26k 26k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_n_nodes_per_face('480km')
1.9M 1.9M 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_node_edge('120km')
127k 127k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_node_edge('480km')
11.9M 11.9M 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_node_face('120km')
747k 747k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_node_face('480km')
4.93±0.08ms 4.99±0.04ms 1.01 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
1.65±0.03ms 1.65±0.07ms 1.00 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
5.67±0.06ms 5.67±0.4ms 1.00 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
962±20μs 954±30μs 0.99 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
57.3k 57.3k 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
12.3k 12.3k 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
123k 123k 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
128 128 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.27M 1.27M 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
50.1k 50.1k 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
516k 516k 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
712 712 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.78M 1.78M 1.00 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
1.76M 1.76M 1.00 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
1.92M 1.92M 1.00 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
35.3k 35.3k 1.00 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.03±0.04μs 1.04±0.05μs 1.01 geometry_kernels.AccucrossKernels.time_accucross
2.42±0.04μs 2.38±0.02μs 0.98 geometry_kernels.AccucrossKernels.time_accucross_pair
325±20ns 331±20ns 1.02 geometry_kernels.EFTPrimitives.time_acc_sqrt_re
331±10ns 316±10ns 0.95 geometry_kernels.EFTPrimitives.time_diff_of_products
271±5ns 290±5ns 1.07 geometry_kernels.EFTPrimitives.time_two_prod
261±10ns 291±20ns ~1.12 geometry_kernels.EFTPrimitives.time_two_sum
466±9ns 626±100ns ~1.34 geometry_kernels.GCAConstLatIntersection.time_accux_constlat_kernel
661±100ns 520±10ns ~0.79 geometry_kernels.GCAConstLatIntersection.time_gca_const_lat_intersection
566±20ns 561±7ns 0.99 geometry_kernels.GCAConstLatIntersection.time_try_gca_const_lat_intersection
721±10ns 701±0.4ns 0.97 geometry_kernels.GCAGCAIntersection.time_accux_gca_kernel
826±9ns 846±30ns 1.02 geometry_kernels.GCAGCAIntersection.time_gca_gca_intersection
956±10ns 962±10ns 1.01 geometry_kernels.GCAGCAIntersection.time_try_gca_gca_intersection
28.0±0.2μs 27.9±0.1μs 1.00 geometry_kernels.OrientPredicates.time_on_minor_arc
28.7±0.2μs 28.4±0.3μs 0.99 geometry_kernels.OrientPredicates.time_orient3d_on_sphere
3.24±0.01ms 3.27±0.02ms 1.01 geometry_samebody.SameBodyConstLat.time_accux_dispatch
1.32±0ms 1.32±0ms 1.00 geometry_samebody.SameBodyConstLat.time_accux_kernel
2.25±0ms 2.26±0.01ms 1.00 geometry_samebody.SameBodyConstLat.time_fp64_dispatch
153±1μs 153±1μs 1.00 geometry_samebody.SameBodyConstLat.time_fp64_kernel
49.5±0.2ms 49.3±0.05ms 1.00 geometry_samebody_gcagca.SameBodyGcaGca.time_accux_dispatch
5.35±0.02ms 5.38±0.04ms 1.01 geometry_samebody_gcagca.SameBodyGcaGca.time_accux_kernel
45.4±0.3ms 45.4±0.3ms 1.00 geometry_samebody_gcagca.SameBodyGcaGca.time_fp64_dispatch
634±10μs 633±0.6μs 1.00 geometry_samebody_gcagca.SameBodyGcaGca.time_fp64_kernel
719±6ms 724±4ms 1.01 import.Imports.timeraw_import_uxarray
1 1 1.00 lazy_grid_construction.LazyGridConstruction.track_computes_isel
3 3 1.00 lazy_grid_construction.LazyGridConstruction.track_computes_open_grid_chunked
103±2ms 104±1ms 1.00 lazy_grid_construction.OpenGridChunked.time_open_grid('120km')
131±2ms 129±2ms 0.99 lazy_grid_construction.OpenGridChunked.time_open_grid('480km')
3.42M 3.43M 1.00 lazy_grid_construction.OpenGridChunked.track_peakmem_open_grid('120km')
2.41M 2.22M 0.92 lazy_grid_construction.OpenGridChunked.track_peakmem_open_grid('480km')
1.80±0.01ms 1.82±0.03ms 1.01 mpas_ocean.AzimuthalAverage.time_azimuthal_average('120km')
726±7μs 719±3μs 0.99 mpas_ocean.AzimuthalAverage.time_azimuthal_average('480km')
2.80±0.08ms 2.76±0.1ms 0.99 mpas_ocean.CheckNorm.time_check_norm('120km')
1.65±0.01ms 1.70±0.06ms 1.03 mpas_ocean.CheckNorm.time_check_norm('480km')
805±7μs 806±10μs 1.00 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('120km')
383±3μs 381±9μs 1.00 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('480km')
529±8μs 523±5μs 0.99 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('120km')
404±5μs 414±8μs 1.03 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('480km')
3.27±0.01ms 3.28±0.03ms 1.01 mpas_ocean.ConstructFaceLatLon.time_cartesian_averaging('120km')
2.45±0.06ms 2.41±0.01ms 0.98 mpas_ocean.ConstructFaceLatLon.time_cartesian_averaging('480km')
81.8±0.6ms 81.8±1ms 1.00 mpas_ocean.ConstructFaceLatLon.time_welzl('120km')
7.27±0.03ms 7.45±0.1ms 1.03 mpas_ocean.ConstructFaceLatLon.time_welzl('480km')
13.0±0.1ms 12.9±0.04ms 0.99 mpas_ocean.ConstructTreeStructures.time_ball_tree('120km')
786±30μs 772±20μs 0.98 mpas_ocean.ConstructTreeStructures.time_ball_tree('480km')
9.33±0.07ms 9.32±0.09ms 1.00 mpas_ocean.ConstructTreeStructures.time_kd_tree('120km')
561±20μs 556±10μs 0.99 mpas_ocean.ConstructTreeStructures.time_kd_tree('480km')
422±4ms 414±3ms 0.98 mpas_ocean.CrossSections.time_const_lat('120km', 1)
209±2ms 209±1ms 1.00 mpas_ocean.CrossSections.time_const_lat('120km', 2)
108±2ms 110±2ms 1.02 mpas_ocean.CrossSections.time_const_lat('120km', 4)
371±3ms 370±4ms 1.00 mpas_ocean.CrossSections.time_const_lat('480km', 1)
187±4ms 186±1ms 0.99 mpas_ocean.CrossSections.time_const_lat('480km', 2)
94.3±1ms 94.6±0.2ms 1.00 mpas_ocean.CrossSections.time_const_lat('480km', 4)
24.6±0.2ms 25.1±0.1ms 1.02 mpas_ocean.DualMesh.time_dual_mesh_construction('120km')
2.92±0.03ms 2.99±0.02ms 1.02 mpas_ocean.DualMesh.time_dual_mesh_construction('480km')
10.7±0.2ms 10.9±0.5ms 1.02 mpas_ocean.FaceAreas.time_face_areas('120km')
3.56±0.06ms 3.52±0.1ms 0.99 mpas_ocean.FaceAreas.time_face_areas('480km')
229k 229k 1.00 mpas_ocean.FaceAreas.track_nbytes_face_areas('120km')
14.3k 14.3k 1.00 mpas_ocean.FaceAreas.track_nbytes_face_areas('480km')
2.12M 2.12M 1.00 mpas_ocean.FaceAreas.track_peakmem_face_areas('120km')
679k 679k 1.00 mpas_ocean.FaceAreas.track_peakmem_face_areas('480km')
48.4±0.4ms 48.4±2ms 1.00 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', 'exclude')
132±0.8ms 133±1ms 1.01 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', 'split')
5.01±0.2ms 5.02±0.4ms 1.00 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', 'exclude')
24.3±0.4ms 23.9±0.3ms 0.99 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', 'split')
10.5±0.1ms 10.9±0.2ms 1.03 mpas_ocean.Gradient.time_gradient('120km')
1.75±0.02ms 1.76±0.03ms 1.00 mpas_ocean.Gradient.time_gradient('480km')
457k 457k 1.00 mpas_ocean.Gradient.track_nbytes_gradient('120km')
28.7k 28.7k 1.00 mpas_ocean.Gradient.track_nbytes_gradient('480km')
3.44M 3.44M 1.00 mpas_ocean.Gradient.track_peakmem_gradient('120km')
226k 226k 1.00 mpas_ocean.Gradient.track_peakmem_gradient('480km')
228±2μs 237±6μs 1.04 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('120km')
106±0.7μs 107±4μs 1.01 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('480km')
170±2μs 170±6μs 1.00 mpas_ocean.Integrate.time_integrate('120km')
147±7μs 142±0.4μs 0.97 mpas_ocean.Integrate.time_integrate('480km')
18.4M 18.4M 1.00 mpas_ocean.Integrate.track_nbytes_integrate('120km')
1.2M 1.2M 1.00 mpas_ocean.Integrate.track_nbytes_integrate('480km')
134±1ms 137±1ms 1.02 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'exclude')
134±1ms 137±2ms 1.02 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'include')
136±1ms 139±0.9ms 1.02 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'split')
9.39±0.01ms 9.74±0.07ms 1.04 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'exclude')
9.40±0.04ms 9.86±0.3ms 1.05 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'include')
9.44±0.05ms 9.57±0.2ms 1.01 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'split')
203±0.5ms 203±0.8ms 1.00 mpas_ocean.NeighborhoodBuild.time_build('120km', 1.0)
419±2ms 422±2ms 1.01 mpas_ocean.NeighborhoodBuild.time_build('120km', 5.0)
10.8±0.01ms 10.9±0.06ms 1.01 mpas_ocean.NeighborhoodBuild.time_build('480km', 1.0)
13.5±0.06ms 13.5±0.07ms 1.00 mpas_ocean.NeighborhoodBuild.time_build('480km', 5.0)
199±1ms 198±0.3ms 1.00 mpas_ocean.NeighborhoodBuild.time_query_radius('120km', 1.0)
418±1ms 414±1ms 0.99 mpas_ocean.NeighborhoodBuild.time_query_radius('120km', 5.0)
10.5±0.03ms 10.6±0.04ms 1.00 mpas_ocean.NeighborhoodBuild.time_query_radius('480km', 1.0)
13.2±0.03ms 13.2±0.08ms 1.01 mpas_ocean.NeighborhoodBuild.time_query_radius('480km', 5.0)
612.76 612.76 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('120km', 15.0)
74.17 74.17 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('120km', 5.0)
37.29 37.29 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('480km', 15.0)
6.57 6.57 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('480km', 5.0)
141M 141M 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('120km', 15.0)
17.4M 17.4M 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('120km', 5.0)
563k 563k 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('480km', 15.0)
123k 123k 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('480km', 5.0)
145M 145M 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('120km', 15.0)
21.5M 21.5M 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('120km', 5.0)
824k 824k 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('480km', 15.0)
384k 384k 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('480km', 5.0)
32.2±0.6ms 32.0±0.1ms 0.99 mpas_ocean.NeighborhoodDask.time_mean('120km', 'grid_chunks')
14.4±0.03ms 14.6±0.08ms 1.01 mpas_ocean.NeighborhoodDask.time_mean('120km', 'numpy')
29.3±0.2ms 28.7±0.4ms 0.98 mpas_ocean.NeighborhoodDask.time_mean('120km', 'time_chunks')
7.28±0.05ms 7.33±0.02ms 1.01 mpas_ocean.NeighborhoodDask.time_mean('480km', 'grid_chunks')
413±4μs 402±5μs 0.97 mpas_ocean.NeighborhoodDask.time_mean('480km', 'numpy')
4.93±0.01ms 5.02±0.06ms 1.02 mpas_ocean.NeighborhoodDask.time_mean('480km', 'time_chunks')
5.82M 5.75M 0.99 mpas_ocean.NeighborhoodDask.track_peakmem_mean('120km', 'grid_chunks')
2.75M 2.75M 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('120km', 'numpy')
5.68M 5.67M 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('120km', 'time_chunks')
675k 632k 0.94 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'grid_chunks')
177k 177k 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'numpy')
534k 528k 0.99 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'time_chunks')
3.78±0s 3.78±0.02s 1.00 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('120km', 'mean')
3.87±0s 3.89±0.01s 1.00 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('120km', 'median')
98.8±0.3ms 98.3±0.7ms 0.99 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('480km', 'mean')
99.0±0.1ms 99.6±0.6ms 1.01 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('480km', 'median')
423±2ms 424±3ms 1.00 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('120km', 'mean')
452±2ms 454±1ms 1.00 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('120km', 'median')
13.6±0.02ms 13.6±0.09ms 1.00 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('480km', 'mean')
13.8±0.03ms 13.8±0.03ms 1.00 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('480km', 'median')
3.80±0.06ms 3.81±0.04ms 1.00 mpas_ocean.NeighborhoodReduce.time_reduce('120km', 'mean')
31.7±0.1ms 31.9±0.1ms 1.01 mpas_ocean.NeighborhoodReduce.time_reduce('120km', 'median')
115±0.6μs 116±2μs 1.01 mpas_ocean.NeighborhoodReduce.time_reduce('480km', 'mean')
320±30μs 340±20μs 1.06 mpas_ocean.NeighborhoodReduce.time_reduce('480km', 'median')
234k 234k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('120km', 'mean')
235k 235k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('120km', 'median')
19.5k 19.5k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('480km', 'mean')
19.6k 19.6k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('480km', 'median')
256±5μs 254±10μs 0.99 mpas_ocean.PointInPolygon.time_face_search_lonlat('120km')
218±20μs 259±6μs ~1.19 mpas_ocean.PointInPolygon.time_face_search_lonlat('480km')
246±8μs 241±10μs 0.98 mpas_ocean.PointInPolygon.time_face_search_xyz('120km')
232±7μs 233±4μs 1.00 mpas_ocean.PointInPolygon.time_face_search_xyz('480km')
73.8±0.3ms 73.7±0.7ms 1.00 mpas_ocean.RemapDownsample.time_bilinear_remapping
12.6±0.1ms 12.9±0.1ms 1.02 mpas_ocean.RemapDownsample.time_inverse_distance_weighted_remapping
11.5±0.07ms 11.6±0.1ms 1.01 mpas_ocean.RemapDownsample.time_nearest_neighbor_remapping
894±4ms 908±7ms 1.02 mpas_ocean.RemapUpsample.time_bilinear_remapping
25.5±2ms 24.9±0.6ms 0.98 mpas_ocean.RemapUpsample.time_inverse_distance_weighted_remapping
10.2±0.6ms 10.3±0.09ms 1.01 mpas_ocean.RemapUpsample.time_nearest_neighbor_remapping
0 0 n/a mpas_ocean.ZonalAverageDask.track_graph_tasks('120km', 'numpy')
0 0 n/a mpas_ocean.ZonalAverageDask.track_graph_tasks('480km', 'numpy')
1.0539017291524029 1.0332306402011184 0.98 nogil_scaling.GILScaling.track_gil_scaling
1.21±0.01ms 1.24±0.01ms 1.02 open_dataset.OpenDataset.time_open_dataset('dataset', 'dataset')
2.18±0.01ms 2.21±0.01ms 1.01 open_dataset.OpenDataset.time_open_dataset('dataset', 'file')
4.84±0.01ms 4.95±0.09ms 1.02 open_dataset.OpenDataset.time_open_dataset('file', 'dataset')
6.06±0.3ms 5.78±0.08ms 0.95 open_dataset.OpenDataset.time_open_dataset('file', 'file')
183±2μs 181±0.7μs 0.99 open_dataset.OpenDataset.time_open_dataset('grid', 'dataset')
1.11±0.01ms 1.13±0.01ms 1.02 open_dataset.OpenDataset.time_open_dataset('grid', 'file')
1.80±0.02s 1.82±0.02s 1.01 plots.PlotContour.time_contour_projected
286±4ms 289±4ms 1.01 plots.PlotHealpix.time_default_plot(6)
2.59±0.02s 2.58±0.02s 1.00 plots.PlotHealpix.time_default_plot(8)
28M 28M 1.00 plots.PlotHealpix.track_peakmem_default_plot(6)
443M 443M 1.00 plots.PlotHealpix.track_peakmem_default_plot(8)
6.11±0.09ms 5.90±0.02ms 0.97 quad_hexagon.QuadHexagon.time_open_dataset
5.09±0.04ms 5.03±0.03ms 0.99 quad_hexagon.QuadHexagon.time_open_grid
408 408 1.00 quad_hexagon.QuadHexagon.track_nbytes_open_dataset
392 392 1.00 quad_hexagon.QuadHexagon.track_nbytes_open_grid
71.8k 71.7k 1.00 quad_hexagon.QuadHexagon.track_peakmem_open_dataset
71.5k 71.5k 1.00 quad_hexagon.QuadHexagon.track_peakmem_open_grid
7.04±0.2ms 7.11±0.2ms 1.01 subset.BoundingBox.time_bounding_box('120km')
3.85±0.2ms 4.07±0.1ms 1.06 subset.BoundingBox.time_bounding_box('480km')
2.38M 2.38M 1.00 subset.BoundingBox.track_peakmem_bounding_box('120km')
203k 203k 1.00 subset.BoundingBox.track_peakmem_bounding_box('480km')
2.99±0.2ms 2.94±0.05ms 0.98 subset.BoundingBoxHealpix.time_bounding_box(6)
12.8±0.1ms 12.8±0.08ms 1.00 subset.BoundingBoxHealpix.time_bounding_box(8)
2.2M 2.2M 1.00 subset.BoundingBoxHealpix.track_peakmem_bounding_box(6)
13.2M 13.2M 1.00 subset.BoundingBoxHealpix.track_peakmem_bounding_box(8)
661±4ms 653±4ms 0.99 to_raster.ToRaster.time_to_raster((10000.0, 10.0))
1.40±0.01s 1.39±0s 0.99 to_raster.ToRaster.time_to_raster((10000.0, 100.0))
1.63±0.01s 1.62±0s 0.99 to_raster.ToRaster.time_to_raster((100000.0, 100.0))
270M 270M 1.00 to_raster.ToRaster.track_peakmem((10000.0, 10.0))
680M 680M 1.00 to_raster.ToRaster.track_peakmem((10000.0, 100.0))
765M 765M 1.00 to_raster.ToRaster.track_peakmem((100000.0, 100.0))
77.7±2μs 71.5±1μs 0.92 to_xarray.UxDataArrayToXarray.time_to_xarray(10)
309±7μs 316±10μs 1.02 to_xarray.UxDatasetToXarray.time_to_xarray((100, 10))
2.77±0.01ms 2.78±0.03ms 1.00 to_xarray.UxDatasetToXarray.time_to_xarray((1000, 100))
664±7μs 656±4μs 0.99 to_xarray.UxDatasetToXarray.time_to_xarray_healpix((100, 10))
6.11±0.07ms 6.04±0.06ms 0.99 to_xarray.UxDatasetToXarray.time_to_xarray_healpix((1000, 100))

Benchmarks that have got worse:

Change Before [70e73b9] After [1b4457b] Ratio Benchmark (Parameter)
+ 305M 390M 1.28 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
+ 307M 390M 1.27 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
+ 309M 390M 1.26 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
+ 306M 390M 1.27 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
+ 280M 390M 1.39 import.Imports.track_peakmem_import_uxarray
+ 327M 390M 1.19 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('120km', 1)
+ 327M 390M 1.19 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('120km', 2)
+ 327M 390M 1.19 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('120km', 4)
+ 309M 390M 1.26 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('480km', 1)
+ 308M 390M 1.26 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('480km', 2)
+ 309M 390M 1.26 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('480km', 4)
+ 323M 390M 1.21 mpas_ocean.GradientColdStartRss.track_peakmem_gradient('120km')
+ 301M 390M 1.29 mpas_ocean.GradientColdStartRss.track_peakmem_gradient('480km')
+ 328M 390M 1.19 mpas_ocean.ZonalAveragePeakMem.track_peakmem_zonal_average('120km')
+ 310M 390M 1.26 mpas_ocean.ZonalAveragePeakMem.track_peakmem_zonal_average('480km')

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 scalability Related to scalability & performance efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant