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

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 batch with 4 cores and 32 GB memory

This resource is open to anyone with UAlbany login credentials.

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 38 s, sys: 6.03 s, total: 44 s
Wall time: 46.1 s
Loading...

Lazy execution using Dask locally

Loading...
Loading...
CPU times: user 49.3 s, sys: 3.27 s, total: 52.5 s
Wall time: 43.1 s
Loading...

Conclusion

On this particular system, we seem to get about the same performance either way -- giving advantage to the lazy method, because the code is nicer to work with.

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 994 ms, sys: 224 ms, total: 1.22 s
Wall time: 18.4 s
Loading...

Same thing, different chunking

Loading...
CPU times: user 261 ms, sys: 62.7 ms, total: 324 ms
Wall time: 20.2 s
Loading...

And yet another chunking

Loading...
Loading...
CPU times: user 475 ms, sys: 119 ms, total: 593 ms
Wall time: 45 s
Loading...

Results

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 50 s down to about 20 s.

That’s close to a factor of three speed-up.

Can we do better through more intelligent chunking and/or fine-tuning of the distributed cluster? Probably.

2022-11-17 22:49:54,749 - distributed.client - ERROR - Failed to reconnect to scheduler after 30.00 seconds, closing client