pypto-optimization

Allocate and tune PyPTO optimization rules for kernel performance on selected backends.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PyPTO provides a set of rules to optimize kernel performance by tuning tile shapes, loop counts, and reduction axes, reducing manual trial-and-error.

Core Features & Use Cases

  • Rule-based tile and loop optimization to improve memory bandwidth and compute efficiency on supported backends.
  • Automatic selection and comparison of tile shapes and loop counts across common operators (softmax, reduction, norm, loss) to identify best performance.
  • Use case: optimize a 3D tensor reduction across multiple axes and compare different tiling strategies to choose the fastest configuration.

Quick Start

Run PyPTO with your operator's shape and backend to generate and evaluate tile and loop configurations.

Frequently Asked Questions about pypto-optimization

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

FAQPage Schema
How do I tune tile shapes and loop counts to improve kernel performance?

Tuning tile shapes and loop counts improves kernel performance by optimizing memory bandwidth and compute efficiency. PyPTO applies rule-based allocation to automatically select and evaluate configurations for common operators like softmax, reduction, and norm.

What is the best way to optimize a 3D tensor reduction across multiple axes?

Optimizing a 3D tensor reduction requires comparing different tiling strategies across multiple axes. PyPTO generates and evaluates tile and loop configurations based on your operator's shape and backend to identify the fastest configuration.

When do I need to adjust reduction axis strategies for contiguous memory access?

Reduction axis strategies need adjustment when optimizing operators with tiling and contiguous memory access patterns. PyPTO allocates optimization rules to maximize kernel performance on selected backends while ensuring consistent results.

Does PyPTO support kernel tuning for operators other than softmax and norm?

PyPTO supports kernel tuning for operators including softmax, reduction, norm, and loss. It applies to operators with tiling, loop partitioning, and contiguous memory access patterns across supported backends.

Why does kernel optimization require careful evaluation of tile shapes and loop counts?

Kernel optimization requires careful evaluation to avoid undefined behavior and ensure consistent results. PyPTO reduces manual trial-and-error by automatically selecting and comparing tile shapes, loop counts, and reduction axis strategies.

Can I use PyPTO optimization to compare different tiling strategies automatically?

PyPTO automatically selects and compares tile shapes and loop counts across common operators. Running it with your operator's shape and backend generates and evaluates configurations to identify the best performance.