Skip to content

Commit 1081734

Browse files
authored
Merge pull request #261 from astro-informatics/mmg/benchmarks-error-and-cost-analysis
Record numerical error in benchmarks and cost + memory estimates for JAX functions
2 parents ac417b9 + f2562ab commit 1081734

File tree

7 files changed

+592
-230
lines changed

7 files changed

+592
-230
lines changed

benchmarks/README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
# Benchmarks for `s2fft`
22

3-
Scripts for benchmarking `s2fft` with `timeit` (and optionally `memory_profiler`).
3+
Scripts for benchmarking `s2fft` transforms.
44

55
Measures time to compute transforms for grids of parameters settings, optionally
66
outputting the results to a JSON file to allow comparing performance over versions
7-
and/or systems.
8-
If the [`memory_profiler` package](https://github.com/pythonprofilers/memory_profiler)
9-
is installed an estimate of the peak (main) memory usage of the benchmarked functions
10-
will also be recorded.
7+
and/or systems.
118
If the [`py-cpuinfo` package](https://pypi.org/project/py-cpuinfo/)
129
is installed additional information about CPU of system benchmarks are run on will be
1310
recorded in JSON output.
1411

15-
1612
## Description
1713

1814
The benchmark scripts are as follows:
@@ -40,7 +36,7 @@ display the usage message:
4036
```
4137
usage: spherical.py [-h] [-number-runs NUMBER_RUNS] [-repeats REPEATS]
4238
[-parameter-overrides [PARAMETER_OVERRIDES ...]] [-output-file OUTPUT_FILE]
43-
[--run-once-and-discard]
39+
[-benchmarks BENCHMARKS [BENCHMARKS ...]]
4440
4541
Benchmarks for on-the-fly spherical transforms.
4642
@@ -55,17 +51,16 @@ options:
5551
parameters. (default: None)
5652
-output-file OUTPUT_FILE
5753
File path to write JSON formatted results to. (default: None)
58-
--run-once-and-discard
59-
Run benchmark function once first without recording time to ignore the effect of any initial
60-
one-off costs such as just-in-time compilation. (default: False)
54+
-benchmarks BENCHMARKS [BENCHMARKS ...]
55+
Names of benchmark functions to run. All benchmarks are run if omitted. (default: None)
6156
```
6257

6358
For example to run the spherical transform benchmarks using only the JAX implementations,
6459
running on a CPU (in double-precision) for `L` values 64, 128, 256, 512 and 1024 we
6560
would run from the root of the repository:
6661

6762
```sh
68-
JAX_PLATFORM_NAME=cpu JAX_ENABLE_X64=1 python benchmarks/spherical.py --run-once-and-discard -p L 64 128 256 512 1024 -p method jax
63+
JAX_PLATFORM_NAME=cpu JAX_ENABLE_X64=1 python benchmarks/spherical.py -p L 64 128 256 512 1024 -p method jax
6964
```
7065

7166
Note the usage of environment variables `JAX_PLATFORM_NAME` and `JAX_ENABLE_X64` to

0 commit comments

Comments
 (0)