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] Add fast_softmax #7163

Merged
merged 3 commits into from
Dec 25, 2020
Merged

[Relay] Add fast_softmax #7163

merged 3 commits into from
Dec 25, 2020

Conversation

merrymercy
Copy link
Member

@merrymercy merrymercy commented Dec 24, 2020

There is an exponent operation in softmax. We can use fast_exp from #4790 to accelerate it.
This pr adds a new op topi.nn.fast_softmax to use this optimization.

I don't have a manual schedule for it, so this op should only be used together with auto-scheduler. I don't add it to relay's FastMath pass, because other people might use FastMath pass without auto-scheduler.

To use this op, users can create a new relay pass to do the op substitution.

@merrymercy merrymercy requested a review from icemelon December 24, 2020 14:59
@merrymercy
Copy link
Member Author

cc @alexgl-github @antinucleon

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

The implementation looks good overall.

@junrushao
Copy link
Member

The impl is good, I was just wondering if the fast softmax is biased or not?

@junrushao junrushao merged commit 6ffd740 into apache:main Dec 25, 2020
@merrymercy merrymercy deleted the pr-fast-softmax branch December 25, 2020 05:11
tkonolige pushed a commit to tkonolige/incubator-tvm that referenced this pull request Jan 11, 2021
* [Relay] Add fast_softmax

* fix

* fix
TusharKanekiDey pushed a commit to TusharKanekiDey/tvm that referenced this pull request Jan 20, 2021
* [Relay] Add fast_softmax

* fix

* fix
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Jan 21, 2021
* [Relay] Add fast_softmax

* fix

* fix
electriclilies pushed a commit to electriclilies/tvm that referenced this pull request Feb 18, 2021
* [Relay] Add fast_softmax

* fix

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

2 participants