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

Lowered hardswish #3492

Closed
lucasc896 opened this issue Apr 12, 2022 · 8 comments
Closed

Lowered hardswish #3492

lucasc896 opened this issue Apr 12, 2022 · 8 comments

Comments

@lucasc896
Copy link
Contributor

🚀 Feature

A lowered version of hardswish to enable performant use of torchvision.models.mobilenet_v3_small and other models on TPU

pt-xla-profiler: Op(s) not lowered: aten::hardswish_, aten::hardswish_backward,  Please open a GitHub issue with the above op lowering requests.
@JackCaoG
Copy link
Collaborator

Thanks for reporting, I will add this to our op lowering queue.

@lucasc896
Copy link
Contributor Author

lucasc896 commented Apr 12, 2022

Would it be simple enough to replicate this PR, but with the function calculation changed? I have minimal experience with under the hood of this codebase, but I'm happy to give it a shot.

@JackCaoG
Copy link
Collaborator

it would be pretty similar to that I think. Some of the things in that pr is out of date (like we no longer has scripts/gen.py) but it mostly applied to what you want to do.

Please refer to https://github.com/pytorch/xla/blob/master/CONTRIBUTING.md for building pt/xla and https://github.com/pytorch/xla/blob/master/OP_LOWERING_GUIDE.md for how to lower an op. Happy to help if you run into issues.

@lucasc896
Copy link
Contributor Author

Thanks for the pointers. I've got a branch ready to push, but I can't access the repo. I'm not sure whether the problem is on my side or not, so naive question: should I have push/write access to the repo by default?

@JackCaoG
Copy link
Collaborator

Ah, so since you do not have write access to PyTorch/XLA repo, what you want to do just fork a PyTorch/XLA repro, push a new branch to your fork, and open a pull request from you new branch to master.

Before you opening a pull requiest, also make sure to run the formater and build is passing. You can refer to https://github.com/pytorch/xla/blob/master/CONTRIBUTING.md#before-submiting-a-pull-request

@lucasc896
Copy link
Contributor Author

lucasc896 commented Apr 13, 2022 via email

@JackCaoG
Copy link
Collaborator

Seems like you already fork a pytorch/xla in https://github.com/lucasc896/xla

@wonjoolee95
Copy link
Collaborator

Closing as #3496 is merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants