CUTLASS / CuTe façade + cuBLAS TF32
CutlassAccel is the GPU linear-algebra entry for MathNN-sized work.
Full TF32 / matmul guide: TF32MatrixMultiply.md (TF32MatrixMultiply.md)
Lua bindings: LuaBrainstormAPI.md (LuaBrainstormAPI.md)
Chat feature index: ChatSession-Features.md (ChatSession-Features.md)
Status
| Mode | Behavior |
| Default GPU (`USE_CUDA`) | cuBLAS `GemmEx` — FP32 or TF32 (CUBLAS_COMPUTE_32F_FAST_TF32, SM≥8) |
| No GPU / cuBLAS fail | Host MatrixAcceleration AVX/AVX-512 GEMM |
| `AI_USE_CUTLASS` + device .cu | Optional future MMA kernels (same API) |
GPU MathNNDevice::MatMul calls _CutlassAccel::Gemm first.
Commands
[text]
cutlass status
cutlass bench [size] [repeats]
cutlass check [size]
cutlass set precision fp32|tf32|fp16|bf16
cutlass gemm [M N K]
Alias: cute ….
API
[cpp]
_CutlassAccel::Gemm(A, B, C, M, N, K, detail);
_CutlassAccel::LinearFused(W, x, bias, y, batch, in, out, relu, detail);
_CutlassAccel::SetPrecision(Precision::Tf32);
Lua
[lua]
cutlass_set_precision(“tf32”)
cutlass_gemm(128, 128, 128)
cutlass_check(64)
cutlass_bench(256, 3)
Correctness
- cutlass check: host golden vs façade; FP32 tol ~1e-3; TF32 probe tol ~5e-2.
- Detail strings report cublas_tf32, cublas_fp32, or host fallback.
Next steps for real CUTLASS MMA
- Add CutlassGemm.cu including CUTLASS/CuTe headers.
- Define AI_USE_CUTLASS on Tensor or a GPU config.
- Keep the same Gemm API; leave cuBLAS as default path.
- Keep cutlass check as golden vs AVX.
Filed under: Uncategorized - @ July 18, 2026 6:28 am