-
Notifications
You must be signed in to change notification settings - Fork 4.4k
pnnx fuse adjacent permute, eliminate noop permute #6467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
There was a problem hiding this 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_permuteoptimization pass that combines consecutiveTensor.permuteandtorch.transposeoperations 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.
There was a problem hiding this 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.
Co-authored-by: Copilot <[email protected]>
No description provided.