Skip to content

Commit 4ae608b

Browse files
author
Amit Raj
committed
Hash fix
Signed-off-by: Amit Raj <amitraj@qti.qualcommm.com>
1 parent e822679 commit 4ae608b

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

QEfficient/utils/export_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ def _generate_export_hash(qeff_model, args, kwargs, func):
101101
Returns:
102102
Tuple of (export_hash: str, filtered_hash_params: dict)
103103
"""
104+
# Extract use_onnx_subfunctions before binding (it's used by wrapper, not _export)
105+
use_onnx_subfunctions = kwargs.pop("use_onnx_subfunctions", False)
106+
104107
# Extract function signature
105108
original_sig = inspect.signature(func)
106109
params = list(original_sig.parameters.values())[1:] # Skip 'self'
107110
new_sig = inspect.Signature(params)
108-
109111
# Bind all arguments
110112
bound_args = new_sig.bind(*args, **kwargs)
111113
bound_args.apply_defaults()
@@ -115,7 +117,7 @@ def _generate_export_hash(qeff_model, args, kwargs, func):
115117
# TODO: Replace with get_model_config property of modeling classes
116118
qeff_model.hash_params.update(
117119
{
118-
"model_config": (
120+
"config": (
119121
qeff_model.model.config.to_diff_dict()
120122
if hasattr(qeff_model.model.config, "to_diff_dict")
121123
else qeff_model.model.config
@@ -130,7 +132,7 @@ def _generate_export_hash(qeff_model, args, kwargs, func):
130132
dynamic_axes=all_args.get("dynamic_axes"),
131133
export_kwargs=all_args.get("export_kwargs", None),
132134
onnx_transform_kwargs=all_args.get("onnx_transform_kwargs", None),
133-
use_onnx_subfunctions=all_args.get("use_onnx_subfunctions", False),
135+
use_onnx_subfunctions=use_onnx_subfunctions,
134136
)
135137

136138
return export_hash, filtered_hash_params

tests/base/test_export_memory_offload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
@pytest.fixture
2929
def tmp_cache(tmp_path, monkeypatch):
30-
monkeypatch.setattr("QEfficient.utils._utils.QEFF_HOME", tmp_path)
30+
monkeypatch.setattr("QEfficient.utils.export_utils.QEFF_HOME", tmp_path)
3131
yield tmp_path
3232

3333

tests/transformers/test_causal_lm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def test_causal_lm_hash_creation(config, cb, tmp_path):
211211

212212
@pytest.fixture
213213
def tmp_cache(tmp_path, monkeypatch):
214-
monkeypatch.setattr("QEfficient.utils._utils.QEFF_HOME", tmp_path)
214+
monkeypatch.setattr("QEfficient.utils.export_utils.QEFF_HOME", tmp_path)
215215
yield tmp_path
216216

217217

tests/transformers/test_speech_seq2seq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def test_seq2seq_hash_creation(config, tmp_path):
141141

142142
@pytest.fixture
143143
def tmp_cache(tmp_path, monkeypatch):
144-
monkeypatch.setattr("QEfficient.utils._utils.QEFF_HOME", tmp_path)
144+
monkeypatch.setattr("QEfficient.utils.export_utils.QEFF_HOME", tmp_path)
145145
yield tmp_path
146146

147147

0 commit comments

Comments
 (0)