Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python: ['3.11', '3.12']
transformers: ['4.48.3', '4.52.4', '4.55.4', 'main']
torch: ['2.7', '2.8', 'main']
python: ['3.13']
transformers: ['5.0', 'main']
torch: ['2.10', 'main']

steps:

Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,43 @@ jobs:
matrix:
os: [ubuntu-latest]
python: ['3.10', '3.11', '3.12', '3.13']
transformers: ['4.48.3', '4.51.3', '4.55.4', '4.56.2', '4.57.6', 'main']
transformers: ['4.48.3', '4.51.3', '4.55.4', '4.57.6', '5.0', 'main']
torch: ['2.10', 'main']
exclude:
- python: '3.10' # 3.10
torch: 'main'
# 3.10 - torch
- python: '3.10'
torch: '2.10'
torch: 'main'
# 3.10 - transformers
- python: '3.10'
transformers: '4.55.4'
- python: '3.10'
transformers: '4.56.2'
- python: '3.10'
transformers: '4.57.6'
- python: '3.10'
transformers: '5.0'
- python: '3.10'
transformers: 'main'
- python: '3.11' # 3.11
# 3.11 - torch
- python: '3.11'
torch: 'main'
# 3.11 - transformers
- python: '3.11'
transformers: '4.55.4'
- python: '3.11'
transformers: '4.56.2'
- python: '3.11'
transformers: '4.57.6'
- python: '3.11'
transformers: '5.0'
- python: '3.11'
transformers: 'main'
- python: '3.13' # 3.11
# 3.13 - torch
- python: '3.13'
torch: '2.10'
# 3.13 - transformers
- python: '3.13'
transformers: '4.48.3'
- python: '3.13'
transformers: '4.51.3'
- python: '3.13'
transformers: '4.55.4'
- python: '3.13'
transformers: '4.56.2'
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python: ['3.12']
python: ['3.13']

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ['3.12']
python: ['3.13']
transformers: ['4.57.6']
torch: ['main']
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/models448.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python: ['3.12']
transformers: ['4.48.3']
python: ['3.13']
transformers: ['4.57.6']
torch: ['main']
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12'
python-version: '3.13'
- name: Install mypy
run: pip install mypy
- name: Run mypy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pyrefly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.13"
cache: "pip"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels-any.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: '3.12'
python-version: '3.13'

- name: build wheel
run: python -m pip wheel . -v
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOGS.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change Logs
===========

0.8.12
++++++

* :pr:`399`: update CI

0.8.11
++++++

Expand Down
2 changes: 1 addition & 1 deletion _doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ The function replaces dynamic dimensions defined as strings by
Older versions
==============

* `0.8.12 <../v0.8.12/index.html>`_
* `0.8.11 <../v0.8.11/index.html>`_
* `0.8.10 <../v0.8.10/index.html>`_
* `0.7.16 <../v0.7.16/index.html>`_
* `0.6.3 <../v0.6.3/index.html>`_
* `0.5.0 <../v0.5.0/index.html>`_
Expand Down
39 changes: 37 additions & 2 deletions _unittests/ut_investigate/test_input_observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,41 @@ def forward(self, x, y=None):
cst = torch.export.Dim.DYNAMIC
self.assertEqual(({0: cst, 1: cst}, {1: cst}), observer.infer_dynamic_shapes())

def test_infer_arguments_optional(self):
class Model(torch.nn.Module):
def forward(self, x, y=None):
if y is None:
return x
return x - y

inputs = [
(torch.randn((5, 6)),),
(torch.randn((6, 7)), torch.randn((1, 7))),
(torch.randn((7, 8)), torch.randn((1, 8))),
(torch.randn((8, 9)), torch.randn((1, 9))),
]

model = Model()
expected = [model(*args) for args in inputs]
observer = InputObserver()
with observer(model):
for args in inputs:
model(*args)
self.assertEqual(len(observer.info), 3)
for i in range(3):
self.assertEqual(len(observer.info.flat_outputs[i]), 1)
torch.testing.assert_close(expected[i], observer.info.flat_outputs[i][0])

cst = torch.export.Dim.DYNAMIC
self.assertEqual(({0: cst, 1: cst}, {1: cst}), observer.infer_dynamic_shapes())
infer_args = observer.infer_arguments(0)
self.assertIsInstance(infer_args, tuple)
self.assertEqual(len(infer_args), 2)
self.assertIsInstance(infer_args[0], torch.Tensor)
self.assertIsInstance(infer_args[1], torch.Tensor)
self.assertEqual(infer_args[0].shape, (5, 6))
self.assertEqual(infer_args[1].shape, (1, 0))

def test_io_captured_optional_kwargs(self):
class Model(torch.nn.Module):
def forward(self, x, y=None):
Expand Down Expand Up @@ -589,11 +624,11 @@ def forward(self, x, y, z=None, w=None):
cst = torch.export.Dim.DYNAMIC
self.assertEqual(
dict(x={0: cst, 1: cst}, y={1: cst}, z={0: cst, 1: cst}, w={1: cst}),
observer.infer_dynamic_shapes(add_batch_dimension_for={0, "z"}),
observer.infer_dynamic_shapes(set_batch_dimension_for={0, "z"}),
)
self.assertEqual(
dict(x={0: cst, 1: cst}, y={1: cst}, z={0: cst, 1: cst}, w={1: cst}),
observer.infer_dynamic_shapes(add_batch_dimension_for={"x", "z"}),
observer.infer_dynamic_shapes(set_batch_dimension_for={"x", "z"}),
)


Expand Down
2 changes: 1 addition & 1 deletion onnx_diagnostic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Functions, classes to dig into a model when this one is right, slow, wrong...
"""

__version__ = "0.8.11"
__version__ = "0.8.12"
__author__ = "Xavier Dupré"
Loading
Loading