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

[ONNX] Add OpSet 13 implementation for Hardmax #8924

Merged
merged 2 commits into from
Sep 4, 2021

Conversation

michalpiszczek
Copy link
Contributor

@michalpiszczek michalpiszczek commented Sep 3, 2021

Add OpSet 13 Hardmax impl

@michalpiszczek michalpiszczek changed the title [ONNX] Add OpSet 13 implementation for Hardmax [Draft][ONNX] Add OpSet 13 implementation for Hardmax Sep 3, 2021
@michalpiszczek michalpiszczek changed the title [Draft][ONNX] Add OpSet 13 implementation for Hardmax [ONNX] Add OpSet 13 implementation for Hardmax Sep 3, 2021
@michalpiszczek michalpiszczek changed the title [ONNX] Add OpSet 13 implementation for Hardmax [ONNX] Add OpSet 13 implementation for Hardmax and some type annotations Sep 3, 2021
@michalpiszczek michalpiszczek changed the title [ONNX] Add OpSet 13 implementation for Hardmax and some type annotations [ONNX] Add OpSet 13 implementation for Hardmax and type annotations Sep 3, 2021
Copy link
Contributor

@mbrookhart mbrookhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. cc @masahi and @jwfromm for thoughts on mypy

Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please separate the Hardmax changes from the typing work in a different PR.

Copy link
Contributor

@jwfromm jwfromm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the hardmax change itself is very small (and looks good) I'm fine having it combined with typing support, which I also consider a good change. Thanks Michal!

@AndrewZhaoLuo
Copy link
Contributor

AndrewZhaoLuo commented Sep 3, 2021

I mean I understand having to make small changes in order to support hardmax. But these other changes don't support hardmax implementation and can easily be another PR.

It's important to have some PR sanitation when it's easy to do so otherwise no one will do it when it's hard (and actually needed)

@jwfromm
Copy link
Contributor

jwfromm commented Sep 3, 2021

I agree it would be better behavior to separate into two PRs. @michalpiszczek since the type annotation is larger change for this PR, can you separate out the hardmax changes into a different PR?

@michalpiszczek
Copy link
Contributor Author

Thanks for the comments @AndrewZhaoLuo @jwfromm ! I am happy to take out the typing changes if that's what it takes to get Hardmax in, but I would share a different perspective first based on a previous experience.

At $prevjob I worked on a large python repo that was also initially untyped (but wanted to eventually be fully-typed) and we found that the best way to do this was for devs to add typings in and around old code as they went, rather than making separate, self-contained efforts to add types. We learned that the latter was difficult to rely upon because, with feature work and other responsibilities, finding dedicated time to go and fix up old files just didn't happen. On the other hand, embracing the first approach ended up creating a culture of leaving files you touch better than you found them amongst developers, which more organically distributed the burden of adding types. Gradually, that code base was able to become fully-typed.

I would suggest we take the same approach here, particularly because TVM's CI duration adds a non-trivial time/attention cost to making any change, further discouraging standalone cleanups.

Please let me know WYT @AndrewZhaoLuo @jwfromm . Thanks! 🙂

@AndrewZhaoLuo
Copy link
Contributor

AndrewZhaoLuo commented Sep 3, 2021

TVM is a large project with many different contributors and we want to make things like reading the git log simple. Externally we want to encourage people to have good PR hygiene. Now for an internal repo that a select few people are working on it's probably fine to do whatever internally they agree upon. Now if you submitted an RFC which suggested this doctrine I would of course be amenable.

As for TVM CI duration, I understand you want to get these changes in as fast as possible, but unless this is actively unblocking someone or CI I do not see this change as important enough to warrant a rushed job. Anyways, we want discussion on the typing changes and ideally we want those threads to be separate from the hardmax changes.

Here is what I suggest. Rewind this PR back to 6a0041d and submit the branch in it's current state as a separate PR. Require merging this PR first before the other. You will have to rebase if new ONNX changes come in, but this provides you an opportunity to add type annotations you would need to add anyway.

@mbaret
Copy link
Contributor

mbaret commented Sep 3, 2021

Just to add another comment in favour of splitting the PRs, if we have patches that fix/cause issues we may very well want to revert them or cherry pick them onto older releases. In those cases, we don't want typing fixes to be associated with functional changes. I still think it's a good intiative to update the typing as you work in a particular area, but those typing changes can land in a separate PR.

@michalpiszczek
Copy link
Contributor Author

Annotations removed. Thanks for the comments @AndrewZhaoLuo @mbaret .

Copy link
Contributor

@AndrewZhaoLuo AndrewZhaoLuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AndrewZhaoLuo
Copy link
Contributor

Please edit the title though before merging

@michalpiszczek michalpiszczek changed the title [ONNX] Add OpSet 13 implementation for Hardmax and type annotations [ONNX] Add OpSet 13 implementation for Hardmax Sep 3, 2021
@masahi masahi merged commit b34d6b9 into apache:main Sep 4, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
* Add opset 13 impl for hardmax

* Format
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
* Add opset 13 impl for hardmax

* Format
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.

6 participants