Skip to content

Upgrade submodule oneDNN to v3.11.2 - #177607

Closed
yanbing-j wants to merge 4 commits into
pytorch:mainfrom
yanbing-j:yanbing/update_onednn_3.11.1
Closed

yanbing-j wants to merge 4 commits into
pytorch:mainfrom
yanbing-j:yanbing/update_onednn_3.11.1

Conversation

@yanbing-j

@yanbing-j yanbing-j commented Mar 17, 2026 •

Copy link
Copy Markdown
Collaborator

This PR is to upgrade oneDNN to v3.11.2.

Improvements

  • Improved fp32 matmul performance with fp4 compressed weights.
  • Improved fp32 matmul performance for cases when one of the tensors has a trivial dimension on processors with Intel AVX-512 instruction set support.
  • Improved fp16/bf16 matmul performance for large tensor cases on Intel Graphics for Intel Core Ultra processor Series 3 (formerly Panther Lake).
  • Improved matmul performance for cases with 4-byte alignment on Intel GPUs based on Xe2 architecture.
  • Improved performance of fp16/bf16 matmul with mxfp4 weights.
  • Introduced destination tensor dynamic quantization in matmul primitive following Open Compute Microscaling (MX) formats specification.
  • Introduced support for NVFP4 quantization scheme. The changes include support for fp8_e4m3 grouped scales and dynamic quantization support for destination tensor with NVFP4-specific formula for scales computation.
  • Introduced support for dropout as a primitive attribute for matmul, softmax and eltwise primitives.

Validation results on Xeon CPU

  1. Dynamo benchmarks

The test results are based on the 3 dynamo benchmark suites with three data types.

image

According to the local test results, we found that two torchbench models on AMP_BF16 show over 7% performance regression:

  • torch_multimodal_clip has 9% e2e regression.
  • BERT_pytorch has 22% e2e performance regression.

Validation results on Intel B60

Suite Precision Shape Eager Speedup Inductor Speedup
Huggingface BF16 Static 1.003 1.002
Timm Bf16 Static 1.001 0.999
Torchbench BF16 Static 1.003 1.000

Validation results on AArch64

Dynamo Suite: Geomean over latency - prev version vs new version (Higher is better)

  • for 16 Threads

Highlights for Neoverse-V2 :

  • MobileNetV3 1.15x lower latency with BF16.
  • Detectron2 1.6x lower latency with BF16.
  • AlexNet 6.2x lower latency with BF16.
Suite Precision Shape Neoverse-V1 Eager Geomean Neoverse-V1 Inductor Geomean Neoverse-V2 Eager Geomean Neoverse-V2 Inductor Geomean
HuggingFace f32 static 0.992358837 0.995203121 1.0062 1.007
HuggingFace f32 dynamic 0.991266938 0.993936984 1.0082 1.0081
HuggingFace bf16 static 1.002295256 0.987069391 0.997 1.0134
HuggingFace bf16 dynamic 0.999110791 0.993443274 1.00108 1.0089
Timm f32 static 0.989609104 0.997575891 0.9168 -
Timm f32 dynamic 0.988387827 0.998601957 0.92156 -
Timm bf16 static 1.007171058 1.01461039 0.9925 0.9949
Timm bf16 dynamic 1.008969741 1.016053648 0.9928 1.0321
Torchbench f32 static 0.997158099 1.00775975 0.96 -
Torchbench f32 dynamic 0.998372653 1.005439427 - -
Torchbench bf16 static 1.011766848 1.02951623 0.9815 0.98613
Torchbench bf16 dynamic 1.017915309 1.028806584 0.9759 0.9831

Torchbenchmark - Geomean over speedup (Higher is better)

  • on 16 Threads
Suite Precision Shape Neoverse-V1 Eager Geomean Neoverse-V1 TorchScript Geomean Neoverse-V2 Eager Geomean Neoverse-V2 TorchScript Geomean
Torchbench amp_bf16 inference 1.00043 1.02446 1.023 1.059
Torchbench amp_bf16 training 1.03322 - - -
Torchbench fp32 inference 1.00452 1.00715 1.0675 1.1086
Torchbench fp32 training 1.00121 - - -

NLP - FP32

  • on 16 threads
Suite Neoverse-V1 Latency Geomean Neoverse-V2 Latency Geomean
NLP 0.996510961 0.99651

cc @gujinghui @PenghuiCheng @XiaobingSuper @jianyuh @jgong5 @mingfeima @sanchitintel @ashokei @jingxu10 @min-jean-cho @Guobing-Chen @Xia-Weiwen @snadampal

@pytorch-bot

pytorch-bot Bot commented Mar 17, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/177607

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (2 Unrelated Failures)

As of commit 34ac1b1 with merge base d5910f0 (image):

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot Bot added ciflow/linux-aarch64 linux aarch64 CI workflow module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration topic: not user facing topic category labels Mar 17, 2026
@yanbing-j yanbing-j added ciflow/trunk Trigger trunk jobs on your pull request and removed module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration topic: not user facing topic category ciflow/linux-aarch64 linux aarch64 CI workflow labels Mar 17, 2026
@pytorch-bot

pytorch-bot Bot commented Mar 17, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

2 similar comments
@pytorch-bot

pytorch-bot Bot commented Mar 17, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@pytorch-bot

pytorch-bot Bot commented Mar 17, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@pytorch-bot pytorch-bot Bot added ciflow/linux-aarch64 linux aarch64 CI workflow module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration topic: not user facing topic category labels Mar 17, 2026
@yanbing-j
yanbing-j force-pushed the yanbing/update_onednn_3.11.1 branch 2 times, most recently from 9bfb932 to d2beb1f Compare March 17, 2026 03:12
@yanbing-j yanbing-j added ci-no-td Do not run TD on this PR ciflow/inductor ciflow/xpu Run XPU CI tasks labels Mar 20, 2026
@yanbing-j

Copy link
Copy Markdown
Collaborator Author

@pytorchbot rebase

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Successfully rebased yanbing/update_onednn_3.11.1 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout yanbing/update_onednn_3.11.1 && git pull --rebase)

@pytorchmergebot
pytorchmergebot force-pushed the yanbing/update_onednn_3.11.1 branch from d2beb1f to fcdf339 Compare March 23, 2026 01:40
@mingfeima

Copy link
Copy Markdown
Collaborator

xpu ci still fails?

@yanbing-j

Copy link
Copy Markdown
Collaborator Author

xpu ci still fails?

cc @LuFinch . Could you please help double check XPU CI failures above? I do the rebase yesterday.

@LuFinch

LuFinch commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

@yanbing-j The failed cases in this PR did not throw error in my PR #177608. Seem they are caused by CPU OneDNN upgrade only.

@yanbing-j

Copy link
Copy Markdown
Collaborator Author

The code base of #177608 is older than this PR. I will rebase later then.

@LuFinch

LuFinch commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

@yanbing-j For XPU, I open a new PR #178249 based on latest main. Let's see the CI result.

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Successfully rebased yanbing/update_onednn_3.11.1 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout yanbing/update_onednn_3.11.1 && git pull --rebase)

@meta-codesync

meta-codesync Bot commented Apr 8, 2026

Copy link
Copy Markdown

@atalman has imported this pull request. If you are a Meta employee, you can view this in D100031545.

@aditew01

aditew01 commented Apr 9, 2026 •

Copy link
Copy Markdown
Collaborator

@yanbing-j @vpirogov I've updated the validation results for AArch64 (edited inline, i hope that's fine), please trigger a merge if all looks fine.

@chuanqi129

Copy link
Copy Markdown
Collaborator

@atalman has imported this pull request. If you are a Meta employee, you can view this in D100031545.

Hi @atalman , may I confirm whether the internal tests have completed? Were any issues detected? If everything looks good, can we proceed with merging this PR?

@aditew01

Copy link
Copy Markdown
Collaborator

@chuanqi129 @yanbing-j are there any blockers for this upgrade?

@chuanqi129

Copy link
Copy Markdown
Collaborator

@atalman has imported this pull request. If you are a Meta employee, you can view this in D100031545.

Hi @aditew01, we're waiting for the signal of the meta internal tests, please @atalman @malfet help to check it.

@atalman atalman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm. Internal signal looks good

@atalman

atalman commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

@pytorchmergebot merge -f "all tests look good"

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

BoyuanFeng pushed a commit that referenced this pull request Apr 15, 2026
This PR is to upgrade oneDNN to v3.11.2.

## Improvements
- Improved fp32 matmul performance with fp4 compressed weights.
- Improved fp32 matmul performance for cases when one of the tensors has a trivial dimension on processors with Intel AVX-512 instruction set support.
- Improved fp16/bf16 matmul performance for large tensor cases on Intel Graphics for Intel Core Ultra processor Series 3 (formerly Panther Lake).
- Improved matmul performance for cases with 4-byte alignment on Intel GPUs based on Xe2 architecture.
- Improved performance of fp16/bf16 matmul with mxfp4 weights.
- Introduced destination tensor [dynamic quantization](https://uxlfoundation.github.io/oneDNN/v3.11/dev_guide_attributes_quantization.html#dynamic-quantization) in matmul primitive following Open Compute Microscaling (MX) formats specification.
- Introduced support for NVFP4 quantization scheme. The changes include support for fp8_e4m3 grouped scales and dynamic quantization support for destination tensor with NVFP4-specific formula for scales computation.
- Introduced support for dropout as a primitive attribute for matmul, softmax and eltwise primitives.

## Validation results on Xeon CPU
1. Dynamo benchmarks

The test results are based on the 3 dynamo benchmark suites with three data types.

<img width="787" height="231" alt="image" src="https://github.com/user-attachments/assets/5e31dc94-4b36-4354-9aa4-3223888d126d" />

According to the local test results, we found that two torchbench models on AMP_BF16 show over 7% performance regression:

- `torch_multimodal_clip` has 9% e2e regression.
- `BERT_pytorch` has 22% e2e performance regression.

# Validation results on Intel B60

Suite | Precision | Shape | Eager Speedup | Inductor Speedup
-- | -- | -- | -- | --
Huggingface | BF16 | Static | 1.003 | 1.002
Timm | Bf16 | Static | 1.001 | 0.999
Torchbench | BF16 | Static | 1.003 | 1.000

## Validation results on AArch64

### Dynamo Suite: Geomean over latency - prev version vs new version (**Higher is better**)
* for 16 Threads

Highlights for **Neoverse-V2** :
* MobileNetV3  1.15x lower latency with BF16.
* Detectron2  **1.6x** lower latency with BF16.
* AlexNet **6.2x** lower latency with BF16.

| Suite       | Precision | Shape   | Neoverse-V1 Eager Geomean | Neoverse-V1 Inductor Geomean | Neoverse-V2 Eager Geomean | Neoverse-V2 Inductor Geomean |
|------------|-----------|---------|---------------------------|------------------------------|--------------------------|-----------------------------|
| HuggingFace         | f32       | static  | 0.992358837               | 0.995203121                  | 1.0062                   | 1.007                       |
| HuggingFace         | f32       | dynamic | 0.991266938               | 0.993936984                  | 1.0082                   | 1.0081                      |
| HuggingFace         | bf16      | static  | 1.002295256               | 0.987069391                  | 0.997                    | 1.0134                      |
| HuggingFace         | bf16      | dynamic | 0.999110791               | 0.993443274                  | 1.00108                  | 1.0089                      |
| Timm       | f32       | static  | 0.989609104               | 0.997575891                  | 0.9168                   | -                      |
| Timm       | f32       | dynamic | 0.988387827               | 0.998601957                  | 0.92156                  |  -                      |
| Timm       | bf16      | static  | 1.007171058               | 1.01461039                   | 0.9925                   | 0.9949                      |
| Timm       | bf16      | dynamic | 1.008969741               | 1.016053648                  | 0.9928                   | 1.0321                      |
| Torchbench | f32       | static  | 0.997158099               | 1.00775975                   | 0.96                     | -                           |
| Torchbench | f32       | dynamic | 0.998372653               | 1.005439427                  | -                        | -                           |
| Torchbench | bf16      | static  | 1.011766848               | 1.02951623                   | 0.9815                   | 0.98613                     |
| Torchbench | bf16      | dynamic | 1.017915309               | 1.028806584                  | 0.9759                   | 0.9831                      |

### Torchbenchmark - Geomean over speedup (Higher is better)
* on 16 Threads

| Suite       | Precision | Shape   | Neoverse-V1 Eager Geomean | Neoverse-V1 TorchScript Geomean | Neoverse-V2 Eager Geomean | Neoverse-V2 TorchScript Geomean |
|------------|-----------|---------|---------------------------|---------------------------------|--------------------------|---------------------------------|
| Torchbench | amp_bf16  | inference | 1.00043                 | 1.02446                         | 1.023                    | 1.059                           |
| Torchbench | amp_bf16  | training  | 1.03322                 | -                               | -                        | -                               |
| Torchbench | fp32      | inference | 1.00452                 | 1.00715                         | 1.0675                   | 1.1086                          |
| Torchbench | fp32      | training  | 1.00121                 | -                               | -                        | -                               |

### NLP - FP32
* on 16 threads

| Suite | Neoverse-V1 Latency Geomean | Neoverse-V2 Latency Geomean |
|-------|-----------------------------|-----------------------------|
| NLP   | 0.996510961                 | 0.99651                     |

Pull Request resolved: #177607
Approved by: https://github.com/malfet, https://github.com/aditew01, https://github.com/atalman

Co-authored-by: fengqing.lu <[email protected]>
pytorchmergebot pushed a commit to scotts/pytorch that referenced this pull request Apr 15, 2026
This PR is to upgrade oneDNN to v3.11.2.

## Improvements
- Improved fp32 matmul performance with fp4 compressed weights.
- Improved fp32 matmul performance for cases when one of the tensors has a trivial dimension on processors with Intel AVX-512 instruction set support.
- Improved fp16/bf16 matmul performance for large tensor cases on Intel Graphics for Intel Core Ultra processor Series 3 (formerly Panther Lake).
- Improved matmul performance for cases with 4-byte alignment on Intel GPUs based on Xe2 architecture.
- Improved performance of fp16/bf16 matmul with mxfp4 weights.
- Introduced destination tensor [dynamic quantization](https://uxlfoundation.github.io/oneDNN/v3.11/dev_guide_attributes_quantization.html#dynamic-quantization) in matmul primitive following Open Compute Microscaling (MX) formats specification.
- Introduced support for NVFP4 quantization scheme. The changes include support for fp8_e4m3 grouped scales and dynamic quantization support for destination tensor with NVFP4-specific formula for scales computation.
- Introduced support for dropout as a primitive attribute for matmul, softmax and eltwise primitives.

## Validation results on Xeon CPU
1. Dynamo benchmarks

The test results are based on the 3 dynamo benchmark suites with three data types.

<img width="787" height="231" alt="image" src="https://github.com/user-attachments/assets/5e31dc94-4b36-4354-9aa4-3223888d126d" />

According to the local test results, we found that two torchbench models on AMP_BF16 show over 7% performance regression:

- `torch_multimodal_clip` has 9% e2e regression.
- `BERT_pytorch` has 22% e2e performance regression.

# Validation results on Intel B60

Suite | Precision | Shape | Eager Speedup | Inductor Speedup
-- | -- | -- | -- | --
Huggingface | BF16 | Static | 1.003 | 1.002
Timm | Bf16 | Static | 1.001 | 0.999
Torchbench | BF16 | Static | 1.003 | 1.000

## Validation results on AArch64

### Dynamo Suite: Geomean over latency - prev version vs new version (**Higher is better**)
* for 16 Threads

Highlights for **Neoverse-V2** :
* MobileNetV3  1.15x lower latency with BF16.
* Detectron2  **1.6x** lower latency with BF16.
* AlexNet **6.2x** lower latency with BF16.

| Suite       | Precision | Shape   | Neoverse-V1 Eager Geomean | Neoverse-V1 Inductor Geomean | Neoverse-V2 Eager Geomean | Neoverse-V2 Inductor Geomean |
|------------|-----------|---------|---------------------------|------------------------------|--------------------------|-----------------------------|
| HuggingFace         | f32       | static  | 0.992358837               | 0.995203121                  | 1.0062                   | 1.007                       |
| HuggingFace         | f32       | dynamic | 0.991266938               | 0.993936984                  | 1.0082                   | 1.0081                      |
| HuggingFace         | bf16      | static  | 1.002295256               | 0.987069391                  | 0.997                    | 1.0134                      |
| HuggingFace         | bf16      | dynamic | 0.999110791               | 0.993443274                  | 1.00108                  | 1.0089                      |
| Timm       | f32       | static  | 0.989609104               | 0.997575891                  | 0.9168                   | -                      |
| Timm       | f32       | dynamic | 0.988387827               | 0.998601957                  | 0.92156                  |  -                      |
| Timm       | bf16      | static  | 1.007171058               | 1.01461039                   | 0.9925                   | 0.9949                      |
| Timm       | bf16      | dynamic | 1.008969741               | 1.016053648                  | 0.9928                   | 1.0321                      |
| Torchbench | f32       | static  | 0.997158099               | 1.00775975                   | 0.96                     | -                           |
| Torchbench | f32       | dynamic | 0.998372653               | 1.005439427                  | -                        | -                           |
| Torchbench | bf16      | static  | 1.011766848               | 1.02951623                   | 0.9815                   | 0.98613                     |
| Torchbench | bf16      | dynamic | 1.017915309               | 1.028806584                  | 0.9759                   | 0.9831                      |

### Torchbenchmark - Geomean over speedup (Higher is better)
* on 16 Threads

| Suite       | Precision | Shape   | Neoverse-V1 Eager Geomean | Neoverse-V1 TorchScript Geomean | Neoverse-V2 Eager Geomean | Neoverse-V2 TorchScript Geomean |
|------------|-----------|---------|---------------------------|---------------------------------|--------------------------|---------------------------------|
| Torchbench | amp_bf16  | inference | 1.00043                 | 1.02446                         | 1.023                    | 1.059                           |
| Torchbench | amp_bf16  | training  | 1.03322                 | -                               | -                        | -                               |
| Torchbench | fp32      | inference | 1.00452                 | 1.00715                         | 1.0675                   | 1.1086                          |
| Torchbench | fp32      | training  | 1.00121                 | -                               | -                        | -                               |

### NLP - FP32
* on 16 threads

| Suite | Neoverse-V1 Latency Geomean | Neoverse-V2 Latency Geomean |
|-------|-----------------------------|-----------------------------|
| NLP   | 0.996510961                 | 0.99651                     |

Pull Request resolved: pytorch#177607
Approved by: https://github.com/malfet, https://github.com/aditew01, https://github.com/atalman

Co-authored-by: fengqing.lu <[email protected]>
laifenxiawucha added a commit to laifenxiawucha/pytorch that referenced this pull request May 22, 2026
…PU page fault in oneDNN MatMul kernel (MFDNN-14479) when head_dim is\nbelow the kernel tiling block size. The oneDNN 3.11.1 upgrade\n(PyTorch pytorch#177607) fixed the original crash (head_dim=96, seq_len=65536)\nbut missed small head_dim values (head_dim=16, seq_len=16413).\n\nRoot cause: can_use_overrideable_attention had no minimum head_dim\ncheck, so shapes that crash oneDNN were still routed to it.\n\nFix: Add minimum head_dim guard in check_head_dim_size_xpu():\n  fp32 requires head_dim >= 32 (SIMD16=64B tiling block)\n  fp16/bf16 requires head_dim >= 16 (SIMD16=32B tiling block)\n\nFixes: intel/torch-xpu-ops#3394\nReference: MFDNN-14479\nCUDA ref: aten/src/ATen/native/transformers/sdp_utils_cpp.cpp:14-34\n  (CUDA has no min check - SIMT handles small dims natively)
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
This PR is to upgrade oneDNN to v3.11.2.

## Improvements
- Improved fp32 matmul performance with fp4 compressed weights.
- Improved fp32 matmul performance for cases when one of the tensors has a trivial dimension on processors with Intel AVX-512 instruction set support.
- Improved fp16/bf16 matmul performance for large tensor cases on Intel Graphics for Intel Core Ultra processor Series 3 (formerly Panther Lake).
- Improved matmul performance for cases with 4-byte alignment on Intel GPUs based on Xe2 architecture.
- Improved performance of fp16/bf16 matmul with mxfp4 weights.
- Introduced destination tensor [dynamic quantization](https://uxlfoundation.github.io/oneDNN/v3.11/dev_guide_attributes_quantization.html#dynamic-quantization) in matmul primitive following Open Compute Microscaling (MX) formats specification.
- Introduced support for NVFP4 quantization scheme. The changes include support for fp8_e4m3 grouped scales and dynamic quantization support for destination tensor with NVFP4-specific formula for scales computation.
- Introduced support for dropout as a primitive attribute for matmul, softmax and eltwise primitives.

## Validation results on Xeon CPU
1. Dynamo benchmarks

The test results are based on the 3 dynamo benchmark suites with three data types.

<img width="787" height="231" alt="image" src="https://github.com/user-attachments/assets/5e31dc94-4b36-4354-9aa4-3223888d126d" />

According to the local test results, we found that two torchbench models on AMP_BF16 show over 7% performance regression:

- `torch_multimodal_clip` has 9% e2e regression.
- `BERT_pytorch` has 22% e2e performance regression.

# Validation results on Intel B60

Suite | Precision | Shape | Eager Speedup | Inductor Speedup
-- | -- | -- | -- | --
Huggingface | BF16 | Static | 1.003 | 1.002
Timm | Bf16 | Static | 1.001 | 0.999
Torchbench | BF16 | Static | 1.003 | 1.000

## Validation results on AArch64

### Dynamo Suite: Geomean over latency - prev version vs new version (**Higher is better**)
* for 16 Threads

Highlights for **Neoverse-V2** :
* MobileNetV3  1.15x lower latency with BF16.
* Detectron2  **1.6x** lower latency with BF16.
* AlexNet **6.2x** lower latency with BF16.

| Suite       | Precision | Shape   | Neoverse-V1 Eager Geomean | Neoverse-V1 Inductor Geomean | Neoverse-V2 Eager Geomean | Neoverse-V2 Inductor Geomean |
|------------|-----------|---------|---------------------------|------------------------------|--------------------------|-----------------------------|
| HuggingFace         | f32       | static  | 0.992358837               | 0.995203121                  | 1.0062                   | 1.007                       |
| HuggingFace         | f32       | dynamic | 0.991266938               | 0.993936984                  | 1.0082                   | 1.0081                      |
| HuggingFace         | bf16      | static  | 1.002295256               | 0.987069391                  | 0.997                    | 1.0134                      |
| HuggingFace         | bf16      | dynamic | 0.999110791               | 0.993443274                  | 1.00108                  | 1.0089                      |
| Timm       | f32       | static  | 0.989609104               | 0.997575891                  | 0.9168                   | -                      |
| Timm       | f32       | dynamic | 0.988387827               | 0.998601957                  | 0.92156                  |  -                      |
| Timm       | bf16      | static  | 1.007171058               | 1.01461039                   | 0.9925                   | 0.9949                      |
| Timm       | bf16      | dynamic | 1.008969741               | 1.016053648                  | 0.9928                   | 1.0321                      |
| Torchbench | f32       | static  | 0.997158099               | 1.00775975                   | 0.96                     | -                           |
| Torchbench | f32       | dynamic | 0.998372653               | 1.005439427                  | -                        | -                           |
| Torchbench | bf16      | static  | 1.011766848               | 1.02951623                   | 0.9815                   | 0.98613                     |
| Torchbench | bf16      | dynamic | 1.017915309               | 1.028806584                  | 0.9759                   | 0.9831                      |

### Torchbenchmark - Geomean over speedup (Higher is better)
* on 16 Threads

| Suite       | Precision | Shape   | Neoverse-V1 Eager Geomean | Neoverse-V1 TorchScript Geomean | Neoverse-V2 Eager Geomean | Neoverse-V2 TorchScript Geomean |
|------------|-----------|---------|---------------------------|---------------------------------|--------------------------|---------------------------------|
| Torchbench | amp_bf16  | inference | 1.00043                 | 1.02446                         | 1.023                    | 1.059                           |
| Torchbench | amp_bf16  | training  | 1.03322                 | -                               | -                        | -                               |
| Torchbench | fp32      | inference | 1.00452                 | 1.00715                         | 1.0675                   | 1.1086                          |
| Torchbench | fp32      | training  | 1.00121                 | -                               | -                        | -                               |

### NLP - FP32
* on 16 threads

| Suite | Neoverse-V1 Latency Geomean | Neoverse-V2 Latency Geomean |
|-------|-----------------------------|-----------------------------|
| NLP   | 0.996510961                 | 0.99651                     |

Pull Request resolved: pytorch#177607
Approved by: https://github.com/malfet, https://github.com/aditew01, https://github.com/atalman

Co-authored-by: fengqing.lu <[email protected]>
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
This PR is to upgrade oneDNN to v3.11.2.

## Improvements
- Improved fp32 matmul performance with fp4 compressed weights.
- Improved fp32 matmul performance for cases when one of the tensors has a trivial dimension on processors with Intel AVX-512 instruction set support.
- Improved fp16/bf16 matmul performance for large tensor cases on Intel Graphics for Intel Core Ultra processor Series 3 (formerly Panther Lake).
- Improved matmul performance for cases with 4-byte alignment on Intel GPUs based on Xe2 architecture.
- Improved performance of fp16/bf16 matmul with mxfp4 weights.
- Introduced destination tensor [dynamic quantization](https://uxlfoundation.github.io/oneDNN/v3.11/dev_guide_attributes_quantization.html#dynamic-quantization) in matmul primitive following Open Compute Microscaling (MX) formats specification.
- Introduced support for NVFP4 quantization scheme. The changes include support for fp8_e4m3 grouped scales and dynamic quantization support for destination tensor with NVFP4-specific formula for scales computation.
- Introduced support for dropout as a primitive attribute for matmul, softmax and eltwise primitives.

## Validation results on Xeon CPU
1. Dynamo benchmarks

The test results are based on the 3 dynamo benchmark suites with three data types.

<img width="787" height="231" alt="image" src="https://github.com/user-attachments/assets/5e31dc94-4b36-4354-9aa4-3223888d126d" />

According to the local test results, we found that two torchbench models on AMP_BF16 show over 7% performance regression:

- `torch_multimodal_clip` has 9% e2e regression.
- `BERT_pytorch` has 22% e2e performance regression.

# Validation results on Intel B60

Suite | Precision | Shape | Eager Speedup | Inductor Speedup
-- | -- | -- | -- | --
Huggingface | BF16 | Static | 1.003 | 1.002
Timm | Bf16 | Static | 1.001 | 0.999
Torchbench | BF16 | Static | 1.003 | 1.000

## Validation results on AArch64

### Dynamo Suite: Geomean over latency - prev version vs new version (**Higher is better**)
* for 16 Threads

Highlights for **Neoverse-V2** :
* MobileNetV3  1.15x lower latency with BF16.
* Detectron2  **1.6x** lower latency with BF16.
* AlexNet **6.2x** lower latency with BF16.

| Suite       | Precision | Shape   | Neoverse-V1 Eager Geomean | Neoverse-V1 Inductor Geomean | Neoverse-V2 Eager Geomean | Neoverse-V2 Inductor Geomean |
|------------|-----------|---------|---------------------------|------------------------------|--------------------------|-----------------------------|
| HuggingFace         | f32       | static  | 0.992358837               | 0.995203121                  | 1.0062                   | 1.007                       |
| HuggingFace         | f32       | dynamic | 0.991266938               | 0.993936984                  | 1.0082                   | 1.0081                      |
| HuggingFace         | bf16      | static  | 1.002295256               | 0.987069391                  | 0.997                    | 1.0134                      |
| HuggingFace         | bf16      | dynamic | 0.999110791               | 0.993443274                  | 1.00108                  | 1.0089                      |
| Timm       | f32       | static  | 0.989609104               | 0.997575891                  | 0.9168                   | -                      |
| Timm       | f32       | dynamic | 0.988387827               | 0.998601957                  | 0.92156                  |  -                      |
| Timm       | bf16      | static  | 1.007171058               | 1.01461039                   | 0.9925                   | 0.9949                      |
| Timm       | bf16      | dynamic | 1.008969741               | 1.016053648                  | 0.9928                   | 1.0321                      |
| Torchbench | f32       | static  | 0.997158099               | 1.00775975                   | 0.96                     | -                           |
| Torchbench | f32       | dynamic | 0.998372653               | 1.005439427                  | -                        | -                           |
| Torchbench | bf16      | static  | 1.011766848               | 1.02951623                   | 0.9815                   | 0.98613                     |
| Torchbench | bf16      | dynamic | 1.017915309               | 1.028806584                  | 0.9759                   | 0.9831                      |

### Torchbenchmark - Geomean over speedup (Higher is better)
* on 16 Threads

| Suite       | Precision | Shape   | Neoverse-V1 Eager Geomean | Neoverse-V1 TorchScript Geomean | Neoverse-V2 Eager Geomean | Neoverse-V2 TorchScript Geomean |
|------------|-----------|---------|---------------------------|---------------------------------|--------------------------|---------------------------------|
| Torchbench | amp_bf16  | inference | 1.00043                 | 1.02446                         | 1.023                    | 1.059                           |
| Torchbench | amp_bf16  | training  | 1.03322                 | -                               | -                        | -                               |
| Torchbench | fp32      | inference | 1.00452                 | 1.00715                         | 1.0675                   | 1.1086                          |
| Torchbench | fp32      | training  | 1.00121                 | -                               | -                        | -                               |

### NLP - FP32
* on 16 threads

| Suite | Neoverse-V1 Latency Geomean | Neoverse-V2 Latency Geomean |
|-------|-----------------------------|-----------------------------|
| NLP   | 0.996510961                 | 0.99651                     |

Pull Request resolved: pytorch#177607
Approved by: https://github.com/malfet, https://github.com/aditew01, https://github.com/atalman

Co-authored-by: fengqing.lu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR ciflow/inductor ciflow/linux-aarch64 linux aarch64 CI workflow ciflow/trunk Trigger trunk jobs on your pull request ciflow/xpu Run XPU CI tasks Merged module: mkldnn Related to Intel IDEEP or oneDNN (a.k.a. mkldnn) integration open source topic: not user facing topic category

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.