Skip to content

Commit

Permalink
fix crash in warmup for xpu
Browse files Browse the repository at this point in the history
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
  • Loading branch information
sywangyi committed Dec 23, 2024
1 parent ea6fa42 commit 3d807cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion optimum/intel/generation/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ def prepare_jit_inputs(model: PreTrainedModel, task: str, use_cache: bool = Fals

dummy_inputs = onnx_config.generate_dummy_inputs(framework="pt")

return {key: dummy_inputs[key] for key in signature.parameters if dummy_inputs.get(key, None) is not None}
return {
key: dummy_inputs[key].to(model.device)
for key in signature.parameters
if dummy_inputs.get(key, None) is not None
}


def jit_trace(model: PreTrainedModel, task: str, use_cache: bool = False):
Expand Down

0 comments on commit 3d807cb

Please sign in to comment.