Skip to content

[Relay][Frontend][Onnx] Allow A to B broadcasting of batch_matmul and reverse strided slice - #6681

Merged
masahi merged 6 commits into
apache:mainfrom
jwfromm:slice_fixes
Oct 15, 2020
Merged

[Relay][Frontend][Onnx] Allow A to B broadcasting of batch_matmul and reverse strided slice#6681
masahi merged 6 commits into
apache:mainfrom
jwfromm:slice_fixes

Conversation

@jwfromm

@jwfromm jwfromm commented Oct 14, 2020

Copy link
Copy Markdown
Contributor

This PR contains two otherwise unrelated bug fixes / improvements that allow us to import a class of segmentation models using the Onnx frontend.

The first is the ability to broadcast the batch dimension of the left hand side argument of batch_matmul to to the right hand side argument, where we previously only allowed rhs to lhs broadcasting. There are a few bug fixes in relay to enable this.

The second is a fix to our strided slice shape inference to allow reverse slicing, specifically when the end is a negative number, indicating that we should iterate all the way to the first element. A test case in relay is added to catch this in the future.

Finally, I removed some unneeded type inference and shape checking in padding.

@jwfromm

jwfromm commented Oct 14, 2020

Copy link
Copy Markdown
Contributor Author

@mbrookhart @masahi can you guys take a look at this PR?

@masahi

masahi commented Oct 14, 2020

Copy link
Copy Markdown
Member

There is an error from auto schedular test. Not sure if it is related or flaky

@jwfromm

jwfromm commented Oct 14, 2020

Copy link
Copy Markdown
Contributor Author

It seems very unlikely that these changes would cause that error. I'll try to rebuild. It looks like it passes locally as well.

@masahi

masahi commented Oct 14, 2020

Copy link
Copy Markdown
Member

hey @comaniac @merrymercy can you check if the error from evolutionary search test https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/PR-6681/1/pipeline/ can be flaky?

@merrymercy

merrymercy commented Oct 14, 2020

Copy link
Copy Markdown
Member

@masahi It seems to be an internal bug of the auto-scheduler rather than a flaky test.
I will look into it.

Comment thread python/tvm/relay/frontend/onnx.py Outdated
@masahi
masahi merged commit 9564925 into apache:main Oct 15, 2020
@masahi

masahi commented Oct 15, 2020

Copy link
Copy Markdown
Member

Thanks @jwfromm @mbrookhart

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Oct 29, 2020
… reverse strided slice (apache#6681)

* slice and batch_matmul fixes.

* Bug fix in shape inference.

* Test backwards strided slice.

* Fix batch_matmul dynamic shape function.

* formatting.

* Fix edge case for implicit broadcast
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 2, 2020
… reverse strided slice (apache#6681)

* slice and batch_matmul fixes.

* Bug fix in shape inference.

* Test backwards strided slice.

* Fix batch_matmul dynamic shape function.

* formatting.

* Fix edge case for implicit broadcast
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 4, 2020
… reverse strided slice (apache#6681)

* slice and batch_matmul fixes.

* Bug fix in shape inference.

* Test backwards strided slice.

* Fix batch_matmul dynamic shape function.

* formatting.

* Fix edge case for implicit broadcast
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Dec 4, 2020
… reverse strided slice (apache#6681)

* slice and batch_matmul fixes.

* Bug fix in shape inference.

* Test backwards strided slice.

* Fix batch_matmul dynamic shape function.

* formatting.

* Fix edge case for implicit broadcast
@jwfromm
jwfromm deleted the slice_fixes branch April 12, 2023 15:57
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.

4 participants