Skip to content

Commit cca5703

Browse files
authored
upgrade to 7.12 (#225)
* upgrade to 7.12 * g * doc * last fix for modelbuilder * doc
1 parent 34ccaab commit cca5703

File tree

6 files changed

+26
-15
lines changed

6 files changed

+26
-15
lines changed

CHANGELOGS.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Change Logs
22
===========
33

4+
0.7.12
5+
++++++
6+
7+
* :pr:`226`: fix input order for models created with modelbuilder
8+
9+
410
0.7.11
511
++++++
612

_doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def linkcode_resolve(domain, info):
122122
("py:class", "CacheProcessor"),
123123
("py:class", "default=sklearn.utils.metadata_routing.UNCHANGED"),
124124
("py:class", "diffusers.models.unets.unet_2d_condition.UNet2DConditionOutput"),
125+
("py:class", "MambaCache"),
125126
("py:class", "ModelProto"),
126127
("py:class", "Model"),
127128
("py:class", "Module"),

_doc/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,8 @@ The function replaces dynamic dimensions defined as strings by
239239
Older versions
240240
==============
241241

242+
* `0.7.12 <../v0.7.12/index.html>`_
242243
* `0.7.11 <../v0.7.11/index.html>`_
243-
* `0.7.10 <../v0.7.10/index.html>`_
244-
* `0.7.9 <../v0.7.9/index.html>`_
245244
* `0.6.3 <../v0.6.3/index.html>`_
246245
* `0.5.0 <../v0.5.0/index.html>`_
247246
* `0.4.4 <../v0.4.4/index.html>`_

_unittests/ut_torch_models/test_validate_whole_models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,18 @@ def test_k_filter_inputs(self):
195195
@ignore_warnings(FutureWarning)
196196
@requires_transformers("4.51")
197197
def test_l_validate_model_modelbuilder(self):
198-
mid = "meta-llama/Llama-2-7b-hf"
198+
mid = "microsoft/phi-2"
199199
summary, data = validate_model(
200200
mid,
201201
do_run=True,
202202
verbose=10,
203203
exporter="modelbuilder",
204204
dump_folder="dump_test/validate_model_modelbuilder",
205+
patch=True,
205206
)
206207
self.assertIsInstance(summary, dict)
207208
self.assertIsInstance(data, dict)
208-
self.assertLess(summary["disc_onnx_ort_run_abs"], 1e-2)
209+
self.assertLess(summary["disc_onnx_ort_run_abs"], 3e-2)
209210
onnx_filename = data["onnx_filename"]
210211
self.assertExists(onnx_filename)
211212

onnx_diagnostic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
Functions, classes to dig into a model when this one is right, slow, wrong...
44
"""
55

6-
__version__ = "0.7.11"
6+
__version__ = "0.7.12"
77
__author__ = "Xavier Dupré"

onnx_diagnostic/helpers/rt_helper.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def make_feeds(
4141
"""
4242
# NOTE: position_ids is a special case because ModelBuilder does not usually use it,
4343
# because it's fued into rotary embedding in GQA.
44-
if isinstance(inputs, dict):
44+
if is_modelbuilder and isinstance(inputs, dict):
4545
inputs.pop("position_ids", None) # Ensure 'position_ids' absent before removing.
4646

4747
flat = flatten_object(inputs, drop_keys=True)
@@ -112,19 +112,23 @@ def reorder_modelbuilder_cache_to_torch(past_kv: List[Any]) -> List[Any]:
112112
Reorders the past_kvs for ModelBuilder to match the expected order
113113
by PyTorch exported models.
114114
115-
NOTE: This function can take either the names or the actual tensors
116-
as long as they are in a list.
115+
.. note::
116+
This function can take either the names or the actual tensors
117+
as long as they are in a list.
117118
118119
Conceptually,
119120
120-
From:
121-
[past_key_values.0.key, past_key_values.0.value,
122-
past_key_values.1.key, past_key_values.1.value, ...]
123-
To:
124-
[past_key_values.0.key, past_key_values.1.key,
125-
..., past_key_values.0.value, past_key_values.1.value, ...]
121+
From::
126122
127-
:param flat: list of flattened inputs
123+
[past_key_values.0.key, past_key_values.0.value,
124+
past_key_values.1.key, past_key_values.1.value, ...]
125+
126+
To::
127+
128+
[past_key_values.0.key, past_key_values.1.key,
129+
..., past_key_values.0.value, past_key_values.1.value, ...]
130+
131+
:param past_kv: list of flattened inputs
128132
:return: reordered list of flattened inputs
129133
"""
130134
total_len = len(past_kv)

0 commit comments

Comments
 (0)