TDAmeritrade / stumpy

STUMPY is a powerful and scalable Python library for modern time series analysis

Home Page:https://stumpy.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

numba JIT-compiled func `core._compute_multi_PI` is not parallel?

NimaSarajpoor opened this issue · comments

The funciton core._compute_multi_PI seems to be parallel according to its decorator:

stumpy/stumpy/core.py

Lines 3955 to 3960 in 76cb980

@njit(
# "(i8, i8, f8[:, :], f8[:], i8, f8[:, :], i8[:, :], f8)",
parallel=True,
fastmath={"nsz", "arcp", "contract", "afn", "reassoc"},
)
def _compute_multi_PI(d, idx, D, D_prime, range_start, P, I, p=2.0):

However, it uses range instead of prange:

stumpy/stumpy/core.py

Lines 3997 to 3998 in 76cb980

for i in range(d):
D_prime = D_prime + np.power(D[i], 1.0 / p)

I'm guessing that, at some point, it was using prange but we found that it was inefficient and we moved prange to the function that called compute_multi_PI. What happens when you remove parallel=True? Does it affect the performance? If not, it can be removed.