@@ -81,6 +81,7 @@ def skl2onnx_convert_lightgbm(scope, operator, container):
8181###############################################
8282# Or with the following command.
8383out ,err = run_cmd ("cat /proc/cpuinfo" )
84+ print (out )
8485
8586###############################################
8687# Fonction to measure inference time
@@ -124,8 +125,6 @@ def measure_inference(fct, X, repeat, max_time=5, quantile=1):
124125# model for a random forest and onnxruntime after it was converted
125126# into ONNX and for the following configurations.
126127
127- legend = "parallel-batch-4096-block"
128-
129128small = cpu_count ()< 12
130129if small :
131130N = 1000
@@ -142,6 +141,8 @@ def measure_inference(fct, X, repeat, max_time=5, quantile=1):
142141depth = [6 ,8 ,10 ,12 ,14 ]
143142Regressor = RandomForestRegressor
144143
144+ legend = f"parallel-nf-{ n_features } -"
145+
145146# avoid duplicates on machine with 1 or 2 cores.
146147n_jobs = list (sorted (set (n_jobs ),reverse = True ))
147148
@@ -175,7 +176,7 @@ def measure_inference(fct, X, repeat, max_time=5, quantile=1):
175176
176177# parallelization
177178cache_name = os .path .join (
178- cache_dir ,f"rf-J-{ n_j } -E-{ n_estimators } -D-{ max_depth } .pkl"
179+ cache_dir ,f"nf- { X . shape [ 1 ] } - rf-J-{ n_j } -E-{ n_estimators } -D-{ max_depth } .pkl"
179180 )
180181if os .path .exists (cache_name ):
181182with open (cache_name ,"rb" )as f :
@@ -196,7 +197,7 @@ def measure_inference(fct, X, repeat, max_time=5, quantile=1):
196197so = SessionOptions ()
197198so .intra_op_num_threads = n_j
198199cache_name = os .path .join (
199- cache_dir ,f"rf-J-{ n_j } -E-{ n_estimators } -D-{ max_depth } .onnx"
200+ cache_dir ,f"nf- { X . shape [ 1 ] } - rf-J-{ n_j } -E-{ n_estimators } -D-{ max_depth } .onnx"
200201 )
201202if os .path .exists (cache_name ):
202203sess = InferenceSession (cache_name ,so )
@@ -268,7 +269,7 @@ def measure_inference(fct, X, repeat, max_time=5, quantile=1):
268269
269270
270271fig ,axes = plt .subplots (n_rows ,n_cols ,figsize = (4 * n_cols ,4 * n_rows ))
271- fig .suptitle (f"{ rf .__class__ .__name__ } " )
272+ fig .suptitle (f"{ rf .__class__ .__name__ } \n X.shape= { X . shape } " )
272273
273274for n_j ,n_estimators in tqdm (product (n_jobs ,n_ests )):
274275i = n_jobs .index (n_j )