Is it possible to use nvidia graphics card with cuda to use for prophet in linux/python?
Has anyone tried it?
Whats the performance improvement like?
Currently just using cpu, it can take upto 10 seconds for fitting a single series with 200 data points.
Thanks
I don't see any easy way to run any of this on CUDA. The actual model fitting happens in Stan which as far as I am aware does not have any GPU support at the moment (it is on their roadmap, https://github.com/stan-dev/stan/wiki/Stan-Road-Map).
Model predictions are done outside of Stan in the Python and R code. But I imagine this would have to be rewritten to be GPU friendly.
If you want to improve speed, the slowest part of the predict step is a Monte Carlo estimation of prediction uncertainty. If you are willing to have higher variance in the yhat_lower and yhat_upper estimates, then you can reduce the number of MC samples used and that will speed things up just about linearly. This is controlled with the uncertainty_samples input, which defaults to 1000. Dropping that to 100 will make the predict step ~10x faster.
@bletham Will reducing uncertainty_samples from 1000 to 50 or even lower change values of yhat as well?
I am only interested in yhat. Thank you.
It would not affect yhat at all, it is only used for the uncertainty intervals.
@bletham I tried your suggestion for speeding up the training by reducing the value of uncertainty_samples in a colab-notebook and it didn't make a difference. My code example is below. Can you advise me what to change and how to accelerate the training? tnx
m = Prophet(mcmc_samples=50, changepoint_prior_scale=0.01, seasonality_mode='multiplicative', uncertainty_samples=50,\
growth = 'logistic', \
holidays_prior_scale = 5, \
yearly_seasonality=True, \
weekly_seasonality=True, \
daily_seasonality=False)
m.add_regressor('y-1', prior_scale=0.5, mode='multiplicative')
m.add_regressor('y-2', prior_scale=0.5, mode='multiplicative')
# adding some more aggressors below
# ....
# ....
m.add_country_holidays(country_name='BG')
m.fit(data6_train, control={'max_treedepth': 24, 'adapt_delta': 0.99})
@Nestak2 reducing uncertainty_samples will reduce predict time but won't affect fit time. I think there are really only 2 things that you can do to reduce fitting time: (1) reduce model complexity, for instance by removing regressors or holidays that aren't being used in the model, and (2) reducing the amount of data in the history, for instance by aggregating if you have sub-daily data but only need daily forecasts, or shortening the history if for instance you have 50 years of data but can get a reasonable forecast from using only the last 5.
Most helpful comment
I don't see any easy way to run any of this on CUDA. The actual model fitting happens in Stan which as far as I am aware does not have any GPU support at the moment (it is on their roadmap, https://github.com/stan-dev/stan/wiki/Stan-Road-Map).
Model predictions are done outside of Stan in the Python and R code. But I imagine this would have to be rewritten to be GPU friendly.
If you want to improve speed, the slowest part of the predict step is a Monte Carlo estimation of prediction uncertainty. If you are willing to have higher variance in the yhat_lower and yhat_upper estimates, then you can reduce the number of MC samples used and that will speed things up just about linearly. This is controlled with the
uncertainty_samplesinput, which defaults to 1000. Dropping that to 100 will make the predict step ~10x faster.