-
Notifications
You must be signed in to change notification settings - Fork 30
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
[Convolution] Packing + objectFifo, initial support #789
Conversation
compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/AMDAIEPackToDma.cpp
Outdated
Show resolved
Hide resolved
Thanks. No, it doesn't get through compilation with the AIR pipeline. |
compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/KernelDispatch.cpp
Outdated
Show resolved
Hide resolved
compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/KernelDispatch.cpp
Show resolved
Hide resolved
ec28364
to
0d98a19
Compare
compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/KernelDispatch.cpp
Outdated
Show resolved
Hide resolved
compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/KernelDispatch.cpp
Show resolved
Hide resolved
compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/KernelDispatch.cpp
Outdated
Show resolved
Hide resolved
compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/KernelDispatch.cpp
Outdated
Show resolved
Hide resolved
@erwei-xilinx @yzhang93 I am making changes to the tiling strategy today, so please don't review this in detail yet. I will post IR once I have channel-last vectorizing correctly. |
5201089
to
b86e1ec
Compare
Reporting current status with current code checked in, mostly to keep track for myself. The vectorization looks good, compilation to vmfb successful. vector.contract -> aievec.matmul, no discontiguous transfer_reads or transfer_writes. Good. But numerically incorrect. Values all quite close (no zeros). If I make the input tensor be all 1s (but kernel still random values) then numerically correct. If I comment out the pass AMDAIEVectorization, numerically correct (with input tensor and kernel having random values). The AIEVec passes look like they're doing the correct thing, I can't see any problem with aievec.matmul, or lowering to LLVM. So what's going on, is this a problem with peano? What experiments can I run to test this hypothesis? Or is the problem somewhere else, and it's just having a bad interaction with AMDAIEVectorization? |
It's possible but I feel like it's unlikely - they run a large test suite (somewhere) nightly which (I'm assuming) checks NA. |
Ok. The difference does appear to be vectorization/below. Replace this:
with this:
And the numerics are fixed. Maybe it's time for me to try the simulator you mentioned @makslevental. |
@newling Can we have a full review of the current state of convolution ops in the next AIE sync? CC @MaheshRavishankar |
I made progress on this yesterday but I'm still blocked by some issue about |
Ok, thanks, I'll keep an eye out for that. |
b86e1ec
to
b9f4242
Compare
compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/test/lowering_strategy_conv.mlir
Show resolved
Hide resolved
@yzhang93 this is ready for review again if you'd like to take a look |
2bed2df
to
b4a86cf
Compare
b4a86cf
to
4dc5ec2
Compare
This PR switches all numerical convolution tests to use the objectFifo pipeline. With respect to the new tiling strategy:
A single column is currently used. Targeting multiple columns results in
error: 'aie.memtile_dma' op could not find and assign a valid BD id
. This will will be investigated as follow-up work: Multicore convolution #821There is no longer interleaving of compute and L2->L1 data movement, which means Failure running conv2d i32 with objectFifo #619 becomes low priority / obsolete
L3->L2, L2->L3 still uses padding. But L2->L1, L1->L2 uses packing.
Channel-first convolution is completely unsupported, we expect high level transforms to convert to channel last before reaching our backend.
Vectorization is not currently enabled, due to issues with alignment. See follow-up task Numerics issue with vectorized conv2d #820. This is functionally ok for now, as peano can scalarize code for all data types.