std1.0.0-beta-7 SafeC docs

std :: ml::gpu_mps

Function std::mps_attn_batch_bf16_chained

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

int mps_attn_batch_bf16_chained(
    struct MpsBuf bufQ,
    struct MpsBuf bufK,
    struct MpsBuf bufV,
    struct MpsBuf bufCacheLens,
    &unsigned short out,
    unsigned long batchSize,
    unsigned long numHeads,
    unsigned long numKvHeads,
    unsigned long headDim,
    unsigned long maxKvLen,
    int isSliding,
    unsigned long slidingWindow,
)

Chained variant of mps_attn_batch_bf16: 'bufQ'/'bufK'/'bufV'/ 'bufCacheLens' are device buffers (e.g. from MpsBuf::upload) and this MUST run inside an open batch (mps_batch_begin()). The output stays a pending GPU buffer (MpsBuf::batch_last_output()) so it can feed a following op -- e.g. o_proj via mps_matmul_abt_bf16_persistent -- in the same commit+wait. 'out' is throwaway CPU scratch, same contract as every other chained op. Same failure conditions as the one-shot variant, plus returning 0 outside a batch.