build(ml-alpha): multi-cubin build.rs + placeholder kernels + local MappedF32Buffer

Cargo.toml: drops gbdt; adds memmap2 + approx; keeps ml-core only
(cannot depend on ml: would cycle since ml depends on ml-alpha for
the Mamba2 gate baseline).

build.rs: compiles 7 cubins (mamba2_alpha + 6 new placeholders)
with -O3 --use_fast_math --ftz --fmad. Skips kernels whose source
isn't present yet so partial check-ins work. Every env::var paired
with rerun-if-env-changed per the canonical build pearl.

src/pinned_mem.rs: local copy of MappedF32Buffer (mirrors
ml::cuda_pipeline::mapped_pinned::MappedF32Buffer). Drives the only
permitted CPU<->GPU path per feedback_no_htod_htoh_only_mapped_pinned.
Eventually the move-to-ml-core refactor will deduplicate; out of
scope for the Phase A branch.

Addendum: updates the import path to ml_alpha::pinned_mem.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-05-16 21:35:35 +02:00
parent 2deec0cf91
commit d3b60b2ef3
11 changed files with 201 additions and 91 deletions

View File

@@ -22,7 +22,7 @@ use cudarc::driver::{
CudaContext, CudaStream, CudaModule, CudaFunction, CudaSlice,
DevicePtr, DevicePtrMut, LaunchConfig, PushKernelArg, DriverError,
};
use ml::cuda_pipeline::mapped_pinned::MappedF32Buffer;
use crate::pinned_mem::MappedF32Buffer; // local copy — see pinned_mem.rs header
use ml_core::device::MlDevice;
```