-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
20% performance regression in 1.1.2/1.1.3 #2358
Comments
Thanks heaps! Is it possible to time each of the fit and predict steps separately to identify the slow part? The warm starts code path should only be run when |
it's even worse, here is a quick snippet you can try. rm -rf venv-1
python3.9 -m venv venv-1
source venv-1/bin/activate
pip install prophet==1.1.1 holidays==0.24
pip freeze -> venv-1-pip-freeze.txt
python3 prophet_benchmark.py Results:
rm -rf venv-3
python3.9 -m venv venv-3
source venv-3/bin/activate
pip install prophet==1.1.3
pip freeze -> venv-3-pip-freeze.txt
python3 prophet_benchmark.py Results:
Test script import statistics
import timeit
import pandas as pd
import prophet
# https://raw.githubusercontent.com/facebook/prophet/main/examples/example_wp_log_peyton_manning.csv
# df_in = pd.read_csv("./example_wp_log_peyton_manning.csv")
df_in = pd.read_csv(
"https://raw.githubusercontent.com/facebook/prophet/main/examples/example_wp_log_peyton_manning.csv"
)
def run_prophet_speedtest_only_fit(periods=30, include_history=False, holiday=True):
m = prophet.Prophet(mcmc_samples=0, uncertainty_samples=1000)
if holiday:
m.add_country_holidays(country_name="US")
m.fit(df_in)
# Python
future = m.make_future_dataframe(periods=periods, include_history=include_history)
forecast = m.predict(future)
return m, forecast
def run_prophet_speedtest(periods=30, include_history=False, holiday=True):
m = prophet.Prophet(mcmc_samples=0, uncertainty_samples=1000)
if holiday:
m.add_country_holidays(country_name="US")
m.fit(df_in)
# Python
future = m.make_future_dataframe(periods=periods, include_history=include_history)
forecast = m.predict(future)
return m, forecast
t = timeit.Timer(lambda: run_prophet_speedtest_only_fit())
ret = t.repeat(repeat=10, number=6)
mean = statistics.mean(ret)
median = statistics.median(ret)
std = statistics.stdev(ret)
print("only fit")
print(f"results: {ret}")
print(f"mean: {mean}, median: {median}, std: {std}")
t = timeit.Timer(lambda: run_prophet_speedtest())
ret = t.repeat(repeat=10, number=6)
mean = statistics.mean(ret)
median = statistics.median(ret)
std = statistics.stdev(ret)
print("fit + predict")
print(f"results: {ret}")
print(f"mean: {mean}, median: {median}, std: {std}") |
@tcuongd hang on, seems to be fixed in 1.1.4, redoing my tests |
Oh interesting. What platform are you on btw? |
Hello,
I believe there is a performance regression between 1.1.1 and 1.1.2
Simple reproducer
try with:
I have also my own build on which I have cherry picked some commits, and I get a speed increase compared to 1.1.1, with this commit: 0716751
I still need to bisect, but I suspect it's either the fourier related commits or this warm start, eb71d01 . Any ideas?
The text was updated successfully, but these errors were encountered: