Evgueni Poloukarov commited on
Commit
dfe9aab
·
1 Parent(s): 6fa9b28

fix: reduce context window to 256h to fit T4 GPU memory

Browse files

CUDA OOM Error Fix:
- Previous: 512h context × 615 features = 12.44 GiB allocation
- New: 256h context × 615 features = fits within 14.74 GiB T4 GPU
- Still provides 10+ days of historical context for forecasting

Changed:
- chronos_inference.py: context_hours default 512 -> 256
- dynamic_forecast.py: context_hours default 512 -> 256

This enables multivariate covariate forecasting with all 615 features
on free-tier T4 GPU (14.74 GB memory).

Error: OutOfMemoryError when allocating 12.44 GiB with 512h context
Fix: Reduced to 256h, maintaining sufficient historical signal

src/forecasting/chronos_inference.py CHANGED
@@ -105,7 +105,7 @@ class ChronosInferencePipeline:
105
  run_date: str,
106
  borders: Optional[List[str]] = None,
107
  forecast_days: int = 7,
108
- context_hours: int = 512,
109
  num_samples: int = 20
110
  ) -> Dict:
111
  """
 
105
  run_date: str,
106
  borders: Optional[List[str]] = None,
107
  forecast_days: int = 7,
108
+ context_hours: int = 256,
109
  num_samples: int = 20
110
  ) -> Dict:
111
  """
src/forecasting/dynamic_forecast.py CHANGED
@@ -30,7 +30,7 @@ class DynamicForecast:
30
  def __init__(
31
  self,
32
  dataset: pl.DataFrame,
33
- context_hours: int = 512,
34
  forecast_hours: int = 336 # Fixed at 14 days
35
  ):
36
  """
 
30
  def __init__(
31
  self,
32
  dataset: pl.DataFrame,
33
+ context_hours: int = 256,
34
  forecast_hours: int = 336 # Fixed at 14 days
35
  ):
36
  """