triton-ascend-case-elemwise-broadcast-2d

Optimize 2D elementwise division with broadcast on Ascend using Triton.

258|48|Updated Jun 22, 2020
One-click install
npx skills add https://github.com/mindspore-ai/akg --skill triton-ascend-case-elemwise-broadcast-2d-mindspore-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: triton-ascend-case-elemwise-broadcast-2d
Source: https://github.com/mindspore-ai/akg/tree/main/akg_agents/python/akg_agents/op/resources/skills/triton-ascend/cases/triton-ascend-case-elemwise-broadcast-2d
Command: npx skills add https://github.com/mindspore-ai/akg --skill triton-ascend-case-elemwise-broadcast-2d-mindspore-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Optimizes 2D elementwise division with broadcast on Ascend/Triton to maximize kernel occupancy by avoiding unnecessary splitting of small dimensions and reusing a preloaded divisor across iterations.

Core Features & Use Cases

  • Complete processing for small N without splitting to maximize UB utilization.
  • Grid-based configuration to control kernel parallelism (NUM_BLOCKS) and inner tiling (SUB_M) for efficient scheduling.
  • General 2D scheduling strategy: along-M kernel-level parallelism, inner row tiling, and column-vectorization for performance gains.

Quick Start

Use configured NUM_BLOCKS and SUB_M to accelerate your 2D broadcast division workloads on Ascend.

Frequently Asked Questions about triton-ascend-case-elemwise-broadcast-2d

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

FAQPage Schema
How do I optimize 2D elementwise division with broadcast on Ascend to maximize kernel occupancy?

To optimize 2D elementwise division with broadcast on Ascend, you can use Triton to avoid splitting small dimensions and preload the divisor outside the inner loop, which maximizes kernel occupancy and UB utilization.

What is the best way to handle large-broadcast axes paired with small non-broadcast axes in 2D tensors?

Handling large-broadcast axes paired with small non-broadcast axes in 2D tensors is best achieved by processing small dimensions completely without splitting, maximizing Unified Buffer (UB) utilization and overall kernel performance.

How does preloading the divisor outside the inner loop improve Triton broadcast operations?

Preloading the divisor outside the inner loop improves Triton broadcast operations by reusing the preloaded divisor across iterations, which reduces redundant memory access and helps balance register pressure during computation.

Do I need to configure NUM_BLOCKS and SUB_M for 2D broadcast division on Ascend?

Yes, you need to configure fixed NUM_BLOCKS to control kernel parallelism and SUB_M to balance UB utilization and register pressure, ensuring efficient grid-based scheduling for 2D broadcast division on Ascend.

What 2D tensor shapes are supported by this Triton Ascend broadcast optimization?

This Triton Ascend broadcast optimization supports 2D tensor configurations with 131072x16 and 2048x131072 shapes, utilizing along-M kernel-level parallelism and inner row tiling for performance gains.