Skip to content

Commit 97cc48c

Browse files
authored
documentation (#132)
* Support for custom kernels * documentation * doc
1 parent b1f65d9 commit 97cc48c

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

CHANGELOGS.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Change Logs
22
===========
33

4+
0.6.2
5+
+++++
6+
7+
* :pr:`131`: support for custom kernels in TorchOnnxEvaluator
8+
49
0.6.1
510
+++++
611

_doc/cmds/validate.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
.. _l-cmd-validate:
2+
13
-m onnx_diagnostic validate ... validate a model id
24
===================================================
35

6+
The command line is a wrapper around function
7+
:func:`onnx_diagnostic.torch_models.test_helper.validate_model`.
8+
49
Description
510
+++++++++++
611

onnx_diagnostic/torch_models/test_helper.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,17 @@ def validate_model(
278278
) -> Tuple[Dict[str, Union[int, float, str]], Dict[str, Any]]:
279279
"""
280280
Validates a model.
281+
The function can also be called through the command line
282+
:ref:`l-cmd-validate`.
281283
282284
:param model_id: model id to validate
283285
:param task: task used to generate the necessary inputs,
284286
can be left empty to use the default task for this model
285287
if it can be determined
286288
:param do_run: checks the model works with the defined inputs
287289
:param exporter: exporter the model using this exporter,
288-
available list: ``export-strict``, ``export-nostrict``, ``onnx``
290+
available list: ``export-strict``, ``export-nostrict``, ...
291+
see below
289292
:param do_same: checks the discrepancies of the exported model
290293
:param verbose: verbosity level
291294
:param dtype: uses this dtype to check the model
@@ -322,6 +325,20 @@ def validate_model(
322325
information:
323326
324327
* ``PRINT_CONFIG``: prints the model configuration
328+
329+
The following exporters are available:
330+
331+
* ``export-nostrict``: run :func:`torch.export.export` (..., strict=False)
332+
* ``onnx-dynamo``: run :func:`torch.onnx.export` (..., dynamo=True),
333+
models can be optimized with ``optimization`` in ``("ir", "os_ort")``
334+
* ``modelbuilder``: use :epkg:`ModelBuilder` to builds the onnx model
335+
* ``custom``: custom exporter (see :epkg:`experimental-experiment`),
336+
models can be optimized with ``optimization`` in
337+
``("default", "default+onnxruntime", "default+os_ort", "default+onnxruntime+os_ort")``
338+
339+
The default runtime, :epkg:`onnxruntime` is used to validate a model and check the
340+
exported model returns the same outputs as the original one, otherwise,
341+
:class:`onnx_diagnostic.reference.TorchOnnxEvaluator` is used.
325342
"""
326343
assert (
327344
not rewrite or patch

0 commit comments

Comments
 (0)