Repository navigation
Open
Labels
dtype: bfloat16bf16 dtypebf16 dtypehw: BMGBattlemageBattlemageinferenceInference workload phaseInference workload phasemodule: inductortorch.compile backend: Triton codegen, lowering, AOTAutogradtorch.compile backend: Triton codegen, lowering, AOTAutogradperformancePerformance-related failurePerformance-related failuretest: e2eEnd-to-end / benchmark failure surfaceEnd-to-end / benchmark failure surface
Milestone
Description
Summary
BMG PyTorch 2.12 release performance results contain multiple cases where inductor is slower than eager (speedup < 1).
These are PyTorch 2.12 release performance results collected from the raw performance artifacts:
- Platform: BMG (Battlemage)
- PyTorch:
torch 2.12.0+xpu - Environment: Ubuntu 24.04 LTS,
intel-opencl-icd 26.05.37020.3,libze-dev 1.27.0,intel-opencl-rt 2025.3.2,oneMKL 2025.3.1
Representative Cases
The rows below come directly from the raw PyTorch 2.12 performance CSVs and show speedup < 1, which means inductor is slower than eager on the same workload.
| suite | dtype | mode | model | batch_size | speedup | source csv |
|---|---|---|---|---|---|---|
| huggingface | bfloat16 | inference | ElectraForQuestionAnswering |
128 | 0.662224 | huggingface/bfloat16/inference/performance/inductor-results-huggingface-bfloat16-inference-xpu-performance.csv |
| huggingface | bfloat16 | inference | BertForQuestionAnswering |
32 | 0.732601 | huggingface/bfloat16/inference/performance/inductor-results-huggingface-bfloat16-inference-xpu-performance.csv |
| huggingface | bfloat16 | inference | BartForConditionalGeneration |
4 | 0.741895 | huggingface/bfloat16/inference/performance/inductor-results-huggingface-bfloat16-inference-xpu-performance.csv |
| huggingface | bfloat16 | inference | MBartForConditionalGeneration |
4 | 0.723328 | huggingface/bfloat16/inference/performance/inductor-results-huggingface-bfloat16-inference-xpu-performance.csv |
| huggingface | bfloat16 | inference | PLBartForConditionalGeneration |
8 | 0.829213 | huggingface/bfloat16/inference/performance/inductor-results-huggingface-bfloat16-inference-xpu-performance.csv |
| huggingface | amp_bf16 | inference | BertForQuestionAnswering |
32 | 0.893284 | huggingface/amp_bf16/inference/performance/inductor-results-huggingface-amp_bf16-inference-xpu-performance.csv |
| huggingface | float16 | inference | ElectraForQuestionAnswering |
128 | 0.646220 | huggingface/float16/inference/performance/inductor-results-huggingface-float16-inference-xpu-performance.csv |
| huggingface | bfloat16 | training | OPTForCausalLM |
2 | 0.876858 | huggingface/bfloat16/training/performance/inductor-results-huggingface-bfloat16-training-xpu-performance.csv |
| torchbench | bfloat16 | inference | lennard_jones |
1000 | 0.671808 | torchbench/bfloat16/inference/performance/inductor-results-torchbench-bfloat16-inference-xpu-performance.csv |
| torchbench | bfloat16 | inference | maml |
1 | 0.664822 | torchbench/bfloat16/inference/performance/inductor-results-torchbench-bfloat16-inference-xpu-performance.csv |
| torchbench | bfloat16 | inference | soft_actor_critic |
256 | 0.865522 | torchbench/bfloat16/inference/performance/inductor-results-torchbench-bfloat16-inference-xpu-performance.csv |
There are additional PyTorch 2.12 rows with the same pattern outside this representative subset.
Notes
- The pattern is concentrated in inference workloads, especially HuggingFace QA/seq2seq style models and several TorchBench models.
- These rows were taken from the raw perf artifacts rather than the generated comparison CSV, because the goal here is to flag inductor-vs-eager gaps directly in the PyTorch 2.12 release results.
Ask
Please review these BMG PyTorch 2.12 cases and track the inductor performance gaps where eager is still faster than inductor.
Metadata
Metadata
Assignees
Labels
dtype: bfloat16bf16 dtypebf16 dtypehw: BMGBattlemageBattlemageinferenceInference workload phaseInference workload phasemodule: inductortorch.compile backend: Triton codegen, lowering, AOTAutogradtorch.compile backend: Triton codegen, lowering, AOTAutogradperformancePerformance-related failurePerformance-related failuretest: e2eEnd-to-end / benchmark failure surfaceEnd-to-end / benchmark failure surface
Activity
[-][BMG] Baseline performance cases where inductor is slower than eager (speedup < 1)[/-][+][BMG] PyTorch 2.12 performance cases where inductor is slower than eager (speedup < 1)[/+]msnliu commentedon Jul 22, 2026
speedup reproduction:

device ratio:

Env:
torch-2.12-xputorch-2.14-xpu3.13.143.13.152.12.0+xpu2.14.0+xpu3.7.13.8.05.14.15.14.1InstalledInstalledmsnliu commentedon Sep 15, 2026
In PyTorch 2.12, models with 4D broadcasted attention masks (e.g. HuggingFace BERT/BART/Electra with shape [B, 1, 1, S]) fail to dispatch to the oneDNN SDPA backend (overrideable_attention) on XPU, falling back to the un-fused math backend.
Profiling traces show that this fallback introduces extra general GEMMs and unfused softmax kernels per attention block, causing substantial performance regressions (speedup < 1.0).
after the sdpa path fix (pytorch/pytorch#197505):

we could see that model 05_plbart_bf16_inf and 06_bert_amp_inf did not show regression again:
msnliu commentedon Sep 20, 2026
Transformers issues:
huggingface/transformers#48924
huggingface/transformers#48925
After applying the Transformers masking fix (huggingface/transformers#48975 & huggingface/transformers#49002), all 8 validation cases pass successfully: Electra, BERT, BART, mBART, PLBART, BERT AMP, Electra FP16, and OPT BF16 training. The fix correctly enables mask skipping under torch.compile.
msnliu commentedon Sep 23, 2026
MAML inference performs task-specific finetuning and calls
torch.autograd.grad(). With PyTorch 2.14's default Dynamo settings, autograd operations are not traced, which causes graph breaks.This change:
trace_autograd_opsfor MAML;deepcopy()andTensor.item()from the compiled path.MAML inference now compiles without the observed graph breaks or recompilations. Validated on Intel XPU with numerical correctness checks and approximately 2.7x Inductor speedup over eager.
pytorch/benchmark#2709
lennard_jones and soft_actor_critic models are host bounded
daisyden commentedon Nov 11, 2026
label-issue: #3761
Root cause: tracking issue for BMG PyTorch 2.12 inductor-vs-eager perf gaps (speedup<1); no single defect traced, representative case is inductor slower than eager on an SDPA-heavy HF QA model.
Analyzed case: huggingface/ElectraForQuestionAnswering/inference/bfloat16 (case 1 of 11; the other 10 not analyzed)
typeBugtesttest: e2emodulemodule: inductorpriorityHighhwhw: BMG[BMG]; Battlemage platform.dtypedtype: bfloat16performanceinferenceTest cases (11):
Applied to this issue. Generated by a local
label-issuerun.