Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _doc/examples/plot_op_onnx_topk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion _doc/examples/plot_opml_linear_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand Down
2 changes: 1 addition & 1 deletion _doc/examples/plot_opml_random_forest_cls_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion _doc/examples/plot_opml_random_forest_reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion _doc/examples/plot_parallelism.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion _doc/sphinxdoc/source/_exts/generate_automated_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:])
Expand Down
2 changes: 1 addition & 1 deletion _doc/sphinxdoc/source/onnx_bench.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
10 changes: 5 additions & 5 deletions _doc/sphinxdoc/source/tutorial/benchmarkorts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions _unittests/ut_onnxrt/test_benchmark_replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion mlprodict/asv_benchmark/common_asv_skl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mlprodict/asv_benchmark/create_asv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion mlprodict/asv_benchmark/template/skl_model_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mlprodict/asv_benchmark/template/skl_model_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mlprodict/asv_benchmark/template/skl_model_outlier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mlprodict/asv_benchmark/template/skl_model_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mlprodict/asv_benchmark/template/skl_model_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mlprodict/cli/asv_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions mlprodict/onnx_conv/operator_converters/conv_lightgbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion mlprodict/onnxrt/validate/validate_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}


Expand Down