Skip to content

Conversation

@nihui
Copy link
Member

@nihui nihui commented Dec 26, 2025

No description provided.

@tencent-adm
Copy link
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a new optimization pass to fuse adjacent permute and transpose operations in the PNNX tool, reducing redundant dimension reordering operations in neural network graphs.

Key Changes:

  • Added fuse_adjacent_permute optimization pass that combines consecutive Tensor.permute and torch.transpose operations into a single permute operation
  • Integrated the new pass into the level 5 optimization pipeline
  • Added comprehensive test coverage with multiple permute/transpose chains

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/pnnx/src/pass_level5/fuse_adjacent_permute.h Header file declaring the new fuse_adjacent_permute function
tools/pnnx/src/pass_level5/fuse_adjacent_permute.cpp Implementation of the permute fusion algorithm that composes multiple permutation operations
tools/pnnx/src/pass_level5.cpp Integration of the new pass into the level 5 optimization pipeline
tools/pnnx/src/CMakeLists.txt Added the new source file to the build configuration
tools/pnnx/tests/test_pnnx_fuse_adjacent_permute.py Test file with multiple test cases exercising adjacent permute fusion
tools/pnnx/tests/CMakeLists.txt Added the new test to the test suite

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nihui nihui changed the title pnnx fuse adjacent permute pnnx fuse adjacent permute, eliminate noop permute Dec 26, 2025
@nihui nihui requested a review from Copilot December 26, 2025 03:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nihui nihui merged commit 7d35703 into Tencent:master Dec 26, 2025
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants