Files
foxhunt/crates
jgrusewski befa7e2f55 perf(gpu): shared memory weight caching, GPU reductions, fix staging flush dim
CUDA kernel: cooperative_load_tile() + matvec_leaky_relu_shmem() cache weight
matrices in shared memory (SRAM), reducing HBM traffic 32x (1.76TB→55GB).
Block size increased to 256 threads for better SHMEM utilization.

Trainer hot-path: replace to_vec2 full-tensor CPU readbacks with GPU-native
flatten_all/min/max/mean_all (4 scalar readbacks). Merge two Q-diagnostic
forward passes into one. Deferred max_priority flush (1 GPU→CPU sync/epoch
instead of ~8/batch).

Fix StagedGpuBuffer::flush() dimension mismatch: used raw experience
state.len() (45) instead of gpu.state_dim() (48 aligned), causing
slice_scatter crash [500,48] vs [n,45] when CPU experiences flush into
GPU-aligned replay buffer.

Fix hardcoded state_dim=48 in optimal_n_episodes() — now uses dynamic
state_dim from network config (correct for OFI-enabled 56-dim states).

Dynamic episode auto-scaling guard: only auto-scale when gpu_n_episodes≥128
(production), respecting explicit test overrides (gpu_n_episodes=2).

Tests: 874 ml + 392 ml-dqn = 1266 pass, 0 fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:24:33 +01:00
..