-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Relax][PyTorch] Add Softplus Op Support for Exported Program and FX graph #17806
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
Conversation
Hzfengsy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. As you added a new relax op, please also expose it in tvm script frontend. To be sepefic: at file https://github.com/apache/tvm/blob/main/python/tvm/script/ir_builder/relax/ir.py.
Also please add unit tests:
- op tests, in tests/python/relax/test_op_nn.py
- tvm sciprt tests, in tests/python/relax/test_frontend_nn_op.py:394
|
I've added the unit tests in test_op_nn.py and test_frontend_nn_op.py as requested. However, regarding exposing the op in the TVMScript frontend (in tvm/script/ir_builder/relax/ir.py), I noticed that only core ops are defined there, and nn ops don't seem to be exposed directly in that file. |
Thanks for pointing it out. I apologize that nn ops do not need to be explicitly exposed in that file, as the |
Hzfengsy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…graph (apache#17806) * add softplus op into exported program and fx graph frontend * fixing trailing whitespace issue * fixing lint issues * fix lint issue on docs * modify description to avoid cpplints issue * update softplus function with threshold attr * remove trailing spaces in softplus func * fix lint issues in legalize func * fixing cpp lints issue * test script for both exported and fx graph * trim trailing spaces iin test script * fix lint issues in test script * unit test script is added in test frontend op files * fixing lint issues in test_op_nn file * fixing attribute error in test script * fixing lint issues in test script functions * adding softplus wrapper function in op file --------- Co-authored-by: deivanayakisankaralingam <deiva@Deivanayaki>
This PR adds support for the Softplus operation in both the Exported Program and FX graph Relax frontend pipeline.