Instructions to use replicate/paged-attention with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use replicate/paged-attention with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("replicate/paged-attention", version=1) - Notebooks
- Google Colab
- Kaggle
File size: 3,024 Bytes
132e594 6df83c0 ed30f9d 132e594 ed30f9d 132e594 4c6b316 132e594 6677800 132e594 ed30f9d 132e594 4c6b316 132e594 4c6b316 132e594 6677800 ed30f9d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | [general]
name = "paged_attention"
universal = false
[torch]
src = [
"torch-ext/torch_binding.cpp",
"torch-ext/torch_binding.h"
]
[kernel.cuda_utils]
backend = "cuda"
src = [
"cuda-utils/cuda_utils.h",
"cuda-utils/cuda_utils_kernels.cu",
]
depends = []
[kernel.cuda_utils_rocm]
backend = "rocm"
rocm-archs = [
"gfx906",
"gfx908",
"gfx90a",
"gfx940",
"gfx941",
"gfx942",
"gfx1030",
"gfx1100",
"gfx1101",
]
src = [
"cuda-utils/cuda_utils.h",
"cuda-utils/cuda_utils_kernels.cu",
]
depends = ["torch"]
[kernel.paged_attention]
backend = "cuda"
src = [
"cuda-utils/cuda_utils.h",
"paged-attention/attention/attention_dtypes.h",
"paged-attention/attention/attention_generic.cuh",
"paged-attention/attention/attention_kernels.cuh",
"paged-attention/attention/attention_utils.cuh",
"paged-attention/attention/dtype_bfloat16.cuh",
"paged-attention/attention/dtype_float16.cuh",
"paged-attention/attention/dtype_float32.cuh",
"paged-attention/attention/dtype_fp8.cuh",
"paged-attention/attention/paged_attention_v1.cu",
"paged-attention/attention/paged_attention_v2.cu",
"paged-attention/cache_kernels.cu",
"paged-attention/cuda_compat.h",
"paged-attention/dispatch_utils.h",
"paged-attention/quantization/fp8/amd/quant_utils.cuh",
"paged-attention/quantization/fp8/nvidia/quant_utils.cuh",
]
include = [ "cuda-utils", "paged-attention" ]
depends = [ "torch" ]
[kernel.paged_attention_rocm]
backend = "rocm"
rocm-archs = [
"gfx906",
"gfx908",
"gfx90a",
"gfx940",
"gfx941",
"gfx942",
"gfx1030",
"gfx1100",
"gfx1101",
]
src = [
"cuda-utils/cuda_utils.h",
"paged-attention/attention/attention_dtypes.h",
"paged-attention/attention/attention_generic.cuh",
"paged-attention/attention/attention_kernels.cuh",
"paged-attention/attention/attention_utils.cuh",
"paged-attention/attention/dtype_bfloat16.cuh",
"paged-attention/attention/dtype_float16.cuh",
"paged-attention/attention/dtype_float32.cuh",
"paged-attention/attention/dtype_fp8.cuh",
"paged-attention/attention/paged_attention_v1.cu",
"paged-attention/attention/paged_attention_v2.cu",
"paged-attention/cache_kernels.cu",
"paged-attention/cuda_compat.h",
"paged-attention/dispatch_utils.h",
"paged-attention/quantization/fp8/amd/quant_utils.cuh",
"paged-attention/quantization/fp8/nvidia/quant_utils.cuh",
]
include = [ "cuda-utils", "paged-attention" ]
depends = [ "torch" ]
[kernel.paged_attention_metal]
backend = "metal"
src = [
"paged-attention-metal/attention/paged_attention.metal",
"paged-attention-metal/cache/copy_blocks.metal",
"paged-attention-metal/cache/reshape_and_cache.metal",
"paged-attention-metal/convert_fp8.metal",
"paged-attention-metal/float8.metal",
"paged-attention-metal/utils.metal",
"paged-attention-metal/paged_attention.mm",
"paged-attention-metal/cache.mm",
"paged-attention-metal/convert_fp8.mm",
"paged-attention-metal/device.mm",
]
include = [ "." ]
depends = [ "torch" ]
|