jgrusewski
5191fa022a
perf(ml): replace remaining CPU tensor allocations with GPU-native ops
Eliminate all remaining from_vec(vec![const; N]) patterns and CPU
tensor roundtrips in the training hot path:
- gamma discount: from_vec → Tensor::full (DQN + distributional C51)
- C51 atoms: from_vec(computed Vec) → arange+affine, 4 instances
across forward pass and C51 loss paths (online/standard/double-DQN)
- IQN cosine embedding indices: from_vec → arange+reshape
- IQN uniform quantiles: from_vec → arange+affine (τ_i = (i+0.5)/N)
- PPO clip epsilon: from_vec+ones+sub/add+tensor_clamp → scalar clamp
(eliminates 6 intermediate tensor allocations, 2 call sites)
- Dead neuron detection: flatten+to_vec1+CPU loop → abs().le().sum_all()
(single scalar per parameter tensor instead of full weight transfer)
548 tests pass (350 ml-dqn + 198 ml-ppo), ml crate compiles clean.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:22:39 +01:00
..
2026-03-01 22:47:39 +01:00
2026-03-08 02:42:53 +01:00
2026-03-05 00:22:04 +01:00
2026-03-01 22:47:39 +01:00
2026-03-07 23:28:18 +01:00
2026-03-01 22:47:39 +01:00
2026-03-01 22:47:39 +01:00
2026-03-08 23:12:54 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 23:12:54 +01:00
2026-03-01 22:47:39 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 23:22:39 +01:00
2026-03-08 22:31:49 +01:00
2026-03-08 22:31:49 +01:00
2026-03-08 15:21:46 +01:00
2026-03-08 22:31:49 +01:00
2026-03-08 22:31:49 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 23:22:39 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 22:31:49 +01:00
2026-03-08 15:17:22 +01:00
2026-03-08 15:17:22 +01:00
2026-03-01 22:47:39 +01:00
2026-03-05 23:19:38 +01:00
2026-03-01 22:47:39 +01:00
2026-03-01 22:47:39 +01:00
2026-03-05 00:18:58 +01:00
2026-03-01 22:47:39 +01:00
2026-03-03 22:16:35 +01:00