Skip to content

Commit 9906b30

Browse files
committed
Merge branch 'main' of https://github.com/sdpython/onnx-diagnostic into exl
2 parents f1cdf11 + 3038095 commit 9906b30

File tree

19 files changed

+71
-70
lines changed

19 files changed

+71
-70
lines changed

.github/workflows/check-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
matrix:
1717
os: [ubuntu-latest, macOS-latest, windows-latest]
1818
python: ['3.11', '3.12']
19-
transformers: ['4.48.3', '4.51.3', 'main']
20-
torch: ['2.6', 'main']
19+
transformers: ['4.48.3', '4.52.4', 'main']
20+
torch: ['2.6', '2.7', 'main']
2121

2222
steps:
2323

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ jobs:
1616
matrix:
1717
os: [ubuntu-latest]
1818
python: ['3.10', '3.11', '3.12', '3.13']
19-
transformers: ['4.48.3', '4.51.3', '4.52.3', 'main']
19+
transformers: ['4.48.3', '4.51.3', '4.52.4', 'main']
2020
torch: ['2.7', 'main']
2121
exclude:
2222
- python: '3.10'
2323
torch: 'main'
2424
- python: '3.11'
2525
torch: 'main'
2626
- python: '3.10'
27-
transformers: '4.52.3'
27+
transformers: '4.52.4'
2828
- python: '3.10'
2929
transformers: 'main'
3030
- python: '3.11'
31-
transformers: '4.52.3'
31+
transformers: '4.52.4'
3232
- python: '3.11'
3333
transformers: 'main'
3434
- python: '3.13'

_doc/api/reference/torch_ops/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ onnx_diagnostic.reference.torch_ops
1818
shape_ops
1919
unary_ops
2020

21-
OpRun
22-
+++++
21+
OpRunKernel
22+
+++++++++++
2323

24-
.. autoclass:: onnx_diagnostic.reference.torch_ops.OpRun
24+
.. autoclass:: onnx_diagnostic.reference.torch_ops.OpRunKernel
2525
:members:
2626

2727
OpRunTensor

_doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ The function replaces dynamic dimensions defined as strings by
206206
Older versions
207207
++++++++++++++
208208

209+
* `0.6.2 <../v0.6.2/index.html>`_
209210
* `0.6.1 <../v0.6.1/index.html>`_
210211
* `0.6.0 <../v0.6.0/index.html>`_
211212
* `0.5.0 <../v0.5.0/index.html>`_

_unittests/ut_reference/test_torch_onnx_evaluator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from onnx_diagnostic.helpers.onnx_helper import from_array_extended
99
from onnx_diagnostic.helpers.torch_helper import onnx_dtype_to_torch_dtype
1010
from onnx_diagnostic.reference import ExtendedReferenceEvaluator, TorchOnnxEvaluator
11-
from onnx_diagnostic.reference.torch_ops import OpRun, OpRunTensor
11+
from onnx_diagnostic.reference.torch_ops import OpRunKernel, OpRunTensor
1212
from onnx_diagnostic.reference.torch_evaluator import get_kernels
1313

1414

@@ -1373,7 +1373,7 @@ def test_tile(self):
13731373
)
13741374

13751375
def test_custom_kernels(self):
1376-
class LayerNormalizationOrt(OpRun):
1376+
class LayerNormalizationOrt(OpRunKernel):
13771377
"LayerNormalization"
13781378

13791379
_shared = [0]

onnx_diagnostic/__init__.py

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

6-
__version__ = "0.6.1"
6+
__version__ = "0.6.2"
77
__author__ = "Xavier Dupré"

onnx_diagnostic/reference/torch_evaluator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
@functools.lru_cache
12-
def get_kernels() -> Dict[Tuple[str, str, int], type[torch_ops.OpRun]]:
12+
def get_kernels() -> Dict[Tuple[str, str, int], type[torch_ops.OpRunKernel]]:
1313
"""
1414
Retrieves all the available kernels class :class:`TorchOnnxEvaluator`
1515
can use. The full list is the following.
@@ -28,7 +28,7 @@ def get_kernels() -> Dict[Tuple[str, str, int], type[torch_ops.OpRun]]:
2828
"""
2929
res = {}
3030
for _k, v in torch_ops.__dict__.items():
31-
if isinstance(v, type) and issubclass(v, torch_ops.OpRun) and "_" in v.__name__:
31+
if isinstance(v, type) and issubclass(v, torch_ops.OpRunKernel) and "_" in v.__name__:
3232
name, version = v.__name__.split("_")
3333
domain = getattr(v, "domain", "")
3434
res[domain, name, int(version)] = v
@@ -161,11 +161,11 @@ class TorchOnnxEvaluator:
161161
from onnx_diagnostic.helpers import string_type
162162
from onnx_diagnostic.helpers.torch_helper import onnx_dtype_to_torch_dtype
163163
from onnx_diagnostic.reference import TorchOnnxEvaluator
164-
from onnx_diagnostic.reference.torch_ops import OpRun, OpRunTensor
164+
from onnx_diagnostic.reference.torch_ops import OpRunKernel, OpRunTensor
165165
166166
TFLOAT16 = onnx.TensorProto.FLOAT16
167167
168-
class LayerNormalizationOrt(OpRun):
168+
class LayerNormalizationOrt(OpRunKernel):
169169
"LayerNormalization based on onnxruntime"
170170
171171
def __init__(self, node: onnx.NodeProto, version=None):
@@ -284,11 +284,11 @@ def __init__(
284284
opsets: Optional[Dict[str, int]] = None,
285285
local_functions: Optional[Dict[Tuple[str, str], "TorchOnnxEvaluator"]] = None,
286286
verbose: int = 0,
287-
custom_kernels: Optional[Dict[Tuple[str, str], type[torch_ops.OpRun]]] = None,
287+
custom_kernels: Optional[Dict[Tuple[str, str], type[torch_ops.OpRunKernel]]] = None,
288288
):
289289
self.providers = providers
290290
self.constants: Dict[str, torch.Tensor] = {}
291-
self.kernels: List[Optional[torch_ops.OpRun]] = []
291+
self.kernels: List[Optional[torch_ops.OpRunKernel]] = []
292292
self.functions = local_functions.copy() if local_functions else {}
293293
self.CPU = torch.tensor([0]).to("cpu").device
294294
self.verbose = verbose

onnx_diagnostic/reference/torch_ops/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ._op_run import OpRun, OpRunFunction, OpRunSequence, OpRunTensor, OpRunValue
1+
from ._op_run import OpRunKernel, OpRunFunction, OpRunSequence, OpRunTensor, OpRunValue
22
from .access_ops import Gather_1, ScatterND_16, Slice_13
33
from .binary_ops import (
44
And_1,

onnx_diagnostic/reference/torch_ops/_op_run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def string_type(self) -> str:
167167
return string_type(self.sequence, with_shape=True)
168168

169169

170-
class OpRun:
170+
class OpRunKernel:
171171
"""
172172
Main class. Every kernel should inherit from it.
173173
It does not copy the proto.
@@ -305,7 +305,7 @@ def same_device(self, *tensors: torch.Tensor) -> Tuple[torch.Tensor, ...]:
305305
return tuple(t.to(device) for t in tensors)
306306

307307

308-
class OpRunFunction(OpRun):
308+
class OpRunFunction(OpRunKernel):
309309
"""
310310
Defines a kernel based on a local functions.
311311
"""

onnx_diagnostic/reference/torch_ops/access_ops.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from typing import Optional
22
import onnx
33
import torch
4-
from . import OpRun, OpRunTensor
4+
from . import OpRunKernel, OpRunTensor
55

66

7-
class Gather_1(OpRun):
7+
class Gather_1(OpRunKernel):
88
"Gather"
99

1010
def __init__(self, node: onnx.NodeProto, version: Optional[int] = None):
@@ -21,7 +21,7 @@ def run(self, x, indices):
2121
return OpRunTensor(x.tensor[tuple(ind)])
2222

2323

24-
class ScatterND_16(OpRun):
24+
class ScatterND_16(OpRunKernel):
2525
"ScatterND"
2626

2727
def __init__(self, node: onnx.NodeProto, version: Optional[int] = None):
@@ -54,7 +54,7 @@ def run(
5454
return OpRunTensor(output)
5555

5656

57-
class Slice_13(OpRun):
57+
class Slice_13(OpRunKernel):
5858
"Slice"
5959

6060
def run(

0 commit comments

Comments
 (0)