Skip to content

[tmva][sofie] Fix ONNX fusion child indexing#21949

Open
markknoffler wants to merge 1 commit intoroot-project:masterfrom
markknoffler:bug_fix_misindexed_children
Open

[tmva][sofie] Fix ONNX fusion child indexing#21949
markknoffler wants to merge 1 commit intoroot-project:masterfrom
markknoffler:bug_fix_misindexed_children

Conversation

@markknoffler
Copy link
Copy Markdown

Fixes #21948.

In SOFIE ONNX parsing, nodesChildren is keyed by original ONNX node index, while the parsing loop iterates over execution order slots from nodesOrder.

Previously, the parser passed nodesChildren[i] to ParseOperator.
For graphs that are not already topologically ordered in file layout, this can pass children for the wrong node and trigger invalid fusion attempts.

This patch fixes the lookup to use the current node id from reordered execution:

nodesChildren[nodesOrder[i]]

so fusion decisions are made using the correct child list of the node being parsed.

Why this matters

This bug can cause runtime parse failures on valid models when reorder is required, e.g. wrong MatMul + Add pairing.

Changes

  • one-line fix in tmva/sofie_parsers/src/RModelParser_ONNX.cxx
  • no extra functional changes

Checklist

  • tested changes locally

Respected @lmoneta and @sanjibansg,

Could you please review this fix?

Also, I have local bug reproduction scripts but they are currently not in ROOT standard test layout.
Kindly advise if you would like me to add the standardized tests in this PR?

With regards,
Samreedh Bhuyan

nodesChildren is keyed by original graph node indices, while the parse loop iterates over nodesOrder positions. Use nodesOrder[i] to retrieve the correct child list for the currently parsed node and avoid incorrect fusion pairing on reordered graphs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tmva][sofie] Wrong fusion child lookup after ONNX graph reordering

3 participants