std1.0.0-beta-7 SafeC docs

std :: ml::gpu_mps

Function std::mps_gated_gelu_f32_chained

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

int mps_gated_gelu_f32_chained(
    struct MpsBuf bufRaw,
    &float out,
    unsigned long rows,
    unsigned long intermediateSize,
)

Fused gated-activation (GeGLU/tanh-GELU) step: 'bufRaw' is a still- pending GPU buffer holding one row-major [rows, 2intermediateSize] matmul output (gate half then up half per row -- e.g. the result of a matmul against a row-concatenated [gateW; upW] weight); computes out[row,col] = gelu(bufRaw[row,col]) * bufRaw[row, intermediateSize+col] for col in [0, intermediateSize), same tanh-approx GELU formula as activations.sc.gelu_fwd(), in one dispatch -- see gpu_mps_kernels.metal's gated_gelu_kernel. 'out' has rows intermediateSize elements, same throwaway-CPU-scratch-until-batch-end contract as every other *_chained function here.