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

[oneDNN] Add 2 new patterns for layernorm fusion #61332

Conversation

kanvi-nervana
Copy link
Contributor

co-author: @ustcuna

Following pattern is seen in 3 models. It looks similar to InstanceNorm pattern but it is actually LayerNorm based on the reduction axis. Under right conditions, this pattern will be fused as LayerNorm to improve performance.

image

With this change we saw ~20% improvement in performance for the 3 models
These are the repo links for 2 of the 3 models
BERT_LARGE : https://github.com/mlperf/training/tree/master/language_model/tensorflow/bert
BERT_BASE : https://github.com/google-research/bert

The other pattern is seen in another customer model and brings in 10-20% improvement
model-level pattern example

@google-ml-butler google-ml-butler bot added the size:L CL Change Size: Large label Jul 19, 2023
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Jul 19, 2023
@github-actions github-actions bot added the kokoro:force-run Tests on submitted change label Jul 19, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jul 19, 2023
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Jul 20, 2023
@gbaned gbaned added the comp:grappler Grappler related issues label Jul 20, 2023
@gbaned
Copy link
Contributor

gbaned commented Aug 24, 2023

Hi @ezhulenev, Can you please take a look at this PR? Thank you!

PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Aug 24, 2023
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Aug 24, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Aug 24, 2023
@copybara-service copybara-service bot merged commit 28649cd into tensorflow:master Aug 24, 2023
15 of 18 checks passed
PR Queue automation moved this from Approved by Reviewer to Merged Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review Pull request awaiting review comp:grappler Grappler related issues ready to pull PR ready for merge process size:L CL Change Size: Large
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

5 participants