std1.0.0-beta-7 SafeC docs

std :: ml::gpu_mps

Function std::mps_matmul_abt_f32

#include <std/ml/gpu_mps.h> source · definition

int mps_matmul_abt_f32(
    const &float a,
    const &float b,
    &float out,
    unsigned long M,
    unsigned long N,
    unsigned long K,
)

GPU-backed matmul backward: dA = dC . B^T, dB = A^T . dC (same math tensor_blas.sc's __matmul_backward_blas passes to cblas_dgemm via a transpose flag; here each is its own kernel instead). Used by a GPU matmul's backward pass, so a forward pass on the GPU gets a matmul_gpu backward pass too, instead of falling back to the CPU backward the way it used to — see that function's comment for why that fallback was the actual dominant cost in a training loop, not dispatch overhead. mps_matmul_abt_f32: out[M,K] = a[M,N] . b^T, b stored [K,N] (dA's shape) mps_matmul_atb_f32: out[K,N] = a^T . b, a stored [M,K] (dB's shape) Both are batch-aware (see "Batched dispatch" below) the same way mps_matmul_f32/mps_relu_f32 are -- a training step's backward pass is its own sequential chain (matmul2-backward -> relu-backward -> matmul1-backward, each waiting on the previous), so it pays the same per-op command-buffer round-trip cost forward used to before batching. Same three-tier smma-multi/smma/tiled shape-based kernel choice as mps_matmul_f32 (see its comment) internally, too.