Skip to content

Commit ccfa16c

Browse files
committed
doc
1 parent c2ab5f6 commit ccfa16c

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

_doc/examples/plot_dump_intermediate_results.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,21 @@
44
Dumps intermediate results of a torch model
55
===========================================
66
7-
8-
codellama/CodeLlama-7b-Python-hf
9-
++++++++++++++++++++++++++++++++
7+
Looking for discrepancies is quickly annoying. Discrepancies
8+
come from two results obtained with the same models
9+
implemented in two different ways, :epkg:`pytorch` and :epkg:`onnx`.
10+
Models are big so where do they come from? That's the
11+
unavoidable question. Unless there is an obious reason,
12+
the only way is to compare intermediate outputs alon the computation.
13+
The first step into that direction is to dump the intermediate results
14+
coming from :epkg:`pytorch`.
15+
We use :func:`onnx_diagnostic.helpers.torch_helper import steal_forward` for that.
16+
17+
A simple LLM Model
18+
++++++++++++++++++
19+
20+
See :func:`onnx_diagnostic.helpers.torch_helper.dummy_llm`
21+
for its definition. It is mostly used for unit test or example.
1022
1123
"""
1224

@@ -87,7 +99,7 @@
8799
# | it is possible to call multiple times,
88100
# | the model to store more
89101
# |
90-
# +--> the name given to steal forward
102+
# +--> the name given to function steal_forward
91103
#
92104
# The same goes for output except ``'I'`` is replaced by ``'O'``.
93105
#

0 commit comments

Comments
 (0)