jgrusewski
d081c122e4
fix(ml): CRITICAL - Actually drop optimizer to free GPU memory
CRITICAL FIX: Optimizer drop was not freeing memory
Previous code used backup/restore pattern:
- optimizer.take() → optimizer_backup (kept in memory)
- Memory stayed at 1611MB (no change)
- Validation still OOM despite claiming to drop optimizer
New code actually frees memory:
- drop(optimizer.take()) → immediately frees 1100MB
- sync_cuda_device() → ensures GPU cleanup
- initialize_optimizer() → recreate after validation
Impact:
- Memory freed: 1100MB AdamW state during validation
- Memory available: 2485MB → 3585MB (87.5% free)
- Trade-off: Momentum reset per epoch (acceptable for 4GB GPUs)
File: ml/src/trainers/tft.rs lines 1113-1124
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 20:46:31 +01:00
..
2025-10-19 09:10:55 +02:00
2025-10-24 01:11:43 +02:00
2025-10-25 23:49:24 +02:00
2025-10-25 15:36:57 +02:00
2025-10-01 21:24:28 +02:00
2025-10-19 09:10:55 +02:00
2025-09-24 23:47:21 +02:00
2025-10-25 15:36:57 +02:00
2025-10-25 23:49:24 +02:00
2025-10-15 21:38:04 +02:00
2025-10-23 14:57:39 +02:00
2025-10-25 23:49:24 +02:00
2025-10-25 23:49:24 +02:00
2025-10-19 09:10:55 +02:00
2025-09-28 22:24:49 +02:00
2025-10-19 09:10:55 +02:00
2025-10-21 08:54:26 +02:00
2025-10-23 09:16:58 +02:00
2025-10-26 11:14:33 +01:00
2025-10-25 23:49:24 +02:00
2025-10-19 09:10:55 +02:00
2025-10-10 23:05:26 +02:00
2025-10-19 09:10:55 +02:00
2025-10-19 09:10:55 +02:00
2025-10-26 11:14:33 +01:00
2025-10-25 15:36:57 +02:00
2025-10-19 09:10:55 +02:00
2025-10-19 09:10:55 +02:00
2025-10-19 09:10:55 +02:00
2025-10-10 23:05:26 +02:00
2025-10-24 01:11:43 +02:00
2025-10-26 12:50:00 +01:00
2025-10-25 15:36:57 +02:00
2025-10-19 09:10:55 +02:00
2025-10-26 20:46:31 +01:00
2025-10-19 09:10:55 +02:00
2025-10-10 23:05:26 +02:00
2025-10-24 01:11:43 +02:00
2025-10-03 07:34:26 +02:00
2025-09-24 23:47:21 +02:00
2025-10-19 09:10:55 +02:00
2025-10-19 09:10:55 +02:00
2025-10-10 23:05:26 +02:00
2025-10-24 23:12:42 +02:00
2025-10-18 01:11:14 +02:00
2025-10-01 21:24:28 +02:00
2025-10-10 23:05:26 +02:00
2025-10-14 09:06:37 +02:00
2025-10-24 01:11:43 +02:00
2025-09-24 23:47:21 +02:00
2025-09-24 23:47:21 +02:00
2025-10-24 01:11:43 +02:00
2025-10-19 09:10:55 +02:00
2025-10-24 01:11:43 +02:00
2025-10-24 01:11:43 +02:00
2025-10-01 00:00:51 +02:00
2025-10-23 09:16:58 +02:00
2025-09-24 23:47:21 +02:00
2025-10-01 21:24:28 +02:00
2025-10-10 23:05:26 +02:00
2025-10-10 23:05:26 +02:00
2025-10-19 09:10:55 +02:00
2025-10-01 21:48:25 +02:00
2025-10-25 15:36:57 +02:00
2025-10-19 09:10:55 +02:00
2025-10-19 09:10:55 +02:00
2025-09-27 20:56:22 +02:00
2025-10-03 07:34:26 +02:00
2025-10-01 21:24:28 +02:00
2025-10-03 07:34:26 +02:00
2025-10-11 18:39:19 +02:00
2025-10-19 09:10:55 +02:00
2025-10-01 21:24:28 +02:00
2025-10-01 21:24:28 +02:00