oa::ml::matrix::flash_attention_causal

Apply the explicit causal Flash provider to [BH,S,Dh] values. This compatibility entry point retains the same semantic scaled-dot-product attention identity as scaled_dot_product_attention. It materializes only the output and one FP32 log-sum-exp value per query row. Errors Returns an error unless Q, K, and V are equal nonempty same-engine F32 matrices, the sequence length is at most 1024, or runtime recording fails.

FnRust public API

Function Documentation

pub fn flash_attention_causal( query: &Matrix, key: &Matrix, value: &Matrix, scale: f32 ) -> Result<Matrix>
Apply the explicit causal Flash provider to [BH,S,Dh] values. This compatibility entry point retains the same semantic scaled-dot-product attention identity as scaled_dot_product_attention. It materializes only the output and one FP32 log-sum-exp value per query row. Errors Returns an error unless Q, K, and V are equal nonempty same-engine F32 matrices, the sequence length is at most 1024, or runtime recording fails.