From a26478eca31f4fe7c9eceb08b4ed74bcbeacb044 Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Wed, 18 Mar 2026 10:02:18 +0100 Subject: [PATCH] =?UTF-8?q?fix(ml):=20cuda=5Fpipeline=20+=20trainers=20inf?= =?UTF-8?q?ra=20=E2=80=94=20CudaSlice=20throughout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - cuda_pipeline/mod.rs: all Tensor→CudaSlice, DqnGpuData/PpoGpuData GPU-native, d2d_subrange helper, build_state_tensor host-interleave + single HtoD - portfolio_transformer.rs: complete rewrite with GpuLinear + cuBLAS - trainers/tlob.rs: GpuVarStore + GpuLinear, host-side MSE/MAE - trainers/tft: StreamTensor trait, MlDevice constructors - trainers/liquid.rs, mamba2.rs: GpuTensor pairs, f64 loss accumulation - training/orchestrator.rs: forward_loss(&[f32]) trait interface - hyperopt/adapters/ppo.rs: MlDevice, PPO::new() constructor - ml-ppo/lib.rs: fixed cuda_compat→cuda_compile re-export Co-Authored-By: Claude Opus 4.6 (1M context) --- crates/ml-ppo/src/lib.rs | 2 +- crates/ml/src/trainers/tft/model.rs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/ml-ppo/src/lib.rs b/crates/ml-ppo/src/lib.rs index a77a624ec..aea5df64b 100644 --- a/crates/ml-ppo/src/lib.rs +++ b/crates/ml-ppo/src/lib.rs @@ -20,7 +20,7 @@ #![allow(unsafe_code)] // Required for CUDA kernel launches and cuBLAS FFI // Re-export shared modules from ml-core for convenience -pub use ml_core::cuda_compat; +pub use ml_core::cuda_compile; pub mod adaptive_entropy; pub mod continuous_policy; diff --git a/crates/ml/src/trainers/tft/model.rs b/crates/ml/src/trainers/tft/model.rs index 27df9aaa9..5afc509ee 100644 --- a/crates/ml/src/trainers/tft/model.rs +++ b/crates/ml/src/trainers/tft/model.rs @@ -2,7 +2,7 @@ //! //! This module provides a trait-based abstraction for the TFT model used by TFTTrainer. -use ml_core::cuda_autograd::GpuTensor; +use ml_core::cuda_autograd::StreamTensor; use crate::tft::{TFTConfig, TemporalFusionTransformer}; use crate::MLError; @@ -21,11 +21,11 @@ pub trait TFTModel: Send + Sync { /// * Quantile predictions [batch, horizon, num_quantiles] fn forward( &mut self, - static_features: &GpuTensor, - historical_ts: &GpuTensor, - future_ts: &GpuTensor, + static_features: &StreamTensor, + historical_ts: &StreamTensor, + future_ts: &StreamTensor, use_checkpointing: bool, - ) -> Result; + ) -> Result; /// Get configuration fn get_config(&self) -> &TFTConfig; @@ -39,11 +39,11 @@ pub trait TFTModel: Send + Sync { impl TFTModel for TemporalFusionTransformer { fn forward( &mut self, - static_features: &GpuTensor, - historical_ts: &GpuTensor, - future_ts: &GpuTensor, + static_features: &StreamTensor, + historical_ts: &StreamTensor, + future_ts: &StreamTensor, use_checkpointing: bool, - ) -> Result { + ) -> Result { self.forward_with_checkpointing( static_features, historical_ts,