Skip to content

Conversation

tianleiwu
Copy link
Contributor

Description:

Gelu subgraph exported from PyTorch 1.4 is different from previous version. Update the Gelu Fusion to support the new pattern.

Motivation and Context

  • Why is this change required? What problem does it solve?
  • If it fixes an open issue, please link to the issue here.

Without this change, BERT model exported by PyTorch cannot be fully optimized since Gelu cannot be fused.

@tianleiwu tianleiwu requested review from liuziyue and yufenglee March 5, 2020 21:39
@tianleiwu tianleiwu requested a review from a team as a code owner March 5, 2020 21:39
Copy link
Member

@yufenglee yufenglee left a comment

Choose a reason for hiding this comment

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

:shipit:

@tianleiwu tianleiwu merged commit 5be6665 into master Mar 6, 2020
@tianleiwu tianleiwu deleted the tlwu/gelu_fusion_for_pytorch14 branch March 6, 2020 02:31
yufenglee pushed a commit that referenced this pull request Mar 6, 2020
* update GeluFusion to support pattern from PyTorch 1.4; 
* Fix a bug that missing the check of an edge between mul2 and root.
* update script to fuse gelu from PyTorch 1.4
* Add test for python optimizer
yufenglee added a commit that referenced this pull request Mar 7, 2020
* Publish release symbols (#3152)

* Publish release symbols

* Publish symbols if IsReleaseBuild

* Disable delayload for cuda dlls (#3147)

This change fixes #3129. When running onnxruntime as dll on Windows, CUDA does some internal cleanups when process exits. After this, any call to CUDA would cause crash. Delayload makes thread_local destructor to happen after CUDA cleanup, thus the crash.

* Update Gelu Fusion to support new graph pattern from PyTorch 1.4 (#3148)

* update GeluFusion to support pattern from PyTorch 1.4; 
* Fix a bug that missing the check of an edge between mul2 and root.
* update script to fuse gelu from PyTorch 1.4
* Add test for python optimizer

Co-authored-by: Tiago Koji Castro Shibata <[email protected]>
Co-authored-by: KeDengMS <[email protected]>
Co-authored-by: Tianlei Wu <[email protected]>
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