Evgueni Poloukarov Claude commited on
Commit
d080539
·
1 Parent(s): 306322f

fix: reduce context window to 1125 hours (1.5 months) for A100-80GB

Browse files

- Previous 1,800h context caused OOM on A100-80GB (needed 93 GiB > 79 GiB available)
- 512h worked on 28GB GPU, so 1125h should fit on 80GB with headroom
- Estimated memory: ~48 GiB (31 GiB headroom)
- Updated both dynamic_forecast.py and chronos_inference.py

Co-Authored-By: Claude <[email protected]>

src/forecasting/chronos_inference.py CHANGED
@@ -132,7 +132,7 @@ class ChronosInferencePipeline:
132
  run_date: str,
133
  borders: Optional[List[str]] = None,
134
  forecast_days: int = 7,
135
- context_hours: int = 2160, # 2,160 hours = 90 days (3 months, optimized for 96GB VRAM)
136
  num_samples: int = 20
137
  ) -> Dict:
138
  """
 
132
  run_date: str,
133
  borders: Optional[List[str]] = None,
134
  forecast_days: int = 7,
135
+ context_hours: int = 1125, # 1,125 hours = 46.9 days (1.5 months, fits A100-80GB)
136
  num_samples: int = 20
137
  ) -> Dict:
138
  """
src/forecasting/dynamic_forecast.py CHANGED
@@ -1,6 +1,6 @@
1
  #!/usr/bin/env python3
2
  """
3
- Dynamic Forecast Module v1.7.0 - Extended Context Window (75 Days / 2.5 Months)
4
  Time-aware data extraction for forecasting with run-date awareness.
5
 
6
  Purpose: Prevent data leakage by extracting data AS IT WAS KNOWN at run time.
@@ -8,7 +8,7 @@ Purpose: Prevent data leakage by extracting data AS IT WAS KNOWN at run time.
8
  Key Concepts:
9
  - run_date: When the forecast is made (e.g., "2025-09-30 23:00")
10
  - forecast_horizon: Always 14 days (D+1 to D+14, fixed at 336 hours)
11
- - context_window: Historical data before run_date (1,800 hours = 75 days / 2.5 months, optimized for A100-80GB)
12
  - future_covariates: ALL 2,514 features (leveraging Chronos-2 past-only masking)
13
  * 603 full-horizon (known future)
14
  * 12 partial D+1 (masked D+2-D+14)
@@ -39,7 +39,7 @@ class DynamicForecast:
39
  def __init__(
40
  self,
41
  dataset: pl.DataFrame,
42
- context_hours: int = 1800, # 1,800 hours = 75 days (2.5 months, optimized for A100-80GB)
43
  forecast_hours: int = 336 # Fixed at 14 days
44
  ):
45
  """
 
1
  #!/usr/bin/env python3
2
  """
3
+ Dynamic Forecast Module v1.8.0 - Context Window (47 Days / 1.5 Months)
4
  Time-aware data extraction for forecasting with run-date awareness.
5
 
6
  Purpose: Prevent data leakage by extracting data AS IT WAS KNOWN at run time.
 
8
  Key Concepts:
9
  - run_date: When the forecast is made (e.g., "2025-09-30 23:00")
10
  - forecast_horizon: Always 14 days (D+1 to D+14, fixed at 336 hours)
11
+ - context_window: Historical data before run_date (1,125 hours = 47 days / 1.5 months, fits A100-80GB)
12
  - future_covariates: ALL 2,514 features (leveraging Chronos-2 past-only masking)
13
  * 603 full-horizon (known future)
14
  * 12 partial D+1 (masked D+2-D+14)
 
39
  def __init__(
40
  self,
41
  dataset: pl.DataFrame,
42
+ context_hours: int = 1125, # 1,125 hours = 46.9 days (1.5 months, fits A100-80GB)
43
  forecast_hours: int = 336 # Fixed at 14 days
44
  ):
45
  """