What problem does it solve? LLM inference on Ascend NPU requires careful KVCache management to control memory usage and latency. This Skill guides the analysis and code migration of KVCache implementations, covering Legacy contiguous caches, Paged Attention with fused FA operators, and MLA compressed caches, so models avoid OOM and performance regressions. ## Core Features & Use Cases - Mode Selection: Chooses between Legacy, Paged Attention (FA + TND layout), and MLA absorb paths based on model attention architecture (MHA/GQA, sliding window, MLA) and deployment mode (framework vs standalone). - Data Structure Construction: Explains and implements block_table, slot_mapping, actual_seq_lengths, and kv_len lifecycle for both framework-managed and runner-managed deployments. - FA Operator Integration: Details npu_fused_infer_attention_score v1/v2 parameter mapping, sparse_mode and atten_mask constraints, and cache write operators like npu_scatter_nd_update_ and npu_kv_rmsnorm_rope_cache. - Use Case: When migrating a Qwen3 or DeepSeek-style model to cann-recipes-infer, use this Skill to convert Legacy scatter_update_ caches into Paged mode with get_cache_info(), cache_entries, and per-attn_type block_table routing, then verify the initialization, runtime, and release links. ## Quick Start Ask the assistant to analyze your model's attention architecture and migrate its KVCache to Paged Attention mode on Ascend NPU.