/** * WebGPU Transformer Layers * GPU-accelerated implementations of transformer building blocks */ import { Tensor } from '../tensor.js'; /** * Layer Normalization */ export declare function layerNorm(input: Tensor, weight: Tensor, bias: Tensor, eps?: number): Promise; /** * RMS Normalization (used in Llama) */ export declare function rmsNorm(input: Tensor, weight: Tensor, eps?: number): Promise; /** * Apply Rotary Position Embeddings * @param input - Input tensor [seqLen, numHeads * headDim] * @param seqLen - Number of tokens being processed * @param numHeads - Number of attention heads * @param headDim - Dimension per head * @param base - RoPE base frequency (default 10000) * @param startPos - Starting position for incremental inference (default 0) */ export declare function applyRope(input: Tensor, seqLen: number, numHeads: number, headDim: number, base?: number, startPos?: number): Promise; export interface AttentionConfig { numHeads: number; headDim: number; scale?: number; causal?: boolean; } /** * Multi-Head Attention * * Q, K, V: [batchSize, seqLen, numHeads * headDim] * Output: [batchSize, seqLen, numHeads * headDim] */ export declare function attention(q: Tensor, k: Tensor, v: Tensor, config: AttentionConfig): Promise; /** * Feed-Forward Network with SiLU activation (Llama-style) * * gate = x @ W_gate * up = x @ W_up * output = (silu(gate) * up) @ W_down */ export declare function feedForward(x: Tensor, wGate: Tensor, wUp: Tensor, wDown: Tensor): Promise; /** * Simple MLP with GELU activation */ export declare function mlp(x: Tensor, w1: Tensor, w2: Tensor): Promise; /** * Reset all cached pipelines (useful after shader updates) */ export declare function resetLayersPipelines(): void; //# sourceMappingURL=index.d.ts.map