Repository navigation
Open
Labels
dependency component: oneDNNoneDNN primitive: matmul/conv/linear/quantizedoneDNN primitive: matmul/conv/linear/quantizeddtype: amp_fp16Autocast/AMP fp16Autocast/AMP fp16hw: BMGBattlemageBattlemageinferenceInference workload phaseInference workload phasemodule: gemmMatmul family (matmul/addmm/bmm/gemm)Matmul family (matmul/addmm/bmm/gemm)performancePerformance-related failurePerformance-related failureregressionRegression with before/after version or commit signalRegression with before/after version or commit signaltest: e2eEnd-to-end / benchmark failure surfaceEnd-to-end / benchmark failure surface
Description
🐛 Describe the bug
Summary
OneDNN 3.14.2 vs OneDNN 3.13.3 BMG Linux comparison shows 4 performance drops (latency ratio < 0.9).
Affected Cases
Higher is better
| Suite | Dtype | Mode | Model | Ind Ratio | Eager Ratio |
|---|---|---|---|---|---|
| huggingface | amp_fp16 | inference | openai/whisper-tiny | 0.6224 | 0.5327 |
| timm_models | bfloat16 | inference | gmlp_s16_224 | 0.8735 | 1.0106 |
| timm_models | float16 | inference | gmlp_s16_224 | 0.869 | 1.0013 |
| torchbench | float16 | inference | detectron2_fcos_r_50_fpn | 0.8558 | 0.8777 |
Reproducer
docker run -it -e TZ=Asia/Shanghai \
--device=/dev/mem --device=/dev/dri --group-add video \
--privileged --shm-size=8g \
intelgpu/ubuntu-26.04-rolling:26.18 bash
curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="/usr/local/bin" sh
uv venv myvenv --python 3.12 --clear
source myvenv/bin/activate
uv pip install torch==2.15.0 torchvision torchaudio triton-xpu --index-url https://download.pytorch.org/whl/xpu
pytorch_commit="$(python -c 'import torch; print(torch.version.git_version)')"
git clone https://github.com/pytorch/pytorch
cd pytorch
git checkout ${pytorch_commit}
uv pip install pandas psutil scipy requests
uv pip install -U accelerate
uv pip install -r .ci/docker/ci_commit_pins/huggingface-requirements.txt
uv pip install timm
git clone https://github.com/intel/torch-xpu-ops
rsync -avz ./torch-xpu-ops/.ci/benchmarks/ ./benchmarks/dynamo/
# benchmark
TORCHBENCH_COMMIT_ID="$(cat .ci/docker/ci_commit_pins/torchbench.txt 2> /dev/null || echo 'e03a63be')"
cd ..
git clone https://github.com/pytorch/benchmark benchmark
cd benchmark
git checkout ${TORCHBENCH_COMMIT_ID}
sed -i -E '/^[[:space:]]*(pynvml|transformers|timm)([[:space:]]*[<>=!~;[].*)?[[:space:]]*$/d' requirements.txt
uv pip install -r requirements.txt
uv pip install pip wheel "setuptools<81"
python install.py --continue_on_fail detectron2_fcos_r_50_fpn
# install target
gh --repo pytorch/pytorch run download 41975295128 -p "manywheel-py3_12-xpu"
uv pip uninstall torch
uv pip install /path/to/download/torch-*.whl --no-deps
# command line
python benchmarks/dynamo/huggingface.py --performance -d xpu -n10 --backend=inductor --cold-start-latency --disable-cudagraphs --inference --amp --amp-dtype float16 --only openai/whisper-tiny
python benchmarks/dynamo/timm_models.py --performance -d xpu -n10 --backend=inductor --cold-start-latency --disable-cudagraphs --inference --float16 --only gmlp_s16_224
python benchmarks/dynamo/timm_models.py --performance -d xpu -n10 --backend=inductor --cold-start-latency --disable-cudagraphs --inference --bfloat16 --only gmlp_s16_224
python benchmarks/dynamo/torchbench.py --performance -d xpu -n10 --backend=inductor --cold-start-latency --disable-cudagraphs --inference --float16 --only detectron2_fcos_r_50_fpnVersions
torch 2.15.0.dev20261105+xpu
torchao 0.18.0+xpu
torchaudio 2.11.1+xpu
torchvision 0.29.2+xpu
Metadata
Metadata
Assignees
Labels
dependency component: oneDNNoneDNN primitive: matmul/conv/linear/quantizedoneDNN primitive: matmul/conv/linear/quantizeddtype: amp_fp16Autocast/AMP fp16Autocast/AMP fp16hw: BMGBattlemageBattlemageinferenceInference workload phaseInference workload phasemodule: gemmMatmul family (matmul/addmm/bmm/gemm)Matmul family (matmul/addmm/bmm/gemm)performancePerformance-related failurePerformance-related failureregressionRegression with before/after version or commit signalRegression with before/after version or commit signaltest: e2eEnd-to-end / benchmark failure surfaceEnd-to-end / benchmark failure surface
Activity
[-][OneDNN 3.14.2][BMG] E2E Performance drops compared with OneDNN 3.14.2[/-][+][OneDNN 3.14.2][BMG] E2E Performance drops compared with OneDNN 3.13.3[/+]daisyden commentedon Nov 11, 2026
label-issue: #6145
Root cause: oneDNN 3.14.2 vs 3.13.3 causes E2E inference latency regressions on BMG across 4 models; both inductor and eager ratios drop (whisper-tiny eager 0.5327), so the defect is in oneDNN primitives, not inductor codegen. One group (shared cause: oneDNN version bump).
Analyzed case: huggingface openai/whisper-tiny inference amp_fp16 (case 1 of 4; the other 3 not analyzed)
typeBugtesttest: e2emodulemodule: gemmpriorityUrgenthwhw: BMG[BMG]; BMG Linux oneDNN comparison.dtypedtype: amp_fp16--amp --amp-dtype float16.dependency componentdependency component: oneDNNperformanceregressioninferenceTest cases (4):
Applied to this issue. Generated by a local
label-issuerun.mengfei25 commentedon Nov 12, 2026
Root-cause analysis (oneDNN 3.14.x vs 3.13.3, BMG B60)
Env: host 818733, same image
intelgpu/ubuntu-26.04-rolling:26.18, target torch2.15.0.dev20261105+xpu(oneDNN 4db284662a), baseline torch2.15.0+xpu(oneDNN v3.13.3). Each case: 3 perf runs on the same card, plusONEDNN_VERBOSE=1andTORCHINDUCTOR_SHAPE_PADDING=0runs; all oneDNN shapes re-timed with benchdnn built from the same oneDNN commits. All oneDNN primitives run on XPU (0 CPU exec).pad_mmmis-decisionFor whisper-tiny / detectron2 the oneDNN verbose shapes and implementations are identical between versions, and benchdnn on all 134 XPU shapes of the two models shows no gap (oneDNN XPU time weighted by call count: whisper-tiny 500.0 → 500.1 ms, detectron2 537.3 → 536.7 ms; only 7 tiny µs-level matmuls are >5% slower). These two look like run-to-run noise in the original test.
gmlp_s16_224: root cause = inductor
pad_mm, triggered by a oneDNN kernel changeInductor benchmarks
mm(98304x196, 196x196)vs paddedmm(98304x200, 200x200)and pads ifori > pad * 1.1. Traced decision (samepad_mm.pyin both envs):The padded benchmark is not representative of the compiled graph:
ablayout; oneDNN 3.14 made98304x200:200x200withwei:ab~30% faster (0.304 → 0.215 ms), but the compiled graph runswei:ba(verbose), which is unchanged (0.403 → 0.400 ms);exclude_pad:True, assumed to be memory-planned away), but at runtime it is a real copy: 30 pad + slice per forward ≈ +8.8 ms.Net: oneDNN time per forward actually drops (25.17 → 24.20 ms); the whole regression is the extra pad/copy kernels.
Minor oneDNN-side regression (not the cause, FYI):
matmul 98304x196:196x196is +3.4% (wei:ba) / +12% (wei:ab) slower on 3.14.Small reproducer
TORCHINDUCTOR_SHAPE_PADDING=0benchdnn (layout effect):
Next steps
pad_mmbenchmark the layout the graph actually lowers to, and not exclude mat1 pad time when it can't be planned away → file upstream.TORCHINDUCTOR_SHAPE_PADDING=0(verified on gmlp only).