catlass-hardware-constraints

Validates CATLASS TileShape selections against Ascend on-chip buffer capacity budgets.

6|1|Updated Apr 19, 2026
One-click install
npx skills add https://github.com/xchang1121/op-autoresearch --skill catlass-hardware-constraints-xchang1121
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: catlass-hardware-constraints
Source: https://github.com/xchang1121/op-autoresearch/tree/main/skills/ascendc-catlass/fundamentals/catlass-hardware-constraints
Command: npx skills add https://github.com/xchang1121/op-autoresearch --skill catlass-hardware-constraints-xchang1121

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Choosing L1TileShape and L0TileShape values for CATLASS kernels on Ascend hardware often fails with compile-time static_assert errors because the selected tiles exceed L1, L0A, L0B, or L0C on-chip buffer capacity. This Skill provides the capacity formulas and selection rules needed to pick valid tile shapes before tuning. ## Core Features & Use Cases - Buffer Budget Formulas: Element-count and byte formulas for L1 (512KB), L0A/L0B (64KB), and L0C (128KB) under fp16/fp32 with Pingpong double buffering. - Tile Selection Rules: Guidance on M/N/K alignment, 512B RowMajor alignment, L0-to-L1 shape relationships, and layout-specific starting tile shapes for matmul and conv operators. - Use Case: Before modifying L1TileShape in a CATLASS matmul kernel for Atlas A2, compute the L1 byte budget with the provided formula to confirm the shape fits, avoiding a failed compile cycle. ## Quick Start Ask the agent to check whether a given CATLASS L1TileShape and L0TileShape fit the Ascend on-chip buffer budgets before editing the kernel.

Frequently Asked Questions about catlass-hardware-constraints

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

FAQPage Schema
How do I choose L1TileShape and L0TileShape for CATLASS matmul kernels?▼

Start with layout-based defaults such as (128, 256, 256) for RowMajor A and B, then verify capacity with the budget formulas. Keep m0=m1 and n0=n1, set k0 around k1/4, and confirm every buffer stays within its limit before compiling.

Why does my CATLASS kernel fail with a static_assert after changing TileShape?▼

Static_assert failures after TileShape edits usually mean a buffer budget was exceeded. Recompute L1, L0A, L0B, and L0C usage with the element-count formulas, accounting for element width and the Pingpong double-buffering factor of two.

What are the L1 and L0 buffer sizes on Ascend Atlas A2?▼

On Atlas A2, L1 is 512KB for A/B tile double buffering, L0A and L0B are 64KB each, and L0C is 128KB for fp32 accumulation. Other generations like Atlas A5 may differ, so verify against the current ArchTag documentation.

Does CATLASS tile selection differ for fp32 versus fp16 inputs?▼

Yes. With fp32 inputs, L1 A/B tiles are counted at 4 bytes per element, so k1 or m1/n1 often must be reduced to stay under the 512KB L1 limit. L0C accumulation typically remains fp32 in both cases.

How does 512B alignment affect CATLASS RowMajor kernels?▼

RowMajor kernels generally require the inner axis to be 512B aligned, roughly 256 fp16 elements per row. If the shape is unaligned, use padding-aware kernel variants or extend shapes with padding semantics rather than forcing tile changes on an incompatible kernel.