input model type is ONNX
Parsing SOFIE model HiggsModel of type onnx
generating the code with batch size = 1 ...
...ParserCode being executed...:
{
TMVA::Experimental::SOFIE::RModelParser_ONNX parser ;
TMVA::Experimental::SOFIE::RModel model = parser.Parse("HiggsModel.onnx");
model.Generate(TMVA::Experimental::SOFIE::Options::kDefault,1, 0, 1);
model.OutputGenerated("HiggsModel_fromRSofieR.hxx");
model.PrintRequiredInputTensors();
model.PrintIntermediateTensors();
model.PrintOutputTensors();
int nInputs = model.GetInputTensorNames().size();
return nInputs;
}
Model requires following inputs:
Fully Specified Tensor name: input type: float shape: [1,7]
Model specify the following dynamic tensors:
Initializing operator 0 N4TMVA12Experimental5SOFIE14ROperator_GemmIfEE
Gemm (or MatMul) ---> relu shape { 1 , 64 }
Initializing operator 1 N4TMVA12Experimental5SOFIE14ROperator_GemmIfEE
Gemm (or MatMul) ---> relu_1 shape { 1 , 64 }
Initializing operator 2 N4TMVA12Experimental5SOFIE14ROperator_GemmIfEE
Gemm (or MatMul) ---> linear_2 shape { 1 , 1 }
Initializing operator 3 N4TMVA12Experimental5SOFIE17ROperator_SigmoidIfEE
generate Main session code - model HiggsModel
******************
analyzing input/output operator 0 N4TMVA12Experimental5SOFIE14ROperator_GemmIfEE
Total chunks allocated
*** AllocateIntermediateMemory: Loop on op output tensors
output tensor relu size 256
no chunk available - add in total stack a new chunk with size of tensor and idx : 0
*** CheckAndFlushIntermediateMemory: Loop on input tensors for op 0
available chunks before freeing them :
.. input tensors : input flash condition is met - looping on chunks to find matching one
--- chunk 0 , relu size 256.. input tensors : 0weight flash condition is met - looping on chunks to find matching one
--- chunk 0 , relu size 256.. input tensors : 0bias flash condition is met - looping on chunks to find matching one
--- chunk 0 , relu size 256
******************
analyzing input/output operator 1 N4TMVA12Experimental5SOFIE14ROperator_GemmIfEE
Total chunks allocated
..... chunk 0 size 256 relu
*** AllocateIntermediateMemory: Loop on op output tensors
output tensor relu_1 size 256
no chunk available - add in total stack a new chunk with size of tensor and idx : 256
*** CheckAndFlushIntermediateMemory: Loop on input tensors for op 1
available chunks before freeing them :
.. input tensors : relu flash condition is met - looping on chunks to find matching one
--- chunk 0 , relu size 256 -- Found chunk corresponding to input tensor: 0 insert in the available stack the chunk with size 256
.. input tensors : 2weight
.. input tensors : 2bias
******************
analyzing input/output operator 2 N4TMVA12Experimental5SOFIE14ROperator_GemmIfEE
Total chunks allocated
..... chunk 0 size 256 free
..... chunk 256 size 256 relu_1
*** AllocateIntermediateMemory: Loop on op output tensors
output tensor linear_2 size 4
.. available chunk 0 with size = 256 is re-used and split in a new of size 4 at 252
*** CheckAndFlushIntermediateMemory: Loop on input tensors for op 2
available chunks before freeing them :
-- free chunk 0 size = 252
.. input tensors : relu_1 flash condition is met - looping on chunks to find matching one
--- chunk 0 , free size 252--- chunk 252 , linear_2 size 4--- chunk 256 , relu_1 size 256 -- Found chunk corresponding to input tensor: 256 insert in the available stack the chunk with size 256
.. input tensors : 4weight
.. input tensors : 4bias
******************
analyzing input/output operator 3 N4TMVA12Experimental5SOFIE17ROperator_SigmoidIfEE
Total chunks allocated
..... chunk 0 size 252 free
..... chunk 252 size 4 linear_2
..... chunk 256 size 256 free
*** AllocateIntermediateMemory: Loop on op output tensors
output tensor output size 4
.. available chunk 0 with size = 252 is re-used and split in a new of size 4 at 248
*** CheckAndFlushIntermediateMemory: Loop on input tensors for op 3
available chunks before freeing them :
-- free chunk 0 size = 248
-- free chunk 256 size = 256
.. input tensors : linear_2 flash condition is met - looping on chunks to find matching one
--- chunk 0 , free size 248--- chunk 248 , output size 4--- chunk 252 , linear_2 size 4 -- Found chunk corresponding to input tensor: 252 is adjacent in memory with following one - merge
Generating main inference code for HiggsModel
Generating code for operator .... 0
Generating code for operator .... 1
Generating code for operator .... 2
Generating code for operator .... 3
Model requires following inputs:
Fully Specified Tensor name: input type: float shape: [1,7]
Model specify the following intermediate tensors:
Tensor name: "output" type: float shape: [1,1]
Tensor name: "relu_1" type: float shape: [1,64]
Tensor name: "linear_2" type: float shape: [1,1]
Tensor name: "relu" type: float shape: [1,64]
Model specify the following output tensors:
Tensor name: "output" with shape: { 1 , 1 }
Model Header file is generated!
compile generated code from file HiggsModel_fromRSofieR.hxx
Creating Inference function for model HiggsModel
//global session declaration
#pragma cling optimize(2)
#include "HiggsModel_fromRSofieR.hxx"
TMVA_SOFIE_HiggsModel::Session session_073170ae8f3f11f1aa010200590abeef("HiggsModel_fromRSofieR.dat");
//Inference function code using global session instance
std::vector<float> SofieInference_073170ae8f3f11f1aa010200590abeef( void * ptr, float * data0) {
TMVA_SOFIE_HiggsModel::Session * s = (TMVA_SOFIE_HiggsModel::Session*) (ptr);
return s->infer(data0);
}
Event prediction = 0.370472