Skip to content

[v640][tmva][sofie] Run PyTorch ONNX export in a separate process in tutorial#22634

Merged
guitargeek merged 4 commits into
root-project:v6-40-00-patchesfrom
guitargeek:bp_1
Jun 16, 2026
Merged

[v640][tmva][sofie] Run PyTorch ONNX export in a separate process in tutorial#22634
guitargeek merged 4 commits into
root-project:v6-40-00-patchesfrom
guitargeek:bp_1

Conversation

@guitargeek

@guitargeek guitargeek commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

User-facing code like tutorials should be nicely formatted, in
particular avoiding non-standard indentations with three spaces that can
annoy users when copy-pasting code.

(cherry picked from commit e46f77c)
Keras and PyTorch still cause some warnings in a few places where they
use deprecated features from their dependencies. We need a mechanism to
silence these warnings to that our tests will run with warnings as
errors, while also making sure we catch when the warnings don't happen
anymore, so we can remove the boilerplate code for warnings silencing.

(cherry picked from commit 18a30fa)
In particular, replace `raiseError` which is only available in pytest
fixtures.

(cherry picked from commit 945cb26)
The tutorial exported a PyTorch model to ONNX and then parsed it with
SOFIE in the same process. `torch.onnx` and ROOT's SOFIE ONNX parser are
both linked against protobuf, but generally against different versions,
so loading them into one process causes a symbol clash and aborts.

Move the model creation, training and ONNX export into a small standalone
script that runs in its own Python process via subprocess, before ROOT is
imported, so the two protobuf copies are never loaded together.

The parent detects success by the presence of the generated .onnx file
and raises a RuntimeError if it is missing.

(cherry picked from commit ce08cbb)
@guitargeek guitargeek self-assigned this Jun 16, 2026
@guitargeek guitargeek requested a review from couet as a code owner June 16, 2026 15:29
@guitargeek guitargeek merged commit 8b2ca6f into root-project:v6-40-00-patches Jun 16, 2026
31 of 34 checks passed
@guitargeek guitargeek deleted the bp_1 branch June 16, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant