Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
add schema to control asym/sym (#1545)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincyZhang authored May 14, 2024
1 parent ae7a4ae commit 49ab653
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function init_params {
script="run_generation_sq.py"
alpha=0.5
weight_dtype="int4_clip"
scheme="asym"
for var in "$@"
do
case $var in
Expand Down Expand Up @@ -47,6 +48,9 @@ function init_params {
--bits=*)
bits=$(echo $var |cut -f2 -d=)
;;
--scheme=*)
scheme=$(echo $var |cut -f2 -d=)
;;
*)
echo "Error: No such parameter: ${var}"
exit 1
Expand Down Expand Up @@ -248,31 +252,31 @@ function run_tuning {
script="run_generation_sq.py"
elif [ "${topology}" = "llama2_7b_gptq" ]; then
model_name_or_path="meta-llama/Llama-2-7b-hf"
extra_cmd=$extra_cmd" --woq --bits ${bits} --compute_dtype fp32 --scheme asym --calib_iters 100"
extra_cmd=$extra_cmd" --woq --bits ${bits} --compute_dtype fp32 --scheme ${scheme} --calib_iters 100"
extra_cmd=$extra_cmd" --woq_algo "GPTQ" --desc_act --blocksize 128 --max_input_length 2048 "
extra_cmd=$extra_cmd" --output_dir ${tuned_checkpoint}"
extra_cmd=$extra_cmd" --trust_remote_code"
extra_cmd=$extra_cmd" --weight_dtype ${weight_dtype}"
script="run_generation_cpu_woq.py"
elif [ "${topology}" = "mistral_7b_autoround" ]; then
model_name_or_path="/tf_dataset2/models/pytorch/Mistral-7B-v0.1"
extra_cmd=$extra_cmd" --woq --bits ${bits} --compute_dtype fp32 --scheme asym "
extra_cmd=$extra_cmd" --woq --bits ${bits} --compute_dtype fp32 --scheme ${scheme} "
extra_cmd=$extra_cmd" --woq_algo "AutoRound" --desc_act --group_size 128 --calib_len 2048 --calib_iters 100"
extra_cmd=$extra_cmd" --output_dir ${tuned_checkpoint}"
extra_cmd=$extra_cmd" --trust_remote_code"
extra_cmd=$extra_cmd" --weight_dtype ${weight_dtype}"
script="run_generation_cpu_woq.py"
elif [ "${topology}" = "mistral_7b_rtn" ]; then
model_name_or_path="/tf_dataset2/models/pytorch/Mistral-7B-v0.1"
extra_cmd=$extra_cmd" --woq --bits ${bits} --compute_dtype fp32 --scheme asym "
extra_cmd=$extra_cmd" --woq --bits ${bits} --compute_dtype fp32 --scheme ${scheme} "
extra_cmd=$extra_cmd" --woq_algo "Rtn" "
extra_cmd=$extra_cmd" --output_dir ${tuned_checkpoint}"
extra_cmd=$extra_cmd" --trust_remote_code"
extra_cmd=$extra_cmd" --weight_dtype ${weight_dtype}"
script="run_generation_cpu_woq.py"
elif [ "${topology}" = "mistral_7b_gptq" ]; then
model_name_or_path="/tf_dataset2/models/pytorch/Mistral-7B-v0.1"
extra_cmd=$extra_cmd" --woq --bits ${bits} --compute_dtype fp32 --scheme asym --calib_iters 100"
extra_cmd=$extra_cmd" --woq --bits ${bits} --compute_dtype fp32 --scheme ${scheme} --calib_iters 100"
extra_cmd=$extra_cmd" --woq_algo "GPTQ" --desc_act --blocksize 128 --max_input_length 2048 --group_size 128"
extra_cmd=$extra_cmd" --output_dir ${tuned_checkpoint}"
extra_cmd=$extra_cmd" --trust_remote_code"
Expand Down

0 comments on commit 49ab653

Please sign in to comment.