tilelang-op-test-design

Generates layered test configurations and coverage-checked test code for TileLang-Ascend NPU operators.

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill tilelang-op-test-design-wangwindow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tilelang-op-test-design
Source: https://github.com/WangWindow/CANN-BatchMatMulMaxsum/tree/main/.agents/skills/tilelang-op-test-design
Command: npx skills add https://github.com/WangWindow/CANN-BatchMatMulMaxsum --skill tilelang-op-test-design-wangwindow

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Designing thorough tests for TileLang-Ascend NPU operators is error-prone: teams often miss non-aligned tail shapes, dtype combinations, or boundary values, and lack a machine-checkable way to prove coverage. This Skill turns operator design docs or kernel code into a complete, layered test plan with enforced coverage gates. ## Core Features & Use Cases - Four input scenarios: generate tests from design.md, supplement tests for existing custom/{op}/.py kernels, build templates from a verbal operator description, or analyze existing test coverage for gaps. - Four-layer test system: L0 smoke tests, L1 functional tests with deterministically generated non-aligned/prime shapes, L2 negative exception tests, and Boundary tests for INF/NAN/extreme values. - Contract-based coverage gate: every L1 case carries D- dimension tags, and scripts/coverage_check.py validates the test file against the coverage matrix, blocking delivery on any unexempted MISS. - Use Case: Given a fused BatchMatmulMaxSum operator design doc, the Skill classifies it as a Cube+Vector fusion operator, generates dtype/shape/value-range test cases with mixed-tolerance precision standards per dtype, and verifies coverage before sign-off. ## Quick Start Ask the assistant to design a layered test plan for your TileLang-Ascend operator by pointing it to your design.md or existing kernel file under custom/{op}/.

Frequently Asked Questions about tilelang-op-test-design

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

FAQPage Schema
How do I design tests for a TileLang-Ascend operator?

Provide the operator's design.md, kernel file, or a verbal description. The Skill classifies the operator by compute type, complexity, and math features, then generates L0/L1/L2/Boundary test configurations with per-dtype precision tolerances.

What test layers does TileLang operator testing use?

Four layers: L0 smoke tests on regular shapes, L1 functional tests covering aligned, tail, prime, and edge shapes, L2 negative tests expecting illegal inputs to be rejected, and Boundary tests checking precision on INF/NAN/extreme values.

How is test coverage verified for NPU operator tests?

Each L1 case carries D-* coverage dimension tags, and scripts/coverage_check.py compares them against the mandatory dimension set for the operator category. Any unexempted MISS exits with code 1 and blocks delivery.

Can I skip non-aligned shape tests if random shapes happen to align?

No. Non-aligned shapes are deterministically generated from the block size using tail-1, tail-mid, and prime formulas. They are a mandatory baseline that can only be extended, never reduced to zero.

What precision standard applies to float16 operator tests?

Float16 uses mixed tolerance with atol 2^-14, rtol 2^-9, max absolute error limit 1e-1, and required matched ratio 0.99. Integer dtypes require exact element-wise matching with zero tolerance.

Do L2 and Boundary test failures block the test suite?

No. L2 and Boundary results are non-blocking warnings tagged BOUNDARY_PASS or BOUNDARY_WARN. Only L0/L1 precision failures affect the exit code and print Test Passed on success.