Skip to content

Commit

Permalink
Remove xpos and llama-landmark [bad merge]
Browse files Browse the repository at this point in the history
  • Loading branch information
joecummings committed Jan 11, 2024
1 parent 3019d1f commit 7628056
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -825,15 +825,8 @@ flash_attn_fuse_mlp: # Whether to fuse part of the MLP into a single operation
# Whether to use scaled-dot-product attention
# https://pytorch.org/docs/stable/generated/torch.nn.functional.scaled_dot_product_attention.html
sdp_attention:
# Landmark attention (only llama)
landmark_attention:
# Shifted-sparse attention (only llama)
s2_attention:

# xpos RoPE see https://github.com/kaiokendev/cutoff-len-is-context-len/blob/main/util/xpos_rope_llama_monkey_patch.py
# LLaMA only
xpos_rope:

# Resume from a specific checkpoint dir
resume_from_checkpoint:
# If resume_from_checkpoint isn't set and you simply want it to start where it left off.
Expand Down
19 changes: 0 additions & 19 deletions src/axolotl/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,30 +299,11 @@ def load_model(

LOG.info("patching with sdp attention")
hijack_llama_sdp_attention()
elif cfg.landmark_attention:
from axolotl.monkeypatch.llama_landmark_attn import (
MEM_TOKEN,
patch_llama_with_landmark_attn,
)

LOG.info("patching with landmark attention")
patch_llama_with_landmark_attn()

# Note: This might overwrite previous additional_special_tokens
tokenizer.add_special_tokens({"additional_special_tokens": [MEM_TOKEN]})
elif cfg.s2_attention:
raise NotImplementedError(
"Shifted-sparse attention not currently implemented without flash attention."
)

if cfg.xpos_rope:
from axolotl.monkeypatch.xpos_rope_llama_monkey_patch import (
replace_llama_rope_with_xpos_rope,
)

LOG.info("patching with xpos rope")
replace_llama_rope_with_xpos_rope()

LOG.info("patching with sdp attention")
hijack_llama_sdp_attention()

Expand Down

0 comments on commit 7628056

Please sign in to comment.