LLM: enable previous models (#9505)

* enable previous models

* test mistral model

* for test

* run models separately

* test all models

* for test

* revert the llm_performance_test.yaml
This commit is contained in:
WeiguangHan 2023-11-28 10:21:07 +08:00 committed by GitHub
parent e7e0cd3b5e
commit 5098bc3544
4 changed files with 71 additions and 2 deletions

View file

@ -83,7 +83,16 @@ jobs:
cd python/llm/dev/benchmark/all-in-one
# hide time info
sed -i 's/str(end - st)/"xxxxxx"/g' run.py
# change csv name
sed -i 's/{today}/{today}_test1/g' run.py
python run.py
# upgrade transformers for model Mistral-7B-v0.1
python -m pip install transformers==4.34.0
mv ../../../test/benchmark/arc-perf-transformers-434.yaml ./config.yaml
# change csv name
sed -i 's/test1/test2/g' run.py
python run.py
python ../../../test/benchmark/concat_csv.py
cp ./*.csv $CSV_SAVE_PATH
cd ../../../test/benchmark
python csv_to_html.py -f $CSV_SAVE_PATH

View file

@ -15,8 +15,6 @@ repo_id:
- 'baichuan-inc/Baichuan2-7B-Chat'
- 'bigscience/bloomz-7b1'
- 'fnlp/moss-moon-003-sft'
# - 'baichuan-inc/Baichuan-13B-Chat'
# - 'mistralai/Mistral-7B-v0.1'
local_model_hub: '/mnt/disk1/models'
warm_up: 1
num_trials: 3

View file

@ -0,0 +1,14 @@
# For the models that require transformers 4.34.0
repo_id:
- 'mistralai/Mistral-7B-v0.1'
local_model_hub: '/mnt/disk1/models'
warm_up: 1
num_trials: 3
num_beams: 1 # default to greedy search
low_bit: 'sym_int4' # default to use 'sym_int4' (i.e. symmetric int4)
in_out_pairs:
- '32-32'
- '1024-128'
- '2048-256'
test_api:
- "transformer_int4_gpu" # on Intel GPU

View file

@ -0,0 +1,48 @@
#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Python program to concat CSVs
import os
import sys
import argparse
import pandas as pd
def main():
parser = argparse.ArgumentParser(description="concat .csv files")
parser.add_argument("-f", "--folder_path", type=str, dest="folder_path",
help="The directory which stores the .csv files", default="./")
args = parser.parse_args()
csv_files = []
for file_name in os.listdir(args.folder_path):
file_path = os.path.join(args.folder_path, file_name)
if os.path.isfile(file_path) and file_name.endswith(".csv"):
csv_files.append(file_path)
csv_files.sort()
df1 = pd.read_csv(csv_files[0], index_col=0)
df2 = pd.read_csv(csv_files[1], index_col=0)
merged_df = pd.concat([df1, df2], ignore_index=True)
merged_df.reset_index(drop=True, inplace=True)
merged_csv=csv_files[0].replace("_test1", "")
merged_df.to_csv(merged_csv)
os.remove(csv_files[0])
os.remove(csv_files[1])
if __name__ == "__main__":
sys.exit(main())