Skip to content

Commit 11f2c83

Browse files
authored
refactor (#291)
* refactor * debug tools * fix * simple
1 parent fefa30b commit 11f2c83

File tree

3 files changed

+528
-201
lines changed

3 files changed

+528
-201
lines changed

_unittests/ut_torch_models/test_validate_whole_models1.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def test_g_validate_model_onnx_dynamo_os_ort(self):
122122
@hide_stdout()
123123
@ignore_warnings(FutureWarning)
124124
@requires_experimental()
125+
@requires_transformers("4.52") # empty_cache None does not work
125126
def test_i_validate_model_custom(self):
126127
mid = "arnir0/Tiny-LLM"
127128
summary, data = validate_model(
@@ -150,6 +151,7 @@ def test_i_validate_model_custom(self):
150151
@requires_torch("2.7")
151152
@hide_stdout()
152153
@ignore_warnings(FutureWarning)
154+
@requires_transformers("4.52") # empty_cache None does not work
153155
@requires_experimental()
154156
def test_j_validate_model_custom_torch(self):
155157
mid = "arnir0/Tiny-LLM"

onnx_diagnostic/helpers/helper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,8 @@ def max_diff(
10161016
10171017
You may use :func:`string_diff` to display the discrepancies in one string.
10181018
"""
1019+
if verbose >= 10:
1020+
print(f"[max_diff] {type(expected)} ? {type(got)}")
10191021
if expected is None and got is None:
10201022
return dict(abs=0, rel=0, sum=0, n=0, dnan=0)
10211023

@@ -1061,8 +1063,8 @@ def max_diff(
10611063
if expected.__class__.__name__ == "CausalLMOutputWithPast":
10621064
if verbose >= 6:
10631065
print(
1064-
f"[max_diff] CausalLMOutputWithPast: {string_type(expected)} "
1065-
f"? {string_type(got)}"
1066+
f"[max_diff] CausalLMOutputWithPast: {string_type(expected, with_shape=True)} "
1067+
f"? {string_type(got, with_shape=True)}"
10661068
)
10671069
if got.__class__.__name__ == "CausalLMOutputWithPast":
10681070
return max_diff(

0 commit comments

Comments
 (0)