Skip to content

Commit d28de99

Browse files
committed
improves CI
1 parent e252d79 commit d28de99

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
os: [ubuntu-latest]
1818
python: ['3.11', '3.12']
19-
transformers: ['4.48', '4.50', 'main']
19+
transformers: ['4.48.3', '4.50.3', 'main']
2020
torch: ['2.6', 'main']
2121

2222
steps:

_doc/examples/plot_export_locate_issue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def forward(self, x: torch.Tensor, ys: list[torch.Tensor]):
8585
# to replace torch implementation by a new one raising the exception
8686
# mentioned in previous section.
8787

88-
with bypass_export_some_errors(stop_if_static=True, verbose=1):
88+
with bypass_export_some_errors(stop_if_static=1, verbose=1):
8989
try:
9090
torch.export.export(model, inputs, dynamic_shapes=dyn_shapes)
9191
except (AssertionError, torch._dynamo.exc.TorchRuntimeError) as e:

_unittests/ut_torch_models/test_test_helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import copy
22
import unittest
3+
import packaging.version as pv
4+
import transformers
35
from onnx_diagnostic.ext_test_case import ExtTestCase, hide_stdout, ignore_warnings
46
from onnx_diagnostic.torch_models.test_helper import (
57
get_inputs_for_task,
@@ -62,6 +64,7 @@ def test_validate_model_onnx(self):
6264
exporter="onnx-dynamo",
6365
dump_folder="dump_test_validate_model_onnx",
6466
patch=True,
67+
stop_if_static=pv.Version(transformers.__version__) >= pv.Version("4.50"),
6568
)
6669
self.assertIsInstance(summary, dict)
6770
self.assertIsInstance(data, dict)

onnx_diagnostic/_command_lines_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ def get_parser_validate() -> ArgumentParser:
267267
parser.add_argument(
268268
"--stop-if-static",
269269
default=0,
270+
type=int,
270271
help="raises an exception if a dynamic dimension becomes static",
271272
)
272273
parser.add_argument(

onnx_diagnostic/torch_models/test_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def validate_model(
202202
optimization: Optional[str] = None,
203203
quiet: bool = False,
204204
patch: bool = False,
205-
stop_if_static: bool = True,
205+
stop_if_static: int = 1,
206206
dump_folder: Optional[str] = None,
207207
drop_inputs: Optional[List[str]] = None,
208208
) -> Tuple[Dict[str, Union[int, float, str]], Dict[str, Any]]:

0 commit comments

Comments
 (0)