add BFloat16 support for LayerNorm CPU#55210
add BFloat16 support for LayerNorm CPU#55210mingfeima wants to merge 15 commits intogh/mingfeima/17/basefrom
Conversation
[ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 5ef2baf (more details on the Dr. CI page and at hud.pytorch.org/pr/55210):
1 failure not recognized by patterns:
ci.pytorch.org: 1 failedPreview docs built from this PR This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
|
Since this PR is not related to parallelization feature, only single core perf is tested: - AT_DISPATCH_FLOATING_TYPES(X.scalar_type(), "LayerNormKernelImpl", [&]() {
+ AT_DISPATCH_FLOATING_TYPES_AND(kBFloat16, X.scalar_type(), "LayerNormKernelImpl", [&]() {
before: LayerNorm: 32x128x1024: fp32: 2.806 ms; bf16: 9.901 ms
after: LayerNorm: 32x128x1024: fp32: 2.813 ms; bf16: 2.306 ms
before: LayerNorm: 32x128x1024: fp32: 5.286 ms; bf16: 15.186 ms
after: LayerNorm: 32x128x1024: fp32: 5.258 ms; bf16: 3.469 ms |
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
ghstack-source-id: 88be540 Pull Request resolved: pytorch#55210
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
ghstack-source-id: 18d4100 Pull Request resolved: pytorch#55210
|
@VitalyFedyunin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Differential Revision: [D28836793](https://our.internmc.facebook.com/intern/diff/D28836793) [ghstack-poisoned]
Differential Revision: [D28836793](https://our.internmc.facebook.com/intern/diff/D28836793) [ghstack-poisoned]
|
rebased and clear test cases failures from |
Differential Revision: [D28836793](https://our.internmc.facebook.com/intern/diff/D28836793) [ghstack-poisoned]
Differential Revision: [D28836793](https://our.internmc.facebook.com/intern/diff/D28836793) [ghstack-poisoned]
|
@VitalyFedyunin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
Please rebase |
Differential Revision: [D28836793](https://our.internmc.facebook.com/intern/diff/D28836793) [ghstack-poisoned]
|
@VitalyFedyunin rebased, please check! |
|
@VitalyFedyunin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
@VitalyFedyunin merged this pull request in 652d911. |
Stack from ghstack:
Differential Revision: D28836793