What problem does it solve? Adapting PyTorch models to graph mode on Ascend NPU involves choosing between npugraph_ex and GE backends, fixing graph breaks, eliminating unexpected recompiles, and handling dynamic shapes like actual_seq_lengths in LLM decode. This Skill provides a structured workflow covering design, implementation, and verification for graph mode adaptation. ## Core Features & Use Cases - Backend Selection Guidance: Compares npugraph_ex (capture & replay, aclgraph) and GE graph mode (Ascend IR via torchair) with quick-start code for each. - LLM Prefill/Decode Separation: Enforces graph mode only on the Decode stage while keeping Prefill in eager mode, with KV cache pre-allocation and rotary embedding refactoring patterns. - Graph Break & Recompile Diagnosis: Provides a problem triage flow (aot_eager → force_eager → graph mode issue) plus FA operator configuration tables for actual_seq_lengths handling. - Use Case: An engineer's LLM decode step is slow due to kernel launch overhead. Use this Skill to compile the decode path with torch.compile backend npugraph_ex, pre-allocate KV cache, externalize dynamic inputs, and verify no recompiles occur during inference. ## Quick Start Ask the assistant to adapt your NPU model's decode stage to torch.compile graph mode and produce a design plan before making code changes.