Closed michal-mmm closed 3 weeks ago
Hey @michal-mmm, thanks for using mlforecast. This is most likely an issue with OpenMP, can you please provide the following information?
hey @jmoralez, can confirm:
conda
and it works fineThanks for reporting back! conda ships its own OpenMP and the coreforecast wheel from pip has a different one, which leads to the program loading two versions and producing a segfault. Glad you were able to solve it and sorry for the troubles.
What happened + What you expected to happen
An error occurs in the
_tail
method of theGroupedArray
class incore_forecast/grouped_array.py
with certain configurations. Specifically, this error is encountered when:num_threads
is set to a value greater than 1,target_transforms
is not empty (must call_tail
method),lightgbm
library is imported (even if not used directly)The error I think occurs in the following method:
Versions / Dependencies
requirements.txt
(only installedlightgbm
andmlforecast
):System: Python 3.10.13 OS: macOS 14.5 23F79 arm64 (Sonoma) Shell: zsh 5.9 pip 23.0.1
Reproduction script
import pandas as pd import lightgbm as lgb # must import this from mlforecast import MLForecast from mlforecast.target_transforms import Differences from sklearn.linear_model import LinearRegression
df = pd.read_csv('https://datasets-nixtla.s3.amazonaws.com/air-passengers.csv', parse_dates=['ds'])
models = {"lin": LinearRegression()}
fcst = MLForecast( models=models, freq='MS', lags=[12], target_transforms=[Differences([1])], # at least one target_transforms num_threads=2, # num_threads must be >1 )
fcst.preprocess(df) print("Success!")
Issue Severity
Low: It annoys or frustrates me.