Skip to content

Conversation

@lukamac
Copy link
Collaborator

@lukamac lukamac commented Oct 30, 2025

In this PR we go one step further in the parsing refactor crusade. The next step was to refactor the parsing procedure which can be seen in the 1d953bd commit.

Note: This PR needs both #131 and #118 so a large portion of changes is from those PRs. If you want to see the changes introduced by this PR, look from the above-mentioned commit forward.

Other big change introduced by this PR is the move of the computeShapes function from the ONNXLayer class to templates. The reasoning is that some templates might implement specialized kernels for specific tensor shapes. For example, we already have implementations of the Mul operator that work with 2 equally shaped tensors or with a tensor and a scalar (tensor of size (1,)) and those 2 cases require different shape alignment. Previously we used the same computeShapes implementation which just blindly broadcasted the scalar value to a tensor of the same shape as the first operand.

I am still deciding on what exactly should be the job of this method because for now we have assumed that if the shape given by the computeShapes can be broadcasted, that it can be executed, but that does not necessarily hold true.
The solution might be to just require shape checks during (current) parseNode (which some templates actually do: PULPTallGemm and PULPMatrixVec).

Added

Changed

  • Parsing procedure
  • Moved computeShapes method from ONNXLayer to NodeTemplate and renamed to alignShapes

Fixed

PR Merge Checklist

  1. The PR is rebased on the latest devel commit and pointing to devel.
  2. Your PR reviewed and approved.
  3. All checks are passing.
  4. The CHANGELOG.md file has been updated.
  5. Stabilize the alignShapes responsibilities and usage

@Xeratec Xeratec added Feature Addition of new features Refactor Changes or improvements to existing features and removed Feature Addition of new features labels Nov 6, 2025
@Xeratec Xeratec added this to Deeploy Nov 6, 2025
@Xeratec Xeratec added this to the Release 0.3.0 milestone Nov 6, 2025
@Xeratec Xeratec moved this to In progress in Deeploy Nov 6, 2025
@lukamac lukamac mentioned this pull request Nov 7, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Changes or improvements to existing features

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants