Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOGS.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Change Logs
===========

0.7.13
++++++

0.7.12
++++++

Expand Down
1 change: 1 addition & 0 deletions _doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ The function replaces dynamic dimensions defined as strings by
Older versions
==============

* `0.7.13 <../v0.7.13/index.html>`_
* `0.7.12 <../v0.7.12/index.html>`_
* `0.7.11 <../v0.7.11/index.html>`_
* `0.6.3 <../v0.6.3/index.html>`_
Expand Down
115 changes: 84 additions & 31 deletions _unittests/ut_xrun_doc/test_check_ort_float16.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def common_scatter(self, opset, providers, dtype, reduction, expected_names):
import onnxruntime
from onnxruntime import InferenceSession, SessionOptions

op_type = "ScatterElements" if "ScatterElements" in expected_names else "ScatterND"
op_type = (
"ScatterElements" if "ScatterElements" in str(expected_names) else "ScatterND"
)
ndim = 2 if op_type == "ScatterElements" else 3

assert dtype in (np.float16, np.float32)
Expand Down Expand Up @@ -62,7 +64,10 @@ def common_scatter(self, opset, providers, dtype, reduction, expected_names):
# onnxruntime might introduces some intermediate cast.
if pv.Version(onnxruntime.__version__) <= pv.Version("1.17.1"):
raise unittest.SkipTest("float16 not supported on cpu")
self.assertEqual(expected_names, names)
if isinstance(expected_names, list):
self.assertEqual(names, expected_names)
else:
self.assertIn(names, expected_names)

sonx = str(onx).replace(" ", "").replace("\n", "|")
sexp = 'op_type:"Cast"|attribute{|name:"to"|type:INT|i:%d|}' % itype
Expand Down Expand Up @@ -127,19 +132,37 @@ def common_scatter(self, opset, providers, dtype, reduction, expected_names):
(row.get("args_provider", None), row.get("args_op_name", None))
)
short_list = [(a, b) for a, b in exe_providers if a is not None and b is not None]
self.assertEqual(short_list, [("CUDAExecutionProvider", o) for o in expected_names])
if isinstance(expected_names, list):
self.assertEqual(
short_list, [("CUDAExecutionProvider", o) for o in expected_names]
)
else:
self.assertIn(
short_list,
tuple([("CUDAExecutionProvider", o) for o in en] for en in expected_names),
)

@requires_cuda()
@ignore_warnings(DeprecationWarning)
@requires_onnxruntime("1.23")
def test_scatterels_cuda(self):
default_value = [
"Cast",
# "MemcpyToHost",
"ScatterElements",
# "MemcpyFromHost",
"Sub",
]
default_value = (
[
"Cast",
# "MemcpyToHost",
"ScatterElements",
# "MemcpyFromHost",
"Sub",
],
[
"Cast",
"Cast",
# "MemcpyToHost",
"ScatterElements",
# "MemcpyFromHost",
"Sub",
],
)
expected = {
(np.float32, "none"): default_value,
(np.float16, "none"): default_value,
Expand All @@ -165,13 +188,23 @@ def test_scatterels_cuda(self):
@requires_cuda()
@ignore_warnings(DeprecationWarning)
def test_scatternd_cuda(self):
default_value = [
"Cast",
# "MemcpyToHost",
"ScatterND",
# "MemcpyFromHost",
"Sub",
]
default_value = (
[
"Cast",
# "MemcpyToHost",
"ScatterND",
# "MemcpyFromHost",
"Sub",
],
[
"Cast",
"Cast",
# "MemcpyToHost",
"ScatterND",
# "MemcpyFromHost",
"Sub",
],
)
expected = {
(np.float32, "none"): default_value,
(np.float16, "none"): default_value,
Expand All @@ -198,13 +231,23 @@ def test_scatterels_cpu(self):
"ScatterElements",
"Sub",
]
default_value_16 = [
"Cast",
"ScatterElements",
"Cast",
"Sub",
"Cast",
]
default_value_16 = (
[
"Cast",
"ScatterElements",
"Cast",
"Sub",
"Cast",
],
[
"Cast",
"Cast",
"ScatterElements",
"Cast",
"Sub",
"Cast",
],
)
expected = {
(np.float32, "none"): default_value,
(np.float16, "none"): default_value_16,
Expand All @@ -231,13 +274,23 @@ def test_scatternd_cpu(self):
"ScatterND",
"Sub",
]
default_value_16 = [
"Cast",
"ScatterND",
"Cast",
"Sub",
"Cast",
]
default_value_16 = (
[
"Cast",
"ScatterND",
"Cast",
"Sub",
"Cast",
],
[
"Cast",
"Cast",
"ScatterND",
"Cast",
"Sub",
"Cast",
],
)
expected = {
(np.float32, "none"): default_value,
(np.float16, "none"): default_value_16,
Expand Down
2 changes: 1 addition & 1 deletion onnx_diagnostic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Functions, classes to dig into a model when this one is right, slow, wrong...
"""

__version__ = "0.7.12"
__version__ = "0.7.13"
__author__ = "Xavier Dupré"
Loading