Skip to content
Open
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
7 changes: 0 additions & 7 deletions models/modeling_llama_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,13 +1335,6 @@ def forward(
# embed positions
hidden_states = inputs_embeds

if self.gradient_checkpointing and self.training:
if use_cache:
logger.warning_once(
"`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`..."
)
use_cache = False

# decoder layers
all_hidden_states = () if output_hidden_states else None
all_self_attns = () if output_attentions else None
Expand Down
1 change: 1 addition & 0 deletions run_clm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export LCKV_FUSED_SWIGLU=1
# - to pretrain a tinyllama, change the config to `TinyLlama/TinyLlama-1.1B-intermediate-step-955k-token-2T`
# - to intialize the model with a pretrained model, add `--model_name_or_path TinyLlama/TinyLlama-1.1B-intermediate-step-1195k-token-2.5T`
# - to use the minipile dataset, use `--dataset_name JeanKaddour/minipile`, with proper `--preprocessing_num_workers`
# - to use gradient checkpointing, add `--gradient_checkpointing`
# - to enable wandb, use `--report_to wandb`
accelerate launch run_clm.py \
--tokenizer_name TinyLlama/TinyLlama-1.1B-intermediate-step-955k-token-2T \
Expand Down