This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Added verification check for linalg.conv to ensure memrefs are of rank > 2
ClosedPublic

Authored by limo1996 on Jul 22 2020, 6:04 AM.

Details

Summary

linalg.conv does not support memrefs with rank smaller than 3 as stated here:
https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/nn/convolution

However it does not verify it and thus crashes with "LLVM ERROR: out of memory"
error for 1D case and "nWin > 0 && "expected at least one window dimension"" assertion
for 2D case. This commit adds check for that in the verification method.

Diff Detail

Event Timeline

limo1996 created this revision.Jul 22 2020, 6:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2020, 6:04 AM
ftynse accepted this revision.Jul 22 2020, 6:22 AM
ftynse edited the summary of this revision. (Show Details)
ftynse added inline comments.
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
999

emitOpError

This revision is now accepted and ready to land.Jul 22 2020, 6:22 AM
limo1996 updated this revision to Diff 279801.Jul 22 2020, 6:31 AM

emitError -> emitOpError

This revision was automatically updated to reflect the committed changes.