model-auto-optimization

Orchestrates staged NPU optimization of diffusion models across fusion, parallelism, and quantization.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Optimizing a diffusion model hosted by a third-party framework on Ascend NPUs involves many disjoint steps—environment setup, kernel fusion, multi-card parallelism, quantization/sparsity/cache tuning, and final verification—which are easy to run out of order or declare done without evidence. This Skill provides a single orchestration entry point that routes each stage (S0–S6) to the right capability skill, enforces stage gates, and mandates evidence-backed closure reports. ## Core Features & Use Cases - Staged routing (S0–S6): Routes tasks through environment preparation, DiT kernel fusion, multi-card parallelism (USP/CP/TP), lossy optimization (quantization, sparsity, cache), training-aware distillation, and VAE/host optimization, each with defined acceptance criteria. - Run-state and stage gates: Maintains a single source of truth in run-state.md and blocks stage advancement via scripts/stage_gate.py until evidence checks pass with zero errors. - Mandatory dual reports and claim discipline: Enforces overview_report.md and detail_report.md with measured e2e baselines, step counts, quality gates, and anti-no-op verification counters before any speedup claim. - Use Case: Given a request like "optimize MiniMax-H3 on vLLM-Omni to 8bit + 80% sparsity + cache", the Skill confirms scope, runs S0 environment setup, executes fusion/parallel/lossy stages with per-stage evidence, and closes with audited overview and detail reports. ## Quick Start Ask the assistant to optimize a specific diffusion model on its hosting framework, for example: run the full optimization flow for MiniMax-H3 on vLLM-Omni starting from environment setup.

Frequently Asked Questions about model-auto-optimization

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

FAQPage Schema
How do I optimize a diffusion model on Ascend NPU with this workflow?

Start with the orchestration entry, which classifies the task and routes it through stages S0 to S6: environment setup, kernel fusion, parallelism, lossy optimization, and closure. Each stage ends with run-state updates and a stage_gate.py check that must pass before advancing.

How do I choose between USP and CP parallelism for multi-card DiT inference?

Route to stage S3, which prefers USP by default and evaluates CP based on topology bandwidth probes across 4, 8, or 16 cards. Validate with a few steps and multi-rank profiling data, comparing communication time under a fixed-rank measurement convention.

Can quantization, sparsity, and cache be combined safely?

Yes, stage S4 enables each feature individually with accuracy checks, then runs a combination matrix including mandatory pairwise tests and the triple Cache+quantization(w8a8f8)+sparsity case. Layer-level rollback is allowed, and rolled-back final configurations must be re-measured at full step counts.

What evidence is required before claiming a speedup?

Every claim needs an explicit baseline denominator, timing boundaries excluding model load and warmup, median over repeated runs, and runtime counters proving the technique actually executed. Anchor rows like baseline, final recommendation, and the triple combination must use measured e2e latency, never estimates.

When should repository code changes go through dev-workflow instead?

Tasks modifying MindIE-SD code itself, such as patterns, operators, graph dispatch, tests, or commits, belong to dev-workflow. This orchestration entry only handles optimizing a model's deployment and never edits code directly.

What happens if a stage gate check fails?

The stage cannot advance or claim closure until stage_gate.py returns zero errors. Failed acceptance repairs are capped at five rounds, after which the stage's changes are rolled back and the blocker is reported to the user.