-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
906e3bb
commit ec877a5
Showing
13 changed files
with
323 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
from mmengine.config import read_base | ||
from opencompass.partitioners import SizePartitioner, NaivePartitioner | ||
from opencompass.runners import LocalRunner | ||
from opencompass.tasks import OpenICLInferTask, OpenICLEvalTask | ||
|
||
with read_base(): | ||
# Datasets | ||
from ..datasets.opseval.datasets import owl_qa_gen, rzy_qa_gen, zedx_qa_gen, owl_qa_ppl, rzy_qa_ppl | ||
# Models | ||
from ..local_models.google.t5 import t5_base | ||
from ..local_models.bert.bert import bert_large_cased | ||
from ..local_models.qwen.qwen import qwen1_5_chat_models | ||
|
||
from ..paths import ROOT_DIR | ||
|
||
|
||
datasets = [ | ||
*owl_qa_gen, | ||
*owl_qa_ppl, | ||
*rzy_qa_gen, | ||
*rzy_qa_ppl, | ||
*zedx_qa_gen, | ||
] | ||
|
||
datasets = [ | ||
dataset for dataset in datasets if 'Zero-shot' in dataset['abbr'] and 'zh' in dataset['abbr'] | ||
] | ||
|
||
models = [ | ||
# t5_base, | ||
# bert_large_cased, | ||
model for model in qwen1_5_chat_models if '14' in model['abbr'] | ||
# *vicuna_bases, | ||
# *internlm2_bases, | ||
# *yi_bases, | ||
# mistral_7b | ||
] | ||
|
||
for model in models: | ||
model['run_cfg'] = dict(num_gpus=1, num_procs=1) | ||
pass | ||
|
||
for dataset in datasets: | ||
dataset['sample_setting'] = dict() | ||
dataset['infer_cfg']['inferencer']['save_every'] = 8 | ||
dataset['infer_cfg']['inferencer']['sc_size'] = 2 | ||
dataset['infer_cfg']['inferencer']['max_token_len'] = 200 | ||
dataset['eval_cfg']['sc_size'] = 2 | ||
dataset['sample_setting'] = dict(sample_size=5) # !!!WARNING: Use for testing only!!! | ||
|
||
|
||
infer = dict( | ||
partitioner=dict( | ||
# type=SizePartitioner, | ||
# max_task_size=100, | ||
# gen_task_coef=1, | ||
type=NaivePartitioner | ||
), | ||
runner=dict( | ||
type=LocalRunner, | ||
max_num_workers=16, | ||
max_workers_per_gpu=1, | ||
task=dict(type=OpenICLInferTask), | ||
), | ||
) | ||
|
||
eval = dict( | ||
partitioner=dict(type=NaivePartitioner), | ||
runner=dict( | ||
type=LocalRunner, | ||
max_num_workers=16, | ||
task=dict(type=OpenICLEvalTask)), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
set -x | ||
set -e | ||
|
||
MODEL_PATH="/mnt/tenant-home_speed/gaozhengwei/projects/LLM/models/Qwen/Qwen1.5-72B-Chat" | ||
PORT=12310 | ||
GPUS=("0,1" "2,3" "4,5" "6,7") | ||
|
||
source /root/miniconda3/etc/profile.d/conda.sh && conda activate vllm | ||
for i in {0..3}; do | ||
CUDA_VISIBLE_DEVICES=${GPUS[$i]} ray start --head --port $((8012 + $i)) --num-cpus 2 | ||
CUDA_VISIBLE_DEVICES=${GPUS[$i]} ray start --address=localhost:$((8012 + $i)) --num-cpus 2 | ||
CUDA_VISIBLE_DEVICES=${GPUS[$i]} RAY_ADDRESS=localhost:$((8012 + $i)) python -m vllm.entrypoints.openai.api_server \ | ||
--model $MODEL_PATH --host 127.0.0.1 --port $(($PORT + $i)) --tensor-parallel-size 2 --gpu-memory-utilization 0.98 --trust-remote-code --max-model-len 2048 & pid[$i]=$! | ||
echo "port=$(($PORT + $i)), pid=${pid[$i]}" | ||
done | ||
echo "[VLLM] All backend servers have been started!!!" | ||
|
||
wait | ||
echo "[VLLM] All backend services have been successfully killed!!!" | ||
ray stop | ||
echo "[VLLM] Ray stoped" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.