mirror of
https://github.com/SakanaAI/doc-to-lora.git
synced 2026-07-23 17:01:04 +02:00
tiny exp
This commit is contained in:
parent
21d8beb65d
commit
43f47d40ad
19 changed files with 192 additions and 71 deletions
|
|
@ -1,52 +0,0 @@
|
|||
output_dir: "" # just a placeholder
|
||||
bf16: true
|
||||
model_name_or_path: google/gemma-3-1b-it
|
||||
label_names: ["labels"]
|
||||
# eval_on_start: True
|
||||
# eval_strategy: "steps"
|
||||
# eval_steps: 500
|
||||
# save_strategy: "no"
|
||||
# # save_steps: 500
|
||||
# logging_strategy: "steps"
|
||||
# logging_steps: 100
|
||||
# use_liger_kernel: true
|
||||
# remove_unused_columns: false
|
||||
|
||||
# needed to avoid OOM by compute the metrics batch by batch
|
||||
# w/o this the trainer stores logits of all sample in memory...
|
||||
# batch_eval_metrics: true
|
||||
|
||||
per_device_train_batch_size: 8
|
||||
per_device_eval_batch_size: 8
|
||||
max_val_samples_per_ds: 1000
|
||||
# optim: schedule_free_adamw
|
||||
|
||||
learning_rate: 0.00004
|
||||
# lr_scheduler_type: "constant_with_warmup"
|
||||
neftune_noise_alpha: 1
|
||||
weight_decay: 0.01
|
||||
|
||||
warmup_steps: 100
|
||||
|
||||
dataloader_prefetch_factor: 16
|
||||
dataloader_num_workers: 8
|
||||
|
||||
# LoRA
|
||||
lora_r: 8
|
||||
lora_dropout: 0.0
|
||||
target_modules:
|
||||
- down_proj
|
||||
|
||||
# data
|
||||
train_ds_names:
|
||||
- self_gen/google/gemma-2-2b-it_temp_1.0/fw_qa_v2_2k_len_level_3_tiny
|
||||
- self_gen/google/gemma-2-2b-it_temp_1.0/squad_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_1.0/pwc_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_1.0/ropes_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_1.0/drop_compact
|
||||
|
||||
val_ds_names:
|
||||
- squad
|
||||
- pwc
|
||||
- drop
|
||||
- ropes
|
||||
|
|
@ -44,3 +44,6 @@ train_ds_names:
|
|||
val_ds_names:
|
||||
- fw_qa_v2_2k_len_level_0
|
||||
- squad
|
||||
- drop
|
||||
- ropes
|
||||
- pwc
|
||||
|
|
@ -39,14 +39,11 @@ target_modules:
|
|||
|
||||
# data
|
||||
train_ds_names:
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.3/fw_qa_v2_2k_len_level_3_tiny
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.3/squad_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.3/pwc_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.3/ropes_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.3/drop_compact
|
||||
- fw_qa_v2_2k_len_level_1_tiny
|
||||
|
||||
val_ds_names:
|
||||
- fw_qa_v2_2k_len_level_0
|
||||
- squad
|
||||
- pwc
|
||||
- drop
|
||||
- ropes
|
||||
- pwc
|
||||
|
|
@ -39,14 +39,11 @@ target_modules:
|
|||
|
||||
# data
|
||||
train_ds_names:
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.5/fw_qa_v2_2k_len_level_3_tiny
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.5/squad_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.5/pwc_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.5/ropes_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.5/drop_compact
|
||||
- fw_qa_v2_2k_len_level_2_tiny
|
||||
|
||||
val_ds_names:
|
||||
- fw_qa_v2_2k_len_level_0
|
||||
- squad
|
||||
- pwc
|
||||
- drop
|
||||
- ropes
|
||||
- pwc
|
||||
|
|
@ -44,3 +44,6 @@ train_ds_names:
|
|||
val_ds_names:
|
||||
- fw_qa_v2_2k_len_level_0
|
||||
- squad
|
||||
- drop
|
||||
- ropes
|
||||
- pwc
|
||||
|
|
@ -37,16 +37,23 @@ lora_dropout: 0.0
|
|||
target_modules:
|
||||
- down_proj
|
||||
|
||||
# data
|
||||
# short ctx data
|
||||
train_ds_names:
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.7/fw_qa_v2_2k_len_level_3_tiny
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.7/squad_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.7/pwc_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.7/ropes_compact
|
||||
- self_gen/google/gemma-2-2b-it_temp_0.7/drop_compact
|
||||
- fw_qa_v2_2k_len_level_3_tiny
|
||||
- squad_compact
|
||||
- pwc_compact
|
||||
- drop_compact
|
||||
- ropes_compact
|
||||
|
||||
# the contexts are kinda long-ish
|
||||
# - narrativeqa
|
||||
# - quoref
|
||||
# - synthetic_convqa
|
||||
|
||||
val_ds_names:
|
||||
- fw_qa_v2_2k_len_level_0
|
||||
- squad
|
||||
- pwc
|
||||
- drop
|
||||
- ropes
|
||||
- pwc
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
#SBATCH --job-name=ctxlora
|
||||
#SBATCH --nodes=1
|
||||
#SBATCH --partition=a3
|
||||
#SBATCH --gpus=4
|
||||
#SBATCH --output=slurm_logs/%x-%j.out
|
||||
#SBATCH --error=slurm_logs/%x-%j.out
|
||||
|
||||
port=$((10000 + ($SLURM_JOBID % 50000)))
|
||||
echo "Using port: $port"
|
||||
|
||||
# --gradient_accumulation_steps=8 --gradient_clipping=1.0
|
||||
uv run accelerate launch --main_process_port $port \
|
||||
--num_processes=4 --gpu_ids all intx_sft.py $1 \
|
||||
--model_name_or_path=google/gemma-2-2b-it \
|
||||
--max_steps=12_000 \
|
||||
--per_device_train_batch_size=-1 \
|
||||
--gradient_accumulation_steps=2 \
|
||||
--per_device_eval_batch_size=64 \
|
||||
--target_modules=down_proj \
|
||||
--num_self_attends_per_block=8 \
|
||||
--n_cross_attn_layers=8 \
|
||||
--concat_latents_context=True \
|
||||
--num_latent_factor=1 \
|
||||
--num_pre_head_layers=1 \
|
||||
--lora_r=8 \
|
||||
--eval_steps=1000 \
|
||||
--save_steps=1000 \
|
||||
--learning_rate=4e-5 \
|
||||
--lora_dropout=0.0 \
|
||||
--neftune_noise_alpha=5 \
|
||||
--add_negative_prompt=False \
|
||||
--add_repeat_prompt=False \
|
||||
--use_sequence_packing=True \
|
||||
--max_packed_inp_len=8192 \
|
||||
--max_packed_ctx_len=16384 \
|
||||
--per_rank_gen=True \
|
||||
--per_layer_processing=True \
|
||||
--gen_lora_l1_reg_coef=0.1 \
|
||||
--logging_steps=50
|
||||
39
scripts/short_ctx/gemma_qa_short_ctx_exp_default.sh
Normal file
39
scripts/short_ctx/gemma_qa_short_ctx_exp_default.sh
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
#SBATCH --job-name=ctxlora
|
||||
#SBATCH --nodes=1
|
||||
#SBATCH --partition=a3
|
||||
#SBATCH --gpus=4
|
||||
#SBATCH --output=slurm_logs/%x-%j.out
|
||||
#SBATCH --error=slurm_logs/%x-%j.out
|
||||
|
||||
port=$((10000 + ($SLURM_JOBID % 50000)))
|
||||
echo "Using port: $port"
|
||||
|
||||
# --gradient_accumulation_steps=8 --gradient_clipping=1.0
|
||||
uv run accelerate launch --main_process_port $port \
|
||||
--num_processes=4 --gpu_ids all intx_sft.py $1 \
|
||||
--model_name_or_path=google/gemma-2-2b-it \
|
||||
--max_steps=12_000 \
|
||||
--per_device_train_batch_size=-1 \
|
||||
--gradient_accumulation_steps=2 \
|
||||
--per_device_eval_batch_size=64 \
|
||||
--target_modules=down_proj \
|
||||
--num_self_attends_per_block=8 \
|
||||
--n_cross_attn_layers=8 \
|
||||
--num_latent_factor=1 \
|
||||
--num_pre_head_layers=1 \
|
||||
--lora_r=8 \
|
||||
--eval_steps=1000 \
|
||||
--save_steps=1000 \
|
||||
--learning_rate=4e-5 \
|
||||
--lora_dropout=0.0 \
|
||||
--neftune_noise_alpha=5 \
|
||||
--add_negative_prompt=False \
|
||||
--add_repeat_prompt=False \
|
||||
--use_sequence_packing=True \
|
||||
--max_packed_inp_len=8192 \
|
||||
--max_packed_ctx_len=16384 \
|
||||
--per_rank_gen=True \
|
||||
--per_layer_processing=True \
|
||||
--gen_lora_l1_reg_coef=0.1 \
|
||||
--logging_steps=50
|
||||
39
scripts/short_ctx/gemma_qa_short_ctx_exp_self_attn.sh
Normal file
39
scripts/short_ctx/gemma_qa_short_ctx_exp_self_attn.sh
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
#SBATCH --job-name=ctxlora
|
||||
#SBATCH --nodes=1
|
||||
#SBATCH --partition=a3
|
||||
#SBATCH --gpus=4
|
||||
#SBATCH --output=slurm_logs/%x-%j.out
|
||||
#SBATCH --error=slurm_logs/%x-%j.out
|
||||
|
||||
port=$((10000 + ($SLURM_JOBID % 50000)))
|
||||
echo "Using port: $port"
|
||||
|
||||
# --gradient_accumulation_steps=8 --gradient_clipping=1.0
|
||||
uv run accelerate launch --main_process_port $port \
|
||||
--num_processes=4 --gpu_ids all intx_sft.py $1 \
|
||||
--model_name_or_path=google/gemma-2-2b-it \
|
||||
--max_steps=12_000 \
|
||||
--per_device_train_batch_size=-1 \
|
||||
--gradient_accumulation_steps=2 \
|
||||
--per_device_eval_batch_size=64 \
|
||||
--target_modules=down_proj \
|
||||
--num_self_attends_per_block=8 \
|
||||
--n_cross_attn_layers=1 \
|
||||
--num_latent_factor=1 \
|
||||
--num_pre_head_layers=1 \
|
||||
--lora_r=8 \
|
||||
--eval_steps=1000 \
|
||||
--save_steps=1000 \
|
||||
--learning_rate=4e-5 \
|
||||
--lora_dropout=0.0 \
|
||||
--neftune_noise_alpha=5 \
|
||||
--add_negative_prompt=False \
|
||||
--add_repeat_prompt=False \
|
||||
--use_sequence_packing=True \
|
||||
--max_packed_inp_len=8192 \
|
||||
--max_packed_ctx_len=16384 \
|
||||
--per_rank_gen=True \
|
||||
--per_layer_processing=True \
|
||||
--gen_lora_l1_reg_coef=0.1 \
|
||||
--logging_steps=50
|
||||
48
scripts/submit_tiny_exp_jobs.sh
Executable file
48
scripts/submit_tiny_exp_jobs.sh
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Script to submit SLURM jobs for all configs in configs/tiny_exp/
|
||||
# with random sleep intervals between submissions
|
||||
|
||||
CONFIG_DIR="configs/tiny_exp"
|
||||
SCRIPT_PATH="scripts/short_ctx/gemma_qa_short_ctx_exp_default.sh"
|
||||
|
||||
# Check if config directory exists
|
||||
if [ ! -d "$CONFIG_DIR" ]; then
|
||||
echo "Error: Config directory $CONFIG_DIR does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if script exists
|
||||
if [ ! -f "$SCRIPT_PATH" ]; then
|
||||
echo "Error: Script $SCRIPT_PATH does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get all yaml config files
|
||||
configs=($(find "$CONFIG_DIR" -name "*.yaml" -type f))
|
||||
|
||||
if [ ${#configs[@]} -eq 0 ]; then
|
||||
echo "No .yaml config files found in $CONFIG_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Found ${#configs[@]} config files:"
|
||||
for config in "${configs[@]}"; do
|
||||
echo " - $config"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Starting job submissions..."
|
||||
|
||||
# Submit jobs with random sleep intervals
|
||||
for config in "${configs[@]}"; do
|
||||
echo "Submitting job for config: $config"
|
||||
sbatch "$SCRIPT_PATH" "$config"
|
||||
|
||||
# Random sleep between 3-30 seconds
|
||||
sleep_time=$((3 + RANDOM % 28))
|
||||
echo "Waiting $sleep_time seconds before next submission..."
|
||||
sleep $sleep_time
|
||||
done
|
||||
|
||||
echo "All jobs submitted!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue