diff --git a/.github/workflows/llm_performance_tests.yml b/.github/workflows/llm_performance_tests.yml index 511c3e4f..8275aa44 100644 --- a/.github/workflows/llm_performance_tests.yml +++ b/.github/workflows/llm_performance_tests.yml @@ -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 diff --git a/python/llm/test/benchmark/arc-perf-test.yaml b/python/llm/test/benchmark/arc-perf-test.yaml index 43a36e63..adbd4c5a 100644 --- a/python/llm/test/benchmark/arc-perf-test.yaml +++ b/python/llm/test/benchmark/arc-perf-test.yaml @@ -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 diff --git a/python/llm/test/benchmark/arc-perf-transformers-434.yaml b/python/llm/test/benchmark/arc-perf-transformers-434.yaml new file mode 100644 index 00000000..8f4c24d9 --- /dev/null +++ b/python/llm/test/benchmark/arc-perf-transformers-434.yaml @@ -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 \ No newline at end of file diff --git a/python/llm/test/benchmark/concat_csv.py b/python/llm/test/benchmark/concat_csv.py new file mode 100644 index 00000000..d230c21b --- /dev/null +++ b/python/llm/test/benchmark/concat_csv.py @@ -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())