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

[Candidate solution] Add an elementwise + activation fusion pass, add mechanizm to add attributes outside of base op. #40081

Closed

Conversation

tsocha
Copy link
Contributor

@tsocha tsocha commented Mar 2, 2022

PR types

Function optimization

PR changes

Function optimization

Describe

Add a pass which fuse elementwise operation with activations and add new attributes in the pass during runtime

  • "elementwise_add", "elementwise_sub", "elementwise_mul"
  • "relu", "tanh", "leaky_relu", "swish", "hardswish", "sqrt", "abs", "clip", "gelu", "relu6", "sigmoid"
    This is another candidate solution of PR Add an elementwise + activation fusion pass. #36541, according to Achun and Hongyu's suggestion.

@paddle-bot-old
Copy link

paddle-bot-old bot commented Mar 2, 2022

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

}
return post_operations;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, I only have one question, why these getting attributes and computation function are in xx.h file? It will not increase the lib size? Thanks !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no .cc file and I didn't create it.

@tsocha tsocha force-pushed the el_add_ect_fuse_experimental branch from 1a1f967 to 64a8277 Compare March 3, 2022 22:10
@lidanqing-intel lidanqing-intel changed the title TEST_PR [Candidate solution] Add an elementwise + activation fusion pass, add mechanizm to add attributes outside of base op. Mar 9, 2022
Copy link
Contributor

@jakpiase jakpiase left a comment

Choose a reason for hiding this comment

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

LGTM

@tsocha
Copy link
Contributor Author

tsocha commented Mar 10, 2022

This solution has been selected.

@tsocha tsocha closed this Mar 10, 2022
@tsocha tsocha deleted the el_add_ect_fuse_experimental branch March 10, 2022 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants