Skip to content

Commit fdc724a

Browse files
committed
doc
1 parent ac1c871 commit fdc724a

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Enlightening Examples
5050

5151
* `Use DYNAMIC or AUTO when exporting if dynamic shapes has constraints
5252
<https://sdpython.github.io/doc/onnx-diagnostic/dev/auto_examples/plot_export_with_dynamic_shapes_auto.html>`_
53+
* `Find and fix an export issue due to dynamic shapes
54+
<https://sdpython.github.io/doc/onnx-diagnostic/dev/auto_examples/plot_export_locate_issue.html>`_
5355
* `Export with DynamicCache and dynamic shapes
5456
<https://sdpython.github.io/doc/onnx-diagnostic/dev/auto_examples/plot_export_with_dynamic_cache.html>`_
5557
* `Steel method forward to guess the dynamic shapes (with Tiny-LLM)

_doc/examples/plot_export_tiny_llm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@
4444

4545
def _forward_(*args, _f=None, **kwargs):
4646
assert _f is not None
47-
if not torch.compiler.is_exporting():
47+
if not hasattr(torch.compiler, "is_exporting") or not torch.compiler.is_exporting():
48+
# torch.compiler.is_exporting requires torch>=2.7
4849
print("<-", string_type((args, kwargs), with_shape=True, with_min_max=True))
4950
res = _f(*args, **kwargs)
50-
if not torch.compiler.is_exporting():
51+
if not hasattr(torch.compiler, "is_exporting") or not torch.compiler.is_exporting():
5152
print("->", string_type((args, kwargs), with_shape=True, with_min_max=True))
5253
return res
5354

_doc/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Enlightening Examples
6161
* :ref:`l-plot-export-cond`
6262
* :ref:`l-plot-sxport-with-dynamio-shapes-auto`
6363
* :ref:`l-plot-export-with-dynamic-shape`
64+
* :ref:`l-plot-export-locale-issue`
6465
* :ref:`l-plot-tiny-llm-export`
6566
* :ref:`l-plot-tiny-llm-export-patched`
6667

@@ -162,5 +163,7 @@ Size of the package:
162163
Older versions
163164
++++++++++++++
164165

166+
* `0.2.2 <../v0.2.2/index.html>`_
167+
* `0.2.1 <../v0.2.1/index.html>`_
165168
* `0.2.0 <../v0.2.0/index.html>`_
166169
* `0.1.0 <../v0.1.0/index.html>`_

onnx_diagnostic/__init__.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,5 @@
33
Functions, classes to dig into a model when this one is right, slow, wrong...
44
"""
55

6-
__version__ = "0.3.0"
6+
__version__ = "0.2.2"
77
__author__ = "Xavier Dupré"
8-
9-
10-
def reset_torch_transformers(gallery_conf, fname):
11-
"Resets torch dynamo for :epkg:`sphinx-gallery`."
12-
import matplotlib.pyplot as plt
13-
import torch
14-
15-
plt.style.use("ggplot")
16-
torch._dynamo.reset()

onnx_diagnostic/torch_test_helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ def is_torchdynamo_exporting() -> bool:
1313
"""Tells if torch is exporting a model."""
1414
import torch
1515

16+
if not hasattr(torch.compiler, "is_exporting"):
17+
# torch.compiler.is_exporting requires torch>=2.7
18+
return False
19+
1620
try:
1721
return torch.compiler.is_exporting()
1822
except Exception:

0 commit comments

Comments
 (0)