onnx-diagnostic 0.7.11__py3-none-any.whl → 0.7.13__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.
Files changed (30) hide show
  1. onnx_diagnostic/__init__.py +1 -1
  2. onnx_diagnostic/_command_lines_parser.py +5 -2
  3. onnx_diagnostic/export/dynamic_shapes.py +11 -2
  4. onnx_diagnostic/helpers/helper.py +11 -5
  5. onnx_diagnostic/helpers/log_helper.py +65 -12
  6. onnx_diagnostic/helpers/mini_onnx_builder.py +17 -0
  7. onnx_diagnostic/helpers/model_builder_helper.py +1 -0
  8. onnx_diagnostic/helpers/rt_helper.py +55 -37
  9. onnx_diagnostic/helpers/torch_helper.py +31 -7
  10. onnx_diagnostic/reference/torch_evaluator.py +2 -2
  11. onnx_diagnostic/tasks/data/__init__.py +13 -0
  12. onnx_diagnostic/tasks/data/dummies_imagetext2text_generation_gemma3.onnx +0 -0
  13. onnx_diagnostic/tasks/image_text_to_text.py +256 -141
  14. onnx_diagnostic/tasks/text_generation.py +15 -0
  15. onnx_diagnostic/torch_export_patches/eval/__init__.py +177 -150
  16. onnx_diagnostic/torch_export_patches/eval/model_cases.py +19 -1
  17. onnx_diagnostic/torch_export_patches/onnx_export_errors.py +40 -14
  18. onnx_diagnostic/torch_export_patches/patch_inputs.py +10 -6
  19. onnx_diagnostic/torch_export_patches/patches/patch_torch.py +116 -10
  20. onnx_diagnostic/torch_export_patches/patches/patch_transformers.py +269 -4
  21. onnx_diagnostic/torch_models/hghub/hub_api.py +4 -10
  22. onnx_diagnostic/torch_models/hghub/hub_data_cached_configs.py +36 -0
  23. onnx_diagnostic/torch_models/hghub/model_inputs.py +32 -4
  24. onnx_diagnostic/torch_models/validate.py +337 -113
  25. onnx_diagnostic/torch_onnx/sbs.py +2 -1
  26. {onnx_diagnostic-0.7.11.dist-info → onnx_diagnostic-0.7.13.dist-info}/METADATA +11 -31
  27. {onnx_diagnostic-0.7.11.dist-info → onnx_diagnostic-0.7.13.dist-info}/RECORD +30 -28
  28. {onnx_diagnostic-0.7.11.dist-info → onnx_diagnostic-0.7.13.dist-info}/WHEEL +0 -0
  29. {onnx_diagnostic-0.7.11.dist-info → onnx_diagnostic-0.7.13.dist-info}/licenses/LICENSE.txt +0 -0
  30. {onnx_diagnostic-0.7.11.dist-info → onnx_diagnostic-0.7.13.dist-info}/top_level.txt +0 -0
@@ -57,7 +57,7 @@ def get_untrained_model_with_inputs(
57
57
  to get a smaller model
58
58
  :param use_pretrained: download the pretrained weights as well
59
59
  :param use_preinstalled: use preinstalled configurations
60
- :param add_second_input: provides a second inputs to check a model
60
+ :param add_second_input: provides others inputs to check a model
61
61
  supports different shapes
62
62
  :param subfolder: subfolder to use for this model id
63
63
  :param use_only_preinstalled: use only preinstalled version
@@ -189,11 +189,11 @@ def get_untrained_model_with_inputs(
189
189
  f"subfolder={subfolder!r}"
190
190
  )
191
191
  model = transformers.AutoModel.from_pretrained(
192
- model_id, subfolder=subfolder, trust_remote_code=True, **mkwargs
192
+ model_id, subfolder=subfolder or "", trust_remote_code=True, **mkwargs
193
193
  )
194
194
  if verbose:
195
195
  print(
196
- f"[get_untrained_model_with_inputs] -- done in "
196
+ f"[get_untrained_model_with_inputs] -- done(1) in "
197
197
  f"{time.perf_counter() - begin}s"
198
198
  )
199
199
  else:
@@ -250,14 +250,36 @@ def get_untrained_model_with_inputs(
250
250
  )
251
251
  if verbose:
252
252
  print(
253
- f"[get_untrained_model_with_inputs] -- done in "
253
+ f"[get_untrained_model_with_inputs] -- done(2) in "
254
254
  f"{time.perf_counter() - begin}s"
255
255
  )
256
256
 
257
257
  seed = int(os.environ.get("SEED", "17"))
258
258
  torch.manual_seed(seed)
259
+
260
+ if verbose:
261
+ begin = time.perf_counter()
262
+ print(
263
+ f"[get_untrained_model_with_inputs] "
264
+ f"instantiate_specific_model {cls_model}"
265
+ )
266
+
259
267
  model = instantiate_specific_model(cls_model, config)
268
+
269
+ if verbose:
270
+ print(
271
+ f"[get_untrained_model_with_inputs] -- done(3) in "
272
+ f"{time.perf_counter() - begin}s (model is {type(model)})"
273
+ )
274
+
260
275
  if model is None:
276
+
277
+ if verbose:
278
+ print(
279
+ f"[get_untrained_model_with_inputs] "
280
+ f"instantiate_specific_model(2) {cls_model}"
281
+ )
282
+
261
283
  try:
262
284
  if type(config) is dict:
263
285
  model = cls_model(**config)
@@ -268,6 +290,12 @@ def get_untrained_model_with_inputs(
268
290
  f"Unable to instantiate class {cls_model.__name__} with\n{config}"
269
291
  ) from e
270
292
 
293
+ if verbose:
294
+ print(
295
+ f"[get_untrained_model_with_inputs] -- done(4) in "
296
+ f"{time.perf_counter() - begin}s (model is {type(model)})"
297
+ )
298
+
271
299
  # input kwargs
272
300
  seed = int(os.environ.get("SEED", "17")) + 1
273
301
  torch.manual_seed(seed)