Skip to content

Commit 4fec0ea

Browse files
authored
improve report coverage (#416)
* improve report coverage * update coveragerc
1 parent d58af8b commit 4fec0ea

6 files changed

Lines changed: 16 additions & 8 deletions

File tree

.coveragerc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[report]
2+
exclude_lines =
3+
pragma: no cover
4+
if __name__ == .__main__.:
5+
@onnxscript.*
6+
7+
[run]
8+
include =
9+
onnx_diagnostic/*
10+
omit =
11+
onnx_diagnostic/big_models/export_phi4_mm*

codecov.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
ignore:
2-
- "*onnx_diagnostic/big_models/*"
3-
- "*onnx_diagnostic/ci_models/export*"

onnx_diagnostic/ci_models/export_qwen25_vl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def process_image(inputs_embeds, image_features):
460460
import onnxscript
461461

462462
v_onnxscript = onnxscript.__version__
463-
if pv.Version(v_onnxscript) <= pv.Version("0.5.6"):
463+
if pv.Version(v_onnxscript) <= pv.Version("0.5.6"): # pragma: no cover
464464
print(f"-- onnxscript=={v_onnxscript} not recent enough")
465465
print("-- stop.")
466466
return

onnx_diagnostic/helpers/cache_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def make_dynamic_cache(
355355
)
356356
return finalize_cache(cache)
357357

358-
else:
358+
else: # pragma: no cover
359359

360360
def make_dynamic_cache(
361361
key_value_pairs: Union[List[torch.Tensor], List[Tuple[torch.Tensor, torch.Tensor]]],

onnx_diagnostic/torch_export_patches/onnx_export_serialization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def register_class_serialization(
8383
serialized_type_name=f"{cls.__module__}.{cls.__name__}",
8484
flatten_with_keys_fn=f_flatten_with_keys,
8585
)
86-
if pv.Version(torch.__version__) < pv.Version("2.7"):
86+
if pv.Version(torch.__version__) < pv.Version("2.7"): # pragma: no cover
8787
if verbose:
8888
print(
8989
f"[register_class_serialization] "
@@ -322,7 +322,7 @@ def unregister_class_serialization(cls: type, verbose: int = 0):
322322
import packaging.version as pv
323323

324324
if pv.Version(torch.__version__) < pv.Version("2.7.0"):
325-
del torch.utils._pytree.SUPPORTED_NODES[cls]
325+
del torch.utils._pytree.SUPPORTED_NODES[cls] # pragma: no cover
326326
assert cls not in torch.utils._pytree.SUPPORTED_NODES, (
327327
f"{cls} was not successful unregistered "
328328
f"from torch.utils._pytree.SUPPORTED_NODES="

onnx_diagnostic/torch_export_patches/patches/_patch_transformers_idefics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,5 @@ def forward(
152152
attn_weights = None
153153

154154
if pv.Version(transformers.__version__) < pv.Version("4.53.99"):
155-
return attn_output, attn_weights, past_key_value
155+
return attn_output, attn_weights, past_key_value # pragma: no cover
156156
return attn_output, attn_weights

0 commit comments

Comments
 (0)