LayerNormFusionL2 removes a public duplicate Sub output
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- machine-learning, performance
Research direction
Start with onnxruntime/core/optimizer/layer_norm_fusion.cc:360-373 and inspect the duplicated-Sub branch alongside the reproducer in onnxruntime/ORT-SEM-016. Run python reproduce.py using the versions in requirements.txt to confirm the failure and the transformer-disabled control. Done means optimization preserves the public output and the source model’s expected behavior, or declines the rewrite.
Written by the indexing model from the issue text.
Description
Affected versions
- Latest stable release tested:
v1.30.0(f2c39fe2f838cf35ce7da92824f5a5e3ee6e88a7) - Default-branch build tested:
a11b4e593164c82f7ce95efce3693744103f8176
Summary
a public output from the second Sub branch of a duplicated-Sub LayerNorm pattern loses its producer.
The source model loads with optimizations disabled. Enabling graph optimization reproduces the failure on ONNX Runtime 1.30.0. Disabling only LayerNormFusionL2 removes the failure. A compiled 1.31 development wheel based on a11b4e593164c82f7ce95efce3693744103f8176 reproduced the same root. The relevant implementation remains present at official main 96f73115c95968a3f31f2a110b33c164d847dda4.
Steps to reproduce
-
Clone the public reproducer and enter this case:
git clone https://github.com/Yuhx141/graph-optimizer-issue-reproducers.git cd graph-optimizer-issue-reproducers/onnxruntime/ORT-SEM-016 -
Install the versions in
requirements.txt. -
Run
python reproduce.py.
The standalone script validates the source behavior, reproduces the optimized behavior, and disables the implicated transformer as a positive control. The readable reproducer is at https://github.com/Yuhx141/graph-optimizer-issue-reproducers/tree/main/onnxruntime/ORT-SEM-016.
Expected result
The optimizer must preserve every public value, remaining consumer, graph interface and numerical result of the valid source model, or decline the rewrite.
Actual result
a public output from the second Sub branch of a duplicated-Sub LayerNorm pattern loses its producer.
Likely cause and source location
the duplicated-Sub branch checks CheckOutputEdges(graph, sub_node, 1) again instead of checking sub_node_dup.
Relevant source locations:
onnxruntime/core/optimizer/layer_norm_fusion.cc:360-373
Environment
- OS: Ubuntu 24.04.4 LTS, x86-64
- CPU: Intel Core Ultra 5 225
- Python: 3.11.16
- NumPy: 2.4.6
- ONNX: 1.22.0
- ONNX Runtime: 1.30.0 (
f2c39fe2f838cf35ce7da92824f5a5e3ee6e88a7) - Execution provider: CPUExecutionProvider
- Optimization level: ORT_ENABLE_ALL
Duplicate search
No exact issue or PR was found by pass-name, symptom and root-cause searches on 2026-09-29.
No exact issue or PR was found by pass-name, symptom and root-cause searches on 2026-09-29.
Reproducer files
reproduce.py: standalone self-checksource.txt: readable ONNX graphminimal_model.onnx: exact source modelSHA256SUMS: file hashes
- Dominant language
- C++
- Stars
- 22.2k
- Forks
- 4.4k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 308
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/onnxruntime
-
.NET ep:WebGPU platform:web
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/onnxruntime#33755 ·
Maintainers usually reply within 2 days
-
[Feature Request] [Web] Expose kvCacheQuantizationBits in the onnxruntime-web WebGPU EP optionsOpenep:WebGPU platform:web quantization
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
microsoft/onnxruntime#33752 ·
Maintainers usually reply within 2 days
-
platform:web
Difficulty 1/5 Under an hour Newbie friendliness 82/100
microsoft/onnxruntime#33570 ·
Maintainers usually reply within 2 days
-
C++ tests fail to compilePossibly taken @winstonwen727 claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/onnxruntime#33430 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/onnxruntime#33300 ·
Maintainers usually reply within 2 days
All issues in microsoft/onnxruntime
Similar issues
-
launch-client --save-creds creates creds/<account>/ with mode 755, not 700Possibly taken @metis-sprock claimed this today. Openbacklog bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
EchoTools/nevr-runtime#1471 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
grumpycoders/pcsx-redux#2530 ·
-
A-tools P-medium S-ready-to-start studio task
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Status: Needs confirmation Status: Needs triage Type: Code Quality
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Image.resolveAssetSource's TypeScript declaration drops the null it returns for an unknown assetOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
react/react-native#59648 ·
Maintainers usually reply within 2 days