You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -26,22 +26,23 @@ about this package, from the Pangeo Showcase).
26
26
## Acknowledgements
27
27
28
28
This work was funded in part by
29
+
29
30
1. NASA-ACCESS 80NSSC18M0156 "Community tools for analysis of NASA Earth Observing System
30
-
Data in the Cloud" (PI J. Hamman, NCAR),
31
-
2. NASA-OSTFL 80NSSC22K0345 "Enhancing analysis of NASA data with the open-source Python Xarray Library" (PIs Scott Henderson, University of Washington; Deepak Cherian, NCAR; Jessica Scheick, University of New Hampshire), and
32
-
3.[NCAR's Earth System Data Science Initiative](https://ncar.github.io/esds/).
31
+
Data in the Cloud" (PI J. Hamman, NCAR),
32
+
1. NASA-OSTFL 80NSSC22K0345 "Enhancing analysis of NASA data with the open-source Python Xarray Library" (PIs Scott Henderson, University of Washington; Deepak Cherian, NCAR; Jessica Scheick, University of New Hampshire), and
33
+
1.[NCAR's Earth System Data Science Initiative](https://ncar.github.io/esds/).
33
34
34
35
It was motivated by [very](https://github.com/pangeo-data/pangeo/issues/266)[very](https://github.com/pangeo-data/pangeo/issues/271)[many](https://github.com/dask/distributed/issues/2602)[discussions](https://github.com/pydata/xarray/issues/2237) in the [Pangeo](https://pangeo.io) community.
Copy file name to clipboardExpand all lines: asv_bench/benchmarks/README_CI.md
+20-16Lines changed: 20 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
# Benchmark CI
2
2
3
3
<!-- Author: @jaimergp -->
4
+
4
5
<!-- Last updated: 2021.07.06 -->
6
+
5
7
<!-- Describes the work done as part of https://github.com/scikit-image/scikit-image/pull/5424 -->
6
8
7
9
## How it works
@@ -10,39 +12,39 @@ The `asv` suite can be run for any PR on GitHub Actions (check workflow `.github
10
12
11
13
We use `asv continuous` to run the job, which runs a relative performance measurement. This means that there's no state to be saved and that regressions are only caught in terms of performance ratio (absolute numbers are available but they are not useful since we do not use stable hardware over time). `asv continuous` will:
12
14
13
-
* Compile `scikit-image` for _both_ commits. We use `ccache` to speed up the process, and `mamba` is used to create the build environments.
14
-
* Run the benchmark suite for both commits, _twice_ (since `processes=2` by default).
15
-
* Generate a report table with performance ratios:
16
-
*`ratio=1.0` -> performance didn't change.
17
-
*`ratio<1.0` -> PR made it slower.
18
-
*`ratio>1.0` -> PR made it faster.
15
+
- Compile `scikit-image` for _both_ commits. We use `ccache` to speed up the process, and `mamba` is used to create the build environments.
16
+
- Run the benchmark suite for both commits, _twice_ (since `processes=2` by default).
17
+
- Generate a report table with performance ratios:
18
+
-`ratio=1.0` -> performance didn't change.
19
+
-`ratio<1.0` -> PR made it slower.
20
+
-`ratio>1.0` -> PR made it faster.
19
21
20
22
Due to the sensitivity of the test, we cannot guarantee that false positives are not produced. In practice, values between `(0.7, 1.5)` are to be considered part of the measurement noise. When in doubt, running the benchmark suite one more time will provide more information about the test being a false positive or not.
21
23
22
24
## Running the benchmarks on GitHub Actions
23
25
24
26
1. On a PR, add the label `run-benchmark`.
25
-
2. The CI job will be started. Checks will appear in the usual dashboard panel above the comment box.
26
-
3. If more commits are added, the label checks will be grouped with the last commit checks _before_ you added the label.
27
-
4. Alternatively, you can always go to the `Actions` tab in the repo and [filter for `workflow:Benchmark`](https://github.com/scikit-image/scikit-image/actions?query=workflow%3ABenchmark). Your username will be assigned to the `actor` field, so you can also filter the results with that if you need it.
27
+
1. The CI job will be started. Checks will appear in the usual dashboard panel above the comment box.
28
+
1. If more commits are added, the label checks will be grouped with the last commit checks _before_ you added the label.
29
+
1. Alternatively, you can always go to the `Actions` tab in the repo and [filter for `workflow:Benchmark`](https://github.com/scikit-image/scikit-image/actions?query=workflow%3ABenchmark). Your username will be assigned to the `actor` field, so you can also filter the results with that if you need it.
28
30
29
31
## The artifacts
30
32
31
33
The CI job will also generate an artifact. This is the `.asv/results` directory compressed in a zip file. Its contents include:
32
34
33
-
*`fv-xxxxx-xx/`. A directory for the machine that ran the suite. It contains three files:
34
-
*`<baseline>.json`, `<contender>.json`: the benchmark results for each commit, with stats.
35
-
*`machine.json`: details about the hardware.
36
-
*`benchmarks.json`: metadata about the current benchmark suite.
37
-
*`benchmarks.log`: the CI logs for this run.
38
-
* This README.
35
+
-`fv-xxxxx-xx/`. A directory for the machine that ran the suite. It contains three files:
36
+
-`<baseline>.json`, `<contender>.json`: the benchmark results for each commit, with stats.
37
+
-`machine.json`: details about the hardware.
38
+
-`benchmarks.json`: metadata about the current benchmark suite.
39
+
-`benchmarks.log`: the CI logs for this run.
40
+
- This README.
39
41
40
42
## Re-running the analysis
41
43
42
44
Although the CI logs should be enough to get an idea of what happened (check the table at the end), one can use `asv` to run the analysis routines again.
43
45
44
46
1. Uncompress the artifact contents in the repo, under `.asv/results`. This is, you should see `.asv/results/benchmarks.log`, not `.asv/results/something_else/benchmarks.log`. Write down the machine directory name for later.
45
-
2. Run `asv show` to see your available results. You will see something like this:
47
+
1. Run `asv show` to see your available results. You will see something like this:
46
48
47
49
```
48
50
$> asv show
@@ -115,8 +117,10 @@ To minimize the time required to run the full suite, we trimmed the parameter ma
115
117
```python
116
118
from . import _skip_slow # this function is defined in benchmarks.__init__
Copy file name to clipboardExpand all lines: docs/source/arrays.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,8 @@
2
2
3
3
Aggregating over other array types will work if the array types supports the following methods, [ufunc.reduceat](https://numpy.org/doc/stable/reference/generated/numpy.ufunc.reduceat.html) or [ufunc.at](https://numpy.org/doc/stable/reference/generated/numpy.ufunc.at.html)
Copy file name to clipboardExpand all lines: docs/source/engines.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
(engines)=
2
+
2
3
# Engines
3
4
4
5
`flox` provides multiple options, using the `engine` kwarg, for computing the core GroupBy reduction on numpy or other array types other than dask.
@@ -7,13 +8,14 @@
7
8
(.e.g `np.maximum.at`) to provided reasonably performant aggregations.
8
9
1.`engine="numba"` wraps `numpy_groupies.aggregate_numba`. This uses `numba` kernels for the core aggregation.
9
10
1.`engine="flox"` uses the `ufunc.reduceat` method after first argsorting the array so that all group members occur sequentially. This was copied from
10
-
a [gist by Stephan Hoyer](https://gist.github.com/shoyer/f538ac78ae904c936844)
11
+
a [gist by Stephan Hoyer](https://gist.github.com/shoyer/f538ac78ae904c936844)
11
12
12
13
See [](arrays) for more details.
13
14
14
15
## Tradeoffs
15
16
16
-
For the common case of reducing a nD array by a 1D array of group labels (e.g. `groupby("time.month")`), `engine="flox"` *can* be faster.
17
+
For the common case of reducing a nD array by a 1D array of group labels (e.g. `groupby("time.month")`), `engine="flox"`*can* be faster.
18
+
17
19
The reason is that `numpy_groupies` converts all groupby problems to a 1D problem, this can involve [some overhead](https://github.com/ml31415/numpy-groupies/pull/46).
18
20
It is possible to optimize this a bit in `flox` or `numpy_groupies`, but the work has not been done yet.
19
21
The advantage of `engine="numpy"` is that it tends to work for more array types, since it appears to be more common to implement `np.bincount`, and not `np.add.reduceat`.
0 commit comments