Expand description
2026-09-25: The CUDA GpuBackend: MetraleCudaBackend, the driver API
declarations its submodules call, and its device-allocation ledger.
Owner: gpu-runtime (CUDA backend). Invariants:
- A pointer that
allocoralloc_managedreturns is onlive_allocsuntilfreeorsweep_unreleasedtakes it off;freetakes it off before callingcuMemFree_v2, whatever that call returns. alloc_arenaallocations are never onlive_allocs.
Modules§
- arch_
preflight - 2026-09-25: Refuse a GPU whose compute capability cannot run the kernels’
architecture, before
MetraleCudaBackend::newloads any module, with an error that names both ([metrale_core::arch::ArchMismatch]); also warn when the device’s SM count differs from the target’ssm_count. - tensormap
- 2026-09-25: TMA descriptors (
CUtensorMap) forcp.async.bulk.tensorloads, encoded with the driver’scuTensorMapEncodeTiled.
Structs§
- Ledger
Probe - 2026-10-01: A read handle on one backend’s ledger, for a reader that cannot hold the
backend, which moves into the model it builds. It reads the map
MetraleCudaBackend::live_bytesreads, so the two always agree. - Metrale
Cuda Backend - 2026-09-25: The CUDA
GpuBackend, holding one model’s kernel modules.
Functions§
- cuda_
free_ memory_ bytes - 2026-09-25: Free device memory without a
GpuBackend, for the OOM watchdog and the TUI.NonewhencuMemGetInfo_v2fails. - spawn_
oom_ watchdog - 2026-09-25: Spawn the OOM watchdog on the tokio runtime, or return
Noneif one was already spawned.