Skip to content
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

[aievec] Add lowering for vector.extract_strided_slice #491

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

jsetoain
Copy link
Collaborator

@jsetoain jsetoain commented May 12, 2023

This patch adds the lowering for vector.extract_strided_slice as a canonical solution to unaligned loads. This process breaks convolution detection and optimization for AIE-ML, and this patch addresses those as well.

@jsetoain jsetoain force-pushed the lower-extract-strided-slice branch 2 times, most recently from e90d5ac to 9e5589b Compare May 17, 2023 16:46
@jsetoain jsetoain force-pushed the lower-extract-strided-slice branch from 9e5589b to e85f4ee Compare May 24, 2023 15:34
@jsetoain jsetoain force-pushed the lower-extract-strided-slice branch 3 times, most recently from 422b500 to 6fe20bc Compare June 29, 2023 17:49
@jsetoain jsetoain force-pushed the lower-extract-strided-slice branch 2 times, most recently from b32514f to 0179d9b Compare July 19, 2023 17:00
@jsetoain jsetoain force-pushed the lower-extract-strided-slice branch 4 times, most recently from ed13e90 to 371021f Compare July 31, 2023 17:51
@jsetoain jsetoain marked this pull request as ready for review July 31, 2023 17:57
@jsetoain jsetoain force-pushed the lower-extract-strided-slice branch 6 times, most recently from 0a9563a to b9ec2c0 Compare August 2, 2023 15:29
Copy link
Collaborator

@david-vc david-vc left a comment

Choose a reason for hiding this comment

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

Hi @jsetoain:
This looks very good. I would like @linay-xsj to go through the changes in lib/Dialect/AIEVec/Transforms/FoldMulAddChainToConvOp.cpp and
lib/Dialect/AIEVec/Transforms/FoldMulAddChainToConvOp.cpp
in detail. Thanks!

printf("%d]\n", buff[nlanes - 1]);
}

void printv16xi32(v16int32 v) { printv<16, int32_t>(v); }
Copy link
Collaborator

Choose a reason for hiding this comment

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

The aie_api.h already has a bunch of nice utilities to print vectors, for example, to print a v16int32, I could call:

aie::print(aie::vector<uint32_t,16>(myV16int32),true, "myV16int32: ");

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had forgotten about these. I've switched to aie api to print vectors, and I've also added missing checks for unaligned loads in aieml.

@jsetoain jsetoain force-pushed the lower-extract-strided-slice branch 2 times, most recently from 57f18a1 to 77fcf18 Compare August 10, 2023 16:47
This is part of the canonical lowering of unaligned transfer read ops.

For now we only support extracting a contiguous vector of half the size
of the source vector.
@jsetoain jsetoain enabled auto-merge (rebase) August 10, 2023 17:06
@jsetoain
Copy link
Collaborator Author

Hi @jsetoain: This looks very good. I would like @linay-xsj to go through the changes in lib/Dialect/AIEVec/Transforms/FoldMulAddChainToConvOp.cpp and lib/Dialect/AIEVec/Transforms/FoldMulAddChainToConvOp.cpp in detail. Thanks!

I think it's best if we do that after landing the patch. It's a bit messy, and it risks becoming even more of a liability. I've already got a couple more patching that will help with clean-up.

@jsetoain jsetoain merged commit 9ccfcdd into Xilinx:main Aug 10, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants