onnx-diagnostic 0.7.14__py3-none-any.whl → 0.7.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- onnx_diagnostic/__init__.py +1 -1
- onnx_diagnostic/_command_lines_parser.py +8 -1
- onnx_diagnostic/helpers/cache_helper.py +1 -1
- onnx_diagnostic/helpers/config_helper.py +2 -1
- onnx_diagnostic/helpers/rt_helper.py +3 -3
- onnx_diagnostic/tasks/image_text_to_text.py +6 -5
- onnx_diagnostic/tasks/text_generation.py +6 -0
- onnx_diagnostic/torch_export_patches/onnx_export_errors.py +1 -1
- onnx_diagnostic/torch_export_patches/onnx_export_serialization.py +31 -13
- onnx_diagnostic/torch_export_patches/patches/patch_torch.py +28 -16
- onnx_diagnostic/torch_export_patches/patches/patch_transformers.py +79 -28
- onnx_diagnostic/torch_models/hghub/model_inputs.py +7 -3
- onnx_diagnostic/torch_models/validate.py +36 -11
- {onnx_diagnostic-0.7.14.dist-info → onnx_diagnostic-0.7.15.dist-info}/METADATA +1 -1
- {onnx_diagnostic-0.7.14.dist-info → onnx_diagnostic-0.7.15.dist-info}/RECORD +18 -18
- {onnx_diagnostic-0.7.14.dist-info → onnx_diagnostic-0.7.15.dist-info}/WHEEL +0 -0
- {onnx_diagnostic-0.7.14.dist-info → onnx_diagnostic-0.7.15.dist-info}/licenses/LICENSE.txt +0 -0
- {onnx_diagnostic-0.7.14.dist-info → onnx_diagnostic-0.7.15.dist-info}/top_level.txt +0 -0
onnx_diagnostic/__init__.py
CHANGED
|
@@ -553,6 +553,12 @@ def get_parser_validate() -> ArgumentParser:
|
|
|
553
553
|
action=BooleanOptionalAction,
|
|
554
554
|
help="Enables onnxruntime logging when the session is created",
|
|
555
555
|
)
|
|
556
|
+
parser.add_argument(
|
|
557
|
+
"--quiet-input-sets",
|
|
558
|
+
default="",
|
|
559
|
+
help="Avoids raising an exception when an input sets does not work with "
|
|
560
|
+
"the exported model, example: --quiet-input-sets=inputs,inputs22",
|
|
561
|
+
)
|
|
556
562
|
return parser
|
|
557
563
|
|
|
558
564
|
|
|
@@ -614,6 +620,7 @@ def _cmd_validate(argv: List[Any]):
|
|
|
614
620
|
warmup=args.warmup,
|
|
615
621
|
inputs2=args.inputs2,
|
|
616
622
|
ort_logs=args.ort_logs,
|
|
623
|
+
quiet_input_sets=set(args.quiet_input_sets.split(",")),
|
|
617
624
|
output_names=(
|
|
618
625
|
None if len(args.outnames.strip()) < 2 else args.outnames.strip().split(",")
|
|
619
626
|
),
|
|
@@ -834,7 +841,7 @@ def get_parser_agg() -> ArgumentParser:
|
|
|
834
841
|
"n_model_pass,n_model_faster,"
|
|
835
842
|
"n_model_faster2x,n_model_faster3x,n_model_faster4x,n_node_attention,"
|
|
836
843
|
"n_node_attention23,n_node_rotary_embedding,n_node_rotary_embedding23,"
|
|
837
|
-
"n_node_layer_normalization,n_node_layer_normalization23,"
|
|
844
|
+
"n_node_gqa,n_node_layer_normalization,n_node_layer_normalization23,"
|
|
838
845
|
"peak_gpu_torch,peak_gpu_nvidia,n_node_control_flow,"
|
|
839
846
|
"n_node_constant,n_node_shape,n_node_expand,"
|
|
840
847
|
"n_node_function,n_node_initializer,n_node_scatter,"
|
|
@@ -108,7 +108,7 @@ def flatten_unflatten_for_dynamic_shapes(
|
|
|
108
108
|
|
|
109
109
|
def is_cache_dynamic_registered(fast: bool = False) -> bool:
|
|
110
110
|
"""
|
|
111
|
-
Tells class :class:`transformers.cache_utils.DynamicCache` can be
|
|
111
|
+
Tells if class :class:`transformers.cache_utils.DynamicCache` can be
|
|
112
112
|
serialized and deserialized. Only then, :func:`torch.export.export`
|
|
113
113
|
can export a model.
|
|
114
114
|
|
|
@@ -95,7 +95,8 @@ def config_class_from_architecture(arch: str, exc: bool = False) -> Optional[typ
|
|
|
95
95
|
mod_name = cls.__module__
|
|
96
96
|
mod = importlib.import_module(mod_name)
|
|
97
97
|
source = inspect.getsource(mod)
|
|
98
|
-
|
|
98
|
+
# [^O] avoids capturing Optional[Something]
|
|
99
|
+
reg = re.compile("config: ([^O][A-Za-z0-9]+)")
|
|
99
100
|
fall = reg.findall(source)
|
|
100
101
|
if len(fall) == 0:
|
|
101
102
|
assert not exc, (
|
|
@@ -3,8 +3,6 @@ import numpy as np
|
|
|
3
3
|
import onnx
|
|
4
4
|
import torch
|
|
5
5
|
from .helper import string_type, flatten_object
|
|
6
|
-
from .torch_helper import to_numpy
|
|
7
|
-
from .cache_helper import is_cache_dynamic_registered
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
def name_type_to_onnx_dtype(name: str) -> int:
|
|
@@ -49,7 +47,7 @@ def make_feeds(
|
|
|
49
47
|
assert (
|
|
50
48
|
not check_flatten
|
|
51
49
|
or not all(isinstance(obj, torch.Tensor) for obj in flat)
|
|
52
|
-
or not is_cache_dynamic_registered(fast=True)
|
|
50
|
+
# or not is_cache_dynamic_registered(fast=True)
|
|
53
51
|
or len(flat) == len(torch.utils._pytree.tree_flatten(inputs)[0])
|
|
54
52
|
), (
|
|
55
53
|
f"Unexpected number of flattened objects, "
|
|
@@ -57,6 +55,8 @@ def make_feeds(
|
|
|
57
55
|
f"{string_type(torch.utils._pytree.tree_flatten(inputs)[0], with_shape=True)}"
|
|
58
56
|
)
|
|
59
57
|
if use_numpy:
|
|
58
|
+
from .torch_helper import to_numpy
|
|
59
|
+
|
|
60
60
|
flat = [to_numpy(t) if isinstance(t, torch.Tensor) else t for t in flat]
|
|
61
61
|
names = (
|
|
62
62
|
[i.name for i in proto.graph.input]
|
|
@@ -186,12 +186,13 @@ def _get_inputs_gemma3(
|
|
|
186
186
|
f"total_sequence_length={total_sequence_length} != 860 "
|
|
187
187
|
f"for model {model.__class__.__name__}"
|
|
188
188
|
)
|
|
189
|
-
assert (
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
assert head_dim in (
|
|
190
|
+
256,
|
|
191
|
+
32,
|
|
192
|
+
), f"head_dim={head_dim} not in (32, 256) for model {model.__class__.__name__}"
|
|
192
193
|
assert n_images == 1, f"n_images={n_images} != 1 for model {model.__class__.__name__}"
|
|
193
|
-
assert num_key_value_heads
|
|
194
|
-
f"num_key_value_heads={num_key_value_heads}
|
|
194
|
+
assert num_key_value_heads in (1, 4), (
|
|
195
|
+
f"num_key_value_heads={num_key_value_heads} not in (1, 4) "
|
|
195
196
|
f"for this model {model.__class__.__name__}"
|
|
196
197
|
)
|
|
197
198
|
|
|
@@ -19,6 +19,9 @@ __TASK__ = "text-generation"
|
|
|
19
19
|
def reduce_model_config(config: Any) -> Dict[str, Any]:
|
|
20
20
|
"""Reduces a model size."""
|
|
21
21
|
# FalconMambaConfig: use_mambapy
|
|
22
|
+
if hasattr(config, "text_config"):
|
|
23
|
+
# The model is probably of mixture of models used only for text.
|
|
24
|
+
config = config.text_config
|
|
22
25
|
check_hasattr(
|
|
23
26
|
config,
|
|
24
27
|
("head_dim", ("hidden_size", "num_attention_heads"), "use_mambapy"),
|
|
@@ -308,6 +311,9 @@ def random_input_kwargs(config: Any) -> Tuple[Dict[str, Any], Callable]:
|
|
|
308
311
|
|
|
309
312
|
If the configuration is None, the function selects typical dimensions.
|
|
310
313
|
"""
|
|
314
|
+
if hasattr(config, "text_config"):
|
|
315
|
+
# The model is probably of mixture of models used only for text.
|
|
316
|
+
config = config.text_config
|
|
311
317
|
if config is not None:
|
|
312
318
|
check_hasattr(
|
|
313
319
|
config,
|
|
@@ -12,17 +12,26 @@ from transformers.cache_utils import (
|
|
|
12
12
|
StaticCache,
|
|
13
13
|
)
|
|
14
14
|
|
|
15
|
-
try:
|
|
16
|
-
from transformers.models.mamba.modeling_mamba import MambaCache
|
|
17
|
-
except ImportError:
|
|
18
|
-
from transformers.cache_utils import MambaCache
|
|
19
|
-
|
|
20
15
|
from ..helpers import string_type
|
|
21
16
|
from .serialization import _lower_name_with_
|
|
22
17
|
|
|
23
18
|
PATCH_OF_PATCHES: Set[Any] = set()
|
|
24
19
|
|
|
25
20
|
|
|
21
|
+
def get_mamba_cache_cls() -> type:
|
|
22
|
+
try:
|
|
23
|
+
from transformers.models.mamba.modeling_mamba import MambaCache
|
|
24
|
+
|
|
25
|
+
return MambaCache
|
|
26
|
+
except ImportError:
|
|
27
|
+
try:
|
|
28
|
+
from transformers.cache_utils import MambaCache
|
|
29
|
+
|
|
30
|
+
return MambaCache
|
|
31
|
+
except ImportError:
|
|
32
|
+
return None
|
|
33
|
+
|
|
34
|
+
|
|
26
35
|
def register_class_serialization(
|
|
27
36
|
cls,
|
|
28
37
|
f_flatten: Callable,
|
|
@@ -203,13 +212,6 @@ def serialization_functions(
|
|
|
203
212
|
# f_check=make_dynamic_cache([(torch.rand((4, 4, 4)), torch.rand((4, 4, 4)))]),
|
|
204
213
|
verbose=verbose,
|
|
205
214
|
),
|
|
206
|
-
MambaCache: lambda verbose=verbose: register_class_serialization(
|
|
207
|
-
MambaCache,
|
|
208
|
-
flatten_mamba_cache,
|
|
209
|
-
unflatten_mamba_cache,
|
|
210
|
-
flatten_with_keys_mamba_cache,
|
|
211
|
-
verbose=verbose,
|
|
212
|
-
),
|
|
213
215
|
EncoderDecoderCache: lambda verbose=verbose: register_class_serialization(
|
|
214
216
|
EncoderDecoderCache,
|
|
215
217
|
flatten_encoder_decoder_cache,
|
|
@@ -232,6 +234,17 @@ def serialization_functions(
|
|
|
232
234
|
verbose=verbose,
|
|
233
235
|
),
|
|
234
236
|
}
|
|
237
|
+
MambaCache = get_mamba_cache_cls()
|
|
238
|
+
if MambaCache:
|
|
239
|
+
transformers_classes[MambaCache] = (
|
|
240
|
+
lambda verbose=verbose: register_class_serialization(
|
|
241
|
+
MambaCache,
|
|
242
|
+
flatten_mamba_cache,
|
|
243
|
+
unflatten_mamba_cache,
|
|
244
|
+
flatten_with_keys_mamba_cache,
|
|
245
|
+
verbose=verbose,
|
|
246
|
+
)
|
|
247
|
+
)
|
|
235
248
|
classes.update(transformers_classes)
|
|
236
249
|
|
|
237
250
|
if patch_diffusers:
|
|
@@ -287,7 +300,12 @@ def unregister_class_serialization(cls: type, verbose: int = 0):
|
|
|
287
300
|
|
|
288
301
|
def unregister_cache_serialization(undo: Dict[str, bool], verbose: int = 0):
|
|
289
302
|
"""Undo all registrations."""
|
|
290
|
-
|
|
303
|
+
MambaCache = get_mamba_cache_cls()
|
|
304
|
+
cls_ensemble = (
|
|
305
|
+
{DynamicCache, EncoderDecoderCache}
|
|
306
|
+
| set(undo)
|
|
307
|
+
| ({MambaCache} if MambaCache else set())
|
|
308
|
+
)
|
|
291
309
|
for cls in cls_ensemble:
|
|
292
310
|
if undo.get(cls.__name__, False):
|
|
293
311
|
unregister_class_serialization(cls, verbose)
|
|
@@ -88,7 +88,7 @@ def patch__check_input_constraints_for_graph(
|
|
|
88
88
|
|
|
89
89
|
def patched_infer_size(a, b):
|
|
90
90
|
"""Patches ``torch._subclasses.fake_impls.infer_size``."""
|
|
91
|
-
from torch.fx.experimental.symbolic_shapes import
|
|
91
|
+
from torch.fx.experimental.symbolic_shapes import guard_or_false
|
|
92
92
|
|
|
93
93
|
dimsA = len(a)
|
|
94
94
|
dimsB = len(b)
|
|
@@ -113,19 +113,19 @@ def patched_infer_size(a, b):
|
|
|
113
113
|
# were not the case, we'd need to write this using torch.sym_or() or
|
|
114
114
|
# something like that).
|
|
115
115
|
try:
|
|
116
|
-
b1 =
|
|
116
|
+
b1 = guard_or_false(sizeA == 1)
|
|
117
117
|
except torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode:
|
|
118
118
|
b1 = False
|
|
119
119
|
try:
|
|
120
|
-
b2 =
|
|
120
|
+
b2 = guard_or_false(sizeB == 1)
|
|
121
121
|
except torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode:
|
|
122
122
|
b2 = False
|
|
123
123
|
try:
|
|
124
|
-
b3 =
|
|
124
|
+
b3 = guard_or_false(sizeA == sizeB)
|
|
125
125
|
except torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode:
|
|
126
126
|
b3 = False
|
|
127
127
|
if b1 or b2 or b3:
|
|
128
|
-
expandedSizes[i] = sizeB if
|
|
128
|
+
expandedSizes[i] = sizeB if guard_or_false(sizeA == 1) else sizeA
|
|
129
129
|
else:
|
|
130
130
|
# PATCHED: generic case, the dimension is known, no need to assert
|
|
131
131
|
expandedSizes[i] = torch.sym_max(sizeA, sizeB)
|
|
@@ -137,7 +137,6 @@ def patched__broadcast_shapes(*_shapes):
|
|
|
137
137
|
from functools import reduce
|
|
138
138
|
from torch._prims_common import IntLike
|
|
139
139
|
from torch.fx.experimental.symbolic_shapes import (
|
|
140
|
-
guard_size_oblivious,
|
|
141
140
|
guard_or_false,
|
|
142
141
|
is_nested_int,
|
|
143
142
|
)
|
|
@@ -174,13 +173,15 @@ def patched__broadcast_shapes(*_shapes):
|
|
|
174
173
|
continue
|
|
175
174
|
# PATCHED: two cases, if == for sure, no broadcast,
|
|
176
175
|
# otherwise maybe broadcast with max(dimensions)
|
|
177
|
-
if
|
|
176
|
+
if guard_or_false(common_shape[idx] != 1):
|
|
177
|
+
pass
|
|
178
|
+
elif guard_or_false(common_shape[idx] == 1) or guard_or_false(shape[idx] != 1):
|
|
178
179
|
if shape[idx] < 0:
|
|
179
180
|
raise ValueError(
|
|
180
181
|
"Attempting to broadcast a dimension with negative length!"
|
|
181
182
|
)
|
|
182
183
|
common_shape[idx] = shape[idx]
|
|
183
|
-
|
|
184
|
+
else:
|
|
184
185
|
common_shape[idx] = torch.sym_max(common_shape[idx], shape[idx])
|
|
185
186
|
|
|
186
187
|
return common_shape
|
|
@@ -360,6 +361,10 @@ class patched_ShapeEnv:
|
|
|
360
361
|
},
|
|
361
362
|
)
|
|
362
363
|
|
|
364
|
+
for source in self.var_to_sources.get(a, []):
|
|
365
|
+
if user_tb:
|
|
366
|
+
self.specialization_stacks[source] = user_tb
|
|
367
|
+
|
|
363
368
|
# PATCHED: removed lines
|
|
364
369
|
# if config.print_specializations:
|
|
365
370
|
# self.log.warning(
|
|
@@ -973,15 +978,22 @@ def patched__broadcast_in_dim_meta(
|
|
|
973
978
|
new_strides.append(a.stride()[original_idx])
|
|
974
979
|
else:
|
|
975
980
|
new_strides.append(0)
|
|
981
|
+
# PATCHED: disabled this check
|
|
982
|
+
elif guard_or_false(a.shape[original_idx] != 1):
|
|
983
|
+
new_strides.append(a.stride()[original_idx])
|
|
976
984
|
else:
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
+
torch._check(
|
|
986
|
+
a.shape[original_idx] == shape[idx],
|
|
987
|
+
lambda idx=idx, original_idx=original_idx: (
|
|
988
|
+
f"non-broadcasting semantics require "
|
|
989
|
+
f"{a.shape[original_idx]} == {shape[idx]}, "
|
|
990
|
+
f"{guard_or_false(a.shape[idx] != 1)}, "
|
|
991
|
+
f"guard_or_false(a.shape[idx] == 1)="
|
|
992
|
+
f"{guard_or_false(a.shape[idx] == 1)}, "
|
|
993
|
+
f"a.stride()={a.stride()}, idx={idx}, "
|
|
994
|
+
f"original_idx={original_idx}"
|
|
995
|
+
),
|
|
996
|
+
)
|
|
985
997
|
new_strides.append(a.stride()[original_idx])
|
|
986
998
|
original_idx = original_idx + 1
|
|
987
999
|
else:
|
|
@@ -1019,6 +1019,26 @@ def patched__compute_dynamic_ntk_parameters(
|
|
|
1019
1019
|
return inv_freq, attention_factor
|
|
1020
1020
|
|
|
1021
1021
|
|
|
1022
|
+
def _get_rope_init_fn(self, layer_type=None) -> Callable:
|
|
1023
|
+
if hasattr(self, "rope_init_fn"):
|
|
1024
|
+
# transformers<=5.0
|
|
1025
|
+
rope_init_fn = (
|
|
1026
|
+
patched__compute_dynamic_ntk_parameters
|
|
1027
|
+
if self.rope_init_fn
|
|
1028
|
+
is transformers.modeling_rope_utils._compute_dynamic_ntk_parameters
|
|
1029
|
+
else self.rope_init_fn
|
|
1030
|
+
)
|
|
1031
|
+
return rope_init_fn
|
|
1032
|
+
|
|
1033
|
+
rope_type = self.rope_type if layer_type is None else self.rope_type[layer_type]
|
|
1034
|
+
rope_init_fn = self.compute_default_rope_parameters
|
|
1035
|
+
if rope_type != "default":
|
|
1036
|
+
rope_init_fn = transformers.modeling_rope_utils.ROPE_INIT_FUNCTIONS[self.rope_type]
|
|
1037
|
+
if rope_init_fn is transformers.modeling_rope_utils._compute_dynamic_ntk_parameters:
|
|
1038
|
+
return patched__compute_dynamic_ntk_parameters
|
|
1039
|
+
return rope_init_fn
|
|
1040
|
+
|
|
1041
|
+
|
|
1022
1042
|
def patched_dynamic_rope_update(rope_forward):
|
|
1023
1043
|
"""manual patch: ``[patch:transformers.modeling_rope_utils.dynamic_rope_update]``
|
|
1024
1044
|
|
|
@@ -1082,22 +1102,27 @@ def patched_dynamic_rope_update(rope_forward):
|
|
|
1082
1102
|
|
|
1083
1103
|
"""
|
|
1084
1104
|
|
|
1085
|
-
def longrope_frequency_update(self, position_ids, device):
|
|
1105
|
+
def longrope_frequency_update(self, position_ids, device, layer_type=None):
|
|
1086
1106
|
# It is no use to patch the function after the model is created
|
|
1087
1107
|
# as rope_init_fn is an attribute set to one function when the model
|
|
1088
1108
|
# is created and when no patch is applied yet.
|
|
1089
1109
|
# So we select the patched version here.
|
|
1090
|
-
rope_init_fn = (
|
|
1091
|
-
patched__compute_dynamic_ntk_parameters
|
|
1092
|
-
if self.rope_init_fn
|
|
1093
|
-
is transformers.modeling_rope_utils._compute_dynamic_ntk_parameters
|
|
1094
|
-
else self.rope_init_fn
|
|
1095
|
-
)
|
|
1110
|
+
rope_init_fn = _get_rope_init_fn(self, layer_type=layer_type)
|
|
1096
1111
|
seq_len = torch.max(position_ids) + 1
|
|
1097
1112
|
if hasattr(self.config, "original_max_position_embeddings"):
|
|
1098
1113
|
original_max_position_embeddings = self.config.original_max_position_embeddings
|
|
1099
1114
|
else:
|
|
1100
1115
|
original_max_position_embeddings = self.config.max_position_embeddings
|
|
1116
|
+
|
|
1117
|
+
if layer_type is None:
|
|
1118
|
+
# rope_type = self.rope_type
|
|
1119
|
+
original_inv_freq = self.original_inv_freq
|
|
1120
|
+
prefix = ""
|
|
1121
|
+
else:
|
|
1122
|
+
# rope_type = self.rope_type[layer_type]
|
|
1123
|
+
original_inv_freq = getattr(self, f"{layer_type}_original_inv_freq")
|
|
1124
|
+
prefix = f"{layer_type}_"
|
|
1125
|
+
|
|
1101
1126
|
# At export time, seq_len is unknown.
|
|
1102
1127
|
long_inv_freq, _ = rope_init_fn(
|
|
1103
1128
|
self.config, device, seq_len=original_max_position_embeddings + 1
|
|
@@ -1112,13 +1137,13 @@ def patched_dynamic_rope_update(rope_forward):
|
|
|
1112
1137
|
(lambda x, y: y.clone()),
|
|
1113
1138
|
[long_inv_freq, original_inv_freq],
|
|
1114
1139
|
)
|
|
1115
|
-
self
|
|
1140
|
+
setattr(self, f"{prefix}inv_freq", inv_freq)
|
|
1116
1141
|
# if seq_len > original_max_position_embeddings:
|
|
1117
1142
|
# self.inv_freq = self.long_inv_freq
|
|
1118
1143
|
# else:
|
|
1119
1144
|
# self.inv_freq = self.original_inv_freq
|
|
1120
1145
|
|
|
1121
|
-
def dynamic_frequency_update(self, position_ids, device):
|
|
1146
|
+
def dynamic_frequency_update(self, position_ids, device, layer_type=None):
|
|
1122
1147
|
# constructor:
|
|
1123
1148
|
# - self.max_seq_len_cached = config.max_position_embeddings
|
|
1124
1149
|
# - self.original_max_seq_len = config.max_position_embeddings
|
|
@@ -1128,12 +1153,7 @@ def patched_dynamic_rope_update(rope_forward):
|
|
|
1128
1153
|
# as rope_init_fn is an attribute set to one function when the model
|
|
1129
1154
|
# is created and when no patch is applied yet.
|
|
1130
1155
|
# So we select the patched version here.
|
|
1131
|
-
rope_init_fn = (
|
|
1132
|
-
patched__compute_dynamic_ntk_parameters
|
|
1133
|
-
if self.rope_init_fn
|
|
1134
|
-
is transformers.modeling_rope_utils._compute_dynamic_ntk_parameters
|
|
1135
|
-
else self.rope_init_fn
|
|
1136
|
-
)
|
|
1156
|
+
rope_init_fn = _get_rope_init_fn(self, layer_type=layer_type)
|
|
1137
1157
|
|
|
1138
1158
|
# This behaviour is difficult to translate.
|
|
1139
1159
|
# The sequence always grows.
|
|
@@ -1162,6 +1182,19 @@ def patched_dynamic_rope_update(rope_forward):
|
|
|
1162
1182
|
self.config, device, seq_len=seq_len
|
|
1163
1183
|
)
|
|
1164
1184
|
|
|
1185
|
+
if layer_type is None:
|
|
1186
|
+
# rope_type = self.rope_type
|
|
1187
|
+
# max_seq_len_cached = self.max_seq_len_cached
|
|
1188
|
+
original_inv_freq = self.original_inv_freq
|
|
1189
|
+
prefix = ""
|
|
1190
|
+
else:
|
|
1191
|
+
# rope_type = self.rope_type[layer_type]
|
|
1192
|
+
# max_seq_len_cached = getattr(
|
|
1193
|
+
# self, f"{layer_type}_max_seq_len_cached", self.max_seq_len_cached
|
|
1194
|
+
# )
|
|
1195
|
+
original_inv_freq = getattr(self, f"{layer_type}_original_inv_freq")
|
|
1196
|
+
prefix = f"{layer_type}_"
|
|
1197
|
+
|
|
1165
1198
|
# Second test to translate.
|
|
1166
1199
|
# Let's keep in mind, self.max_seq_len_cached = seq_len is likely to be True.
|
|
1167
1200
|
# But in that case the following condition is a way to restore the original cache.
|
|
@@ -1183,15 +1216,26 @@ def patched_dynamic_rope_update(rope_forward):
|
|
|
1183
1216
|
(lambda x, y: y.clone()),
|
|
1184
1217
|
[long_inv_freq, original_inv_freq],
|
|
1185
1218
|
)
|
|
1186
|
-
self
|
|
1219
|
+
setattr(self, f"{prefix}inv_freq", inv_freq)
|
|
1187
1220
|
|
|
1188
1221
|
@wraps(rope_forward)
|
|
1189
|
-
def wrapper(self, x, position_ids):
|
|
1222
|
+
def wrapper(self, x, position_ids, layer_type=None):
|
|
1223
|
+
if layer_type is None:
|
|
1224
|
+
if "dynamic" in self.rope_type:
|
|
1225
|
+
dynamic_frequency_update(self, position_ids, device=x.device)
|
|
1226
|
+
elif self.rope_type == "longrope":
|
|
1227
|
+
longrope_frequency_update(self, position_ids, device=x.device)
|
|
1228
|
+
return rope_forward(self, x, position_ids)
|
|
1229
|
+
|
|
1190
1230
|
if "dynamic" in self.rope_type:
|
|
1191
|
-
dynamic_frequency_update(
|
|
1231
|
+
dynamic_frequency_update(
|
|
1232
|
+
self, position_ids, device=x.device, layer_type=layer_type
|
|
1233
|
+
)
|
|
1192
1234
|
elif self.rope_type == "longrope":
|
|
1193
|
-
longrope_frequency_update(
|
|
1194
|
-
|
|
1235
|
+
longrope_frequency_update(
|
|
1236
|
+
self, position_ids, device=x.device, layer_type=layer_type
|
|
1237
|
+
)
|
|
1238
|
+
return rope_forward(self, x, position_ids, layer_type=layer_type)
|
|
1195
1239
|
|
|
1196
1240
|
return wrapper
|
|
1197
1241
|
|
|
@@ -1287,12 +1331,18 @@ class common_RotaryEmbedding(torch.nn.Module):
|
|
|
1287
1331
|
# @torch.no_grad()
|
|
1288
1332
|
# PATCHED: the decorator
|
|
1289
1333
|
@patched_dynamic_rope_update
|
|
1290
|
-
def forward(self, x, position_ids):
|
|
1334
|
+
def forward(self, x, position_ids, layer_type=None):
|
|
1335
|
+
if layer_type is not None:
|
|
1336
|
+
# transformers>=5.0
|
|
1337
|
+
inv_freq = getattr(self, f"{layer_type}_inv_freq")
|
|
1338
|
+
attention_scaling = getattr(self, f"{layer_type}_attention_scaling")
|
|
1339
|
+
else:
|
|
1340
|
+
# transformers<5.0
|
|
1341
|
+
inv_freq = self.inv_freq
|
|
1342
|
+
attention_scaling = self.attention_scaling
|
|
1343
|
+
|
|
1291
1344
|
inv_freq_expanded = (
|
|
1292
|
-
|
|
1293
|
-
.float()
|
|
1294
|
-
.expand(position_ids.shape[0], -1, 1)
|
|
1295
|
-
.to(x.device)
|
|
1345
|
+
inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1).to(x.device)
|
|
1296
1346
|
)
|
|
1297
1347
|
position_ids_expanded = position_ids[:, None, :].float()
|
|
1298
1348
|
|
|
@@ -1304,8 +1354,8 @@ class common_RotaryEmbedding(torch.nn.Module):
|
|
|
1304
1354
|
with torch.autocast(device_type=device_type, enabled=False): # Force float32
|
|
1305
1355
|
freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
|
|
1306
1356
|
emb = torch.cat((freqs, freqs), dim=-1)
|
|
1307
|
-
cos = emb.cos() *
|
|
1308
|
-
sin = emb.sin() *
|
|
1357
|
+
cos = emb.cos() * attention_scaling
|
|
1358
|
+
sin = emb.sin() * attention_scaling
|
|
1309
1359
|
|
|
1310
1360
|
return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
|
|
1311
1361
|
|
|
@@ -1380,7 +1430,8 @@ class patched_IdeficsEmbedding(torch.nn.Module):
|
|
|
1380
1430
|
|
|
1381
1431
|
def _set_cos_sin_cache_then(x, inv_freq, seq_len, _cos_cached, _sin_cached):
|
|
1382
1432
|
t = torch.arange(seq_len, device=x.device, dtype=torch.int64).type_as(inv_freq)
|
|
1383
|
-
freqs = torch.einsum("i,j->ij", t, inv_freq)
|
|
1433
|
+
# freqs = torch.einsum("i,j->ij", t, inv_freq)
|
|
1434
|
+
freqs = t.reshape((-1, 1)) * inv_freq.reshape((1, -1))
|
|
1384
1435
|
emb = torch.cat((freqs, freqs), dim=-1)
|
|
1385
1436
|
return emb.cos().to(x.dtype), emb.sin().to(x.dtype)
|
|
1386
1437
|
|
|
@@ -95,6 +95,8 @@ def get_untrained_model_with_inputs(
|
|
|
95
95
|
print("-- dynamic shapes:", pprint.pformat(data['dynamic_shapes']))
|
|
96
96
|
print("-- configuration:", pprint.pformat(data['configuration']))
|
|
97
97
|
"""
|
|
98
|
+
if task == "":
|
|
99
|
+
task = None
|
|
98
100
|
assert not use_preinstalled or not use_only_preinstalled, (
|
|
99
101
|
f"model_id={model_id!r}, preinstalled model is only available "
|
|
100
102
|
f"if use_only_preinstalled is False."
|
|
@@ -120,14 +122,16 @@ def get_untrained_model_with_inputs(
|
|
|
120
122
|
**(model_kwargs or {}),
|
|
121
123
|
)
|
|
122
124
|
|
|
123
|
-
model,
|
|
125
|
+
model, task_, mkwargs, diff_config = None, None, {}, None
|
|
124
126
|
if use_pretrained and same_as_pretrained:
|
|
125
127
|
if model_id in HANDLED_MODELS:
|
|
126
|
-
model,
|
|
128
|
+
model, task_, config = load_specific_model(model_id, verbose=verbose)
|
|
127
129
|
|
|
130
|
+
if task is None:
|
|
131
|
+
task = task_
|
|
128
132
|
if model is None:
|
|
129
133
|
arch = architecture_from_config(config)
|
|
130
|
-
if arch is None:
|
|
134
|
+
if task is None and arch is None:
|
|
131
135
|
task = task_from_id(model_id, subfolder=subfolder)
|
|
132
136
|
assert task is not None or arch is not None, (
|
|
133
137
|
f"Unable to determine the architecture for model {model_id!r}, "
|
|
@@ -4,7 +4,7 @@ import inspect
|
|
|
4
4
|
import os
|
|
5
5
|
import pprint
|
|
6
6
|
import sys
|
|
7
|
-
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
|
|
7
|
+
from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Union
|
|
8
8
|
import time
|
|
9
9
|
import numpy as np
|
|
10
10
|
import onnx
|
|
@@ -117,11 +117,21 @@ def _make_folder_name(
|
|
|
117
117
|
drop_inputs: Optional[List[str]] = None,
|
|
118
118
|
same_as_pretrained: bool = False,
|
|
119
119
|
use_pretrained: bool = False,
|
|
120
|
+
task: Optional[str] = None,
|
|
120
121
|
) -> str:
|
|
121
122
|
"Creates a filename unique based on the given options."
|
|
122
123
|
els = [model_id.replace("/", "_")]
|
|
123
124
|
if subfolder:
|
|
124
125
|
els.append(subfolder.replace("/", "_"))
|
|
126
|
+
if not task:
|
|
127
|
+
els.append(task) # type: ignore[arg-type]
|
|
128
|
+
if drop_inputs:
|
|
129
|
+
ii = "-".join(f"{s[0]}{s[-1]}" for s in drop_inputs)
|
|
130
|
+
els.append(f"I-{ii.upper()}")
|
|
131
|
+
if use_pretrained:
|
|
132
|
+
els.append("TRAINED")
|
|
133
|
+
elif same_as_pretrained:
|
|
134
|
+
els.append("SAMESIZE")
|
|
125
135
|
if exporter:
|
|
126
136
|
els.append(exporter)
|
|
127
137
|
if optimization:
|
|
@@ -142,14 +152,7 @@ def _make_folder_name(
|
|
|
142
152
|
els.append(sdev)
|
|
143
153
|
if opset is not None:
|
|
144
154
|
els.append(f"op{opset}")
|
|
145
|
-
if
|
|
146
|
-
ii = "-".join(f"{s[0]}{s[-1]}" for s in drop_inputs)
|
|
147
|
-
els.append(f"I-{ii.upper()}")
|
|
148
|
-
if use_pretrained:
|
|
149
|
-
els.append("TRAINED")
|
|
150
|
-
elif same_as_pretrained:
|
|
151
|
-
els.append("SAMESIZE")
|
|
152
|
-
return "-".join(els)
|
|
155
|
+
return "/".join([e for e in els if e])
|
|
153
156
|
|
|
154
157
|
|
|
155
158
|
def version_summary() -> Dict[str, Union[int, float, str]]:
|
|
@@ -319,6 +322,7 @@ def validate_model(
|
|
|
319
322
|
inputs2: int = 1,
|
|
320
323
|
output_names: Optional[List[str]] = None,
|
|
321
324
|
ort_logs: bool = False,
|
|
325
|
+
quiet_input_sets: Optional[Set[str]] = None,
|
|
322
326
|
) -> Tuple[Dict[str, Union[int, float, str]], Dict[str, Any]]:
|
|
323
327
|
"""
|
|
324
328
|
Validates a model.
|
|
@@ -373,6 +377,8 @@ def validate_model(
|
|
|
373
377
|
or an empty cache for example
|
|
374
378
|
:param output_names: output names the onnx exporter should use
|
|
375
379
|
:param ort_logs: increases onnxruntime verbosity when creating the session
|
|
380
|
+
:param quiet_input_sets: avoid raising an exception if the inputs belongs to that set
|
|
381
|
+
even if quiet is False
|
|
376
382
|
:return: two dictionaries, one with some metrics,
|
|
377
383
|
another one with whatever the function produces
|
|
378
384
|
|
|
@@ -473,6 +479,7 @@ def validate_model(
|
|
|
473
479
|
drop_inputs=drop_inputs,
|
|
474
480
|
use_pretrained=use_pretrained,
|
|
475
481
|
same_as_pretrained=same_as_pretrained,
|
|
482
|
+
task=task,
|
|
476
483
|
)
|
|
477
484
|
dump_folder = os.path.join(dump_folder, folder_name)
|
|
478
485
|
if not os.path.exists(dump_folder):
|
|
@@ -487,6 +494,8 @@ def validate_model(
|
|
|
487
494
|
print(f"[validate_model] validate model id {model_id!r}, subfolder={subfolder!r}")
|
|
488
495
|
else:
|
|
489
496
|
print(f"[validate_model] validate model id {model_id!r}")
|
|
497
|
+
if task:
|
|
498
|
+
print(f"[validate_model] with task {task!r}")
|
|
490
499
|
print(f"[validate_model] patch={patch!r}")
|
|
491
500
|
if model_options:
|
|
492
501
|
print(f"[validate_model] model_options={model_options!r}")
|
|
@@ -762,6 +771,10 @@ def validate_model(
|
|
|
762
771
|
ep = data["exported_program"]
|
|
763
772
|
if verbose:
|
|
764
773
|
print(f"[validate_model] -- dumps exported program in {dump_folder!r}...")
|
|
774
|
+
assert isinstance(
|
|
775
|
+
folder_name, str
|
|
776
|
+
), f"folder_name={folder_name!r} should be a string"
|
|
777
|
+
folder_name = folder_name.replace("/", "-")
|
|
765
778
|
with open(os.path.join(dump_folder, f"{folder_name}.ep"), "w") as f:
|
|
766
779
|
f.write(str(ep))
|
|
767
780
|
torch.export.save(ep, os.path.join(dump_folder, f"{folder_name}.pt2"))
|
|
@@ -770,6 +783,10 @@ def validate_model(
|
|
|
770
783
|
if verbose:
|
|
771
784
|
print("[validate_model] done (dump ep)")
|
|
772
785
|
if "onnx_program" in data:
|
|
786
|
+
assert isinstance(
|
|
787
|
+
folder_name, str
|
|
788
|
+
), f"folder_name={folder_name!r} should be a string"
|
|
789
|
+
folder_name = folder_name.replace("/", "-")
|
|
773
790
|
epo = data["onnx_program"]
|
|
774
791
|
if verbose:
|
|
775
792
|
print(f"[validate_model] dumps onnx program in {dump_folder!r}...")
|
|
@@ -842,6 +859,7 @@ def validate_model(
|
|
|
842
859
|
warmup=warmup,
|
|
843
860
|
second_input_keys=second_input_keys,
|
|
844
861
|
ort_logs=ort_logs,
|
|
862
|
+
quiet_input_sets=quiet_input_sets,
|
|
845
863
|
)
|
|
846
864
|
summary.update(summary_valid)
|
|
847
865
|
summary["time_total_validation_onnx"] = time.perf_counter() - validation_begin
|
|
@@ -904,6 +922,7 @@ def validate_model(
|
|
|
904
922
|
repeat=repeat,
|
|
905
923
|
warmup=warmup,
|
|
906
924
|
second_input_keys=second_input_keys,
|
|
925
|
+
quiet_input_sets=quiet_input_sets,
|
|
907
926
|
)
|
|
908
927
|
summary.update(summary_valid)
|
|
909
928
|
|
|
@@ -1289,6 +1308,7 @@ def validate_onnx_model(
|
|
|
1289
1308
|
warmup: int = 0,
|
|
1290
1309
|
second_input_keys: Optional[List[str]] = None,
|
|
1291
1310
|
ort_logs: bool = False,
|
|
1311
|
+
quiet_input_sets: Optional[Set[str]] = None,
|
|
1292
1312
|
) -> Tuple[Dict[str, Any], Dict[str, Any]]:
|
|
1293
1313
|
"""
|
|
1294
1314
|
Verifies that an onnx model produces the same
|
|
@@ -1308,6 +1328,7 @@ def validate_onnx_model(
|
|
|
1308
1328
|
to make sure the exported model supports dynamism, the value is
|
|
1309
1329
|
used as an increment added to the first set of inputs (added to dimensions)
|
|
1310
1330
|
:param ort_logs: triggers the logs for onnxruntime
|
|
1331
|
+
:param quiet_input_sets: avoid raising an exception for these sets of inputs
|
|
1311
1332
|
:return: two dictionaries, one with some metrics,
|
|
1312
1333
|
another one with whatever the function produces
|
|
1313
1334
|
"""
|
|
@@ -1431,6 +1452,8 @@ def validate_onnx_model(
|
|
|
1431
1452
|
keys = [("inputs", "run_expected", "")]
|
|
1432
1453
|
if second_input_keys:
|
|
1433
1454
|
keys.extend([(k, f"run_expected2{k[6:]}", f"2{k[6:]}") for k in second_input_keys])
|
|
1455
|
+
if verbose:
|
|
1456
|
+
print(f"[validate_onnx_model] -- keys={keys}")
|
|
1434
1457
|
for k_input, k_expected, suffix in keys:
|
|
1435
1458
|
# make_feeds
|
|
1436
1459
|
assert k_input in data, f"Unable to find {k_input!r} in {sorted(data)}"
|
|
@@ -1455,10 +1478,12 @@ def validate_onnx_model(
|
|
|
1455
1478
|
|
|
1456
1479
|
# run ort
|
|
1457
1480
|
if verbose:
|
|
1458
|
-
print("[validate_onnx_model] run session...")
|
|
1481
|
+
print(f"[validate_onnx_model] run session on inputs 'inputs{suffix}'...")
|
|
1482
|
+
if quiet_input_sets and f"inputs{suffix}" in quiet_input_sets:
|
|
1483
|
+
print(f"[validate_onnx_model] quiet_input_sets={quiet_input_sets}")
|
|
1459
1484
|
|
|
1460
1485
|
got = _quiet_or_not_quiet(
|
|
1461
|
-
quiet,
|
|
1486
|
+
quiet or (quiet_input_sets is not None and f"inputs{suffix}" in quiet_input_sets),
|
|
1462
1487
|
_mk(f"run_onnx_ort{suffix}"),
|
|
1463
1488
|
summary,
|
|
1464
1489
|
data,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
onnx_diagnostic/__init__.py,sha256=
|
|
1
|
+
onnx_diagnostic/__init__.py,sha256=rsSRl1QPe3XLEW8cPAdFVV6eLYgcRFg37pNNVTw5FAc,174
|
|
2
2
|
onnx_diagnostic/__main__.py,sha256=YmyV_Aq_ianDlHyKLHMa6h8YK3ZmFPpLVHLKjM91aCk,79
|
|
3
|
-
onnx_diagnostic/_command_lines_parser.py,sha256=
|
|
3
|
+
onnx_diagnostic/_command_lines_parser.py,sha256=bl6lorcodFk14dm2lgeCjr4OkRziUrKXn3GGkbxIuVA,33987
|
|
4
4
|
onnx_diagnostic/api.py,sha256=BhCl_yCd78N7TlVtPOHjeYv1QBEy39TjZ647rcHqLh0,345
|
|
5
5
|
onnx_diagnostic/doc.py,sha256=t3RELgfooYnVMAi0JSpggWkQEgUsREz8NmRvn0TnLI8,2829
|
|
6
6
|
onnx_diagnostic/ext_test_case.py,sha256=emfQGiQSz5FVDhyJ1Acsv_Tast7tWl426TjtpNqxDBU,43558
|
|
@@ -12,8 +12,8 @@ onnx_diagnostic/helpers/__init__.py,sha256=GJ2GT7cgnlIveVUwMZhuvUwidbTJaKv8CsSIO
|
|
|
12
12
|
onnx_diagnostic/helpers/_log_helper.py,sha256=OTwQH0OIxs9B6nrSvR7MoxMimSw_8mU0mj133NvLk5o,16832
|
|
13
13
|
onnx_diagnostic/helpers/args_helper.py,sha256=SRWnqC7EENg09RZlA50B_PcdiIhdbgA4C3ACfzl5nMs,4419
|
|
14
14
|
onnx_diagnostic/helpers/bench_run.py,sha256=CGA6VMJZMH2gDhVueT9ypNm4PMcjGrrGFYp08nhWj9k,16539
|
|
15
|
-
onnx_diagnostic/helpers/cache_helper.py,sha256=
|
|
16
|
-
onnx_diagnostic/helpers/config_helper.py,sha256=
|
|
15
|
+
onnx_diagnostic/helpers/cache_helper.py,sha256=4fkPKLG590l1Gbqaw_QubXeJqY17X2Z6CBmLp23-BYI,24849
|
|
16
|
+
onnx_diagnostic/helpers/config_helper.py,sha256=cWRETgFhZ7tayIZPnMqF8BF5AvTU64G2BMqyzgO7lzs,5670
|
|
17
17
|
onnx_diagnostic/helpers/doc_helper.py,sha256=pl5MZd3_FaE8BqQnqoBuSBxoNCFcd2OJd3eITUSku5c,5897
|
|
18
18
|
onnx_diagnostic/helpers/graph_helper.py,sha256=hevQT5a7_QuriVPQcbT5qe18n99Doyl5h3-qshx1-uk,14093
|
|
19
19
|
onnx_diagnostic/helpers/helper.py,sha256=zl7vG6G4ueq931Z9iT8OlKfmtFxvRJD2WJQh_qsMiBs,63401
|
|
@@ -23,7 +23,7 @@ onnx_diagnostic/helpers/mini_onnx_builder.py,sha256=Cgx1ojmV0S_JpZ_UqwsNxeULMMDv
|
|
|
23
23
|
onnx_diagnostic/helpers/model_builder_helper.py,sha256=sK40KRN9GWK1vbNJHIXkYAojblbKD0bdom7BFmoNSv4,12860
|
|
24
24
|
onnx_diagnostic/helpers/onnx_helper.py,sha256=oxl3x0EQowGP9kfz8aKDqnJZcvYY8FeZLsfoLJDiSUg,39826
|
|
25
25
|
onnx_diagnostic/helpers/ort_session.py,sha256=UgUUeUslDxEFBc6w6f3HMq_a7bn4TBlItmojqWquSj4,29281
|
|
26
|
-
onnx_diagnostic/helpers/rt_helper.py,sha256=
|
|
26
|
+
onnx_diagnostic/helpers/rt_helper.py,sha256=mmxQ0RQ7mhG0ybHOtzbZiV2mt503JVaKcErQQ79ydWs,5208
|
|
27
27
|
onnx_diagnostic/helpers/torch_helper.py,sha256=SY01uEx5tKtPcix91AifhgmsvNkDMGpTigT7w_0Nj98,34442
|
|
28
28
|
onnx_diagnostic/reference/__init__.py,sha256=rLZsxOlnb7-81F2CzepGnZLejaROg4JvgFaGR9FwVQA,208
|
|
29
29
|
onnx_diagnostic/reference/evaluator.py,sha256=RzNzjFDeMe-4X51Tb22N6aagazY5ktNq-mRmPcfY5EU,8848
|
|
@@ -77,7 +77,7 @@ onnx_diagnostic/tasks/automatic_speech_recognition.py,sha256=umZmjGW1gDUFkqvBJnQ
|
|
|
77
77
|
onnx_diagnostic/tasks/feature_extraction.py,sha256=Zh9p_Q8FqEO2_aqI0cCiq8OXuM3WUZbwItlLOmLnNl8,5537
|
|
78
78
|
onnx_diagnostic/tasks/fill_mask.py,sha256=5Gt6zlj0p6vuifox7Wmj-TpHXJvPS0CEH8evgdBHDNA,2640
|
|
79
79
|
onnx_diagnostic/tasks/image_classification.py,sha256=nLpBBB1Gkog3Fk6pu2waiHcuQr4ILPptc9FhQ-pn460,4682
|
|
80
|
-
onnx_diagnostic/tasks/image_text_to_text.py,sha256=
|
|
80
|
+
onnx_diagnostic/tasks/image_text_to_text.py,sha256=HDXuk1bEE3qTR0mUR_6rw-5RAXSyUvGY-dMNamIpvn0,21577
|
|
81
81
|
onnx_diagnostic/tasks/image_to_video.py,sha256=SoF2cVIJr6P30Abp-FCuixFDh5RvTuNEOL36QthGY6U,3860
|
|
82
82
|
onnx_diagnostic/tasks/mask_generation.py,sha256=fjdD3rd-O-mFL0hQy3la3JXKth_0bH2HL7Eelq-3Dbs,5057
|
|
83
83
|
onnx_diagnostic/tasks/mixture_of_expert.py,sha256=al4tk1BrHidtRiHlAaiflWiJaAte0d5M8WcBioANG9k,2808
|
|
@@ -86,14 +86,14 @@ onnx_diagnostic/tasks/sentence_similarity.py,sha256=vPqNZgAnIvY0rKWPUTs0IlU3RFQD
|
|
|
86
86
|
onnx_diagnostic/tasks/summarization.py,sha256=8vB_JiRzDEacIvr8CYTuVQTH73xG_jNkndoS9RHJTSs,8292
|
|
87
87
|
onnx_diagnostic/tasks/text2text_generation.py,sha256=35eF_RlSeMdLTZPooLMAnszs-z0bkKZ34Iej3JgA96A,8602
|
|
88
88
|
onnx_diagnostic/tasks/text_classification.py,sha256=CGc72SpXFzTUyzAHEMPgyy_s187DaYGsRdrosxG80_Q,2711
|
|
89
|
-
onnx_diagnostic/tasks/text_generation.py,sha256
|
|
89
|
+
onnx_diagnostic/tasks/text_generation.py,sha256=FwpmI4c_cO9uYQwJFfsHRMArPdwaeU5TBan2lisoHZk,14205
|
|
90
90
|
onnx_diagnostic/tasks/text_to_image.py,sha256=mOS3Ruosi3hzRMxXLDN7ZkAbi7NnQb7MWwQP_okGVHs,2962
|
|
91
91
|
onnx_diagnostic/tasks/zero_shot_image_classification.py,sha256=jJCMWuOqGv5ahCfjrcqxuYCJFhTgHV5KUf2yyv2yxYA,4624
|
|
92
92
|
onnx_diagnostic/tasks/data/__init__.py,sha256=uJoemrWgEjI6oA-tMX7r3__x-b3siPmkgqaY7bgIles,401
|
|
93
93
|
onnx_diagnostic/tasks/data/dummies_imagetext2text_generation_gemma3.onnx,sha256=UbtvmWMqcZOKJ-I-HXWI1A6YR6QDaFS5u_yXm5C3ZBw,10299
|
|
94
94
|
onnx_diagnostic/torch_export_patches/__init__.py,sha256=0SaZedwznm1hQUCvXZsGZORV5vby954wEExr5faepGg,720
|
|
95
|
-
onnx_diagnostic/torch_export_patches/onnx_export_errors.py,sha256=
|
|
96
|
-
onnx_diagnostic/torch_export_patches/onnx_export_serialization.py,sha256=
|
|
95
|
+
onnx_diagnostic/torch_export_patches/onnx_export_errors.py,sha256=T2FaIBSU3NfUyt54whwBmRHPuAzmZKFVHuwu-mikNz4,30475
|
|
96
|
+
onnx_diagnostic/torch_export_patches/onnx_export_serialization.py,sha256=K78uX5EHTuu0ah3mkZWNcGow4775GKH-EnDs3ZlIEhE,11778
|
|
97
97
|
onnx_diagnostic/torch_export_patches/patch_expressions.py,sha256=vr4tt61cbDnaaaduzMj4UBZ8OUtr6GfDpIWwOYqjWzs,3213
|
|
98
98
|
onnx_diagnostic/torch_export_patches/patch_inputs.py,sha256=2HQZKQV6TM5430RIvKiMPe4cfGvFdx1UnP1w76CeGE4,8110
|
|
99
99
|
onnx_diagnostic/torch_export_patches/patch_module.py,sha256=R2d9IHM-RwsBKDsxuBIJnEqMoxbS9gd4YWFGG2wwV5A,39881
|
|
@@ -101,19 +101,19 @@ onnx_diagnostic/torch_export_patches/patch_module_helper.py,sha256=2U0AdyZuU0W54
|
|
|
101
101
|
onnx_diagnostic/torch_export_patches/eval/__init__.py,sha256=YQoOGt9XQLWqnJ15NnT7ri_jDevfvpuQwEJo38E-VRU,25056
|
|
102
102
|
onnx_diagnostic/torch_export_patches/eval/model_cases.py,sha256=joDJV1YfrhYBR_6eXYvNO1jbiJM8Whb47NWZxo8SBwg,27172
|
|
103
103
|
onnx_diagnostic/torch_export_patches/patches/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
104
|
-
onnx_diagnostic/torch_export_patches/patches/patch_torch.py,sha256=
|
|
105
|
-
onnx_diagnostic/torch_export_patches/patches/patch_transformers.py,sha256=
|
|
104
|
+
onnx_diagnostic/torch_export_patches/patches/patch_torch.py,sha256=QIm3GabPnoJDIM1HJl0reyUKf7fg7h57TsHkWfDWjF4,41408
|
|
105
|
+
onnx_diagnostic/torch_export_patches/patches/patch_transformers.py,sha256=aVYEhrn48YUGn0rim5o2oygWFkwm3-HsGRpS1rGySeQ,81496
|
|
106
106
|
onnx_diagnostic/torch_export_patches/serialization/__init__.py,sha256=BHLdRPtNAtNPAS-bPKEj3-foGSPvwAbZXrHzGGPDLEw,1876
|
|
107
107
|
onnx_diagnostic/torch_export_patches/serialization/diffusers_impl.py,sha256=drq3EH_yjcSuIWYsVeUWm8Cx6YCZFU6bP_1PLtPfY5I,945
|
|
108
108
|
onnx_diagnostic/torch_export_patches/serialization/transformers_impl.py,sha256=mcmZGekzQlLgE_o3SdKlRgCx4ewwyyAuNWZ9CaN_zrI,9317
|
|
109
109
|
onnx_diagnostic/torch_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
110
110
|
onnx_diagnostic/torch_models/llms.py,sha256=soyg4yC87ptGoeulJhKqw5opGmuLvH1pn_ZDXZ4Jr8E,90
|
|
111
|
-
onnx_diagnostic/torch_models/validate.py,sha256=
|
|
111
|
+
onnx_diagnostic/torch_models/validate.py,sha256=0KL1vQmB9DTFuJqc8_CyddIztuwFx9qpRRPULHd-C04,80434
|
|
112
112
|
onnx_diagnostic/torch_models/hghub/__init__.py,sha256=vi1Q7YHdddj1soiBN42MSvJdFqe2_KUoWafHISjwOu8,58
|
|
113
113
|
onnx_diagnostic/torch_models/hghub/hub_api.py,sha256=rFbiPNLET-KdBpnv-p0nKgwHX6d7C_Z0s9zZ86_92kQ,14307
|
|
114
114
|
onnx_diagnostic/torch_models/hghub/hub_data.py,sha256=8V_pAgACPLPsLRYUododg7MSL6str-T3tBEGY4OaeYQ,8724
|
|
115
115
|
onnx_diagnostic/torch_models/hghub/hub_data_cached_configs.py,sha256=aSa_7Rjider6ruqQ2-fXQMyyDS8VhB1xKxcPNk8qUeU,288776
|
|
116
|
-
onnx_diagnostic/torch_models/hghub/model_inputs.py,sha256=
|
|
116
|
+
onnx_diagnostic/torch_models/hghub/model_inputs.py,sha256=xIY_CWOp3m5-cJUvDLTZiH9GwiXi6xTYwONgFY4o45g,15593
|
|
117
117
|
onnx_diagnostic/torch_models/hghub/model_specific.py,sha256=j50Nu7wddJMoqmD4QzMbNdFDUUgUmSBKRzPDH55TlUQ,2498
|
|
118
118
|
onnx_diagnostic/torch_models/untrained/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
119
119
|
onnx_diagnostic/torch_models/untrained/llm_phi2.py,sha256=JbGZmW41MPJcQgqaJc9R2G00nI79nI-lABN-ffA1lmY,4037
|
|
@@ -121,8 +121,8 @@ onnx_diagnostic/torch_models/untrained/llm_tiny_llm.py,sha256=QXw_Bs2SzfeiQMf-tm
|
|
|
121
121
|
onnx_diagnostic/torch_onnx/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
122
122
|
onnx_diagnostic/torch_onnx/runtime_info.py,sha256=1g9F_Jf9AAgYQU4stbsrFXwQl-30mWlQrFbQ7val8Ps,9268
|
|
123
123
|
onnx_diagnostic/torch_onnx/sbs.py,sha256=IoKLA5UwS6kY8g4OOf_bdQwCziIsQfBczZ3w8wo4wZM,16905
|
|
124
|
-
onnx_diagnostic-0.7.
|
|
125
|
-
onnx_diagnostic-0.7.
|
|
126
|
-
onnx_diagnostic-0.7.
|
|
127
|
-
onnx_diagnostic-0.7.
|
|
128
|
-
onnx_diagnostic-0.7.
|
|
124
|
+
onnx_diagnostic-0.7.15.dist-info/licenses/LICENSE.txt,sha256=Vv6TXglX6Rc0d-f8aREhayhT-6PMQXEyOmI2NKlUCMc,1045
|
|
125
|
+
onnx_diagnostic-0.7.15.dist-info/METADATA,sha256=8PCb8jeG1AwC10iaBQRqNBE_JF7huNn2o-l_7BnwzzE,6730
|
|
126
|
+
onnx_diagnostic-0.7.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
127
|
+
onnx_diagnostic-0.7.15.dist-info/top_level.txt,sha256=KwNkXewmcobM3ZT1DJLVWH6ebJzA5qKg7cWqKfpGNT4,16
|
|
128
|
+
onnx_diagnostic-0.7.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|