-
Notifications
You must be signed in to change notification settings - Fork 276
Generalised Transpose and Reshape support #1419
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
Open
Parent:
Release merge for v0.10.1
STFleming
wants to merge
57
commits into
dev
Choose a base branch
from
feature/shuffle
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+2,607
−8
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… to be made to how simulations are being launched.
…ues, fixed the specialised version so it is compatible with new xsi flow.
…use a ptranspose or a shuffle, this needs to be worked on but just bringing it up for initial testing of the op
…and sorting out minor syntax issues
…es into simpler transposes. Also added test to ensure the equivalence of these transformations.
…ding both for now.
…tegration of the ptranspose operator
…adlock after new skidbuffer changes.
…he constraints of the input_generator and ptranspose operators. This is now passing RTL tests with chained operators together.
…ir SIMD values by the minimum amount to satisfy constraints while still meeting the original SIMD performance targets. I'm not sure if this is the best thing to do here, but it is increasing the flexibility of the compilation with less user intervention.
…the new conventions
…h the RTL clock (?) so that I can validate the stitched ip flow
…flags to vivad/slow tests.
…sition transformation to reflect the new changes in the operator names inner_shuffle and outer_shuffle. Also added additional SIMD constraints in the transformation search.
auphelia
reviewed
Sep 23, 2025
auphelia
reviewed
Sep 23, 2025
auphelia
reviewed
Sep 24, 2025
…g fetch_repos to pull the appropriate hlslib with these kernels persent.
…le decomposition.
…fixed license headers; removed shuffle_helpers migrated used methods into the decomposition transformation.
…cialise layers transformation
auphelia
reviewed
Sep 26, 2025
auphelia
reviewed
Sep 26, 2025
…pre-ShuffleDecomposition transformation.
… of warnings if shapes are not set
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces operators and compiler support to enable flexible reshape and transpose operations in FINN, enhancing its capability to handle complex tensor manipulations efficiently.
Motivation: Flexible support for reshape and transpose operations is crucial for supporting Transformer based hardware implementations and improving flexibility in various applications.
Specifically, it adds:
Shuffle(HWCustomOp): A new operator designed to capture reshape and transpose operations without a backend. It decomposes into chains of validInnerShuffleandOuterShuffleoperations, which can be implemented via hardware backends.OuterShuffle(HWCustomOp): A HLS-based operator supporting parallel flexible reshape/transposition of N-Dimensional tensors, provided the last dimension remains static. This operator requires that SIMD be divisible into the last dimension of the input tensor, ensuring efficient parallel processing.InnerShuffle(HWCustomOp): An RTL-based operator supporting parallel transposition of N-Dimensional tensors, where only the last two dimensions are swapped. It requires that SIMD be divisible into the second-to-last dimension of the input tensor, facilitating efficient hardware implementation.ONNX-level transformation
ShuffleDecomposition: This transformation breaks complex transpositions into chains ofInnerShuffleandOuterShuffleoperations, supporting general transposition while respecting constraints like dimension movement and SIMD divisibility.Builder Step: Integrates the Shuffle decomposition and inference into the default build flow, ensuring seamless application of these transformations.
Testing Suite: Includes a comprehensive suite of tests covering various simple and complex transpose operations involving
InnerShuffle,OuterShuffle, and chains of these operations, ensuring robustness and reliability.