Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit c779203

Browse files
Reinstate llama tests (#141)
1 parent e209d07 commit c779203

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

intel_npu_acceleration_library/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# SPDX-License-Identifier: Apache 2.0
44
#
55

6-
__version__ = "v1.3.0"
6+
__version__ = "v1.4.0"

intel_npu_acceleration_library/nn/llm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def __init__(
154154

155155
self.hidden_size = config.hidden_size
156156
self.num_heads = config.num_attention_heads
157-
self.head_dim = self.hidden_size // self.num_heads
157+
self.head_dim = getattr(config, "head_dim", self.hidden_size // self.num_heads)
158158
self.num_key_value_heads = config.num_key_value_heads
159159
self.num_key_value_groups = self.num_heads // self.num_key_value_heads
160160
self.is_causal = True
@@ -238,7 +238,7 @@ def forward(
238238
)
239239

240240
attn_output = attn_output.transpose(1, 2).contiguous()
241-
attn_output = attn_output.reshape(bsz, q_len, self.hidden_size)
241+
attn_output = attn_output.view(bsz, q_len, -1)
242242

243243
attn_output = self.o_proj(attn_output)
244244

test/python/test_optimizations.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def get_model(model_name, hidden_size, intermediate_size, bias):
8181
conf.num_hidden_layers = 1
8282
conf.hidden_size = hidden_size
8383
conf.intermediate_size = intermediate_size
84+
conf.head_dim = conf.hidden_size // conf.num_attention_heads
8485

8586
return LlamaModel(conf)
8687
elif model_name == "GemmaModel":
@@ -130,9 +131,6 @@ def test_fusion(model_name, hidden_size, intermediate_size, batch, bias):
130131
@pytest.mark.parametrize("bias", [True, False])
131132
def test_model(model_name, hidden_size, intermediate_size, sequence_length, bias):
132133

133-
if model_name == "LlamaModel":
134-
pytest.skip("LlamaModel Fix in progress")
135-
136134
with torch.no_grad():
137135
model = get_model(model_name, hidden_size, intermediate_size, bias).eval()
138136
example_input = torch.randint(

0 commit comments

Comments
 (0)