Skip to content
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

Respect sliding_window=None #1214

Merged
merged 1 commit into from
Jan 26, 2024
Merged
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
4 changes: 2 additions & 2 deletions src/axolotl/monkeypatch/mistral_attn_hijack_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _prepare_decoder_attention_mask(
sliding_window,
): # pylint: disable=unused-argument
# [bsz, seq_len]
if attention_mask is None:
if attention_mask is None or sliding_window is None:
return attention_mask

# NOTE: attention mask and sliding masks are only broadcastable in certain scenarios.
Expand Down Expand Up @@ -151,7 +151,7 @@ def flashattn_forward(
)

use_sliding_windows = (
hasattr(self.config, "sliding_window") is not None
getattr(self.config, "sliding_window") is not None
and kv_seq_len > self.config.sliding_window
)

Expand Down
Loading