From 26eacc161955bb5ec70d77671bfb34bd29f6bca6 Mon Sep 17 00:00:00 2001 From: Naveen Suda Date: Mon, 3 Mar 2025 20:24:21 -0800 Subject: [PATCH] fix head_dim in metadata Summary: After https://github.com/pytorch/executorch/pull/8846, the models exported correctly, but failed to run on-device with segmentation error. This diff fixes that error. Reviewed By: sxu, billmguo Differential Revision: D70538475 --- examples/qualcomm/oss_scripts/llama/model/static_llama.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/qualcomm/oss_scripts/llama/model/static_llama.py b/examples/qualcomm/oss_scripts/llama/model/static_llama.py index 40044db7428..ea8e2f5d319 100755 --- a/examples/qualcomm/oss_scripts/llama/model/static_llama.py +++ b/examples/qualcomm/oss_scripts/llama/model/static_llama.py @@ -461,7 +461,7 @@ def get_metadata(self): "get_bos_id": 1, "get_eos_id": 2, "get_dim": self.dim, - "get_head_dim": self.dim // self.n_heads, + "get_head_dim": self.head_dim, "get_max_batch_size": self.max_batch_size, "get_max_seq_len": self.max_seq_len, "get_n_bos": 1,