This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Vector] Use llvm::zip to avoid assertion failed.
ClosedPublic

Authored by jacquesguan on Dec 12 2022, 1:06 AM.

Details

Summary

This patch fixes the issue https://github.com/llvm/llvm-project/issues/59455.
We could omit the un-changed dimensions in offsets and sizes, so llvm::zip_equal would fail in this case.

Diff Detail

Event Timeline

jacquesguan created this revision.Dec 12 2022, 1:06 AM
jacquesguan requested review of this revision.Dec 12 2022, 1:06 AM
Herald added a project: Restricted Project. · View Herald Transcript

Thanks for the fix! Can you add the reproducer from the bug as test in the vector dialect test directory?

mehdi_amini added inline comments.Dec 12 2022, 3:44 PM
mlir/lib/Dialect/Vector/IR/VectorOps.cpp
2974

I don't quite get how do these have a different size?
The bug report has:
%261 = vector.extract_strided_slice %256 {offsets = [3], sizes = [5], strides = [1]} : vector<12x7xi1> to vector<5x7xi1>
where all the array attributes seem to have the same size?

Mogball requested changes to this revision.Dec 12 2022, 10:16 PM

Please add a repro test as @aartbik suggested.

This revision now requires changes to proceed.Dec 12 2022, 10:16 PM

Thanks for the fix! Can you add the reproducer from the bug as test in the vector dialect test directory?

Done.

Please add a repro test as @aartbik suggested.

Done.

mlir/lib/Dialect/Vector/IR/VectorOps.cpp
2974

In this case, maskDimSizes contains 2 dimensions but sliceOffsets and sliceSizes only have one. For the last unchanged dimension, we could omit it in offsets and sizes input of extract_strided_slice.

Mogball accepted this revision.Dec 13 2022, 9:36 AM
This revision is now accepted and ready to land.Dec 13 2022, 9:36 AM