vllm.v1.attention.backends.gdn_attn ΒΆ
Backend for GatedDeltaNet attention.
GDNAttentionBackend ΒΆ
Bases: AttentionBackend
Source code in vllm/v1/attention/backends/gdn_attn.py
GDNAttentionMetadata dataclass
ΒΆ
Source code in vllm/v1/attention/backends/gdn_attn.py
non_spec_query_start_loc class-attribute
instance-attribute
ΒΆ
non_spec_state_indices_tensor class-attribute
instance-attribute
ΒΆ
num_accepted_tokens class-attribute
instance-attribute
ΒΆ
spec_query_start_loc class-attribute
instance-attribute
ΒΆ
spec_sequence_masks class-attribute
instance-attribute
ΒΆ
spec_state_indices_tensor class-attribute
instance-attribute
ΒΆ
token_chunk_offset_ptr class-attribute
instance-attribute
ΒΆ
__init__ ΒΆ
__init__(
num_prefills: int,
num_prefill_tokens: int,
num_decodes: int,
num_decode_tokens: int,
num_spec_decodes: int,
num_spec_decode_tokens: int,
num_actual_tokens: int,
has_initial_state: Optional[Tensor] = None,
spec_query_start_loc: Optional[Tensor] = None,
non_spec_query_start_loc: Optional[Tensor] = None,
spec_state_indices_tensor: Optional[Tensor] = None,
non_spec_state_indices_tensor: Optional[Tensor] = None,
spec_sequence_masks: Optional[Tensor] = None,
spec_token_masks: Optional[Tensor] = None,
num_accepted_tokens: Optional[Tensor] = None,
nums_dict: Optional[dict] = None,
batch_ptr: Optional[Tensor] = None,
token_chunk_offset_ptr: Optional[Tensor] = None,
) -> None
GDNAttentionMetadataBuilder ΒΆ
Bases: AttentionMetadataBuilder[GDNAttentionMetadata]
Source code in vllm/v1/attention/backends/gdn_attn.py
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
|
decode_cudagraph_max_bs instance-attribute
ΒΆ
decode_cudagraph_max_bs = min(
max_num_seqs * (num_spec + 1), max_capture_size
)
non_spec_query_start_loc instance-attribute
ΒΆ
non_spec_query_start_loc = empty(
(decode_cudagraph_max_bs + 1,),
dtype=int32,
device=device,
)
non_spec_state_indices_tensor instance-attribute
ΒΆ
non_spec_state_indices_tensor = empty(
(decode_cudagraph_max_bs,), dtype=int32, device=device
)
num_accepted_tokens instance-attribute
ΒΆ
num_accepted_tokens = empty(
(decode_cudagraph_max_bs,), dtype=int32, device=device
)
spec_query_start_loc instance-attribute
ΒΆ
spec_query_start_loc = empty(
(decode_cudagraph_max_bs + 1,),
dtype=int32,
device=device,
)
spec_sequence_masks instance-attribute
ΒΆ
spec_sequence_masks = empty(
(decode_cudagraph_max_bs,), dtype=bool, device=device
)
spec_state_indices_tensor instance-attribute
ΒΆ
spec_state_indices_tensor = empty(
(decode_cudagraph_max_bs, num_spec + 1),
dtype=int32,
device=device,
)
spec_token_masks instance-attribute
ΒΆ
spec_token_masks = empty(
(decode_cudagraph_max_bs * (num_spec + 1),),
dtype=bool,
device=device,
)
__init__ ΒΆ
__init__(
kv_cache_spec: AttentionSpec,
layer_names: list[str],
vllm_config: VllmConfig,
device: device,
)
Source code in vllm/v1/attention/backends/gdn_attn.py
build ΒΆ
build(
common_prefix_len: int,
common_attn_metadata: CommonAttentionMetadata,
num_accepted_tokens: Optional[Tensor] = None,
num_decode_draft_tokens_cpu: Optional[Tensor] = None,
fast_build: bool = False,
) -> GDNAttentionMetadata
Source code in vllm/v1/attention/backends/gdn_attn.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
|
build_for_cudagraph_capture ΒΆ
build_for_cudagraph_capture(
common_attn_metadata: CommonAttentionMetadata,
)
This method builds the metadata for full cudagraph capture. Currently, only decode is supported for full cudagraphs with Mamba.