Matmul Reference and cuBLAS Routines #
Low-level matrix-multiplication routines used to compare the CPU reference implementation with the explicit FP32 and FP64 cuBLAS paths. User-facing execution selects kernels through the runtime device and backend profile; this module does not define a separate execution mode.
Precision selector for GPU-backed fast matmul over Lean Float tensors.
.fp32routes throughCuda.Bufferand cuBLAS SGEMM, matching the precision used by the eager CUDA tensor-buffer path..fp64routes through the hostFloatArrayDGEMM bridge and cuBLAS DGEMM, preserving LeanFloatprecision for matmul-only research paths.
- fp32 : GpuMatmulPrecision
- fp64 : GpuMatmulPrecision
Instances For
Instances For
Convert an (m×n) matrix tensor into an array-of-rows representation.
This is purely a representation change to make runtime loops faster/easier to write.
Instances For
Fast (runtime-only) 2D matmul kernel.
This is a tight-loop kernel (array-of-rows representation) intended to avoid the overhead of the spec-layer definitions when running eager autograd.
Instances For
Convert an FFI dimension to UInt32, failing before the native call on overflow.
Instances For
2D matmul forward via cuBLAS DGEMM (torchlean_dgemm_cuda / Cuda.torchleanDgemmCuda).
Instances For
2D matmul forward via the float32 CUDA buffer path.
This path uploads Lean Float values to Cuda.Buffer (rounding to float32), calls the existing
Buffer.bmm SGEMM implementation with batch = 1, then downloads the float32 result back to Lean
Float.
Instances For
Dispatch to the requested GPU matmul precision.