dit-perf-opt

Selects and validates DiT compute optimization tiers for quantization, sparsity, caching, and compilation on NPU.

14|5|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Ascend/MindIE-SD --skill dit-perf-opt-ascend
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dit-perf-opt
Source: https://github.com/Ascend/MindIE-SD/tree/main/.agents/skills/dit-perf-opt
Command: npx skills add https://github.com/Ascend/MindIE-SD --skill dit-perf-opt-ascend

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Once profiling has identified a DiT compute bottleneck in a diffusion model, engineers still face the hard question of which optimization tier to enable, at what setting, and how to prove it actually took effect. This Skill turns a located DiT compute bottleneck into a concrete, verifiable feature-tier combination for MindIE-SD on Ascend NPU. ## Core Features & Use Cases - Tier Selection: Chooses concrete quantization tiers (W8A16, W4A16, W8A8 series, W4A4, MXFP8, FA quantization), sparsity (rf_v2, ada_bsa), caching (DiTCache, AttentionCache, timestep optimization), and compilation options (MindieSDBackend, pattern fusion, ACLGraph) based on docs/zh/features/* as the single source of truth plus the framework support matrix. - Enablement Verification: Enforces the rule that "enabled does not mean effective" by requiring graph-hit, kernel-diff, or feature-active-count evidence, and treats byte-identical output to the lossless baseline as proof of non-activation rather than near-zero gain. - Combination Search Protocol: Provides a disciplined protocol for combining two or more lossy dimensions, including seam conflict checks, mandatory pairwise and ternary test coverage, single-variable stacking, frontier retention, and layer fallback. - Use Case: A profiling report shows MatMul takes 58% of DiT time with a quantization direction. The Skill looks up quantization.md for the API, checks the support matrix, selects W8A8_MXFP8, verifies activation with kernel evidence, and revalidates with a same-window A/B run. ## Quick Start Ask the assistant to pick and enable the right quantization, sparsity, or cache tier for an already-located DiT compute bottleneck and verify it actually took effect.

Frequently Asked Questions about dit-perf-opt

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose a quantization tier for DiT inference on Ascend NPU?▼

Look up the tier semantics and API in docs/zh/features/quantization.md, then confirm support status in the framework support matrix. Consider hardware generation, model compatibility, and the accuracy-versus-speed tradeoff, preferring lossless tiers first and MXFP8 W8A8 as a general default.

How to verify a DiTCache or quantization setting actually took effect?▼

Collect evidence that the feature participates, such as graph hits, kernel diffs, feature-active counters, or sampled-step kernels, rather than judging by wall-clock time alone. If output is byte-identical to the lossless baseline, classify it as not activated, not as near-zero gain.

What is the difference between rf_v2 and ada_bsa sparse attention?▼

rf_v2 is the preferred sparse attention option when attention exceeds about 30% of compute, using sparsity 0.8 for video and 0.6 for image workloads. ada_bsa is the fallback when the model is incompatible with rf_v2. Interfaces and hardware constraints are documented in docs/zh/features/sparse.md.

Can I combine quantization, sparsity, and caching together?▼

Yes, but combinations must follow the seam-based protocol: each lossy dimension passes the quality gate alone first, then pairwise and the ternary Cache plus quantization plus sparsity combinations are mandatory test rows. Same-seam writers are not stacked, and failures trigger layer fallback with full-step revalidation.

When should this Skill not be used for performance work?▼

Do not use it when the bottleneck is not yet located, since bottleneck analysis belongs to the orchestration layer. Multi-card parallelism and communication overlap go to dit-parallel-opt, VAE decode and host fixed overheads go to their own modules, and new operator or pattern implementation goes to operator-dev or pattern-dev.

Why does the same quantization tier behave differently on two NPU machines?▼

A tier name is not the actual algorithm; the device generation dispatches the real encoding, such as MXFP8 on newer generations versus INT8 dynamic quantization on older ones. Confirm the generation with npu-smi and verify the actual algorithm through quantization node evidence before comparing results.