Skip to content

Commit

Permalink
[KV-Cache Injection][MPT] Update config (#1801)
Browse files Browse the repository at this point in the history
* Update export.py

* quality

* Update configs.py

* add comment regarding MPT version
  • Loading branch information
dbogunowicz committed Nov 3, 2023
1 parent f1626b7 commit 4e59d69
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sparseml/exporters/transforms/kv_cache/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,17 @@ class Config:
multiply_batch_by_num_att_heads=False,
)

# the injection config for MPT config is compatible
# with the MPT model in HF Space 'mosaicml/mpt-7b'
# at the state corresponding to the commit
# `68e1a8e0ebb9b30f3c45c1ef6195980f29063ae2`
MPT_CONFIG = KeyValueCacheConfig(
model_name="mpt",
additional_transforms=AdditionalTransformsMPT,
key_num_attention_heads="n_heads",
key_num_embedding_hidden_size="d_model",
transpose_value_input=None,
transpose_key_input=(0, 1, 3, 2),
transpose_value_input=(0, 2, 1, 3),
transpose_key_input=(0, 2, 1, 3),
multiply_batch_by_num_att_heads=False,
)

Expand Down

0 comments on commit 4e59d69

Please sign in to comment.