Enumerated every DtoH/HtoD/memcpy call in the DQN hot path (run_full_step → child graphs). Classified 55 call sites: 31 OK-pinned, 20 COLD-PATH, 4 MIGRATED. Fix 1 (gpu_dqn_trainer.rs): removed dead cuMemcpyDtoHAsync_v2 in run_causal_intervention_unconditional — result (causal_mean_scratch) was never consumed; now stays on device. Fix 2 (fused_training.rs + training_loop.rs): compute_iqr() was called inside submit_aux_ops (captured aux_child graph). Its sync cuMemcpyDtoH_v2 cannot be graph-captured — silently ran only during capture, then HtoD replayed stale IQR data on every step. Removed from submit_aux_ops; added refresh_iqn_iqr() called once per epoch in process_epoch_boundary. Fix 3 (gpu_iqn_head.rs): tau_buf (CudaSlice<f32>) + tau_host (f32) + cuMemcpyHtoDAsync_v2 each step replaced by tau_pinned (*mut f32) + tau_dev_ptr (u64) via cuMemAllocHost_v2(DEVICEMAP) + cuMemHostGetDevicePointer_v2. CPU writes *tau_pinned = tau; EMA kernel reads via tau_dev_ptr — zero PCIe overhead. Drop updated. Audit table populated in docs/dqn-gpu-hot-path-audit.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ml
10-model ML ensemble for the Foxhunt HFT system, built on Candle v0.9.1.
Models
- DQN (Rainbow) — deep Q-network with prioritized replay, dueling heads, noisy nets
- PPO — proximal policy optimization with GAE, LSTM policies, clip-higher
- TFT — temporal fusion transformer for multi-horizon forecasting
- Mamba2 — state space model for sequence prediction
- Liquid Networks — biologically inspired networks for non-stationary data
- TLOB — transformer-based limit order book analysis
- KAN — Kolmogorov-Arnold networks
- xLSTM — extended LSTM architecture
- TGGN — temporal graph neural network
- Diffusion — diffusion-based generative model
Key Modules
ensemble— model ensemble coordination and confidence aggregationhyperopt— PSO-based hyperparameter optimization with per-model adapterstrainers— unified training loops (DQN, PPO, supervised)inference—InferenceAdaptertrait for predictioncheckpoint— model checkpointing and restorationevaluation— walk-forward evaluation pipeline
Usage
use ml::dqn::DQN;
use ml::ppo::PpoTrainer;