File size: 2,883 Bytes
1f57542
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
export HTTP_PROXY=http://sys-proxy-rd-relay.byted.org:8118
export http_proxy=http://sys-proxy-rd-relay.byted.org:8118
export https_proxy=http://sys-proxy-rd-relay.byted.org:8118
export no_proxy="$no_proxy,.byteintl.net"
export HF_ENDPOINT=https://hf-mirror.com


cd quantization_metric/
model_id=/mnt/bn/life-mllm/users/cxr/quantization/models/Qwen/Qwen2.5-7B
model_name=$(basename "$model_id")

model=/mnt/bn/life-mllm/users/cxr/quantization/models/${model_name}-quantization-fg
# output_dir=Alpha_values_mlp
# bit_layers_dir=/mnt/bn/life-mllm/users/cxr/quantization/quantization_metric/bit_layers
# result_dir=/mnt/bn/life-mllm/users/cxr/quantization/lm-evaluation-harness/results

start=$(date +%s.%N)
# rm -rf $model
cd ../quantization_metric
# fg1
# self_attn_layer_to_quant="4 1 2 8 23"
# mlp_layer_to_quant="27 16 19 17 25"


# save_fg=fg2
# self_attn_layer_to_quant="23 22 25 24 26"
# mlp_layer_to_quant="27 16 19 17 25"


# save_fg=fg3
# self_attn_layer_to_quant="23 22 25 24 26"
# mlp_layer_to_quant="27 16 19"



# save_fg=fg4
# self_attn_layer_to_quant="23 22 25 24 26"
# mlp_layer_to_quant="27"


# save_fg=fg5
# self_attn_layer_to_quant="27 16 19 17 25"
# mlp_layer_to_quant="27 16 19 17 25"

# save_fg=baseline_BI
# self_attn_layer_to_quant="16 17 15 14 13"
# mlp_layer_to_quant="16 17 15 14 13"


save_fg=f6
self_attn_layer_to_quant="4 1 2 8 23 22 25 5 24 7 26 6 20 12 19 17 21 11 10 9 18"
mlp_layer_to_quant="27 16 19"

python -u main_fg.py --cuda_id 6  --save_dir ${model} --model_id $model_id  --self_attn_layer_to_quant "${self_attn_layer_to_quant}" --mlp_layer_to_quant "${mlp_layer_to_quant}"
cd ../lm-evaluation-harness
bash run_scripts/eval_base_fg.sh ${model} ${save_fg}
rm -rf ${model}
end=$(date +%s.%N)
runtime=$(awk "BEGIN {print $end - $start}")
echo "Execution time: $runtime seconds"



model_id=/mnt/bn/life-mllm/users/cxr/quantization/models/meta-llama/Llama-3.1-8B
model_name=$(basename "$model_id")

model=/mnt/bn/life-mllm/users/cxr/quantization/models/${model_name}-quantization-fg
# output_dir=Alpha_values_mlp
# bit_layers_dir=/mnt/bn/life-mllm/users/cxr/quantization/quantization_metric/bit_layers
# result_dir=/mnt/bn/life-mllm/users/cxr/quantization/lm-evaluation-harness/results

start=$(date +%s.%N)
# rm -rf $model
cd ../quantization_metric
# save_fg=baseline_BI
# self_attn_layer_to_quant="24 25 23 26 27"
# mlp_layer_to_quant="24 25 23 26 27"
save_fg=fg6
self_attn_layer_to_quant="29 23 24 30 18 28 26 20 16 27 25 17 19 21"
mlp_layer_to_quant="26 20 22"

python -u main_fg.py --cuda_id 6  --save_dir ${model} --model_id $model_id  --self_attn_layer_to_quant "${self_attn_layer_to_quant}" --mlp_layer_to_quant "${mlp_layer_to_quant}"
cd ../lm-evaluation-harness
bash run_scripts/eval_base_fg.sh ${model} ${save_fg}
rm -rf ${model}
end=$(date +%s.%N)
runtime=$(awk "BEGIN {print $end - $start}")
echo "Execution time: $runtime seconds"