Nixtla / neuralforecast

Scalable and user friendly neural :brain: forecasting algorithms.
https://nixtlaverse.nixtla.io/neuralforecast
Apache License 2.0
2.71k stars 314 forks source link

NotImplementedError: The operator 'aten::upsample_linear1d.out' is not currently implemented for the MPS device. #709

Open tinased95 opened 11 months ago

tinased95 commented 11 months ago

What happened + What you expected to happen

How can I run neuralforecast on M1 macI am using jupyter notebook and already tried adding environment variable. Is there a way to explicitly set cpu as the running platform for neuralforecast? Thanks.

Versions / Dependencies

neuralforecast=1.6.1

Reproduction script

nhits = NHITS(h=horizon, input_size=input_size, step_size=step_size, max_steps=200) nf = NeuralForecast(models=[nhits], freq='15T') nf.fit(df)

Issue Severity

None

nigelparsad commented 11 months ago

Ran into same problem using NHiTs on my Mac M1. Added to Pytorch issues:

https://github.com/pytorch/pytorch/issues/77764#issuecomment-1656531763

yeraypabon commented 4 months ago

I'm also having this issue. My current workaround is to fall back to CPU using import os os.environ['PYTORCH_ENABLE_MPS_FALLBACK'] = '1' at the beginning of your script. It does seems like a PyTorch issue, and their MPS backend is in beta phase according to this: https://developer.apple.com/metal/pytorch/

damandak commented 1 month ago

I also have this issue. The proposed workaround of the fallback doesn't work for me, but my workaround is to add the following to the N-HiTS parameters: accelerator='cpu'