Expand description
GPU backend abstraction (SBIO IORouter for GPU operations).
All CUDA interactions flow through GpuBackend. Business logic
(model forward pass, KV cache management) never calls cuLaunchKernel
or cuMemAlloc directly.
Structs§
- Device
Ptr - Opaque device pointer wrapping a CUDA CUdeviceptr (u64).
- Graph
Handle - Handle to an instantiated CUDA graph (CUgraphExec).
- Kernel
Handle - Handle to a loaded CUDA kernel function.
Enums§
- Kernel
Arg - Typed kernel argument, used by
launch_typed.
Traits§
- GpuBackend
- GPU backend trait — SBIO IORouter for all CUDA operations.
Functions§
- baseline_
free_ bytes - The free-memory baseline captured at context init, or
Noneif never set. - pack_
kernel_ args - Pack typed args into u64 slots, returning the slots and each argument’s STARTING slot index.
- set_
baseline_ free_ bytes - Record the free-memory baseline at GPU-context init. Call once, early, before weight loading. Idempotent-last-write; intended to be set exactly once.