Skip to content
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

[devops] Upgrade to lightning 2.0 #1514

Merged
merged 26 commits into from
Jun 21, 2024
Merged

[devops] Upgrade to lightning 2.0 #1514

merged 26 commits into from
Jun 21, 2024

Conversation

ourownstory
Copy link
Owner

@ourownstory ourownstory marked this pull request as draft January 17, 2024 00:41
@ourownstory ourownstory changed the title [devops] Upgrade lightning 2 [WIP] [devops] Upgrade to lightning 2.0 [WIP] Jan 17, 2024
Copy link

github-actions bot commented Jun 20, 2024

Model Benchmark

Benchmark Metric main current diff
PeytonManning MAE_val 0.34955 0.35511 1.59%
PeytonManning RMSE_val 0.50049 0.50375 0.65%
PeytonManning Loss_val 0.01771 0.01801 1.69%
PeytonManning train_loss nan 0.01463 0.0%
PeytonManning reg_loss nan 0 0.0%
PeytonManning MAE 0.34653 0.34734 0.24%
PeytonManning RMSE 0.49312 0.49386 0.15%
PeytonManning Loss 0.01464 0.01463 -0.09%
PeytonManning time 11.8065 12.7 7.57%
AirPassengers MAE_val 30.6285 30.8786 0.82%
AirPassengers RMSE_val 31.5254 31.8365 0.99%
AirPassengers Loss_val 0.01277 0.01303 1.98%
AirPassengers train_loss nan 0.00071 0.0%
AirPassengers reg_loss nan 0 0.0%
AirPassengers MAE 6.16861 6.85845 11.18%
AirPassengers RMSE 7.85225 8.90745 13.44%
AirPassengers Loss 0.00065 0.00076 16.92%
AirPassengers time 7.29709 7.76 6.34% ⚠️
EnergyPriceDaily MAE_val 5.41157 5.64156 4.25% ⚠️
EnergyPriceDaily RMSE_val 6.71538 7.19554 7.15%
EnergyPriceDaily Loss_val 0.02525 0.0289 14.47%
EnergyPriceDaily train_loss nan 0.02962 0.0%
EnergyPriceDaily reg_loss nan 0 0.0%
EnergyPriceDaily MAE 5.94936 6.40067 7.59%
EnergyPriceDaily RMSE 7.9833 8.56962 7.34%
EnergyPriceDaily Loss 0.02579 0.02941 14.05%
EnergyPriceDaily time 14.2089 15.82 11.34%
YosemiteTemps MAE_val 0.56412 0.48186 -14.58% 🎉
YosemiteTemps RMSE_val 0.83161 0.71525 -13.99% 🎉
YosemiteTemps Loss_val 0.0004 0.0003 -26.0% 🎉
YosemiteTemps train_loss nan 0.00103 0.0%
YosemiteTemps reg_loss nan 0 0.0%
YosemiteTemps MAE 0.98449 0.85851 -12.8% 🎉
YosemiteTemps RMSE 1.75389 1.54684 -11.81% 🎉
YosemiteTemps Loss 0.00132 0.00103 -21.4% 🎉
YosemiteTemps time 30.8231 35.24 14.33%
\nModel training plots\n ## Model Training ### PeytonManning ![](https://asset.cml.dev/1d71ab731130716a13ca5609c24d52e4e540dbcd?cml=svg%2Bxml&cache-bypass=3c0b1bd7-0cd7-448a-aa0b-27a9d908b270) ### YosemiteTemps ![](https://asset.cml.dev/25c0d646f1807f399110bf3dd41a6af7b5e4d0bb?cml=svg%2Bxml&cache-bypass=07bc006a-81a4-40cd-a3ea-4902b537b8b9) ### AirPassengers ![](https://asset.cml.dev/85d58e6f0d87f903ddc54d6984086a6e1661dec8?cml=svg%2Bxml&cache-bypass=4a361a46-2823-4af3-8f49-d1143b7be716) ### EnergyPriceDaily ![](https://asset.cml.dev/88a4f18f9122a4b1cfb9ad479dcdb8c1c0883759?cml=svg%2Bxml&cache-bypass=499b3718-3366-4903-a754-8d5a27f5859a) \n

Copy link
Owner Author

@ourownstory ourownstory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the tests are yielding differing metrics - Do you have any idea what might be the cause?

pyproject.toml Outdated
@@ -16,28 +16,27 @@ classifiers = [
Homepage = "https://github.com/ourownstory/neural_prophet"

[tool.poetry.dependencies]
python = "^3.9"
typing-extensions = "^4.5.0"
python = ">=3.9,<3.12"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason that we are no longer including python 3.12?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't changed that requirement. I'll add it shortly.

pyproject.toml Show resolved Hide resolved
@MaiBe-ctrl
Copy link
Collaborator

@ourownstory Not sure where the differences in the metrics are coming from, but I had to cast some variables to float32 to fix some tests which might caused these differences.

@ourownstory ourownstory marked this pull request as ready for review June 21, 2024 00:23
Copy link
Owner Author

@ourownstory ourownstory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like two changes to the if-check have unintentional consequences. @MaiBe-ctrl

@@ -311,12 +311,12 @@ def __post_init__(self):
self.trend_local_reg = False

# If trend_local_reg = True
if self.trend_local_reg == True:
if self.trend_local_reg:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks wrong - see comment in other PR

@@ -398,12 +398,12 @@ def __post_init__(self):
self.seasonality_local_reg = False

# If seasonality_local_reg = True
if self.seasonality_local_reg == True:
if self.seasonality_local_reg:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also overwrites existing config, which should not happen

log.error("trend_local_reg = True. Default trend_local_reg value set to 1")
self.trend_local_reg = 1

# If Trend modelling is global.
if self.trend_global_local == "global" and self.trend_local_reg:
if self.trend_global_local == "global" and self.trend_local_reg is True:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, your change was actually correct before:
if self.trend_global_local == "global" and self.trend_local_reg:

log.error("seasonality_local_reg = True. Default seasonality_local_reg value set to 1")
self.seasonality_local_reg = 1

# If Season modelling is global.
if self.global_local == "global" and self.seasonality_local_reg:
if self.global_local == "global" and self.seasonality_local_reg is True:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, your change was actually correct before:
if self.global_local == "global" and self.seasonality_local_reg:

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.46%. Comparing base (79ea9cd) to head (cfbe96e).
Report is 3 commits behind head on main.

Current head cfbe96e differs from pull request most recent head c4037b0

Please upload reports for the commit c4037b0 to get more accurate results.

Files Patch % Lines
neuralprophet/forecaster.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1514      +/-   ##
==========================================
- Coverage   88.16%   87.46%   -0.70%     
==========================================
  Files          41       41              
  Lines        5374     5378       +4     
==========================================
- Hits         4738     4704      -34     
- Misses        636      674      +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ourownstory
Copy link
Owner Author

@ourownstory Not sure where the differences in the metrics are coming from, but I had to cast some variables to float32 to fix some tests which might caused these differences.

I think the difference comes from the potentially changed implementation of the learning rate finder, that now is part of lightning Tuner.

@ourownstory ourownstory changed the title [devops] Upgrade to lightning 2.0 [WIP] [devops] Upgrade to lightning 2.0 Jun 21, 2024
@ourownstory ourownstory merged commit 79a6907 into main Jun 21, 2024
7 of 11 checks passed
@ourownstory ourownstory deleted the upgrade-lightning-2 branch June 21, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants