refactor(ml): eliminate candle from all 104 src files

Zero candle_core/candle_nn imports in ml/src/. Three-agent parallel migration:

- cuda_pipeline/ (19 files): Tensor→CudaSlice, Device→Arc<CudaStream>,
  VarMap→GpuVarStore, cudarc import path fixed
- trainers/ + adapters (45 files): DQN/PPO/TFT trainers, 10 ensemble
  adapters, 11 hyperopt adapters — all migrated to MlDevice, GpuTensor,
  GpuVarStore, GpuAdamW
- model dirs + infra (40 files): 10 trainable adapters, preprocessing,
  inference, transformers, validation, benchmarks

61 test/example files still reference candle — next commit.
candle-nn still in Cargo.toml (needed by tests until migrated).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-18 00:24:35 +01:00
parent 20319618b6
commit 0d62bdba2e
106 changed files with 2176 additions and 3667 deletions

View File

@@ -29,7 +29,7 @@ simd = [] # SIMD without heavy dependencies
# Storage and memory management features
gc = [] # Garbage collection features
s3-storage = ["ml-checkpoint/s3-storage", "aws-config", "aws-sdk-s3", "aws-types", "aws-credential-types", "urlencoding"] # S3 storage backend with AWS SDK
cuda = ["candle-core/cuda", "candle-nn/cuda", "ml-core/cuda", "ml-dqn/cuda", "ml-ppo/cuda", "ml-supervised/cuda", "ml-ensemble/cuda", "ml-labeling/cuda", "ml-explainability/cuda", "ml-hyperopt/cuda"] # CUDA support — enabled by compile-training CI step via --features ml/cuda
cuda = ["cudarc", "ml-core/cuda", "ml-dqn/cuda", "ml-ppo/cuda", "ml-supervised/cuda", "ml-ensemble/cuda", "ml-labeling/cuda", "ml-explainability/cuda", "ml-hyperopt/cuda"] # CUDA support — enabled by compile-training CI step via --features ml/cuda
nccl = ["cuda"] # NCCL multi-GPU data parallelism (requires NCCL library + cudarc nccl feature)
# ALL HEAVY ML FEATURES REMOVED:
@@ -135,7 +135,8 @@ rust_decimal.workspace = true
# gymnasium, rerun - REMOVED (RL frameworks moved to ml_training_service)
# cudarc, wgpu - REMOVED (GPU frameworks moved to ml_training_service)
# cudarc — direct dep after candle removal, gated behind cuda feature
cudarc = { version = "0.19", optional = true, default-features = false, features = ["driver", "nvrtc", "cublas", "dynamic-linking", "std", "cuda-version-from-build-system"] }
rayon.workspace = true
crossbeam = { version = "0.8", features = ["std"] }