Repository navigation
Conversation
…ce tuning Add skills/npu-perf-optimization/ — a systematic performance optimization loop for SGLang on Ascend NPU: reproducible baseline collection, operator-level bottleneck attribution, a quantified A/B matrix over NPU feature switches (NPU Graph, DeepEP, DP-Attention, MTP/speculative), and a structured report with a recommended launch command. Includes SKILL.md, scripts (baseline / profile analysis / A/B matrix / report generation / smoke test), and references (JSON contracts, feature-switch matrix, subagent contracts, report template). Task: Ascend/sglang#1109
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
skills/npu-perf-optimization/— a systematic performance optimization loop for SGLang on Ascend NPU: reproducible baseline collection, operator-level bottleneck attribution, a quantified A/B matrix over NPU feature switches (NPU Graph, DeepEP, DP-Attention, MTP/speculative), and a structured report with a recommended launch command.sglang-npu-adapterandnpu-api-adaptation-checkerskills in this repo; this skill adds the orchestration layer: matrix planning, JSON contracts, comparability rules, and recommendation synthesis.Skill functionality
When to invoke: a model already serves on Ascend NPU and you need a defensible optimal config or before/after numbers per switch; or a deployment regressed and you need to locate the config regression. Not intended for NVIDIA/CUDA deployments or for single one-off trace analysis.
The loop — SKILL.md orchestrates five phases; all handoff is via JSON files on disk, scripts are idempotent and need no interactive session:
--tp-size= 2 × card count), model weights (draft weights only for draft-based speculative options), workdir layout (traces never written to /tmp); fail fast until all passcollect_baseline.pybaseline/baseline.jsonanalyze_profile.pybottleneck.jsonrun_ab_matrix.pyab/*.jsongen_report.pyreports/report.md+report.jsonQuality gates built into the skill: every number in the report must trace to a stored JSON artifact; 3-run median everywhere; no improvement is claimed below the 3% noise floor; the recommended config must pass the
--validate-onlycompatibility check; the workload spec is stated verbatim for reproducibility.Mapping to the issue's acceptance criteria (Ascend/sglang#1109):
SKILL.md+references/json-schemas.mdreferences/subagent-contracts.md(machine contracts for three sub-agents: baseline-collector, bottleneck-analyzer, matrix-runner)collect_baseline.py/analyze_profile.py/run_ab_matrix.py/gen_report.py, with the schemas and report template inreferences/report.md(template inreferences/report-template.md), backed by the hardware numbers in the Test plan belowTask
Ascend/sglang#1109
The skill deliverable (SKILL.md + scripts + references) was included in the Ascend Task Center acceptance package submitted on 2026-09-24 (under review there); this PR adds it to the skills repo as guided in the task discussion group, with minor parsing/validation fixes applied since the package submission.
Deliverables
Test plan
python scripts/smoke_test.py— 19/19 checks pass