Skip to content

Commit

Permalink
fix args
Browse files Browse the repository at this point in the history
  • Loading branch information
iankur committed Sep 1, 2024
1 parent e26ba50 commit 6b05132
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ wandb login

Verify setup by calling
```
from vqllm.models.llama3 import llama3_8b
from vqllm.models import llama3_8b
```

### Eval
Expand Down
7 changes: 2 additions & 5 deletions recipes/run_vq_size_ablation.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# eval meta/llama3-8b
tune run recipes/eleuther_eval.py --config recipes/config/eleuther_evaluation.yaml

# train and eval vqllm/llama3-8b
VQ_KEY="model.vq_attn_key"
VQ_VALUE="model.vq_attn_value"
Expand All @@ -23,15 +20,15 @@ for dhat in 32 64; do
# train
tune run recipes/full_finetune_single_device.py \
--config recipes/config/llama3_8b_single_device.yaml \
$VQ_KEY=True $VQ_VALUE=True $FAST_QUANTIZER \
$VQ_KEY=True $VQ_VALUE=True $FAST_QUANTIZER=True \
$RESIDUAL_CODEBOOKS=$K $CODES=$C $CODE_DIM=$dhat \
checkpointer.output_dir=$CKPT_DIR \
$WANDB_PROJECT $WANDB_GROUP $WANDB_NAME="train_K${K}_C${C}_dhat${dhat}"

# eval
tune run recipes/eleuther_eval.py \
--config recipes/config/eleuther_evaluation.yaml \
$VQ_KEY=True $VQ_VALUE=True $FAST_QUANTIZER \
$VQ_KEY=True $VQ_VALUE=True $FAST_QUANTIZER=True \
$RESIDUAL_CODEBOOKS=$K $CODES=$C $CODE_DIM=$dhat \
checkpointer.checkpoint_dir=$CKPT_DIR \
checkpointer.checkpoint_files=['meta_model_0.pt'] \
Expand Down
18 changes: 9 additions & 9 deletions recipes/run_vq_type_ablation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ CKPT_DIR="/home/ubuntu/vqllm/recipes/ckpts/key"
# train
tune run recipes/full_finetune_single_device.py \
--config recipes/config/llama3_8b_single_device.yaml \
$VQ_KEY=True $VQ_VALUE=False $FAST_QUANTIZER \
$VQ_KEY=True $VQ_VALUE=False $FAST_QUANTIZER=True \
$RESIDUAL_CODEBOOKS=$K $CODES=$C $CODE_DIM=$dhat \
$REORDER_CHANNEL=False checkpointer.output_dir=$CKPT_DIR \
$WANDB_PROJECT $WANDB_GROUP $WANDB_NAME="train_key"

# eval
tune run recipes/eleuther_eval.py \
--config recipes/config/eleuther_evaluation.yaml \
$VQ_KEY=True $VQ_VALUE=False $FAST_QUANTIZER \
$VQ_KEY=True $VQ_VALUE=False $FAST_QUANTIZER=True \
$RESIDUAL_CODEBOOKS=$K $CODES=$C $CODE_DIM=$dhat \
$REORDER_CHANNEL=False checkpointer.output_dir=$CKPT_DIR \
checkpointer.checkpoint_files=['meta_model_0.pt'] \
Expand All @@ -48,15 +48,15 @@ CKPT_DIR="/home/ubuntu/vqllm/recipes/ckpts/key_reorder"
# train
tune run recipes/full_finetune_single_device.py \
--config recipes/config/llama3_8b_single_device.yaml \
$VQ_KEY=True $VQ_VALUE=False $FAST_QUANTIZER \
$VQ_KEY=True $VQ_VALUE=False $FAST_QUANTIZER=True \
$RESIDUAL_CODEBOOKS=$K $CODES=$C $CODE_DIM=$dhat \
$REORDER_CHANNEL=True checkpointer.output_dir=$CKPT_DIR \
$WANDB_PROJECT $WANDB_GROUP $WANDB_NAME="train_key_reorder"

# eval
tune run recipes/eleuther_eval.py \
--config recipes/config/eleuther_evaluation.yaml \
$VQ_KEY=True $VQ_VALUE=False $FAST_QUANTIZER \
$VQ_KEY=True $VQ_VALUE=False $FAST_QUANTIZER=True \
$RESIDUAL_CODEBOOKS=$K $CODES=$C $CODE_DIM=$dhat \
$REORDER_CHANNEL=True checkpointer.output_dir=$CKPT_DIR \
checkpointer.checkpoint_files=['meta_model_0.pt'] \
Expand All @@ -68,35 +68,35 @@ CKPT_DIR="/home/ubuntu/vqllm/recipes/ckpts/key_reorder"
# train
tune run recipes/full_finetune_single_device.py \
--config recipes/config/llama3_8b_single_device.yaml \
$VQ_KEY=False $VQ_VALUE=True $FAST_QUANTIZER \
$VQ_KEY=False $VQ_VALUE=True $FAST_QUANTIZER=True \
$RESIDUAL_CODEBOOKS=$K $CODES=$C $CODE_DIM=$dhat \
$REORDER_CHANNEL=True checkpointer.output_dir=$CKPT_DIR \
$WANDB_PROJECT $WANDB_GROUP $WANDB_NAME="train_key_reorder"

# eval
tune run recipes/eleuther_eval.py \
--config recipes/config/eleuther_evaluation.yaml \
$VQ_KEY=False $VQ_VALUE=True $FAST_QUANTIZER \
$VQ_KEY=False $VQ_VALUE=True $FAST_QUANTIZER=True \
$RESIDUAL_CODEBOOKS=$K $CODES=$C $CODE_DIM=$dhat \
$REORDER_CHANNEL=True checkpointer.output_dir=$CKPT_DIR \
checkpointer.checkpoint_files=['meta_model_0.pt'] \
$WANDB_PROJECT $WANDB_GROUP $WANDB_NAME="eval_key_reorder"

# train and eval with vq with both key (channel reordering) and value
# train and eval with vq for both key (with channel reordering) and value
CKPT_DIR="/home/ubuntu/vqllm/recipes/ckpts/key_reorder_value"

# train
tune run recipes/full_finetune_single_device.py \
--config recipes/config/llama3_8b_single_device.yaml \
$VQ_KEY=True $VQ_VALUE=True $FAST_QUANTIZER \
$VQ_KEY=True $VQ_VALUE=True $FAST_QUANTIZER=True \
$RESIDUAL_CODEBOOKS=$K $CODES=$C $CODE_DIM=$dhat \
$REORDER_CHANNEL=True checkpointer.output_dir=$CKPT_DIR \
$WANDB_PROJECT $WANDB_GROUP $WANDB_NAME="train_key_reorder_value"

# eval
tune run recipes/eleuther_eval.py \
--config recipes/config/eleuther_evaluation.yaml \
$VQ_KEY=True $VQ_VALUE=True $FAST_QUANTIZER \
$VQ_KEY=True $VQ_VALUE=True $FAST_QUANTIZER=True \
$RESIDUAL_CODEBOOKS=$K $CODES=$C $CODE_DIM=$dhat \
$REORDER_CHANNEL=True checkpointer.output_dir=$CKPT_DIR \
checkpointer.checkpoint_files=['meta_model_0.pt'] \
Expand Down

0 comments on commit 6b05132

Please sign in to comment.