Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Benchmarking a data-intensive operation (snow version)

University at Albany (SUNY)

We’re going to compute the zonal, time average of a product of two high-frequency fields from the CFSR dataset.

Specifically we will compute

[vT‾][\overline{vT}]

for the month of January (one single year)

I want to compare various ways of accelerating the calculation.

Compute environment

I logged into https://jupyterlab.arcc.albany.edu, and spawned on snow with 8 cores and 64 GB memory

This resource is only open to snow group members

Python kernel is daes_nov22.

Eager execution in memory

First we do the “normal” style: open the datasets, execute the calculation immediately

Loading...

Computing the product vTvT over one month involves taking the product of two arrays of size

124 x 32 x 361 x 720

The total number of grid points for the whole year is

12143462400

The month of January alone is about 1×1091\times 10^9 points.

Using 32-bit real numbers (4 bytes per numbers), this means we’re taking the product of two arrays of size around 4 GB each.

Timing the eager execution

CPU times: user 56.9 s, sys: 7.19 s, total: 1min 4s
Wall time: 1min 8s
Loading...

Lazy execution using Dask locally

Loading...
Loading...
CPU times: user 1min 12s, sys: 5.86 s, total: 1min 18s
Wall time: 1min 5s
Loading...

Conclusion

Similar to running on batch, we get about the same performance either way -- giving advantage to the lazy method, because the code is nicer to work with.

Snow is slower than batch -- probably just because the cpu hardware is significantly older.

Lazy execution using Dask and a distributed cluster

Now we’ll try the same thing but farm the computation out to a dask cluster.

Loading...

Effects of different chunking

Loading...
Loading...
CPU times: user 2.5 s, sys: 455 ms, total: 2.96 s
Wall time: 41.9 s
Loading...

Same thing, different chunking

Loading...
CPU times: user 812 ms, sys: 120 ms, total: 932 ms
Wall time: 29.9 s
Loading...

And yet another chunking

Loading...
Loading...
CPU times: user 1.7 s, sys: 217 ms, total: 1.91 s
Wall time: 1min 13s
Loading...

Results

Same as for batch, the smallest wall time for this calculation was achieved using the distributed cluster and a chunking strategy chunks={'time':10, 'lev': 32}.

For this one-month calculation, using the distributed cluster reduces our wall time from about 65 s down to about 30 s.

That’s about a factor of two speedup.

Compared to batch, snow is about 1.5x slower (30 seconds vs 20 seconds).