Skip to content

Add matrix-field benchmark #2294

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add matrix-field benchmark #2294

wants to merge 1 commit into from

Conversation

charleskawczynski
Copy link
Member

@charleskawczynski charleskawczynski commented Apr 17, 2025

This PR adds a matrix field benchmark that is currently impressively slow on the A100 (on pretty low resolution):

BenchmarkTools.Trial: 107 samples with 1 evaluation per sample.
 Range (min  max):  43.442 ms  48.436 ms  ┊ GC (min  max): 0.00%  0.00%
 Time  (median):     47.463 ms              ┊ GC (median):    0.00%
 Time  (mean ± σ):   46.995 ms ±  1.086 ms  ┊ GC (mean ± σ):  0.00% ± 0.00%

                                                 ▄▄▇▃█         
  ▃▁▁▁▃▃▁▁▁▃▁▁▁▁▁▄▁▃▃▄▁▁▁▃▃▄▇▁▄▁▅▃▃▄▁▃▃▁▃▁▁▁▃▃▆▆▇█████▃▇▄▁▁▁▃ ▃
  43.4 ms         Histogram: frequency by time        48.4 ms <

 Memory estimate: 1.22 KiB, allocs estimate: 59.

For reference / comparison, pointwise operations for a single assign can be (easily) as low as 100μs. This benchmark only requires 3 reads (2 fields +1 boundary read) and 1 write (4 reads+writes total). So, I'd estimate that this should take at most 400μs (100x faster).

I'd like to do a couple things:

  • make a utils file, so that we can use this example for running nsight compute, as well as a benchmark
  • make the resolution flexible, so that we can see how this performs with different resolutions
  • make this somehow reusable for our shared memory unit tests, since adding shmem support for these operations should (likely) improve performance.

This is related to CliMA/ClimaLand.jl#1097.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant