SuperAPI AI Directory

triton-operator-doc-gen

Coding & development

View repository

Updated 10-16 05:00

About this skill

Triton Operator Interface Documentation Generation

Workflow

  1. Collect operator information: name, functionality, formula, interface, parameters, constraints
  2. MANDATORY: read in full triton_operator_template.md to get the output format
  3. Reference example: read in full layer-norm.md to understand the complete documentation structure
  4. When the API signature needs to be confirmed, read in full triton-api-reference.md
  5. Generate documentation according to the template, ensuring it includes:
    • Product Support Table (the full Ascend product series)
    • Functionality description + LaTeX formula
    • Function prototype
    • Parameter description table
    • Constraints (data type support per platform)
    • Call example

Common Pitfalls

Pitfall Symptom Solution
Product support table incomplete Documentation is missing platform rows Cover all Ascend product lines (A3/A2/950/Kirin)
Constraint table missing dtype combinations Users use unsupported types according to the documentation Derive backwards from the code's BLOCK_SIZE/dtype restrictions and list all valid combinations
Formula inconsistent with implementation What the documentation says differs from what the code computes Verify the formula line by line against the kernel code
Call example not runnable Users get errors when copying and pasting The example must be fully executable, including imports and data construction

Anti-pattern checklist (NEVER)

  • ❌ Generate empty template placeholders (such as {公式}、{参数描述} not filled in) — all placeholders must be replaced with actual content
  • ❌ Call examples missing import statements or data construction
  • ❌ Constraint table missing dtype × platform combinations
  • ❌ Function prototype inconsistent with the actual kernel signature
  • ❌ Formula uses plain text instead of LaTeX syntax
  • ❌ Product support table marks unsupported models as √