Skip to content

fix typo #6419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/models/llama/llama_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __init__(
):
super().__init__()
self.max_seq_length = max_seq_length
self.is_tranposed = transpose_cache
self.is_transposed = transpose_cache
if transpose_cache:
cache_shape = (max_batch_size, n_heads, max_seq_length, head_dim)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def update(self, input_pos, k_val, v_val):
@classmethod
def from_float(cls, kv_cache, cache_type: QuantizedCacheType):
cache_shape = kv_cache.k_cache.shape
if kv_cache.is_tranposed:
if kv_cache.is_transposed:
max_batch_size, n_heads, max_seq_length, head_dim = cache_shape
else:
max_batch_size, max_seq_length, n_heads, head_dim = cache_shape
Expand All @@ -203,7 +203,7 @@ def from_float(cls, kv_cache, cache_type: QuantizedCacheType):
n_heads,
head_dim,
cache_type,
kv_cache.is_tranposed,
kv_cache.is_transposed,
kv_cache.enable_dynamic_shape,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def setUp(self):
self.transpose_kv_cache = False
self.dtype = torch.float32

def _test_simple_update_fetch(self, is_tranposed=False, is_dynamic_shape=False):
self.transpose_kv_cache = is_tranposed
def _test_simple_update_fetch(self, is_transposed=False, is_dynamic_shape=False):
self.transpose_kv_cache = is_transposed
self.enable_dynamic_shape = is_dynamic_shape
input_pos = torch.tensor([0, 1, 2])
self.seq_len = input_pos.size(0)
Expand Down Expand Up @@ -122,7 +122,7 @@ def test_simple_update_fetch_not_transposed_dynamic_shape(self):
self._test_simple_update_fetch(is_dynamic_shape=True)

def test_simple_update_fetch_transposed(self):
self._test_simple_update_fetch(is_tranposed=True)
self._test_simple_update_fetch(is_transposed=True)

def test_simple_update_fetch_transposed_dynamic_shape(self):
self._test_simple_update_fetch(is_tranposed=True, is_dynamic_shape=True)
self._test_simple_update_fetch(is_transposed=True, is_dynamic_shape=True)
Loading