gpu-correlation-caching
Installation
SKILL.md
GPU Correlation Caching - Research Notes
Experiment Overview
| Item | Details |
|---|---|
| Date | 2026-01-17 |
| Goal | Eliminate performance bottleneck where training notebook hangs at "Correlations: 1/2 (50%)" during universe selection |
| Environment | Python 3.11+, PyTorch 2.x, SQLite |
| Status | Success |
Problem
The calculate_correlation_matrix() function in alpaca_trading/selection/portfolio/correlation.py was slow because:
- Rolling correlation is O(n² × m): Nested Python loops at lines 138-153
- CPU-bound pandas: Uses
window_df.corr()repeatedly in loop - No caching: Recomputes from scratch every run, even with identical data
Symptom: Selection hangs at "Correlations: 1/2 (50%)" for 60-90+ seconds with 100 symbols, 4-6+ minutes with 200 symbols.