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

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

Merged
merged 6 commits into from
Oct 15, 2020

Conversation

jwfromm
Copy link
Contributor

@jwfromm jwfromm commented Oct 14, 2020

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
Copy link
Contributor Author

jwfromm commented Oct 14, 2020

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

@masahi
Copy link
Member

masahi commented Oct 14, 2020

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

@jwfromm
Copy link
Contributor Author

jwfromm commented Oct 14, 2020

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
Copy link
Member

masahi commented Oct 14, 2020

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
Copy link
Member

merrymercy commented Oct 14, 2020

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

@masahi masahi merged commit 9564925 into apache:main Oct 15, 2020
@masahi
Copy link
Member

masahi commented Oct 15, 2020

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