Skip to content

Commit 1233851

Browse files
committed
Add some new COnvTranspose models for benchmarking
1 parent 6d9c75f commit 1233851

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

root/tmva/sofie/ONNXRuntimeInference_Template.cxx.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,11 @@ static void @FUNC_NAME@(benchmark::State& state, string model_path)
139139
//std::cout << "writing file" << filename << std::endl;
140140
ofstream f;
141141
f.open(filename);
142-
f << yOut.size() << std::endl;
143-
for (size_t i = 0; i < yOut.size(); i++)
142+
f << yOut.size();
143+
for (size_t i = 0; i < yOut.size(); i++) {
144+
if ((i % 10) == 0) f << "\n"; // add endline every 10
144145
f << yOut[i] << " ";
146+
}
145147
f << std::endl;
146148
f.close();
147149
}

root/tmva/sofie/SOFIEInference.cxx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#include "higgs_model_dense.hxx"
2828
#include "DDB_B1.hxx" // CMS onnx model
2929
#include "Conv2DTranspose_Relu_Sigmoid.hxx"
30+
#include "ConvTrans2dModel_B1.hxx"
31+
//#include "ConvTransposeM.hxx"
32+
#include "ConvTModel_G4.hxx"
33+
#include "SimpleNN_Alice.hxx"
3034

3135
#include "resnet18v1.hxx"
3236
#include "TMath.h"
@@ -83,9 +87,11 @@ void BM_SOFIE_Inference(benchmark::State &state)
8387
std::ofstream f;
8488
std::string filename = std::string(typeid(s).name()) + ".out";
8589
f.open(filename);
86-
f << yOut.size() << std::endl;
87-
for (size_t i = 0; i < yOut.size(); i++)
90+
f << yOut.size();
91+
for (size_t i = 0; i < yOut.size(); i++) {
92+
if ((i % 10) == 0) f << "\n"; // add endline every 10
8893
f << yOut[i] << " ";
94+
}
8995
f << std::endl;
9096
f.close();
9197
doWrite = false;
@@ -163,7 +169,12 @@ void BM_SOFIE_Inference_3(benchmark::State &state)
163169
// CMS benchmark (3 inputs)
164170
//BENCHMARK_TEMPLATE(BM_SOFIE_Inference_3, TMVA_SOFIE_DDB_B1::Session)->Name("DDB_B1")->Args({1, 1*27, 60*8, 5*2})->Unit(benchmark::kMillisecond);
165171
// Conv Transpose
166-
BENCHMARK_TEMPLATE(BM_SOFIE_Inference, TMVA_SOFIE_Conv2DTranspose_Relu_Sigmoid::Session)->Name("Cov2DTranspose_Relu_Sigmoid")->Args({15,1})->Unit(benchmark::kMillisecond);
172+
BENCHMARK_TEMPLATE(BM_SOFIE_Inference, TMVA_SOFIE_Conv2DTranspose_Relu_Sigmoid::Session)->Name("Conv2DTranspose_Relu_Sigmoid")->Args({15,1})->Unit(benchmark::kMillisecond);
173+
BENCHMARK_TEMPLATE(BM_SOFIE_Inference, TMVA_SOFIE_ConvTModel_G4::Session)->Name("ConvTModel_G4")->Args({15,1})->Unit(benchmark::kMillisecond);
174+
//BENCHMARK_TEMPLATE(BM_SOFIE_Inference, TMVA_SOFIE_ConvTransposeM::Session)->Name("ConvTransposeM")->Args({4*30*30,4})->Unit(benchmark::kMillisecond);
175+
BENCHMARK_TEMPLATE(BM_SOFIE_Inference, TMVA_SOFIE_ConvTrans2dModel_B1::Session)->Name("ConvTrans2dModel_B1")->Args({4*4*4,1})->Unit(benchmark::kMillisecond);
176+
177+
BENCHMARK_TEMPLATE(BM_SOFIE_Inference, TMVA_SOFIE_SimpleNN_Alice::Session)->Name("SimpleNN_Alice")->Args({16,1})->Unit(benchmark::kMillisecond);
167178

168179
//Gemm benchmarks
169180
BENCHMARK_TEMPLATE(BM_SOFIE_Inference, TMVA_SOFIE_Linear_16::Session)->Name("Linear_16")->Args({100, 16})->Unit(benchmark::kMillisecond);
2.28 MB
Binary file not shown.
3.44 KB
Binary file not shown.
27.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)