refactor(cuda): eliminate all CPU fallbacks — CUDA mandatory across ML stack

- Remove ALL #[cfg(feature = "cuda")] guards (~400+ occurrences)
- Remove ALL #[cfg_attr(not(feature = "cuda"), ignore)] test annotations (~250)
- Make cuda default feature in 9 ML crates (ml, ml-core, ml-dqn, ml-ppo, etc.)
- Convert nvrtc JIT compilation to precompiled nvcc (searchsorted, prefix_sum)
- Move compile_ptx_for_device() to ml-core for shared access
- Delete dead CPU code: multi_step.rs, self_supervised_pretraining.rs,
  training_guard_gpu_tests.rs, CPU PER buffer paths, CPU Q-diagnostics
- Replace unwrap_or(Device::Cpu) with hard errors everywhere
- Remove dead is_cuda() else branches in DQN/PPO/hyperopt trainers
- Change config defaults from "cpu" to "cuda" (rainbow, tlob, pipeline)
- Port IQL value network to GPU kernel (5 CUDA entry points)
- Port HER goal relabeling to GPU kernel (warp-per-sample)
- Wire DSR GPU-to-CPU sync in training loop
- cfg!(feature = "cuda") → true in inference_validator

Zero warnings, zero errors across entire workspace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-16 21:01:28 +01:00
parent 979f135271
commit 450c23a6d0
221 changed files with 3879 additions and 17772 deletions

View File

@@ -5,14 +5,12 @@
use super::utils::*;
use log::{info, warn};
#[cfg(feature = "cuda")]
use cudarc::driver::{CudaDevice, DevicePtr, LaunchAsync, LaunchConfig};
#[cfg(test)]
mod tests {
use super::*;
#[cfg(feature = "cuda")]
#[test]
fn test_cuda_kernel_manager_creation() {
init_gpu_test_env();
@@ -49,7 +47,6 @@ mod tests {
}
}
#[cfg(feature = "cuda")]
#[test]
fn test_cuda_memory_operations() {
init_gpu_test_env();
@@ -121,7 +118,6 @@ mod tests {
}
}
#[cfg(feature = "cuda")]
#[test]
fn test_cuda_kernel_compilation() {
init_gpu_test_env();
@@ -270,7 +266,6 @@ mod tests {
}
}
#[cfg(feature = "cuda")]
#[test]
fn test_cuda_stream_operations() {
init_gpu_test_env();