vllm.v1.hisparse.binding
¶
Worker-side wiring of HiSparse caches to attention layers.
Functions:
-
allocate_hisparse_kv_caches–Allocate the host pool separately from the shared device backing.
-
bind_hisparse_kv_caches–Bind existing cache storage and block tables; return the bound handles.
-
init_hisparse_kv_cache–Allocate and bind HiSparse caches within the caller's allocation context.
-
resolve_hisparse_specs–Resolve a common kernel block size for HiSparse MLA specs, and add the
allocate_hisparse_kv_caches(kv_cache_config, device, layout, kernel_block_sizes, host_pool)
¶
Allocate the host pool separately from the shared device backing.
Source code in vllm/v1/hisparse/binding.py
bind_hisparse_kv_caches(*, forward_context, kv_cache_config, kv_caches, block_tables, host_pool)
¶
Bind existing cache storage and block tables; return the bound handles.
Source code in vllm/v1/hisparse/binding.py
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 | |
init_hisparse_kv_cache(kv_cache_config, device, kernel_block_sizes, vllm_config, forward_context, block_tables)
¶
Allocate and bind HiSparse caches within the caller's allocation context.
Source code in vllm/v1/hisparse/binding.py
resolve_hisparse_specs(vllm_config, kv_cache_spec, attn_layers)
¶
Resolve a common kernel block size for HiSparse MLA specs, and add the resident/hot specs HiSparse derives from them.