[BUG] MiniRocket
segfault
#6252
Labels
bug
Something isn't working
module:transformations
transformations module: time series transformation, feature extraction, pre-/post-processing
Describe the bug
MiniRocket, when calling transform(), segfaults on some systems.
To Reproduce
Expected behavior
Expected behaviour is a 1x84 pandas dataframe containing the extracted features.
Additional context
This is a strange bug that I had not found addressed online. On the server I am currently working on, when I tried to use MiniRocket as the feature extractor, I instead got
Segmentation fault (core dumped)
. I was able to consistently reproduce this behavior with the minimal example above. This server is hosted at a hospital, and around 20 or so people use it for machine learning tasks as part of a research collaboration. My hunch is that the server places some limits on multithreading/multiprocessing in order to conserve computational resources. The minimal example runs fine on my personal computer.I spent a lot of time investigating the cause of this segfault, with gdb and other tools. It ended up being related to numba parallelization. Here is the (long) output from gdb.
I attempted to limit numba's behaviour, by, e.g., setting NUMBA_NUM_THREADS=1. However this did not fix the problem.
Solution
I then went into the sktime code files, and traced the root of the problem to the file
sktime/transformations/panel/rocket/_minirocket_numba.py
.Specifically, the function
_transform()
, on line 411. It has a decorator which saysIf you change this to
parallel=False
, then everything works.This is the only thing I have observed that consistently fixes the segfault.
I'm putting this issue here in case other people also experience a segfault issue, to spare them the frustration of debugging it themselves. To be clear, I don't think this is a bug with sktime per se. Instead, the issue I believe stems from some multiprocessing limit on the external server I am running code on for this project. But, others may potentially run into the same problem if working on some external server.
I'm not sure if there is a more elegant way of fixing this. For now, I have just edited the sktime code in my own installation. It would be nice if there was a better way to disable parallelization for this function.
Versions
The text was updated successfully, but these errors were encountered: