Instructions to use hellmans/metal-flash-sdpa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use hellmans/metal-flash-sdpa with Kernels:
# !pip install kernels from kernels import get_kernel kernel = get_kernel("hellmans/metal-flash-sdpa") - Notebooks
- Google Colab
- Kaggle
File size: 350 Bytes
cc6ca73 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #pragma once
#include <torch/torch.h>
void flash_attention_varlen(
torch::Tensor &out,
torch::Tensor &query,
torch::Tensor &key,
torch::Tensor &value,
torch::Tensor &cu_seqlens_q,
torch::Tensor &cu_seqlens_k,
int64_t max_seqlen_q,
int64_t max_seqlen_k,
bool do_causal,
double scale,
double softcapping);
|