MicroGPT::Backend
Instance methods
add(a : Mat, b : Mat) : Mat
Sourceadd!(a : Mat, b : Mat)
Sourcebatched_matmul(a_list : Array(Mat), b_list : Array(Mat), transpose_a : Bool, transpose_b : Bool) : Array(Mat)
Sourcebias_add(data : Mat, bias : Mat)
Sourcecausal_mask(scores : Mat)
SourceFused attention: scale + causal mask + softmax in one pass Default implementation falls back to separate ops
Fused bias + ReLU: add bias then apply ReLU in one pass Default falls back to separate ops
matmul_into(a : Mat, b : Mat, dst : Mat)
Sourcerelease(a : Mat)
Sourcerelu_backward(grad : Mat, mask : Mat) : Mat
Sourcerope_apply(x : Mat, cos_cache : Mat, sin_cache : Mat)
RoPE: apply/inverse on GPU if available, default is no-op (handled by RoPE class on CPU)
rope_apply_inverse(x : Mat, cos_cache : Mat, sin_cache : Mat)
Sourcesoftmax_backward(s : Mat, ds : Mat) : Mat
Sourcesync
Sourcetranspose(a : Mat) : Mat
Source