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

Fix: Higher vram usage for mistral and sample_packing #691

Merged
merged 3 commits into from
Oct 6, 2023
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
8 changes: 4 additions & 4 deletions examples/mistral/qlora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ lora_target_modules:
- k_proj
- o_proj

wandb_project:
wandb_entity:
wandb_project:
wandb_entity:
wandb_watch:
wandb_run_id:
wandb_run_id:
wandb_log_model:

gradient_accumulation_steps: 4
Expand Down Expand Up @@ -76,4 +76,4 @@ fsdp_config:
special_tokens:
bos_token: "<s>"
eos_token: "</s>"
unk_token: "<unk>"
unk_token: "<unk>"
3 changes: 2 additions & 1 deletion src/axolotl/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def load_tokenizer(cfg):
tokenizer.add_special_tokens({"pad_token": "[PAD]"})
os.environ["TOKENIZERS_PARALLELISM"] = "false"

if cfg.is_mistral_derived_model:
# Mistral's official FA implementation requires left padding
if cfg.is_mistral_derived_model and cfg.flash_attention and not cfg.sample_packing:
tokenizer.padding_side = "left"

if cfg.special_tokens:
Expand Down