Skip to content

Commit

Permalink
rebased to main and resolved all conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: eplatero <[email protected]>
  • Loading branch information
eplatero97 committed Nov 13, 2024
1 parent a7b4347 commit afe5209
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 259 deletions.
13 changes: 12 additions & 1 deletion QEfficient/base/modeling_qeff.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ def _export(
"""
export_dir = Path(export_dir or (QEFF_HOME / self.model_name))
export_dir = export_dir.with_name(export_dir.name + "-" + self.model_hash)
onnx_path = export_dir / f"{self.model_name}.onnx"
if self.num_speculative_tokens:
model_name = f"{self.model_name}_{self.num_speculative_tokens+1}nltk.onnx"
else:
model_name = f"{self.model_name}.onnx"
onnx_path = export_dir / model_name
# TODO: need to add hash to onnx
if onnx_path.is_file():
self.onnx_path = onnx_path
return onnx_path
Expand Down Expand Up @@ -244,6 +249,12 @@ def _compile(
if mdp_ts_num_devices > 1:
compile_hash.update(to_hashable({"mdp_ts_num_devices": mdp_ts_num_devices}))

if self.num_speculative_tokens:
compile_hash.update(to_hashable({"num_speculative_tokens": self.num_speculative_tokens}))

if self.is_dlm:
compile_hash.update(to_hashable({"is_dlm": self.is_dlm}))

# Check if already compiled
compile_hash = compile_hash.hexdigest()[:16]
qpc_path = qpc_path.with_name(qpc_path.name + "-" + compile_hash)
Expand Down
Loading

0 comments on commit afe5209

Please sign in to comment.