Eliminate candle-core/candle-nn from the KAN and Diffusion model forward
paths in ml-supervised. All dense layers now use cuBLAS sgemm via the new
gpu_tensor module. Element-wise ops (SiLU, sigmoid, tanh, exp) use host
roundtrips for now; fused CUDA kernels are a follow-up.
Changes:
- Add gpu_tensor.rs: GpuTensor (CudaSlice<f32> + shape), GpuLinear
(cuBLAS sgemm), and ~30 element-wise GPU ops
- Rewrite kan/{spline,layer,network}.rs to use GpuTensor instead of
candle_core::Tensor and candle_nn::{VarBuilder,Linear}
- Rewrite diffusion/{denoiser,noise,sampler}.rs to use GpuTensor and
GpuLinear instead of candle_nn::Linear
- Update ml crate trainable adapters (kan/trainable.rs,
diffusion/trainable.rs) to bridge Candle<->GpuTensor at the
UnifiedTrainable interface boundary
- Update ensemble inference adapters for both models
- Add cudarc 0.17 with cublas feature to ml-supervised Cargo.toml
- Candle deps retained in ml-supervised for unconverted models (TFT,
Liquid, Mamba, xLSTM) -- will be removed once all 8 models are
converted
Net: -424 lines, 509 -> ~453 Candle refs remaining (KAN: 0, Diffusion: 0)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>