Spaces:
Sleeping
Sleeping
Evgueni Poloukarov
commited on
Commit
·
e1f5207
1
Parent(s):
3254242
feat: extend context window to 3 months (2,160 hours) for 96GB VRAM
Browse files- Updated context_hours from 1,440 to 2,160 across all modules
- Version bump to v1.6.0
- Optimized for upgraded hardware: 96GB VRAM, 48 vCPU, 186GB RAM
- Previous OOM issues resolved with hardware upgrade
- Memory profiling diagnostics remain active for baseline analysis
Hardware: 48 vCPU, 186 GB RAM, 96 GB VRAM
Context: 2,160 hours (90 days / 3 months)
Files: app.py, chronos_inference.py, dynamic_forecast.py
- app.py +2 -2
- src/forecasting/chronos_inference.py +2 -2
- src/forecasting/dynamic_forecast.py +3 -3
app.py
CHANGED
|
@@ -2,8 +2,8 @@
|
|
| 2 |
"""
|
| 3 |
FBMC Chronos-2 Forecasting API
|
| 4 |
HuggingFace Space Gradio Interface
|
| 5 |
-
Version: 1.
|
| 6 |
-
FORCE REBUILD:
|
| 7 |
"""
|
| 8 |
|
| 9 |
# CRITICAL: Set PyTorch memory allocator config BEFORE any imports
|
|
|
|
| 2 |
"""
|
| 3 |
FBMC Chronos-2 Forecasting API
|
| 4 |
HuggingFace Space Gradio Interface
|
| 5 |
+
Version: 1.6.0 - Extended Context Window (2,160 hours = 90 days / 3 months)
|
| 6 |
+
FORCE REBUILD: Optimized for 96GB VRAM with memory profiling diagnostics
|
| 7 |
"""
|
| 8 |
|
| 9 |
# CRITICAL: Set PyTorch memory allocator config BEFORE any imports
|
src/forecasting/chronos_inference.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
Chronos-2 Inference Pipeline with Past-Only Covariate Masking
|
| 4 |
Standalone inference script for HuggingFace Space deployment.
|
| 5 |
Uses predict_df() API with ALL 2,514 features leveraging Chronos-2's mask-based attention.
|
| 6 |
-
FORCE REBUILD: v1.
|
| 7 |
"""
|
| 8 |
|
| 9 |
import os
|
|
@@ -128,7 +128,7 @@ class ChronosInferencePipeline:
|
|
| 128 |
run_date: str,
|
| 129 |
borders: Optional[List[str]] = None,
|
| 130 |
forecast_days: int = 7,
|
| 131 |
-
context_hours: int =
|
| 132 |
num_samples: int = 20
|
| 133 |
) -> Dict:
|
| 134 |
"""
|
|
|
|
| 3 |
Chronos-2 Inference Pipeline with Past-Only Covariate Masking
|
| 4 |
Standalone inference script for HuggingFace Space deployment.
|
| 5 |
Uses predict_df() API with ALL 2,514 features leveraging Chronos-2's mask-based attention.
|
| 6 |
+
FORCE REBUILD: v1.6.0 - Extended context window (2,160 hours = 90 days) optimized for 96GB VRAM
|
| 7 |
"""
|
| 8 |
|
| 9 |
import os
|
|
|
|
| 128 |
run_date: str,
|
| 129 |
borders: Optional[List[str]] = None,
|
| 130 |
forecast_days: int = 7,
|
| 131 |
+
context_hours: int = 2160, # 2,160 hours = 90 days (3 months, optimized for 96GB VRAM)
|
| 132 |
num_samples: int = 20
|
| 133 |
) -> Dict:
|
| 134 |
"""
|
src/forecasting/dynamic_forecast.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
-
Dynamic Forecast Module v1.
|
| 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 (
|
| 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 =
|
| 43 |
forecast_hours: int = 336 # Fixed at 14 days
|
| 44 |
):
|
| 45 |
"""
|
|
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
+
Dynamic Forecast Module v1.6.0 - Extended Context Window (90 Days / 3 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 (2,160 hours = 90 days / 3 months)
|
| 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 = 2160, # 2,160 hours = 90 days (3 months, optimized for 96GB VRAM)
|
| 43 |
forecast_hours: int = 336 # Fixed at 14 days
|
| 44 |
):
|
| 45 |
"""
|