chore(ml): file-level allow(unsafe_code) on 12 CUDA-launch files
CUDA kernel launches via cudarc::launch_builder and MappedF32::new (cuMemHostAlloc DEVICEMAP FFI) inherently require unsafe blocks. The workspace-wide '-W unsafe-code' lint produced ~80 warnings across these files, all structurally identical. Match the established pattern from ml-backtesting/src/harness.rs and ml-backtesting/src/sim/mod.rs: single file-level allow with a comment explaining the rationale. Files: alpha_dqn_h600_smoke, alpha_baseline, cublaslt_debug, gpu_walk_forward, cuda_pipeline/mod, hyperopt adapters (mamba2, ppo), DQN smoke_tests (helpers, td_propagation), trainers/ppo, and two ml/tests files. Documented in dqn-wire-up-audit.md.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
//! Phase E.3 Task 23 — Composition backtest with cost sweep.
|
||||
//!
|
||||
//! Trains the Phase E execution-policy DQN (linear Q + Phase 1d.3
|
||||
|
||||
@@ -38,6 +38,12 @@
|
||||
//! --n-episodes 1000
|
||||
//! ```
|
||||
|
||||
// CUDA kernel launches via `cudarc::launch_builder.launch(...)` and
|
||||
// `MappedF32::new` (`cuMemHostAlloc(DEVICEMAP)` FFI) require `unsafe`. The
|
||||
// workspace-wide `-W unsafe-code` lint is therefore noise here. Same rationale
|
||||
// as `ml-backtesting/src/harness.rs` and `sim/mod.rs`'s file-level allows.
|
||||
#![allow(unsafe_code)]
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::mem::MaybeUninit;
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
//! Standalone cublasLtMatmul debug test.
|
||||
//! Tests the EXACT same API call that fails in the experience collector on H100.
|
||||
//! Run: SQLX_OFFLINE=true cargo test -p ml --lib -- cuda_pipeline::cublaslt_debug --nocapture
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
//! GPU-resident walk-forward data manager.
|
||||
//!
|
||||
//! Uploads the ENTIRE dataset to GPU VRAM once, then provides per-fold
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
//! GPU Pipeline: Pre-uploaded training data for DQN/PPO trainers.
|
||||
//!
|
||||
//! Eliminates per-bar heap allocations by uploading all training data
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
//! MAMBA-2 Hyperparameter Optimization Adapter
|
||||
//!
|
||||
//! This module provides a production-ready adapter for optimizing MAMBA-2
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
//! PPO Hyperparameter Optimization Adapter
|
||||
//!
|
||||
//! This module provides a production-ready adapter for optimizing PPO
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
use crate::trainers::dqn::{DQNHyperparameters, DQNTrainer};
|
||||
use ml_core::device::MlDevice;
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
//! TD propagation diagnostic: does sparse-reward Q-learning actually learn?
|
||||
//!
|
||||
//! After Phase 2's reward-shaping purge, training reward is essentially pure
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
//! PPO Trainer with gRPC Integration
|
||||
//!
|
||||
//! This module provides a production-ready PPO trainer that integrates with the ML Training Service
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
//! Per-regime WR GPU oracle tests (audit follow-up 2026-05-09).
|
||||
//!
|
||||
//! Validates that `compute_backtest_metrics` correctly bucketises
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// CUDA kernel launches via cudarc + MappedF32::new (cuMemHostAlloc DEVICEMAP) require
|
||||
// unsafe FFI. Workspace -W unsafe-code is structural noise here. Same rationale as
|
||||
// ml-backtesting/src/harness.rs file-level allow.
|
||||
#![allow(unsafe_code)]
|
||||
#![allow(
|
||||
clippy::assertions_on_constants,
|
||||
clippy::assertions_on_result_states,
|
||||
|
||||
Reference in New Issue
Block a user