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

Commit 4741e8e

Browse files
dbogunowiczbfineran
authored andcommitted
[KV-Cache Injection][MPT] Update config (#1801)
* Update export.py * quality * Update configs.py * add comment regarding MPT version
1 parent e81f14d commit 4741e8e

File tree

1 file changed

+6
-2
lines changed
  • src/sparseml/exporters/transforms/kv_cache

1 file changed

+6
-2
lines changed

src/sparseml/exporters/transforms/kv_cache/configs.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,17 @@ class Config:
108108
multiply_batch_by_num_att_heads=False,
109109
)
110110

111+
# the injection config for MPT config is compatible
112+
# with the MPT model in HF Space 'mosaicml/mpt-7b'
113+
# at the state corresponding to the commit
114+
# `68e1a8e0ebb9b30f3c45c1ef6195980f29063ae2`
111115
MPT_CONFIG = KeyValueCacheConfig(
112116
model_name="mpt",
113117
additional_transforms=AdditionalTransformsMPT,
114118
key_num_attention_heads="n_heads",
115119
key_num_embedding_hidden_size="d_model",
116-
transpose_value_input=None,
117-
transpose_key_input=(0, 1, 3, 2),
120+
transpose_value_input=(0, 2, 1, 3),
121+
transpose_key_input=(0, 2, 1, 3),
118122
multiply_batch_by_num_att_heads=False,
119123
)
120124

0 commit comments

Comments
 (0)