diff --git a/_doc/examples/plot_op_onnx_topk.py b/_doc/examples/plot_op_onnx_topk.py index 4e7e7839b..4f182ad5a 100644 --- a/_doc/examples/plot_op_onnx_topk.py +++ b/_doc/examples/plot_op_onnx_topk.py @@ -201,7 +201,7 @@ def f2(x, k=k): return fct2(x, k=k) K = [1, 2, 5, 10, 15] -N = [1, 2, 3, 10, 100, 1000, 10000, 100000] +N = [1, 2, 3, 10, 100, 1000, 10000] bench_para = benchmark_test( X32, (lambda x, k: topk_sorted_implementation_cpp( diff --git a/_doc/examples/plot_opml_linear_regression.py b/_doc/examples/plot_opml_linear_regression.py index 06309ca5f..b302831b7 100644 --- a/_doc/examples/plot_opml_linear_regression.py +++ b/_doc/examples/plot_opml_linear_regression.py @@ -259,7 +259,7 @@ def autolabel(ax, rects): @ignore_warnings(category=FutureWarning) def run_bench(repeat=250, verbose=False): - n_obs = [1, 10, 100, 1000, 10000, 100000] + n_obs = [1, 10, 100, 1000, 10000] methods = ['predict'] n_features = [10, 50] n_jobss = [cpu_count()] diff --git a/_doc/examples/plot_opml_random_forest_cls_multi.py b/_doc/examples/plot_opml_random_forest_cls_multi.py index b393ade1f..05e1cb619 100644 --- a/_doc/examples/plot_opml_random_forest_cls_multi.py +++ b/_doc/examples/plot_opml_random_forest_cls_multi.py @@ -311,7 +311,7 @@ def autolabel(ax, rects): @ignore_warnings(category=FutureWarning) def run_bench(repeat=100, verbose=False): - n_obs = [1, 10, 100, 1000, 10000, 100000] + n_obs = [1, 10, 100, 1000, 10000] methods = ['predict'] n_features = [30] max_depths = [6, 8, 10, 12] diff --git a/_doc/examples/plot_opml_random_forest_reg.py b/_doc/examples/plot_opml_random_forest_reg.py index 4b80c35f1..434227ebf 100644 --- a/_doc/examples/plot_opml_random_forest_reg.py +++ b/_doc/examples/plot_opml_random_forest_reg.py @@ -335,7 +335,7 @@ def autolabel(ax, rects): @ignore_warnings(category=FutureWarning) def run_bench(repeat=100, verbose=False): - n_obs = [1, 10, 100, 1000, 10000, 100000] + n_obs = [1, 10, 100, 1000, 10000] methods = ['predict'] n_features = [30] max_depths = [6, 8, 10, 12] diff --git a/_doc/examples/plot_parallelism.py b/_doc/examples/plot_parallelism.py index 26dd9463f..f4a070725 100644 --- a/_doc/examples/plot_parallelism.py +++ b/_doc/examples/plot_parallelism.py @@ -42,7 +42,7 @@ # +++++++++++++++++++++++++++++++ -data = make_regression(100000, 20) +data = make_regression(50000, 20) X, y = data X_train, X_test, y_train, y_test = train_test_split(X, y) diff --git a/_doc/sphinxdoc/source/_exts/generate_automated_pages.py b/_doc/sphinxdoc/source/_exts/generate_automated_pages.py index 4127cf86b..6a6099cb0 100644 --- a/_doc/sphinxdoc/source/_exts/generate_automated_pages.py +++ b/_doc/sphinxdoc/source/_exts/generate_automated_pages.py @@ -118,7 +118,7 @@ def write_page_onnxrt_benches(app, runtime, skip=None, white_list=None): opset_cols = [oc[1] for oc in opset_cols] new_cols = opset_cols[:1] bench_cols = ["RT/SKL-N=1", "N=10", "N=100", - "N=1000", "N=10000", "N=100000"] + "N=1000", "N=10000"] new_cols.extend(["ERROR-msg", "name", "problem", "scenario", 'optim']) new_cols.extend(bench_cols) new_cols.extend(opset_cols[1:]) diff --git a/_doc/sphinxdoc/source/onnx_bench.rst b/_doc/sphinxdoc/source/onnx_bench.rst index ea17b8cf4..3936f63fe 100644 --- a/_doc/sphinxdoc/source/onnx_bench.rst +++ b/_doc/sphinxdoc/source/onnx_bench.rst @@ -155,7 +155,7 @@ it is *1/r* faster than *scikit-learn*. row["name"], row["problem"], row["scenario"], row["optim"], row["n_features"], row["opset"]).replace("-default|", "-*]"), axis=1) indices = ['label'] - values = ['RT/SKL-N=1', 'N=10', 'N=100', 'N=1000', 'N=10000', 'N=100000'] + values = ['RT/SKL-N=1', 'N=10', 'N=100', 'N=1000', 'N=10000'] df1 = df1[indices + values] df2 = df2[indices + values] df = df1.merge(df2, on="label", suffixes=("__pyrtc", "__ort"), how='outer') diff --git a/_doc/sphinxdoc/source/tutorial/benchmarkorts.rst b/_doc/sphinxdoc/source/tutorial/benchmarkorts.rst index 8db381c83..8230e04c8 100644 --- a/_doc/sphinxdoc/source/tutorial/benchmarkorts.rst +++ b/_doc/sphinxdoc/source/tutorial/benchmarkorts.rst @@ -87,8 +87,8 @@ and with :epkg:`scikit-learn`. keep = [ 'name', 'problem', 'scenario', 'optim', 'n_features', 'runtime', 'skl_version', 'opset11', - 'RT/SKL-N=1', 'N=100000', - 'RT/SKL-N=1-base', 'N=100000-base', + 'RT/SKL-N=1', + 'RT/SKL-N=1-base', ] suma = suma[keep].copy() @@ -100,11 +100,11 @@ and with :epkg:`scikit-learn`. "'raw_scores': True", "RAW") suma['ORT ?x SKL ONE'] = 1. / suma["RT/SKL-N=1"] - suma['ORT ?x SKL BATCH'] = 1. / suma["N=100000"] + suma['ORT ?x SKL BATCH'] = 1. / suma["N=10000"] suma['NEW ?x ORT ONE'] = 1. / suma["RT/SKL-N=1-base"] - suma['NEW ?x ORT BATCH'] = 1. / suma["N=100000-base"] + suma['NEW ?x ORT BATCH'] = 1. / suma["N=10000-base"] suma['optim'] = suma['optim'].apply(replace) - suma = suma.drop(['RT/SKL-N=1', 'N=100000', 'RT/SKL-N=1-base', 'N=100000-base'], axis=1) + suma = suma.drop(['RT/SKL-N=1', 'N=10000', 'RT/SKL-N=1-base', 'N=10000-base'], axis=1) writer = pandas.ExcelWriter('merged.xlsx', engine='xlsxwriter') suma.to_excel(writer, index=False, float_format="%1.3f", diff --git a/_unittests/ut_onnxrt/test_benchmark_replay.py b/_unittests/ut_onnxrt/test_benchmark_replay.py index a44d1f064..ed62ff224 100644 --- a/_unittests/ut_onnxrt/test_benchmark_replay.py +++ b/_unittests/ut_onnxrt/test_benchmark_replay.py @@ -26,7 +26,7 @@ def test_benchmark_replay(self): rows = list(enumerate_benchmark_replay( temp, runtime='python', verbose=0)) df = pandas.DataFrame(rows) - self.assertEqual(df.shape, (4, 39)) + self.assertEqual(df.shape, (4, 35)) self.assertIn('1000-skl-details', df.columns) self.assertIn('1000-skl', df.columns) @@ -45,7 +45,7 @@ def test_benchmark_replay_onnxruntime(self): rows = list(enumerate_benchmark_replay( temp, runtime='onnxruntime', verbose=0)) df = pandas.DataFrame(rows) - self.assertEqual(df.shape, (4, 39)) + self.assertEqual(df.shape, (4, 35)) self.assertIn('1000-skl-details', df.columns) self.assertIn('1000-skl', df.columns) diff --git a/mlprodict/asv_benchmark/common_asv_skl.py b/mlprodict/asv_benchmark/common_asv_skl.py index f4cf14df1..c028b33ec 100644 --- a/mlprodict/asv_benchmark/common_asv_skl.py +++ b/mlprodict/asv_benchmark/common_asv_skl.py @@ -46,7 +46,7 @@ class _CommonAsvSklBenchmark: params = [ ['skl', 'pyrtc', 'ort'], # values for runtime - [1, 10, 100, 10000, 100000], # values for N + [1, 10, 100, 10000], # values for N [4, 20], # values for nf [get_opset_number_from_onnx()], # values for opset ["float", "double"], # values for dtype diff --git a/mlprodict/asv_benchmark/create_asv.py b/mlprodict/asv_benchmark/create_asv.py index a70423c1a..9f2004404 100644 --- a/mlprodict/asv_benchmark/create_asv.py +++ b/mlprodict/asv_benchmark/create_asv.py @@ -64,7 +64,7 @@ def create_asv_benchmark( location, opset_min=-1, opset_max=None, runtime=('scikit-learn', 'python_compiled'), models=None, skip_models=None, extended_list=True, - dims=(1, 10, 100, 10000, 100000), + dims=(1, 10, 100, 10000), n_features=(4, 20), dtype=None, verbose=0, fLOG=print, clean=True, conf_params=None, filter_exp=None, @@ -540,7 +540,7 @@ def _make_simple_name(name): # n_features, N, runtimes rep = { "['skl', 'pyrtc', 'ort'], # values for runtime": str(runtime), - "[1, 10, 100, 1000, 10000, 100000], # values for N": str(dims), + "[1, 10, 100, 1000, 10000], # values for N": str(dims), "[4, 20], # values for nf": str(n_features), "[get_opset_number_from_onnx()], # values for opset": str(opsets), "['float', 'double'], # values for dtype": diff --git a/mlprodict/asv_benchmark/template/skl_model_classifier.py b/mlprodict/asv_benchmark/template/skl_model_classifier.py index db49250be..81dfe9a18 100644 --- a/mlprodict/asv_benchmark/template/skl_model_classifier.py +++ b/mlprodict/asv_benchmark/template/skl_model_classifier.py @@ -29,7 +29,7 @@ class TemplateBenchmarkClassifier(_CommonAsvSklBenchmarkClassifier): """ params = [ ['skl', 'pyrtc', 'ort'], # values for runtime - [1, 10, 100, 1000, 10000, 100000], # values for N + [1, 10, 100, 1000, 10000], # values for N [4, 20], # values for nf [get_opset_number_from_onnx()], # values for opset ['float', 'double'], # values for dtype diff --git a/mlprodict/asv_benchmark/template/skl_model_classifier_raw_scores.py b/mlprodict/asv_benchmark/template/skl_model_classifier_raw_scores.py index 67e6651eb..f1338c158 100644 --- a/mlprodict/asv_benchmark/template/skl_model_classifier_raw_scores.py +++ b/mlprodict/asv_benchmark/template/skl_model_classifier_raw_scores.py @@ -29,7 +29,7 @@ class TemplateBenchmarkClassifierRawScore(_CommonAsvSklBenchmarkClassifierRawSco """ params = [ ['skl', 'pyrtc', 'ort'], # values for runtime - [1, 10, 100, 1000, 10000, 100000], # values for N + [1, 10, 100, 1000, 10000], # values for N [4, 20], # values for nf [get_opset_number_from_onnx()], # values for opset ['float', 'double'], # values for dtype diff --git a/mlprodict/asv_benchmark/template/skl_model_clustering.py b/mlprodict/asv_benchmark/template/skl_model_clustering.py index 3b427996e..fd162f76d 100644 --- a/mlprodict/asv_benchmark/template/skl_model_clustering.py +++ b/mlprodict/asv_benchmark/template/skl_model_clustering.py @@ -29,7 +29,7 @@ class TemplateBenchmarkClustering(_CommonAsvSklBenchmarkClustering): """ params = [ ['skl', 'pyrtc', 'ort'], # values for runtime - [1, 10, 100, 1000, 10000, 100000], # values for N + [1, 10, 100, 1000, 10000], # values for N [4, 20], # values for nf [get_opset_number_from_onnx()], # values for opset ['float', 'double'], # values for dtype diff --git a/mlprodict/asv_benchmark/template/skl_model_multi_classifier.py b/mlprodict/asv_benchmark/template/skl_model_multi_classifier.py index ff1c8e3e5..b1553b712 100644 --- a/mlprodict/asv_benchmark/template/skl_model_multi_classifier.py +++ b/mlprodict/asv_benchmark/template/skl_model_multi_classifier.py @@ -29,7 +29,7 @@ class TemplateBenchmarkMultiClassifier(_CommonAsvSklBenchmarkMultiClassifier): """ params = [ ['skl', 'pyrtc', 'ort'], # values for runtime - [1, 10, 100, 1000, 10000, 100000], # values for N + [1, 10, 100, 1000, 10000], # values for N [4, 20], # values for nf [get_opset_number_from_onnx()], # values for opset ['float', 'double'], # values for dtype diff --git a/mlprodict/asv_benchmark/template/skl_model_outlier.py b/mlprodict/asv_benchmark/template/skl_model_outlier.py index c53d673ac..649a85fc9 100644 --- a/mlprodict/asv_benchmark/template/skl_model_outlier.py +++ b/mlprodict/asv_benchmark/template/skl_model_outlier.py @@ -29,7 +29,7 @@ class TemplateBenchmarkOutlier(_CommonAsvSklBenchmarkOutlier): """ params = [ ['skl', 'pyrtc', 'ort'], # values for runtime - [1, 10, 100, 1000, 10000, 100000], # values for N + [1, 10, 100, 1000, 10000], # values for N [4, 20], # values for nf [get_opset_number_from_onnx()], # values for opset ['float', 'double'], # values for dtype diff --git a/mlprodict/asv_benchmark/template/skl_model_regressor.py b/mlprodict/asv_benchmark/template/skl_model_regressor.py index 3c9dc4b10..d108ace04 100644 --- a/mlprodict/asv_benchmark/template/skl_model_regressor.py +++ b/mlprodict/asv_benchmark/template/skl_model_regressor.py @@ -29,7 +29,7 @@ class TemplateBenchmarkRegressor(_CommonAsvSklBenchmarkRegressor): """ params = [ ['skl', 'pyrtc', 'ort'], # values for runtime - [1, 10, 100, 1000, 10000, 100000], # values for N + [1, 10, 100, 1000, 10000], # values for N [4, 20], # values for nf [get_opset_number_from_onnx()], # values for opset ['float', 'double'], # values for dtype diff --git a/mlprodict/asv_benchmark/template/skl_model_trainable_transform.py b/mlprodict/asv_benchmark/template/skl_model_trainable_transform.py index 7b0aba28a..bf0dec1fe 100644 --- a/mlprodict/asv_benchmark/template/skl_model_trainable_transform.py +++ b/mlprodict/asv_benchmark/template/skl_model_trainable_transform.py @@ -29,7 +29,7 @@ class TemplateBenchmarkTrainableTransform(_CommonAsvSklBenchmarkTrainableTransfo """ params = [ ['skl', 'pyrtc', 'ort'], # values for runtime - [1, 10, 100, 1000, 10000, 100000], # values for N + [1, 10, 100, 1000, 10000], # values for N [4, 20], # values for nf [get_opset_number_from_onnx()], # values for opset ['float', 'double'], # values for dtype diff --git a/mlprodict/asv_benchmark/template/skl_model_transform.py b/mlprodict/asv_benchmark/template/skl_model_transform.py index e7a630659..a6099bcd8 100644 --- a/mlprodict/asv_benchmark/template/skl_model_transform.py +++ b/mlprodict/asv_benchmark/template/skl_model_transform.py @@ -29,7 +29,7 @@ class TemplateBenchmarkTransform(_CommonAsvSklBenchmarkTransform): """ params = [ ['skl', 'pyrtc', 'ort'], # values for runtime - [1, 10, 100, 1000, 10000, 100000], # values for N + [1, 10, 100, 1000, 10000], # values for N [4, 20], # values for nf [get_opset_number_from_onnx()], # values for opset ['float', 'double'], # values for dtype diff --git a/mlprodict/asv_benchmark/template/skl_model_transform_positive.py b/mlprodict/asv_benchmark/template/skl_model_transform_positive.py index f520905d1..3e3fd097e 100644 --- a/mlprodict/asv_benchmark/template/skl_model_transform_positive.py +++ b/mlprodict/asv_benchmark/template/skl_model_transform_positive.py @@ -29,7 +29,7 @@ class TemplateBenchmarkTransformPositive(_CommonAsvSklBenchmarkTransformPositive """ params = [ ['skl', 'pyrtc', 'ort'], # values for runtime - [1, 10, 100, 1000, 10000, 100000], # values for N + [1, 10, 100, 1000, 10000], # values for N [4, 20], # values for nf [get_opset_number_from_onnx()], # values for opset ['float', 'double'], # values for dtype diff --git a/mlprodict/cli/asv_bench.py b/mlprodict/cli/asv_bench.py index 6fb2a4ce5..a24aaf4e1 100644 --- a/mlprodict/cli/asv_bench.py +++ b/mlprodict/cli/asv_bench.py @@ -10,7 +10,7 @@ def asv_bench(location='asvsklonnx', opset_min=-1, opset_max=None, runtime='scikit-learn,python_compiled', models=None, skip_models=None, extended_list=True, - dims='1,10,100,1000,10000,100000', + dims='1,10,100,1000,10000', n_features='4,20', dtype=None, verbose=1, fLOG=print, clean=True, flat=False, conf_params=None, build=None, add_pyspy=False, diff --git a/mlprodict/onnx_conv/operator_converters/conv_lightgbm.py b/mlprodict/onnx_conv/operator_converters/conv_lightgbm.py index 4ed67de71..694046755 100644 --- a/mlprodict/onnx_conv/operator_converters/conv_lightgbm.py +++ b/mlprodict/onnx_conv/operator_converters/conv_lightgbm.py @@ -110,8 +110,8 @@ def _parse_tree_structure(tree_id, class_id, learning_rate, tree_structure, attr except ValueError as e: # pragma: no cover import pprint text = pprint.pformat(tree_structure) - if len(text) > 100000: - text = text[:100000] + "\n..." + if len(text) > 99999: + text = text[:99999] + "\n..." raise TypeError("threshold must be a number not '{}'" "\n{}".format(tree_structure['threshold'], text)) from e else: @@ -173,8 +173,8 @@ def _parse_node(tree_id, class_id, node_id, node_id_pool, node_pyid_pool, except ValueError as e: # pragma: no cover import pprint text = pprint.pformat(node) - if len(text) > 100000: - text = text[:100000] + "\n..." + if len(text) > 99999: + text = text[:99999] + "\n..." raise TypeError("threshold must be a number not '{}'" "\n{}".format(node['threshold'], text)) from e else: diff --git a/mlprodict/onnxrt/validate/validate_helper.py b/mlprodict/onnxrt/validate/validate_helper.py index b03c27e7c..8db8ccde3 100644 --- a/mlprodict/onnxrt/validate/validate_helper.py +++ b/mlprodict/onnxrt/validate/validate_helper.py @@ -320,7 +320,6 @@ def default_time_kwargs(): 100: dict(number=8, repeat=10), 1000: dict(number=5, repeat=5), 10000: dict(number=3, repeat=3), - 100000: dict(number=2, repeat=1), }