Merged
feat(PANKO-Pro): Tune and export PyPTO-Pro operators with JIT functions across multiple files #1078
feat(PANKO-Pro): Tune and export PyPTO-Pro operators with JIT functions across multiple files #1078
Merged
Tomomasa YamasakiAdd on 11 days ago
Tomomasa Yamasaki
Tomomasa YamasakiCollaborators
11 days ago

Was This PR authored or co-authored using generative AI tooling?

  1. AI Agent: Claude; OpenAI Codex
  2. AI Model: Claude Opus 5; GPT-6
  3. Prompt: Extend the single-file PANKO adapter to multi-file PyPTO-Pro operators. Preserve runtime imports, verify that STEP retries keep the candidate identity, and export reproducible packages.

The multi-file implementation used Claude Opus 5 (Claude Code) and GPT-6 (OpenAI Codex). Squashed commit.

What this PR does / why we need it:

This PR adds multi-file tuning, package restoration and export on top of the single-file adapter merged in #1077.

The diff from master at cc816ea8 covers 21 files, with 1,645 additions and 77 deletions.

git diff cc816ea8...7b715644

Merge order: #922 → #1077 → #1078.

A PyPTO-Pro operator can define its entry point in kernel.py and call a JIT function from helper.py. To tune that operator and deliver a reproducible result, PANKO must track both files from the first measurement through the final export.

  • Tune across files. PANKO builds a combined view for source analysis and maps edits back to the original modules. The precision test continues to import the operator through its original package layout.
  • Measure the complete operator. Each measurement receipt records the hashes of the package files used for that run. Latency includes all AI-Core tasks in the test invocation.
  • Restore and export retained candidates. Each candidate on the Pareto front is exported with its runtime package and a manifest identifying the package root, required files and file hashes. The exported candidate can be checked and measured after the original source directory has moved.

Which issue this PR fixes

Related to issue #326 — PANKO for PyPTO-Pro.

Special notes for your reviewer:

This is the third PR in the PANKO series, in merge order:

  1. PR #922 — Shared PANKO core provides the common search, acceptance, stopping and verification logic.
  2. PR #1077 — Single-file PyPTO-Pro tuning uses that core to tune operators whose JIT functions live in one source file.
  3. This PR extends the same workflow to operators whose JIT functions span multiple files.

For source mapping and package restoration, start with source_analysis/program_view.py and source_analysis/program_bundle.py. The regression test test_exported_package_passes_runtime_check exercises delivery from the installed CLI.

Change Type / 改动类型

Testing / 测试信息

On 7b715644, the shared-core suite passed all 834 tests. The Pro host suite passed 90 tests and skipped 2 (Torch-dependent CPU golden and Windows junction fallback). git diff --check passed.

The package-export regression test installs the Pro runtime, initializes a campaign with kernel.py and helper.py, and exports a retained candidate. It then moves the original package away and calls the installed measure.py on the export using a host profiling fixture. The precision check passes, and the measurement receipt contains the verified hashes of both exported files.

Run the suite from the repository root:

python3 -m unittest discover -s cannbot-skills/plugins-official/pypto-pro-op-orchestrator/tests

Checklist / 检查清单

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for Tomomasa Yamasaki's contribution.)
Tomomasa YamasakiTomomasa YamasakiCollaborators
11 days ago Created pull request, commit 72b35793
Tomomasa YamasakiTomomasa YamasakiCollaborators
11 days ago Associated issue: [Feature]: PANKO for PyPTO-Pro — a multi-objective search-based Stage 5 auto-tuner for Pro kernels
CANN-robotCANN-robotCollaborators
11 days ago Added label: stat/needs-squashai-co-authored
CANN-robotCANN-robotCollaborators
11 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
11 days ago Comments:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/pypto-gym ✅ lim-jiunnbin, wangzheng97 (2/2) ✅ lim-jiunnbin (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

tomomasayamasaki, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
301 messages are collapsed here。 See more
lim-jiunnbin
lim-jiunnbinCollaborators
4 days ago Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
4 days ago Added label: approved
wangzheng97
wangzheng97Collaborators
4 days ago Comments:

/lgtm

likedislike
CANN-robotCANN-robotCollaborators
4 days ago Added label: lgtm
CANN-robotCANN-robotCollaborators
4 days ago Merged pull request