Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

LayerNormFusionL2 removes a public duplicate Sub output

Open Beginner friendly
#32,953 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@Yuhx141 is already working on this.

Since Sep 30, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp, python

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

  1. 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
    
  2. Install the versions in requirements.txt.

  3. 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

Dominant language
C++
Stars
22.2k
Forks
4.4k
Avg merge
3d 5h
Merged PRs (30d)
308

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/onnxruntime

All issues in microsoft/onnxruntime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.