.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gyexamples/plot_orttraining_benchmark_fwbw.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gyexamples_plot_orttraining_benchmark_fwbw.py: .. _l-orttraining-benchmark-fwbw: Benchmark, comparison scikit-learn - forward-backward ===================================================== The benchmark compares the processing time between :epkg:`scikit-learn` and :epkg:`onnxruntime-training` on a linear regression and a neural network. It replicates the benchmark implemented in :ref:`l-orttraining-benchmark` but uses the forward backward approach developped in :ref:`l-orttraining-linreg-fwbw`. .. contents:: :local: First comparison: neural network ++++++++++++++++++++++++++++++++ .. GENERATED FROM PYTHON SOURCE LINES 21-42 .. code-block:: default import warnings import time import numpy import matplotlib.pyplot as plt from pandas import DataFrame from onnxruntime import get_device from pyquickhelper.pycode.profiling import profile, profile2graph from sklearn.datasets import make_regression from sklearn.model_selection import train_test_split from sklearn.neural_network import MLPRegressor from mlprodict.onnx_conv import to_onnx from onnxcustom.utils.onnx_helper import onnx_rename_weights from onnxcustom.training.optimizers_partial import ( OrtGradientForwardBackwardOptimizer) X, y = make_regression(1000, n_features=100, bias=2) X = X.astype(numpy.float32) y = y.astype(numpy.float32) X_train, X_test, y_train, y_test = train_test_split(X, y) .. GENERATED FROM PYTHON SOURCE LINES 43-44 Benchmark function. .. GENERATED FROM PYTHON SOURCE LINES 44-74 .. code-block:: default def benchmark(X, y, skl_model, train_session, name, verbose=True): """ :param skl_model: model from scikit-learn :param train_session: instance of OrtGradientForwardBackwardOptimizer :param name: experiment name :param verbose: to debug """ print(f"[benchmark] {name}") begin = time.perf_counter() skl_model.fit(X, y) duration_skl = time.perf_counter() - begin length_skl = len(skl_model.loss_curve_) print( f"[benchmark] skl={length_skl!r} iterations - {duration_skl!r} seconds") begin = time.perf_counter() train_session.fit(X, y) duration_ort = time.perf_counter() - begin length_ort = len(train_session.train_losses_) print( f"[benchmark] ort={length_ort!r} iteration - {duration_ort!r} seconds") return dict(skl=duration_skl, ort=duration_ort, name=name, iter_skl=length_skl, iter_ort=length_ort, losses_skl=skl_model.loss_curve_, losses_ort=train_session.train_losses_) .. GENERATED FROM PYTHON SOURCE LINES 75-76 Common parameters and model .. GENERATED FROM PYTHON SOURCE LINES 76-90 .. code-block:: default batch_size = 15 max_iter = 100 nn = MLPRegressor(hidden_layer_sizes=(50, 10), max_iter=max_iter, solver='sgd', learning_rate_init=5e-4, alpha=0, n_iter_no_change=max_iter * 3, batch_size=batch_size, nesterovs_momentum=False, momentum=0, learning_rate="invscaling") with warnings.catch_warnings(): warnings.simplefilter('ignore') nn.fit(X_train, y_train) .. GENERATED FROM PYTHON SOURCE LINES 91-92 Conversion to ONNX and trainer initialization .. GENERATED FROM PYTHON SOURCE LINES 92-103 .. code-block:: default onx = to_onnx(nn, X_train[:1].astype(numpy.float32), target_opset=15) onx = onnx_rename_weights(onx) train_session = OrtGradientForwardBackwardOptimizer( onx, device='cpu', learning_rate=1e-5, warm_start=False, max_iter=max_iter, batch_size=batch_size) benches = [benchmark(X_train, y_train, nn, train_session, name='NN-CPU')] .. rst-class:: sphx-glr-script-out .. code-block:: none [benchmark] NN-CPU somewhere/workspace/onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:679: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet. warnings.warn( [benchmark] skl=100 iterations - 6.7421140319202095 seconds [benchmark] ort=100 iteration - 8.580952186952345 seconds .. GENERATED FROM PYTHON SOURCE LINES 104-106 Profiling +++++++++ .. GENERATED FROM PYTHON SOURCE LINES 106-130 .. code-block:: default def clean_name(text): pos = text.find('onnxruntime') if pos >= 0: return text[pos:] pos = text.find('sklearn') if pos >= 0: return text[pos:] pos = text.find('onnxcustom') if pos >= 0: return text[pos:] pos = text.find('site-packages') if pos >= 0: return text[pos:] return text ps = profile(lambda: benchmark(X_train, y_train, nn, train_session, name='NN-CPU'))[0] root, nodes = profile2graph(ps, clean_text=clean_name) text = root.to_text() print(text) .. rst-class:: sphx-glr-script-out .. code-block:: none [benchmark] NN-CPU somewhere/workspace/onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:679: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet. warnings.warn( [benchmark] skl=100 iterations - 7.738673658925109 seconds [benchmark] ort=100 iteration - 9.941554001998156 seconds isfunction -- 6 6 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/inspect.py:159:isfunction (isfunction) name -- 101 101 -- 0.00003 0.00003 -- /usr/local/lib/python3.9/inspect.py:2565:name (name) kind -- 82 82 -- 0.00003 0.00003 -- /usr/local/lib/python3.9/inspect.py:2577:kind (kind) parameters -- 7 7 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/inspect.py:2882:parameters (parameters) signature -- 3 3 -- 0.00001 0.00097 -- /usr/local/lib/python3.9/inspect.py:3128:signature (signature) from_callable -- 3 3 -- 0.00001 0.00096 -- /usr/local/lib/python3.9/inspect.py:2876:from_callable (from_callable) _signature_from_callable -- 3 3 -- 0.00007 0.00096 -- /usr/local/lib/python3.9/inspect.py:2244:_signature_from_callable (_signature_from_callable) isfunction -- 3 3 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/inspect.py:159:isfunction (isfunction) +++ unwrap -- 3 3 -- 0.00002 0.00003 -- /usr/local/lib/python3.9/inspect.py:494:unwrap (unwrap) _is_wrapper -- 3 3 -- 0.00000 0.00001 -- /usr/local/lib/python3.9/inspect.py:514:_is_wrapper (_is_wrapper) _signature_from_function -- 3 3 -- 0.00029 0.00084 -- /usr/local/lib/python3.9/inspect.py:2150:_signature_from_function (_signature_from_function) isfunction -- 3 3 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/inspect.py:159:isfunction (isfunction) +++ __init__ -- 34 34 -- 0.00022 0.00038 -- /usr/local/lib/python3.9/inspect.py:2515:__init__ (__init__) __call__ -- 34 34 -- 0.00009 0.00012 -- /usr/local/lib/python3.9/enum.py:289:__call__ (__call__) __new__ -- 34 34 -- 0.00003 0.00003 -- /usr/local/lib/python3.9/enum.py:580:__new__ (__new__) -- 34 34 -- 0.00003 0.00003 -- ~:0: () -- 34 34 -- 0.00002 0.00002 -- ~:0: () +++ __init__ -- 3 3 -- 0.00007 0.00013 -- /usr/local/lib/python3.9/inspect.py:2798:__init__ (__init__) -- 37 37 -- 0.00004 0.00005 -- /usr/local/lib/python3.9/inspect.py:2847: () name -- 34 34 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/inspect.py:2565:name (name) +++ -- 34 34 -- 0.00001 0.00001 -- ~:0: () +++ -- 58 58 -- 0.00002 0.00002 -- ~:0: () +++ filter -- 18 18 -- 0.00006 0.00016 -- /usr/local/lib/python3.9/logging/__init__.py:787:filter (filter) filter -- 12 12 -- 0.00002 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:351:filter (filter) filter -- 6 6 -- 0.00004 0.00005 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:484:filter (filter) -- 18 18 -- 0.00001 0.00001 -- ~:0: () +++ -- 18 18 -- 0.00003 0.00003 -- ~:0: () +++ acquire -- 30 30 -- 0.00005 0.00009 -- /usr/local/lib/python3.9/logging/__init__.py:892:acquire (acquire) -- 30 30 -- 0.00003 0.00003 -- ~:0: () release -- 30 30 -- 0.00005 0.00006 -- /usr/local/lib/python3.9/logging/__init__.py:899:release (release) -- 30 30 -- 0.00001 0.00001 -- ~:0: () emit -- 12 12 -- 0.00007 0.00092 -- /usr/local/lib/python3.9/logging/__init__.py:1067:emit (emit) format -- 12 12 -- 0.00003 0.00047 -- /usr/local/lib/python3.9/logging/__init__.py:912:format (format) format -- 12 12 -- 0.00008 0.00043 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:531:format (format) format -- 12 12 -- 0.00007 0.00032 -- /usr/local/lib/python3.9/logging/__init__.py:646:format (format) usesTime -- 12 12 -- 0.00002 0.00007 -- /usr/local/lib/python3.9/logging/__init__.py:624:usesTime (usesTime) usesTime -- 12 12 -- 0.00003 0.00005 -- /usr/local/lib/python3.9/logging/__init__.py:417:usesTime (usesTime) -- 12 12 -- 0.00002 0.00002 -- ~:0: () formatMessage -- 12 12 -- 0.00002 0.00008 -- /usr/local/lib/python3.9/logging/__init__.py:630:formatMessage (formatMessage) format -- 12 12 -- 0.00002 0.00006 -- /usr/local/lib/python3.9/logging/__init__.py:428:format (format) _format -- 12 12 -- 0.00004 0.00004 -- /usr/local/lib/python3.9/logging/__init__.py:425:_format (_format) getMessage -- 12 12 -- 0.00005 0.00011 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:89:getMessage (getMessage) getMessage -- 12 12 -- 0.00005 0.00005 -- /usr/local/lib/python3.9/logging/__init__.py:354:getMessage (getMessage) -- 12 12 -- 0.00001 0.00001 -- ~:0: () +++ colorize -- 2 2 -- 0.00001 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/console.py:72:colorize (colorize) escseq -- 4 4 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/console.py:73:escseq (escseq) -- 12 12 -- 0.00001 0.00001 -- ~:0: () +++ flush -- 12 12 -- 0.00006 0.00033 -- /usr/local/lib/python3.9/logging/__init__.py:1056:flush (flush) acquire -- 12 12 -- 0.00002 0.00003 -- /usr/local/lib/python3.9/logging/__init__.py:892:acquire (acquire) +++ release -- 12 12 -- 0.00002 0.00003 -- /usr/local/lib/python3.9/logging/__init__.py:899:release (release) +++ flush -- 6 6 -- 0.00002 0.00020 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:557:flush (flush) -- 6 6 -- 0.00018 0.00018 -- ~:0: () -- 12 12 -- 0.00001 0.00001 -- ~:0: () +++ write -- 6 6 -- 0.00002 0.00003 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:549:write (write) write -- 6 6 -- 0.00002 0.00003 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:567:write (write) isEnabledFor -- 12 12 -- 0.00002 0.00002 -- /usr/local/lib/python3.9/logging/__init__.py:1677:isEnabledFor (isEnabledFor) inner -- 6 6 -- 0.00002 0.00002 -- /usr/local/lib/python3.9/typing.py:256:inner (inner) cast -- 6 6 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/typing.py:1326:cast (cast) __init__ -- 2 2 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/warnings.py:403:__init__ (__init__) -- 1 1 -- 0.00001 17.68219 -- onnxcustom/onnxcustom_UT_39_std/_doc/examples/plot_orttraining_benchmark_fwbw.py:124: () benchmark -- 1 1 -- 0.00010 17.68219 -- onnxcustom/onnxcustom_UT_39_std/_doc/examples/plot_orttraining_benchmark_fwbw.py:46:benchmark (benchmark) fit -- 1 1 -- 0.00428 9.94152 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:288:fit (fit) __init__ -- 1 1 -- 0.00004 0.00008 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/data_loader.py:31:__init__ (__init__) get_ort_device -- 1 1 -- 0.00000 0.00000 -- onnxruntime_helper.py:63:get_ort_device (get_ort_device) numpy_to_ort_value -- 2 2 -- 0.00000 0.00002 -- onnxruntime_helper.py:133:numpy_to_ort_value (numpy_to_ort_value) +++ needs_grad -- 3 3 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:104:needs_grad (needs_grad) needs_grad -- 3 3 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_rate.py:194:needs_grad (needs_grad) get_full_state -- 101 101 -- 0.00060 0.00185 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:155:get_full_state (get_full_state) +++ set_state -- 2 2 -- 0.00009 0.00029 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:216:set_state (set_state) _get_att_state -- 2 2 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:147:_get_att_state (_get_att_state) +++ numpy_to_ort_value -- 12 12 -- 0.00003 0.00015 -- onnxruntime_helper.py:133:numpy_to_ort_value (numpy_to_ort_value) +++ -- 28 28 -- 0.00001 0.00001 -- ~:0: () +++ -- 12 12 -- 0.00001 0.00001 -- ~:0: () +++ -- 1 1 -- 0.00004 0.00212 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:339: () get_initializer -- 7 7 -- 0.00014 0.00209 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:278:get_initializer (get_initializer) to_array -- 6 6 -- 0.00016 0.00195 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/onnx/numpy_helper.py:35:to_array (to_array) uses_external_data -- 6 6 -- 0.00001 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/onnx/external_data_helper.py:273:uses_external_data (uses_external_data) tensor_dtype_to_np_dtype -- 12 12 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/onnx/helper.py:1137:tensor_dtype_to_np_dtype (tensor_dtype_to_np_dtype) tensor_dtype_to_storage_tensor_dtype -- 6 6 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/onnx/helper.py:1147:tensor_dtype_to_storage_tensor_dtype (tensor_dtype_to_storage_tensor_dtype) tensor_dtype_to_field -- 6 6 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/onnx/helper.py:1167:tensor_dtype_to_field (tensor_dtype_to_field) -- 12 12 -- 0.00003 0.00003 -- ~:0: () +++ -- 6 6 -- 0.00159 0.00159 -- ~:0: () +++ _iteration -- 100 100 -- 1.14051 9.87827 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:424:_iteration (_iteration) iter_ortvalue -- 5100 5100 -- 0.09284 0.51146 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/data_loader.py:147:iter_ortvalue (iter_ortvalue) _next_iter -- 5000 5000 -- 0.02890 0.27638 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/data_loader.py:98:_next_iter (_next_iter) -- 5000 5000 -- 0.23792 0.23792 -- ~:0: () -- 5000 5000 -- 0.00564 0.00955 -- ~:0: () +++ numpy_to_ort_value -- 10000 10000 -- 0.02078 0.11462 -- onnxruntime_helper.py:133:numpy_to_ort_value (numpy_to_ort_value) +++ -- 5200 5200 -- 0.01337 0.02762 -- ~:0: () +++ forward -- 5000 5000 -- 0.90311 1.17092 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:669:forward (forward) input_to_ort -- 5000 5000 -- 0.15747 0.22587 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:592:input_to_ort (input_to_ort) +++ save_for_backward -- 5000 5000 -- 0.03396 0.03396 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:644:save_for_backward (save_for_backward) -- 5000 5000 -- 0.00799 0.00799 -- ~:0: () +++ backward -- 5000 5000 -- 1.22054 1.35949 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:747:backward (backward) input_to_ort -- 5000 5000 -- 0.09584 0.12645 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:592:input_to_ort (input_to_ort) +++ saved_tensors -- 5000 5000 -- 0.00465 0.00465 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:656:saved_tensors (saved_tensors) -- 5000 5000 -- 0.00785 0.00785 -- ~:0: () loss_gradient -- 5000 5000 -- 1.30555 1.89041 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_loss.py:61:loss_gradient (loss_gradient) clear_binding_inputs -- 5000 5000 -- 0.01551 0.03591 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:145:clear_binding_inputs (clear_binding_inputs) _cache_in_clear -- 5000 5000 -- 0.01497 0.02040 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:134:_cache_in_clear (_cache_in_clear) -- 5000 5000 -- 0.00543 0.00543 -- ~:0: () +++ _bind_input_ortvalue -- 10000 10000 -- 0.05878 0.24194 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:177:_bind_input_ortvalue (_bind_input_ortvalue) +++ _call_iobinding -- 5000 5000 -- 0.29915 0.29915 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_loss.py:58:_call_iobinding (_call_iobinding) -- 10000 10000 -- 0.00785 0.00785 -- ~:0: () +++ penalty_loss -- 5000 5000 -- 0.00354 0.00354 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_penalty.py:101:penalty_loss (penalty_loss) update_weights -- 30000 30000 -- 0.01407 0.01407 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_penalty.py:115:update_weights (update_weights) update_weights -- 30000 30000 -- 1.02702 3.72939 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_rate.py:258:update_weights (update_weights) _bind_input_ortvalue -- 90000 90000 -- 0.32448 0.98387 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:177:_bind_input_ortvalue (_bind_input_ortvalue) +++ _bind_output_ortvalue -- 30000 30000 -- 0.10338 0.31148 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:221:_bind_output_ortvalue (_bind_output_ortvalue) _bio_cache -- 30000 30000 -- 0.07221 0.08894 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:156:_bio_cache (_bio_cache) +++ _bio_ptr -- 30000 30000 -- 0.10755 0.10755 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:173:_bio_ptr (_bio_ptr) +++ -- 30000 30000 -- 0.01162 0.01162 -- ~:0: () +++ _call_iobinding -- 30000 30000 -- 1.03680 1.03680 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_rate.py:33:_call_iobinding (_call_iobinding) value -- 30000 30000 -- 0.02599 0.02599 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_rate.py:186:value (value) +++ -- 30000 30000 -- 0.30947 0.30947 -- ~:0: () +++ -- 60000 60000 -- 0.03475 0.03475 -- ~:0: () +++ -- 100 100 -- 0.00055 0.01095 -- ~:0: () +++ -- 100 100 -- 0.00620 0.00620 -- ~:0: () +++ -- 5000 5000 -- 0.00470 0.00470 -- ~:0: () +++ -- 30100 30100 -- 0.03662 0.03662 -- ~:0: () +++ _create_training_session -- 1 1 -- 0.00003 0.05102 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:659:_create_training_session (_create_training_session) __init__ -- 1 1 -- 0.00014 0.05095 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:59:__init__ (__init__) -- 1 1 -- 0.00002 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:96: () -- 1 1 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:99: () -- 1 1 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:117: () _init_next -- 1 1 -- 0.00016 0.05076 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:169:_init_next (_init_next) -- 1 1 -- 0.00002 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:179: () -- 1 1 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:181: () -- 1 1 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:184: () _create_onnx_graphs -- 1 1 -- 0.00635 0.05056 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:299:_create_onnx_graphs (_create_onnx_graphs) -- 1 1 -- 0.00002 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:418: () -- 1 1 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:419: () -- 1 1 -- 0.00003 0.00004 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:421: () _provider_nam..._device_type -- 1 1 -- 0.00000 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:269:_provider_name_to_device_type (_provider_name_to_device_type) +++ -- 1 1 -- 0.00006 0.00008 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:426: () _provider_nam..._device_type -- 7 7 -- 0.00001 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:269:_provider_name_to_device_type (_provider_name_to_device_type) +++ -- 1 1 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:432: () _provider_nam..._device_type -- 1 1 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:269:_provider_name_to_device_type (_provider_name_to_device_type) +++ -- 1 1 -- 0.00002 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:511: () -- 1 1 -- 0.00002 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:512: () load_model -- 2 2 -- 0.00001 0.00091 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/onnx/__init__.py:116:load_model (load_model) _load_bytes -- 2 2 -- 0.00004 0.00006 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/onnx/__init__.py:30:_load_bytes (_load_bytes) inner -- 4 4 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/typing.py:256:inner (inner) +++ cast -- 4 4 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/typing.py:1326:cast (cast) +++ _get_file_path -- 2 2 -- 0.00000 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/onnx/__init__.py:50:_get_file_path (_get_file_path) load_model_from_string -- 2 2 -- 0.00002 0.00083 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/onnx/__init__.py:160:load_model_from_string (load_model_from_string) _deserialize -- 2 2 -- 0.00003 0.00081 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/onnx/__init__.py:89:_deserialize (_deserialize) inner -- 2 2 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/typing.py:256:inner (inner) +++ cast -- 2 2 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/typing.py:1326:cast (cast) +++ -- 2 2 -- 0.00077 0.00077 -- ~:0: () get_inputs -- 1 1 -- 0.00000 0.00000 -- onnxruntime/capi/onnxruntime_inference_collection.py:117:get_inputs (get_inputs) get_outputs -- 1 1 -- 0.00000 0.00000 -- onnxruntime/capi/onnxruntime_inference_collection.py:121:get_outputs (get_outputs) __init__ -- 2 2 -- 0.00007 0.04287 -- onnxruntime/capi/onnxruntime_inference_collection.py:308:__init__ (__init__) get -- 2 2 -- 0.00001 0.00007 -- /usr/local/lib/python3.9/_collections_abc.py:675:get (get) __getitem__ -- 2 2 -- 0.00003 0.00006 -- /usr/local/lib/python3.9/os.py:674:__getitem__ (__getitem__) encode -- 2 2 -- 0.00002 0.00003 -- /usr/local/lib/python3.9/os.py:754:encode (encode) __init__ -- 2 2 -- 0.00001 0.00001 -- onnxruntime/capi/onnxruntime_inference_collection.py:107:__init__ (__init__) _create_inference_session -- 2 2 -- 0.04254 0.04271 -- onnxruntime/capi/onnxruntime_inference_collection.py:371:_create_inference_session (_create_inference_session) check_and_n...vider_args -- 2 2 -- 0.00008 0.00015 -- onnxruntime/capi/onnxruntime_inference_collection.py:24:check_and_normalize_provider_args (check_and_normalize_provider_args) set_provider_options -- 2 2 -- 0.00002 0.00002 -- onnxruntime/capi/onnxruntime_inference_collection.py:52:set_provider_options (set_provider_options) -- 2 2 -- 0.00000 0.00000 -- onnxruntime/capi/onnxruntime_inference_collection.py:63: () -- 2 2 -- 0.00001 0.00001 -- onnxruntime/capi/onnxruntime_inference_collection.py:76: () -- 2 2 -- 0.00000 0.00000 -- onnxruntime/capi/onnxruntime_inference_collection.py:79: () -- 1 1 -- 0.00020 0.00020 -- ~:0: () -- 16 16 -- 0.00001 0.00001 -- ~:0: () +++ new_instance -- 1 1 -- 0.00000 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:217:new_instance (new_instance) __init__ -- 1 1 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:536:__init__ (__init__) device_to_providers -- 1 1 -- 0.00004 0.00004 -- onnxruntime_helper.py:149:device_to_providers (device_to_providers) value -- 100 100 -- 0.00009 0.00009 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_rate.py:186:value (value) +++ init_learning_rate -- 1 1 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_rate.py:205:init_learning_rate (init_learning_rate) update_learning_rate -- 100 100 -- 0.00276 0.00276 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_rate.py:226:update_learning_rate (update_learning_rate) proto_type_to_dtype -- 6 6 -- 0.00002 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/utils/onnx_helper.py:61:proto_type_to_dtype (proto_type_to_dtype) -- 6 6 -- 0.00055 0.00055 -- ~:0: () -- 107 107 -- 0.00007 0.00007 -- ~:0: () +++ -- 108 108 -- 0.00005 0.00005 -- ~:0: () +++ fit -- 1 1 -- 0.00002 7.73866 -- sklearn/neural_network/_multilayer_perceptron.py:723:fit (fit) _validate_params -- 1 1 -- 0.00002 0.00286 -- sklearn/base.py:562:_validate_params (_validate_params) get_params -- 1 1 -- 0.00003 0.00082 -- sklearn/base.py:153:get_params (get_params) _get_param_names -- 1 1 -- 0.00005 0.00078 -- sklearn/base.py:122:_get_param_names (_get_param_names) kind -- 23 23 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/inspect.py:2577:kind (kind) +++ parameters -- 1 1 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/inspect.py:2882:parameters (parameters) +++ signature -- 1 1 -- 0.00000 0.00064 -- /usr/local/lib/python3.9/inspect.py:3128:signature (signature) +++ -- 1 1 -- 0.00004 0.00006 -- sklearn/base.py:136: () name -- 24 24 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/inspect.py:2565:name (name) +++ kind -- 23 23 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/inspect.py:2577:kind (kind) +++ -- 1 1 -- 0.00001 0.00002 -- sklearn/base.py:151: () name -- 23 23 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/inspect.py:2565:name (name) +++ -- 23 23 -- 0.00002 0.00002 -- ~:0: () +++ validate_parameter_constraints -- 1 1 -- 0.00014 0.00202 -- sklearn/utils/_param_validation.py:28:validate_parameter_constraints (validate_parameter_constraints) +++ _fit -- 1 1 -- 0.00011 7.73578 -- sklearn/neural_network/_multilayer_perceptron.py:417:_fit (_fit) any -- 1 1 -- 0.00001 0.00008 -- <__array_function__ internals>:177:any (any) _any_dispatcher -- 1 1 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:2328:_any_dispatcher (_any_dispatcher) _initialize -- 1 1 -- 0.00004 0.00049 -- sklearn/neural_network/_multilayer_perceptron.py:357:_initialize (_initialize) is_classifier -- 1 1 -- 0.00000 0.00000 -- sklearn/base.py:993:is_classifier (is_classifier) _init_coef -- 3 3 -- 0.00008 0.00045 -- sklearn/neural_network/_multilayer_perceptron.py:400:_init_coef (_init_coef) -- 6 6 -- 0.00032 0.00032 -- ~:0: () -- 1 1 -- 0.00001 0.00002 -- sklearn/neural_network/_multilayer_perceptron.py:455: () -- 1 1 -- 0.00000 0.00001 -- sklearn/neural_network/_multilayer_perceptron.py:460: () _fit_stochastic -- 1 1 -- 0.20103 7.73381 -- sklearn/neural_network/_multilayer_perceptron.py:540:_fit_stochastic (_fit_stochastic) clip -- 1 1 -- 0.00000 0.00016 -- <__array_function__ internals>:177:clip (clip) _clip_dispatcher -- 1 1 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:2107:_clip_dispatcher (_clip_dispatcher) -- 1 1 -- 0.00000 0.00016 -- ~:0: () +++ _backprop -- 5000 5000 -- 0.41618 5.78974 -- sklearn/neural_network/_multilayer_perceptron.py:278:_backprop (_backprop) dot -- 15000 15000 -- 0.05229 0.21245 -- <__array_function__ internals>:177:dot (dot) dot -- 15000 15000 -- 0.00926 0.00926 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/multiarray.py:740:dot (dot) -- 15000 15000 -- 0.15090 0.15090 -- ~:0: () +++ inplace_relu_derivative -- 10000 10000 -- 0.31373 0.31373 -- sklearn/neural_network/_base.py:132:inplace_relu_derivative (inplace_relu_derivative) squared_loss -- 5000 5000 -- 0.16139 0.56343 -- sklearn/neural_network/_base.py:158:squared_loss (squared_loss) -- 5000 5000 -- 0.02052 0.40204 -- ~:0: () +++ _forward_pass -- 5000 5000 -- 0.36596 1.04699 -- sklearn/neural_network/_multilayer_perceptron.py:156:_forward_pass (_forward_pass) inplace_identity -- 5000 5000 -- 0.00360 0.00360 -- sklearn/neural_network/_base.py:13:inplace_identity (inplace_identity) inplace_relu -- 10000 10000 -- 0.18498 0.18498 -- sklearn/neural_network/_base.py:47:inplace_relu (inplace_relu) safe_sparse_dot -- 15000 15000 -- 0.46051 0.49245 -- sklearn/utils/extmath.py:156:safe_sparse_dot (safe_sparse_dot) +++ _compute_loss_grad -- 15000 15000 -- 0.84857 2.97290 -- sklearn/neural_network/_multilayer_perceptron.py:214:_compute_loss_grad (_compute_loss_grad) mean -- 15000 15000 -- 0.05883 1.61252 -- <__array_function__ internals>:177:mean (mean) _mean_dispatcher -- 15000 15000 -- 0.01043 0.01043 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3340:_mean_dispatcher (_mean_dispatcher) -- 15000 15000 -- 0.04918 1.54325 -- ~:0: () +++ safe_sparse_dot -- 15000 15000 -- 0.47966 0.51181 -- sklearn/utils/extmath.py:156:safe_sparse_dot (safe_sparse_dot) +++ safe_sparse_dot -- 10000 10000 -- 0.21871 0.23984 -- sklearn/utils/extmath.py:156:safe_sparse_dot (safe_sparse_dot) +++ -- 15000 15000 -- 0.02422 0.02422 -- ~:0: () _update_no_improvement_count -- 100 100 -- 0.00053 0.00053 -- sklearn/neural_network/_multilayer_perceptron.py:694:_update_no_improvement_count (_update_no_improvement_count) update_params -- 5000 5000 -- 0.25584 1.40933 -- sklearn/neural_network/_stochastic_optimizers.py:29:update_params (update_params) -- 35000 35000 -- 0.02199 0.02199 -- sklearn/neural_network/_stochastic_optimizers.py:43: () _get_updates -- 5000 5000 -- 0.04984 1.13150 -- sklearn/neural_network/_stochastic_optimizers.py:169:_get_updates (_get_updates) -- 5000 5000 -- 1.08166 1.08166 -- sklearn/neural_network/_stochastic_optimizers.py:183: () __init__ -- 1 1 -- 0.00001 0.00029 -- sklearn/neural_network/_stochastic_optimizers.py:121:__init__ (__init__) __init__ -- 1 1 -- 0.00000 0.00000 -- sklearn/neural_network/_stochastic_optimizers.py:25:__init__ (__init__) -- 1 1 -- 0.00002 0.00027 -- sklearn/neural_network/_stochastic_optimizers.py:136: () zeros_like -- 6 6 -- 0.00002 0.00025 -- <__array_function__ internals>:177:zeros_like (zeros_like) _zeros_like_dispatcher -- 6 6 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/numeric.py:73:_zeros_like_dispatcher (_zeros_like_dispatcher) -- 6 6 -- 0.00002 0.00023 -- ~:0: () +++ iteration_ends -- 100 100 -- 0.00100 0.00100 -- sklearn/neural_network/_stochastic_optimizers.py:138:iteration_ends (iteration_ends) _safe_indexing -- 5000 5000 -- 0.03959 0.27465 -- sklearn/utils/__init__.py:285:_safe_indexing (_safe_indexing) +++ shuffle -- 100 100 -- 0.00095 0.03101 -- sklearn/utils/__init__.py:617:shuffle (shuffle) resample -- 100 100 -- 0.00248 0.03006 -- sklearn/utils/__init__.py:467:resample (resample) -- 100 100 -- 0.00033 0.00055 -- sklearn/utils/__init__.py:608: () isspmatrix -- 100 100 -- 0.00012 0.00023 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/scipy/sparse/_base.py:1301:isspmatrix (isspmatrix) +++ -- 100 100 -- 0.00030 0.00462 -- sklearn/utils/__init__.py:609: () _safe_indexing -- 100 100 -- 0.00078 0.00432 -- sklearn/utils/__init__.py:285:_safe_indexing (_safe_indexing) +++ check_consistent_length -- 100 100 -- 0.00091 0.01386 -- sklearn/utils/validation.py:383:check_consistent_length (check_consistent_length) +++ check_random_state -- 100 100 -- 0.00057 0.00179 -- sklearn/utils/validation.py:1197:check_random_state (check_random_state) +++ -- 100 100 -- 0.00510 0.00510 -- ~:0: () -- 100 100 -- 0.00137 0.00137 -- ~:0: () +++ -- 100 100 -- 0.00016 0.00016 -- ~:0: () +++ -- 200 200 -- 0.00013 0.00013 -- ~:0: () +++ gen_batches -- 5100 5100 -- 0.02447 0.02503 -- sklearn/utils/__init__.py:728:gen_batches (gen_batches) -- 100 100 -- 0.00022 0.00057 -- ~:0: () +++ -- 100 100 -- 0.00010 0.00010 -- ~:0: () +++ -- 1 1 -- 0.00006 0.00092 -- ~:0: () _showwarnmsg -- 1 1 -- 0.00001 0.00086 -- /usr/local/lib/python3.9/warnings.py:96:_showwarnmsg (_showwarnmsg) _showwarning -- 1 1 -- 0.00001 0.00085 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx_gallery/gen_rst.py:557:_showwarning (_showwarning) formatwarning -- 1 1 -- 0.00001 0.00005 -- /usr/local/lib/python3.9/warnings.py:15:formatwarning (formatwarning) _formatwarnmsg_impl -- 1 1 -- 0.00003 0.00004 -- /usr/local/lib/python3.9/warnings.py:35:_formatwarnmsg_impl (_formatwarnmsg_impl) getline -- 1 1 -- 0.00000 0.00001 -- /usr/local/lib/python3.9/linecache.py:26:getline (getline) getlines -- 1 1 -- 0.00000 0.00001 -- /usr/local/lib/python3.9/linecache.py:36:getlines (getlines) __init__ -- 1 1 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/warnings.py:403:__init__ (__init__) +++ write -- 1 1 -- 0.00002 0.00079 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx_gallery/gen_rst.py:83:write (write) +++ __init__ -- 1 1 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/warnings.py:403:__init__ (__init__) +++ _validate_input -- 1 1 -- 0.00002 0.00101 -- sklearn/neural_network/_multilayer_perceptron.py:1582:_validate_input (_validate_input) _validate_data -- 1 1 -- 0.00002 0.00099 -- sklearn/base.py:453:_validate_data (_validate_data) _check_n_features -- 1 1 -- 0.00000 0.00002 -- sklearn/base.py:318:_check_n_features (_check_n_features) _num_features -- 1 1 -- 0.00001 0.00001 -- sklearn/utils/validation.py:267:_num_features (_num_features) _check_feature_names -- 1 1 -- 0.00000 0.00001 -- sklearn/base.py:364:_check_feature_names (_check_feature_names) _get_feature_names -- 1 1 -- 0.00000 0.00000 -- sklearn/utils/validation.py:1860:_get_feature_names (_get_feature_names) check_X_y -- 1 1 -- 0.00001 0.00095 -- sklearn/utils/validation.py:979:check_X_y (check_X_y) check_consistent_length -- 1 1 -- 0.00001 0.00017 -- sklearn/utils/validation.py:383:check_consistent_length (check_consistent_length) +++ check_array -- 1 1 -- 0.00005 0.00047 -- sklearn/utils/validation.py:629:check_array (check_array) +++ _check_y -- 1 1 -- 0.00001 0.00030 -- sklearn/utils/validation.py:1127:_check_y (_check_y) check_array -- 1 1 -- 0.00004 0.00029 -- sklearn/utils/validation.py:629:check_array (check_array) +++ check_random_state -- 1 1 -- 0.00000 0.00000 -- sklearn/utils/validation.py:1197:check_random_state (check_random_state) +++ -- 1 1 -- 0.00001 0.00023 -- ~:0: () +++ -- 3 3 -- 0.00003 0.00190 -- ~:0: () write -- 6 6 -- 0.00008 0.00186 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx_gallery/gen_rst.py:83:write (write) +++ _bio_cache -- 130000 130000 -- 0.33028 0.40879 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:156:_bio_cache (_bio_cache) -- 130000 130000 -- 0.07851 0.07851 -- ~:0: () +++ _bio_ptr -- 130000 130000 -- 0.48423 0.48423 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:173:_bio_ptr (_bio_ptr) _bind_input_ortvalue -- 100000 100000 -- 0.38325 1.22581 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:177:_bind_input_ortvalue (_bind_input_ortvalue) _bio_cache -- 100000 100000 -- 0.25807 0.31986 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:156:_bio_cache (_bio_cache) +++ _bio_do_bind_in -- 10597 10597 -- 0.10562 0.10562 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:169:_bio_do_bind_in (_bio_do_bind_in) _bio_ptr -- 100000 100000 -- 0.37668 0.37668 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/_base_onnx_function.py:173:_bio_ptr (_bio_ptr) +++ -- 100000 100000 -- 0.04040 0.04040 -- ~:0: () +++ _get_att_state -- 103 103 -- 0.00010 0.00010 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:147:_get_att_state (_get_att_state) get_full_state -- 101 201 -- 0.00100 0.00185 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:155:get_full_state (get_full_state) _get_att_state -- 101 101 -- 0.00009 0.00009 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:147:_get_att_state (_get_att_state) +++ -- 100 100 -- 0.00046 0.00120 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:163: () get_full_state -- 100 100 -- 0.00040 0.00075 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/optimizers_partial.py:155:get_full_state (get_full_state) +++ -- 101 101 -- 0.00005 0.00005 -- ~:0: () +++ -- 101 101 -- 0.00006 0.00006 -- ~:0: () +++ -- 201 201 -- 0.00019 0.00019 -- ~:0: () +++ _provider_name_to_device_type -- 9 9 -- 0.00002 0.00003 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:269:_provider_name_to_device_type (_provider_name_to_device_type) input_to_ort -- 10000 10000 -- 0.25331 0.35231 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:592:input_to_ort (input_to_ort) -- 10000 10000 -- 0.03361 0.06633 -- ~:0: () +++ -- 10000 10000 -- 0.02660 0.02660 -- ~:0: () +++ -- 10000 10000 -- 0.00607 0.00607 -- ~:0: () +++ value -- 30100 30100 -- 0.02608 0.02608 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/sgd_learning_rate.py:186:value (value) _mean -- 20100 20100 -- 0.70561 1.78320 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_methods.py:164:_mean (_mean) __enter__ -- 15000 15000 -- 0.03751 0.11019 -- /usr/local/lib/python3.9/contextlib.py:112:__enter__ (__enter__) -- 15000 15000 -- 0.01392 0.07268 -- ~:0: () +++ __exit__ -- 15000 15000 -- 0.06841 0.15410 -- /usr/local/lib/python3.9/contextlib.py:121:__exit__ (__exit__) -- 15000 15000 -- 0.02446 0.08569 -- ~:0: () +++ helper -- 15000 15000 -- 0.04956 0.13764 -- /usr/local/lib/python3.9/contextlib.py:242:helper (helper) __init__ -- 15000 15000 -- 0.07522 0.08808 -- /usr/local/lib/python3.9/contextlib.py:86:__init__ (__init__) -- 15000 15000 -- 0.01286 0.01286 -- ~:0: () +++ _count_reduce_items -- 20100 20100 -- 0.23316 0.27075 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_methods.py:67:_count_reduce_items (_count_reduce_items) -- 25200 25200 -- 0.02360 0.02360 -- ~:0: () -- 15000 15000 -- 0.01399 0.01399 -- ~:0: () +++ -- 20100 20100 -- 0.01002 0.01002 -- ~:0: () +++ -- 20100 20100 -- 0.35009 0.35009 -- ~:0: () +++ -- 5100 5100 -- 0.00704 0.00704 -- ~:0: () +++ -- 20100 20100 -- 0.01333 0.01333 -- ~:0: () +++ -- 40200 40200 -- 0.02444 0.02444 -- ~:0: () seterr -- 4 4 -- 0.00004 0.00008 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_ufunc_config.py:33:seterr (seterr) geterr -- 4 4 -- 0.00002 0.00003 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_ufunc_config.py:132:geterr (geterr) _wrapreduction -- 3 3 -- 0.00003 0.00018 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:69:_wrapreduction (_wrapreduction) -- 3 3 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:70: () -- 3 3 -- 0.00015 0.00015 -- ~:0: () +++ isspmatrix -- 45202 45202 -- 0.05159 0.09313 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/scipy/sparse/_base.py:1301:isspmatrix (isspmatrix) -- 45202 45202 -- 0.04154 0.04154 -- ~:0: () +++ write -- 7 7 -- 0.00010 0.00265 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx_gallery/gen_rst.py:83:write (write) verbose -- 6 6 -- 0.00004 0.00253 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:128:verbose (verbose) log -- 6 6 -- 0.00006 0.00249 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:121:log (log) log -- 6 6 -- 0.00007 0.00243 -- /usr/local/lib/python3.9/logging/__init__.py:1825:log (log) log -- 6 6 -- 0.00006 0.00227 -- /usr/local/lib/python3.9/logging/__init__.py:1485:log (log) _log -- 6 6 -- 0.00004 0.00220 -- /usr/local/lib/python3.9/logging/__init__.py:1553:_log (_log) findCaller -- 6 6 -- 0.00008 0.00014 -- /usr/local/lib/python3.9/logging/__init__.py:1502:findCaller (findCaller) -- 6 6 -- 0.00002 0.00002 -- /usr/local/lib/python3.9/logging/__init__.py:156: () normcase -- 12 12 -- 0.00002 0.00003 -- /usr/local/lib/python3.9/posixpath.py:52:normcase (normcase) -- 12 12 -- 0.00001 0.00001 -- ~:0: () +++ -- 12 12 -- 0.00001 0.00001 -- ~:0: () +++ makeRecord -- 6 6 -- 0.00005 0.00066 -- /usr/local/lib/python3.9/logging/__init__.py:1538:makeRecord (makeRecord) __init__ -- 6 6 -- 0.00026 0.00061 -- /usr/local/lib/python3.9/logging/__init__.py:278:__init__ (__init__) getLevelName -- 6 6 -- 0.00004 0.00005 -- /usr/local/lib/python3.9/logging/__init__.py:119:getLevelName (getLevelName) -- 12 12 -- 0.00001 0.00001 -- ~:0: () +++ current_process -- 6 6 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/multiprocessing/process.py:37:current_process (current_process) name -- 6 6 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/multiprocessing/process.py:189:name (name) splitext -- 6 6 -- 0.00003 0.00008 -- /usr/local/lib/python3.9/posixpath.py:117:splitext (splitext) _splitext -- 6 6 -- 0.00003 0.00005 -- /usr/local/lib/python3.9/genericpath.py:121:_splitext (_splitext) -- 12 12 -- 0.00001 0.00001 -- ~:0: () +++ basename -- 6 6 -- 0.00004 0.00007 -- /usr/local/lib/python3.9/posixpath.py:140:basename (basename) _get_sep -- 6 6 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/posixpath.py:41:_get_sep (_get_sep) name -- 6 6 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/threading.py:1053:name (name) current_thread -- 6 6 -- 0.00001 0.00002 -- /usr/local/lib/python3.9/threading.py:1318:current_thread (current_thread) handle -- 6 6 -- 0.00002 0.00136 -- /usr/local/lib/python3.9/logging/__init__.py:1579:handle (handle) filter -- 6 6 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/logging/__init__.py:787:filter (filter) +++ callHandlers -- 6 6 -- 0.00006 0.00133 -- /usr/local/lib/python3.9/logging/__init__.py:1633:callHandlers (callHandlers) handle -- 12 12 -- 0.00006 0.00127 -- /usr/local/lib/python3.9/logging/__init__.py:935:handle (handle) filter -- 12 12 -- 0.00006 0.00015 -- /usr/local/lib/python3.9/logging/__init__.py:787:filter (filter) +++ acquire -- 12 12 -- 0.00003 0.00005 -- /usr/local/lib/python3.9/logging/__init__.py:892:acquire (acquire) +++ release -- 12 12 -- 0.00001 0.00002 -- /usr/local/lib/python3.9/logging/__init__.py:899:release (release) +++ emit -- 6 6 -- 0.00003 0.00031 -- /usr/local/lib/python3.9/logging/__init__.py:1067:emit (emit) +++ emit -- 6 6 -- 0.00005 0.00069 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:151:emit (emit) acquire -- 6 6 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/logging/__init__.py:892:acquire (acquire) +++ release -- 6 6 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/logging/__init__.py:899:release (release) +++ emit -- 6 6 -- 0.00004 0.00062 -- /usr/local/lib/python3.9/logging/__init__.py:1067:emit (emit) +++ isEnabledFor -- 6 6 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/logging/__init__.py:1677:isEnabledFor (isEnabledFor) +++ isEnabledFor -- 6 6 -- 0.00002 0.00003 -- /usr/local/lib/python3.9/logging/__init__.py:1834:isEnabledFor (isEnabledFor) isEnabledFor -- 6 6 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/logging/__init__.py:1677:isEnabledFor (isEnabledFor) +++ process -- 6 6 -- 0.00004 0.00005 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sphinx/util/logging.py:131:process (process) numpy_to_ort_value -- 10014 10014 -- 0.02081 0.11479 -- onnxruntime_helper.py:133:numpy_to_ort_value (numpy_to_ort_value) -- 10014 10014 -- 0.09399 0.09399 -- ~:0: () +++ get_config -- 6 6 -- 0.00002 0.00004 -- sklearn/_config.py:30:get_config (get_config) _get_threadlocal_config -- 6 6 -- 0.00001 0.00001 -- sklearn/_config.py:22:_get_threadlocal_config (_get_threadlocal_config) _safe_indexing -- 5100 5100 -- 0.04036 0.27897 -- sklearn/utils/__init__.py:285:_safe_indexing (_safe_indexing) _array_indexing -- 5100 5100 -- 0.12826 0.13791 -- sklearn/utils/__init__.py:179:_array_indexing (_array_indexing) isspmatrix -- 5100 5100 -- 0.00413 0.00766 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/scipy/sparse/_base.py:1301:isspmatrix (isspmatrix) +++ -- 5100 5100 -- 0.00199 0.00199 -- ~:0: () +++ _determine_key_type -- 5100 5100 -- 0.07020 0.09128 -- sklearn/utils/__init__.py:215:_determine_key_type (_determine_key_type) -- 5100 5100 -- 0.00461 0.00461 -- ~:0: () -- 5100 5100 -- 0.00301 0.00301 -- ~:0: () +++ -- 15300 15300 -- 0.01346 0.01346 -- ~:0: () +++ -- 10200 10200 -- 0.00942 0.00942 -- ~:0: () +++ __getattr__ -- 6 6 -- 0.00001 0.00001 -- sklearn/utils/_array_api.py:63:__getattr__ (__getattr__) asarray -- 4 4 -- 0.00001 0.00001 -- sklearn/utils/_array_api.py:70:asarray (asarray) get_namespace -- 4 4 -- 0.00001 0.00005 -- sklearn/utils/_array_api.py:90:get_namespace (get_namespace) get_config -- 4 4 -- 0.00002 0.00003 -- sklearn/_config.py:30:get_config (get_config) +++ validate_parameter_constraints -- 1 3 -- 0.00020 0.00202 -- sklearn/utils/_param_validation.py:28:validate_parameter_constraints (validate_parameter_constraints) -- 23 31 -- 0.00006 0.00129 -- sklearn/utils/_param_validation.py:74: () make_constraint -- 26 42 -- 0.00014 0.00125 -- sklearn/utils/_param_validation.py:103:make_constraint (make_constraint) __init__ -- 5 5 -- 0.00001 0.00001 -- sklearn/utils/_param_validation.py:226:__init__ (__init__) +++ __init__ -- 10 10 -- 0.00003 0.00004 -- sklearn/utils/_param_validation.py:258:__init__ (__init__) +++ __init__ -- 1 1 -- 0.00002 0.00050 -- sklearn/utils/_param_validation.py:505:__init__ (__init__) wrapper -- 1 1 -- 0.00003 0.00047 -- sklearn/utils/_param_validation.py:169:wrapper (wrapper) +++ __init__ -- 2 2 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:226:__init__ (__init__) +++ __init__ -- 1 1 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:258:__init__ (__init__) +++ __init__ -- 4 4 -- 0.00005 0.00009 -- sklearn/utils/_param_validation.py:530:__init__ (__init__) __init__ -- 4 4 -- 0.00001 0.00001 -- sklearn/utils/_param_validation.py:226:__init__ (__init__) +++ __init__ -- 12 12 -- 0.00003 0.00004 -- sklearn/utils/_param_validation.py:258:__init__ (__init__) +++ __init__ -- 1 1 -- 0.00002 0.00043 -- sklearn/utils/_param_validation.py:563:__init__ (__init__) wrapper -- 1 1 -- 0.00002 0.00041 -- sklearn/utils/_param_validation.py:169:wrapper (wrapper) +++ __init__ -- 1 1 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:226:__init__ (__init__) +++ __init__ -- 2 2 -- 0.00001 0.00001 -- sklearn/utils/_param_validation.py:258:__init__ (__init__) +++ -- 192 192 -- 0.00012 0.00017 -- ~:0: () +++ is_satisfied_by -- 7 7 -- 0.00001 0.00004 -- sklearn/utils/_param_validation.py:262:is_satisfied_by (is_satisfied_by) +++ is_satisfied_by -- 1 1 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:272:is_satisfied_by (is_satisfied_by) +++ is_satisfied_by -- 6 6 -- 0.00001 0.00001 -- sklearn/utils/_param_validation.py:328:is_satisfied_by (is_satisfied_by) is_satisfied_by -- 13 13 -- 0.00003 0.00043 -- sklearn/utils/_param_validation.py:450:is_satisfied_by (is_satisfied_by) +++ is_satisfied_by -- 1 1 -- 0.00000 0.00002 -- sklearn/utils/_param_validation.py:471:is_satisfied_by (is_satisfied_by) _is_arraylike_not_scalar -- 1 1 -- 0.00001 0.00002 -- sklearn/utils/validation.py:262:_is_arraylike_not_scalar (_is_arraylike_not_scalar) isscalar -- 1 1 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/numeric.py:1878:isscalar (isscalar) _is_arraylike -- 1 1 -- 0.00000 0.00000 -- sklearn/utils/validation.py:257:_is_arraylike (_is_arraylike) is_satisfied_by -- 1 1 -- 0.00001 0.00002 -- sklearn/utils/_param_validation.py:513:is_satisfied_by (is_satisfied_by) -- 1 1 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:514: () +++ is_satisfied_by -- 4 4 -- 0.00003 0.00007 -- sklearn/utils/_param_validation.py:538:is_satisfied_by (is_satisfied_by) -- 4 4 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:547: () +++ is_satisfied_by -- 1 1 -- 0.00001 0.00003 -- sklearn/utils/_param_validation.py:571:is_satisfied_by (is_satisfied_by) -- 1 1 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:572: () +++ wrapper -- 2 2 -- 0.00006 0.00088 -- sklearn/utils/_param_validation.py:169:wrapper (wrapper) apply_defaults -- 2 2 -- 0.00003 0.00004 -- /usr/local/lib/python3.9/inspect.py:2718:apply_defaults (apply_defaults) parameters -- 2 2 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/inspect.py:2882:parameters (parameters) +++ parameters -- 2 2 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/inspect.py:2882:parameters (parameters) +++ bind -- 2 2 -- 0.00001 0.00013 -- /usr/local/lib/python3.9/inspect.py:3057:bind (bind) _bind -- 2 2 -- 0.00009 0.00012 -- /usr/local/lib/python3.9/inspect.py:2926:_bind (_bind) name -- 20 20 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/inspect.py:2565:name (name) +++ kind -- 26 26 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/inspect.py:2577:kind (kind) +++ __init__ -- 2 2 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/inspect.py:2657:__init__ (__init__) parameters -- 2 2 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/inspect.py:2882:parameters (parameters) +++ -- 20 20 -- 0.00001 0.00001 -- ~:0: () +++ signature -- 2 2 -- 0.00001 0.00034 -- /usr/local/lib/python3.9/inspect.py:3128:signature (signature) +++ validate_parameter_constraints -- 2 2 -- 0.00005 0.00025 -- sklearn/utils/_param_validation.py:28:validate_parameter_constraints (validate_parameter_constraints) +++ -- 2 2 -- 0.00002 0.00002 -- sklearn/utils/_param_validation.py:179: () kind -- 10 10 -- 0.00000 0.00000 -- /usr/local/lib/python3.9/inspect.py:2577:kind (kind) +++ -- 2 2 -- 0.00001 0.00001 -- sklearn/utils/_param_validation.py:185: () __init__ -- 2 2 -- 0.00001 0.00004 -- sklearn/utils/_param_validation.py:395:__init__ (__init__) __init__ -- 2 2 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:226:__init__ (__init__) +++ _check_params -- 2 2 -- 0.00001 0.00003 -- sklearn/utils/_param_validation.py:412:_check_params (_check_params) __init__ -- 39 39 -- 0.00004 0.00004 -- sklearn/utils/_param_validation.py:226:__init__ (__init__) __init__ -- 25 25 -- 0.00007 0.00010 -- sklearn/utils/_param_validation.py:258:__init__ (__init__) __init__ -- 25 25 -- 0.00003 0.00003 -- sklearn/utils/_param_validation.py:226:__init__ (__init__) +++ is_satisfied_by -- 12 12 -- 0.00001 0.00005 -- sklearn/utils/_param_validation.py:262:is_satisfied_by (is_satisfied_by) -- 12 12 -- 0.00001 0.00004 -- ~:0: () +++ is_satisfied_by -- 2 2 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:272:is_satisfied_by (is_satisfied_by) is_satisfied_by -- 15 15 -- 0.00003 0.00046 -- sklearn/utils/_param_validation.py:450:is_satisfied_by (is_satisfied_by) __contains__ -- 14 14 -- 0.00029 0.00031 -- sklearn/utils/_param_validation.py:434:__contains__ (__contains__) -- 12 12 -- 0.00001 0.00001 -- ~:0: () -- 13 13 -- 0.00001 0.00001 -- ~:0: () -- 15 15 -- 0.00003 0.00012 -- ~:0: () +++ -- 4 4 -- 0.00001 0.00001 -- sklearn/utils/_param_validation.py:514: () is_satisfied_by -- 1 1 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:262:is_satisfied_by (is_satisfied_by) +++ is_satisfied_by -- 1 1 -- 0.00000 0.00000 -- sklearn/utils/_param_validation.py:272:is_satisfied_by (is_satisfied_by) +++ is_satisfied_by -- 1 1 -- 0.00000 0.00001 -- sklearn/utils/_param_validation.py:450:is_satisfied_by (is_satisfied_by) +++ -- 8 8 -- 0.00001 0.00002 -- sklearn/utils/_param_validation.py:547: () is_satisfied_by -- 4 4 -- 0.00000 0.00001 -- sklearn/utils/_param_validation.py:262:is_satisfied_by (is_satisfied_by) +++ -- 2 2 -- 0.00000 0.00003 -- sklearn/utils/_param_validation.py:572: () is_satisfied_by -- 1 1 -- 0.00000 0.00002 -- sklearn/utils/_param_validation.py:450:is_satisfied_by (is_satisfied_by) +++ safe_sparse_dot -- 40000 40000 -- 1.15888 1.24411 -- sklearn/utils/extmath.py:156:safe_sparse_dot (safe_sparse_dot) isspmatrix -- 40000 40000 -- 0.04734 0.08524 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/scipy/sparse/_base.py:1301:isspmatrix (isspmatrix) +++ _num_samples -- 104 104 -- 0.00226 0.00394 -- sklearn/utils/validation.py:320:_num_samples (_num_samples) -- 312 312 -- 0.00036 0.00036 -- ~:0: () +++ -- 104 104 -- 0.00022 0.00128 -- ~:0: () +++ -- 104 104 -- 0.00005 0.00005 -- ~:0: () +++ check_consistent_length -- 101 101 -- 0.00092 0.01403 -- sklearn/utils/validation.py:383:check_consistent_length (check_consistent_length) unique -- 101 101 -- 0.00052 0.00889 -- <__array_function__ internals>:177:unique (unique) _unique_dispatcher -- 101 101 -- 0.00007 0.00007 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/lib/arraysetops.py:133:_unique_dispatcher (_unique_dispatcher) -- 101 101 -- 0.00067 0.00830 -- ~:0: () +++ -- 101 101 -- 0.00029 0.00417 -- sklearn/utils/validation.py:394: () _num_samples -- 102 102 -- 0.00223 0.00388 -- sklearn/utils/validation.py:320:_num_samples (_num_samples) +++ -- 101 101 -- 0.00005 0.00005 -- ~:0: () +++ check_array -- 2 2 -- 0.00009 0.00076 -- sklearn/utils/validation.py:629:check_array (check_array) simplefilter -- 2 2 -- 0.00001 0.00005 -- /usr/local/lib/python3.9/warnings.py:165:simplefilter (simplefilter) _add_filter -- 2 2 -- 0.00003 0.00004 -- /usr/local/lib/python3.9/warnings.py:181:_add_filter (_add_filter) __init__ -- 2 2 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/warnings.py:437:__init__ (__init__) __enter__ -- 2 2 -- 0.00002 0.00003 -- /usr/local/lib/python3.9/warnings.py:458:__enter__ (__enter__) __exit__ -- 2 2 -- 0.00001 0.00001 -- /usr/local/lib/python3.9/warnings.py:477:__exit__ (__exit__) isspmatrix -- 2 2 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/scipy/sparse/_base.py:1301:isspmatrix (isspmatrix) +++ get_namespace -- 2 2 -- 0.00001 0.00003 -- sklearn/utils/_array_api.py:90:get_namespace (get_namespace) +++ _asarray_with_order -- 2 2 -- 0.00002 0.00004 -- sklearn/utils/_array_api.py:168:_asarray_with_order (_asarray_with_order) __getattr__ -- 2 2 -- 0.00000 0.00000 -- sklearn/utils/_array_api.py:63:__getattr__ (__getattr__) +++ asarray -- 2 2 -- 0.00000 0.00001 -- sklearn/utils/_array_api.py:70:asarray (asarray) +++ _assert_all_finite -- 2 2 -- 0.00010 0.00041 -- sklearn/utils/validation.py:96:_assert_all_finite (_assert_all_finite) sum -- 2 2 -- 0.00001 0.00017 -- <__array_function__ internals>:177:sum (sum) _sum_dispatcher -- 2 2 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:2183:_sum_dispatcher (_sum_dispatcher) -- 2 2 -- 0.00001 0.00016 -- ~:0: () +++ __init__ -- 2 2 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_ufunc_config.py:426:__init__ (__init__) __enter__ -- 2 2 -- 0.00001 0.00006 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_ufunc_config.py:430:__enter__ (__enter__) seterr -- 2 2 -- 0.00002 0.00005 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_ufunc_config.py:33:seterr (seterr) +++ __exit__ -- 2 2 -- 0.00001 0.00004 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_ufunc_config.py:435:__exit__ (__exit__) seterr -- 2 2 -- 0.00001 0.00003 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_ufunc_config.py:33:seterr (seterr) +++ get_config -- 2 2 -- 0.00000 0.00001 -- sklearn/_config.py:30:get_config (get_config) +++ __getattr__ -- 4 4 -- 0.00000 0.00001 -- sklearn/utils/_array_api.py:63:__getattr__ (__getattr__) +++ asarray -- 2 2 -- 0.00000 0.00000 -- sklearn/utils/_array_api.py:70:asarray (asarray) +++ get_namespace -- 2 2 -- 0.00001 0.00002 -- sklearn/utils/_array_api.py:90:get_namespace (get_namespace) +++ _num_samples -- 2 2 -- 0.00003 0.00006 -- sklearn/utils/validation.py:320:_num_samples (_num_samples) +++ _ensure_no_complex_data -- 2 2 -- 0.00001 0.00001 -- sklearn/utils/validation.py:571:_ensure_no_complex_data (_ensure_no_complex_data) _check_estimator_name -- 2 2 -- 0.00000 0.00001 -- sklearn/utils/validation.py:581:_check_estimator_name (_check_estimator_name) check_random_state -- 101 101 -- 0.00057 0.00180 -- sklearn/utils/validation.py:1197:check_random_state (check_random_state) -- 200 200 -- 0.00044 0.00122 -- ~:0: () +++ -- 50958 50958 -- 0.06205 0.08021 -- ~:0: () __len__ -- 10200 10200 -- 0.01816 0.01816 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/data_loader.py:94:__len__ (__len__) -- 18 18 -- 0.00014 0.00014 -- ~:0: () -- 10297 10297 -- 0.01289 0.01289 -- ~:0: () -- 91012 91012 -- 0.06273 0.06273 -- ~:0: () -- 281693 281693 -- 0.17309 0.17553 -- ~:0: () __instancecheck__ -- 370 370 -- 0.00039 0.00244 -- /usr/local/lib/python3.9/abc.py:96:__instancecheck__ (__instancecheck__) -- 370 370 -- 0.00146 0.00204 -- ~:0: () __subclasscheck__ -- 121 121 -- 0.00015 0.00058 -- /usr/local/lib/python3.9/abc.py:100:__subclasscheck__ (__subclasscheck__) -- 121 121 -- 0.00043 0.00043 -- ~:0: () -- 101 101 -- 0.00621 0.00621 -- ~:0: () -- 10005 10005 -- 0.03362 0.06657 -- ~:0: () -- 40000 40000 -- 0.02392 0.03272 -- onnxcustom/onnxcustom_UT_39_std/_doc/sphinxdoc/source/onnxcustom/training/ortgradient.py:612: () -- 40000 40000 -- 0.00880 0.00880 -- ~:0: () +++ -- 7 7 -- 0.00009 0.00022 -- sklearn/neural_network/_multilayer_perceptron.py:485: () -- 6 6 -- 0.00002 0.00013 -- ~:0: () _all -- 6 6 -- 0.00001 0.00011 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_methods.py:61:_all (_all) -- 6 6 -- 0.00010 0.00010 -- ~:0: () +++ -- 15181 15181 -- 0.01298 0.01298 -- ~:0: () -- 5100 5100 -- 0.02107 0.41299 -- ~:0: () _mean -- 5100 5100 -- 0.18268 0.39192 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_methods.py:164:_mean (_mean) +++ -- 107 107 -- 0.00050 0.00050 -- ~:0: () -- 101 101 -- 0.00138 0.00138 -- ~:0: () -- 30111 30125 -- 0.20088 1.70307 -- ~:0: () clip -- 1 1 -- 0.00001 0.00016 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:2111:clip (clip) _wrapfunc -- 1 1 -- 0.00001 0.00015 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:51:_wrapfunc (_wrapfunc) _wrapit -- 1 1 -- 0.00002 0.00014 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:38:_wrapit (_wrapit) -- 1 1 -- 0.00001 0.00012 -- ~:0: () _clip -- 1 1 -- 0.00001 0.00011 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_methods.py:127:_clip (_clip) _clip_dep_is_scalar_nan -- 2 2 -- 0.00004 0.00008 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_methods.py:93:_clip_dep_is_scalar_nan (_clip_dep_is_scalar_nan) ndim -- 2 2 -- 0.00001 0.00004 -- <__array_function__ internals>:177:ndim (ndim) _ndim_dispatcher -- 2 2 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3148:_ndim_dispatcher (_ndim_dispatcher) _clip_dep_is_byte_swapped -- 2 2 -- 0.00000 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_methods.py:103:_clip_dep_is_byte_swapped (_clip_dep_is_byte_swapped) _clip_dep_invoke_with_casting -- 1 1 -- 0.00001 0.00001 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_methods.py:108:_clip_dep_invoke_with_casting (_clip_dep_invoke_with_casting) sum -- 2 2 -- 0.00001 0.00015 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:2188:sum (sum) _wrapreduction -- 2 2 -- 0.00002 0.00013 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:69:_wrapreduction (_wrapreduction) +++ any -- 1 1 -- 0.00001 0.00006 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:2333:any (any) _wrapreduction -- 1 1 -- 0.00001 0.00005 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:69:_wrapreduction (_wrapreduction) +++ ndim -- 2 2 -- 0.00002 0.00002 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3152:ndim (ndim) mean -- 15000 15000 -- 0.10279 1.49407 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/fromnumeric.py:3345:mean (mean) _mean -- 15000 15000 -- 0.52293 1.39128 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_methods.py:164:_mean (_mean) +++ zeros_like -- 6 6 -- 0.00005 0.00021 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/numeric.py:77:zeros_like (zeros_like) empty_like -- 6 6 -- 0.00003 0.00007 -- <__array_function__ internals>:177:empty_like (empty_like) empty_like -- 6 6 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/multiarray.py:84:empty_like (empty_like) copyto -- 6 6 -- 0.00003 0.00007 -- <__array_function__ internals>:177:copyto (copyto) copyto -- 6 6 -- 0.00000 0.00000 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/multiarray.py:1079:copyto (copyto) unique -- 101 101 -- 0.00083 0.00763 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/lib/arraysetops.py:138:unique (unique) _unpack_tuple -- 101 101 -- 0.00020 0.00025 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/lib/arraysetops.py:125:_unpack_tuple (_unpack_tuple) -- 101 101 -- 0.00005 0.00005 -- ~:0: () +++ _unique1d -- 101 101 -- 0.00443 0.00576 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/lib/arraysetops.py:323:_unique1d (_unique1d) -- 101 101 -- 0.00066 0.00066 -- ~:0: () -- 101 101 -- 0.00016 0.00016 -- ~:0: () -- 101 101 -- 0.00003 0.00003 -- ~:0: () +++ -- 101 101 -- 0.00049 0.00049 -- ~:0: () +++ -- 101 101 -- 0.00079 0.00079 -- ~:0: () +++ -- 40014 40014 -- 0.40345 0.40345 -- ~:0: () -- 135004 135004 -- 0.08394 0.08394 -- ~:0: () -- 91 91 -- 0.00005 0.00005 -- ~:0: () -- 18 18 -- 0.00004 0.00004 -- ~:0: () -- 15 15 -- 0.00161 0.00161 -- ~:0: () -- 20302 20302 -- 0.01084 0.01084 -- ~:0: () -- 20109 20109 -- 0.35034 0.35034 -- ~:0: () -- 30020 30020 -- 0.03838 0.15838 -- ~:0: () _no_nep50_warning -- 30000 30000 -- 0.06103 0.11999 -- onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/numpy/core/_ufunc_config.py:452:_no_nep50_warning (_no_nep50_warning) -- 15000 15000 -- 0.03065 0.03065 -- ~:0: () -- 15000 15000 -- 0.02831 0.02831 -- ~:0: () -- 24 24 -- 0.00001 0.00001 -- ~:0: () -- 12 12 -- 0.00001 0.00001 -- ~:0: () -- 18 18 -- 0.00003 0.00003 -- ~:0: () .. GENERATED FROM PYTHON SOURCE LINES 131-133 if GPU is available +++++++++++++++++++ .. GENERATED FROM PYTHON SOURCE LINES 133-143 .. code-block:: default if get_device().upper() == 'GPU': train_session = OrtGradientForwardBackwardOptimizer( onx, device='cuda', learning_rate=1e-5, warm_start=False, max_iter=max_iter, batch_size=batch_size) benches.append(benchmark(X_train, y_train, nn, train_session, name='NN-GPU')) .. GENERATED FROM PYTHON SOURCE LINES 144-146 Linear Regression +++++++++++++++++ .. GENERATED FROM PYTHON SOURCE LINES 146-176 .. code-block:: default lr = MLPRegressor(hidden_layer_sizes=tuple(), max_iter=max_iter, solver='sgd', learning_rate_init=5e-2, alpha=0, n_iter_no_change=max_iter * 3, batch_size=batch_size, nesterovs_momentum=False, momentum=0, learning_rate="invscaling") with warnings.catch_warnings(): warnings.simplefilter('ignore') lr.fit(X, y) onx = to_onnx(lr, X_train[:1].astype(numpy.float32), target_opset=15) train_session = OrtGradientForwardBackwardOptimizer( onx, device='cpu', learning_rate=5e-4, warm_start=False, max_iter=max_iter, batch_size=batch_size) benches.append(benchmark(X_train, y_train, lr, train_session, name='LR-CPU')) if get_device().upper() == 'GPU': train_session = OrtGradientForwardBackwardOptimizer( onx, device='cuda', learning_rate=5e-4, warm_start=False, max_iter=max_iter, batch_size=batch_size) benches.append(benchmark(X_train, y_train, nn, train_session, name='LR-GPU')) .. rst-class:: sphx-glr-script-out .. code-block:: none [benchmark] LR-CPU somewhere/workspace/onnxcustom/onnxcustom_UT_39_std/_venv/lib/python3.9/site-packages/sklearn/neural_network/_multilayer_perceptron.py:679: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (100) reached and the optimization hasn't converged yet. warnings.warn( [benchmark] skl=100 iterations - 2.387998206075281 seconds [benchmark] ort=100 iteration - 4.822139478987083 seconds .. GENERATED FROM PYTHON SOURCE LINES 177-179 GPU profiling +++++++++++++ .. GENERATED FROM PYTHON SOURCE LINES 179-187 .. code-block:: default if get_device().upper() == 'GPU': ps = profile(lambda: benchmark(X_train, y_train, lr, train_session, name='LR-GPU'))[0] root, nodes = profile2graph(ps, clean_text=clean_name) text = root.to_text() print(text) .. GENERATED FROM PYTHON SOURCE LINES 188-192 Graphs ++++++ Dataframe first. .. GENERATED FROM PYTHON SOURCE LINES 192-196 .. code-block:: default df = DataFrame(benches).set_index('name') df .. raw:: html
skl ort iter_skl iter_ort losses_skl losses_ort
name
NN-CPU 6.742114 8.580952 100 100 [11400.110439453125, 2514.482399902344, 1908.9... [18110.033, 15505.606, 14046.155, 13452.841, 1...
LR-CPU 2.387998 4.822139 100 100 [4046.618494873047, 171.19379272460938, 152.44... [14614.284, 14333.03, 12868.344, 13646.479, 12...


.. GENERATED FROM PYTHON SOURCE LINES 197-198 text output .. GENERATED FROM PYTHON SOURCE LINES 198-201 .. code-block:: default print(df) .. rst-class:: sphx-glr-script-out .. code-block:: none skl ... losses_ort name ... NN-CPU 6.742114 ... [18110.033, 15505.606, 14046.155, 13452.841, 1... LR-CPU 2.387998 ... [14614.284, 14333.03, 12868.344, 13646.479, 12... [2 rows x 6 columns] .. GENERATED FROM PYTHON SOURCE LINES 202-203 Graphs. .. GENERATED FROM PYTHON SOURCE LINES 203-214 .. code-block:: default fig, ax = plt.subplots(1, 2, figsize=(10, 4)) df[['skl', 'ort']].plot.bar(title="Processing time", ax=ax[0]) ax[0].tick_params(axis='x', rotation=30) for bench in benches: ax[1].plot(bench['losses_skl'][1:], label='skl-' + bench['name']) ax[1].plot(bench['losses_ort'][1:], label='ort-' + bench['name']) ax[1].set_yscale('log') ax[1].set_title("Losses") ax[1].legend() .. image-sg:: /gyexamples/images/sphx_glr_plot_orttraining_benchmark_fwbw_001.png :alt: Processing time, Losses :srcset: /gyexamples/images/sphx_glr_plot_orttraining_benchmark_fwbw_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 215-217 The gradient update are not exactly the same. It should be improved for a fair comprison. .. GENERATED FROM PYTHON SOURCE LINES 217-220 .. code-block:: default fig.savefig("plot_orttraining_benchmark_fwbw.png") # plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 51.860 seconds) .. _sphx_glr_download_gyexamples_plot_orttraining_benchmark_fwbw.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_orttraining_benchmark_fwbw.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_orttraining_benchmark_fwbw.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_