Skip to content

[tmva][sofie] Remove some historical code paths and helpers - #23497

Merged
guitargeek merged 3 commits into
root-project:masterfrom
guitargeek:sofie-consolidation
Sep 29, 2026
Merged

guitargeek merged 3 commits into
root-project:masterfrom
guitargeek:sofie-consolidation

Conversation

@guitargeek

@guitargeek guitargeek commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor
  1. Remove the kNoSession code generation mode. This reduces the possible configuration space for SOFIE, and there is no reason to not use a session class at this point.
  2. Merge RModel_Base back into RModel. Now that the GNN support via the abandoned graph_nets library is removed, there is not reason anymore for this split. See [tmva][sofie] Evolve the SOFIE GNN support from graph_nets to PyTorch + ONNX #23144 for the removal.
  3. Remove the SofieFunctor helper and show in the RDF tutorial how to use the SOFIE-generated code directly. This is more honest and helpful to the users: the SofieFunctor generalizes poorly to different model structures, so we have to show our users how to use the generated model code directly anyway, because the will hit cases where the helper doesn't work. It only supported models with a single flat input tensor. And if we already show that in the tutorial, we might as well remove the SofieFunctor.

More detail in the commit messages.

The Session struct is now the only way the inference code is generated.
The no-session mode was the original output format kept for backward
compatibility: it is untested in-tree, incompatible with dynamic tensors
and with a separate weight file, and its only remaining property
(static, allocation-free generated code) is orthogonal to scoping and
is better reintroduced as an explicit allocation-strategy option when
the need arises.

Removes the kNoSession Options value, the fUseSession flags on
RModel_Base and ROperator, and the parallel no-session emission
branches in RModel::GenerateSessionCode/GenerateOutput and in the
Conv, ConvTranspose, Pool, Reduce, GRU, LSTM and RNN operators.
RModel_Base was introduced with the SOFIE-GNN support (RModel_GNN,
RModel_GraphIndependent) to share the generated-code machinery between
the model classes. Since the GNN classes were removed, RModel is its
only derived class, and the split is pure indirection.

Move all members and functions into RModel and delete the base class.
The moved implementations (GenerateHeaderInfo, EmitHelperFunctionsCode
and the file-writing part of OutputGenerated) are kept byte-identical
to ease review; the constructor logic is folded into the RModel
constructor. RModel_Base is dropped from the dictionary, the build
and the public header list; its removal from the LinkDef is safe
because RModel has no ROOT IO support.
The SofieFunctor/SofieFunctorHelper adapter in SOFIEHelpers.hxx only
supports models with a single flat float input tensor and a single
scalar output, and silently relies on the RDataFrame column order
matching the model input layout. Instead of a helper that generalizes
poorly, the RDataFrame tutorials now show the underlying pattern
explicitly: one Session object per processing slot, dispatched by slot
number, with the input tensor assembled from the columns in the
functor body. This makes session ownership (and its weight loading)
visible and is straightforward to adapt to multiple inputs or outputs.
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 11h 53m 9s ⏱️
 3 869 tests  3 868 ✅ 0 💤 1 ❌
76 160 runs  76 159 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit a74917a.

♻️ This comment has been updated with latest results.

@guitargeek
guitargeek merged commit 0878949 into root-project:master Sep 29, 2026
53 of 61 checks passed
@guitargeek
guitargeek deleted the sofie-consolidation branch September 29, 2026 17:25
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.

2 participants