Skip to main content

evaluate_ffn

Function evaluate_ffn 

pub fn evaluate_ffn<C>(
    context: &mut C,
    schedule: Schedule,
    input_size: usize,
    hidden_size: usize,
    output_size: usize,
    warmups: usize,
    samples: usize,
) -> Result<(GeneratedShader, GpuEvaluation), ForgeError>
where C: OracleContext,
Expand description

Cross-backend differential-oracle evaluation for the fused FFN against ffn_cpu (plan §7). Generic over OracleContext — the same code runs on wgpu and CUDA; only OracleContext::run_kernel differs. One workgroup-thread per output element; the output buffer is output_size. Tensors, bindings, dispatch sizing and tolerance are identical to the prior wgpu/evaluate_ffn_cuda paths.