[tmva][sofie] Inputs of unsupported type (e.g. float16) give code that does not compile instead of an error
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- machine-learning
Direzione di ricerca
Il controllo errato è il confronto con "other" in RModel::GenerateInferSignature in tmva/sofie/src/RModel.cxx (intorno alle righe 1202-1205). ConvertTypeToString in tmva/sofie/src/SOFIE_common.cxx (intorno alla riga 102) restituisce "other_" + type per i tipi sconosciuti, quindi inizia confrontando questi due. Esegui il reproducer Python e verifica che Generate() generi l'errore già esistente di funzionalità non ancora supportata per un input FLOAT16. Un test del parser in TestSofieParser.cxx dovrebbe coprirlo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Check duplicate issues.
- Checked for duplicates
Description
When a model input has a type that SOFIE does not support, RModel::Generate() is supposed to throw "input tensor ... is of a data type which is not yet supported." (RModel::GenerateInferSignature, tmva/sofie/src/RModel.cxx, lines 1202-1205). That check never fires: it compares the type name with "other", but ConvertTypeToString returns "other_" + std::to_string(type) for the types it does not know (tmva/sofie/src/SOFIE_common.cxx, line 102), e.g. "other_10" for FLOAT16.
So Generate() succeeds and writes a header with other_10 const* tensor_x in the signatures of infer() and doInfer(), and the user only gets an unknown type name 'other_10' compile error later. This affects every type that ConvertTypeToString does not handle (FLOAT16, BFLOAT16, STRING, COMPLEX64/128). Operators such as Relu or Identity reject such inputs themselves, but Shape and Cast let them through.
Expected: Generate() throws the existing "not yet supported" error.
Reproducer
import os
import re
import ROOT
from onnx import TensorProto, helper, save
os.chdir(os.path.dirname(os.path.abspath(__file__)))
node = helper.make_node("Shape", ["x"], ["y"])
graph = helper.make_graph(
[node],
"float16_input",
[helper.make_tensor_value_info("x", TensorProto.FLOAT16, [2, 3])],
[helper.make_tensor_value_info("y", TensorProto.INT64, [2])],
)
model = helper.make_model(graph, opset_imports=[helper.make_opsetid("", 13)], ir_version=8)
save(model, "float16_input.onnx")
ROOT.gInterpreter.Declare("""
#include "TMVA/RModelParser_ONNX.hxx"
std::string float16_generate() {
using namespace TMVA::Experimental::SOFIE;
try {
RModelParser_ONNX parser;
RModel model = parser.Parse("float16_input.onnx");
model.Generate();
model.OutputGenerated("float16_input.hxx");
} catch (const std::exception &e) {
return e.what();
}
return "no exception";
}
""")
print("Generate():", ROOT.float16_generate())
print("infer signature:", re.search(r"infer\((.*)\)", open("float16_input.hxx").read()).group(1))
print("compiles:", ROOT.gInterpreter.Declare('#include "float16_input.hxx"'))
Output (compiler errors shortened):
./float16_input.hxx:77:28: error: unknown type name 'other_10'
std::vector<int64_t> infer(other_10 const* tensor_x){
Generate(): no exception
infer signature: other_10 const* tensor_x
compiles: False
ROOT version
6.41.01, master at c619e8fbd7f (the code is unchanged in the current master)
Installation method
Built from source (CMake, Release, -Dtesting=ON)
Operating system
macOS 26 (arm64, Apple M4 Pro)
Additional context
I found this while running the ONNX operator tests (from the onnx Python package) through SOFIE. I used AI assistance (Claude) to investigate it I ran the reproducer and checked its output myself. I'll open a PR with a fix and a test in TestSofieParser.cxx.
- Lingua principale
- C++
- Stelle
- 3.3k
- Fork
- 1.6k
- Merge medio
- 2g 16h
- PR unite (30g)
- 194
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di root-project/root
-
thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newlineForse già presa @dpiparo l’ha presa 3 giorni fa. Apertabug in:Build System
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
root-project/root#23746 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[RDataFrame] Code that transforms `#var` alias to `R_rdf_sizeof_var` does not respect string literalsForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 71/100
root-project/root#23790 ·
I maintainer di solito rispondono entro 1 giorno
-
bug in:Core Libraries
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
root-project/root#23777 ·
I maintainer di solito rispondono entro 1 giorno
-
`TChain::GetEntries` internal caching ineffective?Forse già presa @pcanal l’ha presa 6 giorni fa. Apertaimprovement in:TTree
root-project/root#23738 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[PyROOT] Segfault at exit deleting a branch with a Cling-generated collection destructor after cppyy instantiated a templateForse già presa @guitargeek l’ha presa 6 giorni fa. Apertabug in:Python Interface
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
root-project/root#23728 · 8 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di root-project/root
Issue simili
-
Jupyter kernel leaks two file descriptors per cell; after ~100 cells every cell fails with "pipe() failed"Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Test discovery aborts on GPU builds without cuStateVec: check_cuStateVec expects a failed result but set_config() now raises RuntimeErrorForse già presa @dmeliksetian l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Qiskit/qiskit-aer#2495 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
sumatrapdfreader/sumatrapdf#6403 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Jumballaya/Journeyman-Engine#199 ·
I maintainer di solito rispondono entro 1 giorno
-
backend enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno