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
{{ message }}
Repository navigation
Neighborhood filter reductions are making uxarray imports slow #1706
The new neighborhood filters require support for vectorized reduction kernels:
_MEAN_KERNEL=_make_kernel(lambdawindow, _: np.mean(window))
_SUM_KERNEL=_make_kernel(lambdawindow, _: np.sum(window))
_MIN_KERNEL=_make_kernel(lambdawindow, _: np.min(window))
_MAX_KERNEL=_make_kernel(lambdawindow, _: np.max(window))
_PTP_KERNEL=_make_kernel(lambdawindow, _: np.max(window) -np.min(window))
_MEDIAN_KERNEL=_make_kernel(_median)
_VAR_KERNEL=_make_kernel(_variance)
_STD_KERNEL=_make_kernel(lambdawindow, ddof: np.sqrt(_variance(window, ddof)))
# ``percentile`` is ``quantile`` on a 0-100 scale, so both methods rescale onto# this one kernel rather than compiling a near-duplicate._QUANTILE_KERNEL=_make_kernel(lambdawindow, q: np.quantile(window, q))
However, this block is resulting in severe performance degradations of uxarray imports, notably affecting the benchmark suites.
In exploratory work with PR #1700, I found that this block can affect thread pooling as well. The strategy seems to be to lazily generate these kernels, which would defer the overeager thread pooling and limit the burden on uxarray imports.
Activity