Files
foxhunt/crates/ml-ppo
jgrusewski 2bbc80cf46 feat(cuda): PPO GPU-resident pipeline — 123 MB/epoch roundtrip eliminated
PpoExperienceBatch: all 6 fields Vec<T>→CudaSlice<T>. Data stays on GPU
from kernel collection through training. Zero DtoH for batch data.

- collect_experiences(): returns CudaSlice via D2D copy, no memcpy_dtoh
- gpu_batch_to_trajectory_batch(): DELETED (was CPU conversion)
- PPO::update_gpu(): reads states via D2D mini-batch, forward on GPU
- compute_metrics_from_gpu(): downloads only scalars (returns/advantages/
  actions), NOT the 123 MB state tensor
- download_*() methods for debug/checkpoint only

States (123 MB/epoch) never leave GPU. Only 2 scalar losses come to CPU.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 09:09:40 +01:00
..