Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gemma-2-2b-it and gemma-2-9b-it to igpu nightly performance test #11778

Merged
merged 3 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 197 additions & 5 deletions .github/workflows/llm_performance_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,33 @@ jobs:

call conda deactivate

- name: Prepare igpu perf test for transformers 4.43 (32-32 int4+fp16)
shell: bash
run: |
sed -i 's/{today}_test3/{today}_test4/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/32-32_int4_fp16_443.yaml

- name: Test on igpu for transformers 4.43 (32-32 int4+fp16)
shell: cmd
run: |
call conda activate igpu-perf
pip install transformers==4.43.1
pip install trl

set SYCL_CACHE_PERSISTENT=1
set BIGDL_LLM_XMX_DISABLED=1

cd python\llm\dev\benchmark\all-in-one
move ..\..\..\test\benchmark\igpu-perf\32-32_int4_fp16_443.yaml config.yaml
set PYTHONIOENCODING=utf-8
python run.py >> %CSV_SAVE_PATH%\32-32_int4_fp16\log\%LOG_FILE% 2>&1
if %ERRORLEVEL% neq 0 if %ERRORLEVEL% neq -1073740791 (exit /b 1)
python ..\..\..\test\benchmark\igpu-perf\check_csv_results.py --yaml-file config.yaml --suffix test4
if %ERRORLEVEL% neq 0 (exit /b 1)

pip uninstall trl -y
call conda deactivate

- name: Concat csv and generate html (32-32 int4+fp16)
shell: cmd
run: |
Expand All @@ -737,7 +764,7 @@ jobs:
shell: bash
run: |
sed -i 's/32-32/1024-128/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i 's/{today}_test3/{today}_test1/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i 's/{today}_test4/{today}_test1/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/1024-128_int4_fp16.yaml

- name: Test on igpu (1024-128 int4+fp16)
Expand Down Expand Up @@ -811,6 +838,33 @@ jobs:

call conda deactivate

- name: Prepare igpu perf test for transformers 4.43 (1024-128 int4+fp16)
shell: bash
run: |
sed -i 's/{today}_test3/{today}_test4/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/1024-128_int4_fp16_443.yaml

- name: Test on igpu for transformers 4.43 (1024-128 int4+fp16)
shell: cmd
run: |
call conda activate igpu-perf
pip install transformers==4.43.1
pip install trl

set SYCL_CACHE_PERSISTENT=1
set BIGDL_LLM_XMX_DISABLED=1

cd python\llm\dev\benchmark\all-in-one
move ..\..\..\test\benchmark\igpu-perf\1024-128_int4_fp16_443.yaml config.yaml
set PYTHONIOENCODING=utf-8
python run.py >> %CSV_SAVE_PATH%\1024-128_int4_fp16\log\%LOG_FILE% 2>&1
if %ERRORLEVEL% neq 0 (exit /b 1)
python ..\..\..\test\benchmark\igpu-perf\check_csv_results.py --yaml-file config.yaml --suffix test4
if %ERRORLEVEL% neq 0 (exit /b 1)

pip uninstall trl -y
call conda deactivate

- name: Concat csv and generate html (1024-128 int4+fp16)
shell: cmd
run: |
Expand All @@ -833,7 +887,7 @@ jobs:
shell: bash
run: |
sed -i 's/1024-128/2048-256/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i 's/{today}_test3/{today}_test1/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i 's/{today}_test4/{today}_test1/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/2048-256_int4_fp16.yaml

- name: Test on igpu (2048-256 int4+fp16)
Expand Down Expand Up @@ -907,6 +961,33 @@ jobs:

call conda deactivate

- name: Prepare igpu perf test for transformers 4.43 (2048-256 int4+fp16)
shell: bash
run: |
sed -i 's/{today}_test3/{today}_test4/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/2048-256_int4_fp16_443.yaml

- name: Test on igpu for transformers 4.43 (2048-256 int4+fp16)
shell: cmd
run: |
call conda activate igpu-perf
pip install transformers==4.43.1
pip install trl

set SYCL_CACHE_PERSISTENT=1
set BIGDL_LLM_XMX_DISABLED=1

cd python\llm\dev\benchmark\all-in-one
move ..\..\..\test\benchmark\igpu-perf\2048-256_int4_fp16_443.yaml config.yaml
set PYTHONIOENCODING=utf-8
python run.py >> %CSV_SAVE_PATH%\2048-256_int4_fp16\log\%LOG_FILE% 2>&1
if %ERRORLEVEL% neq 0 (exit /b 1)
python ..\..\..\test\benchmark\igpu-perf\check_csv_results.py --yaml-file config.yaml --suffix test4
if %ERRORLEVEL% neq 0 (exit /b 1)

pip uninstall trl -y
call conda deactivate

- name: Concat csv and generate html (2048-256 int4+fp16)
shell: cmd
run: |
Expand All @@ -929,7 +1010,7 @@ jobs:
shell: bash
run: |
sed -i 's/2048-256/3072-384/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i 's/{today}_test3/{today}_test1/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i 's/{today}_test4/{today}_test1/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/3072-384_int4_fp16.yaml

- name: Test on igpu (3072-384 int4+fp16)
Expand Down Expand Up @@ -1003,6 +1084,33 @@ jobs:

call conda deactivate

- name: Prepare igpu perf test for transformers 4.43 (3072-384 int4+fp16)
shell: bash
run: |
sed -i 's/{today}_test3/{today}_test4/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/3072-384_int4_fp16_443.yaml

- name: Test on igpu for transformers 4.43 (3072-384 int4+fp16)
shell: cmd
run: |
call conda activate igpu-perf
pip install transformers==4.43.1
pip install trl

set SYCL_CACHE_PERSISTENT=1
set BIGDL_LLM_XMX_DISABLED=1

cd python\llm\dev\benchmark\all-in-one
move ..\..\..\test\benchmark\igpu-perf\3072-384_int4_fp16_443.yaml config.yaml
set PYTHONIOENCODING=utf-8
python run.py >> %CSV_SAVE_PATH%\3072-384_int4_fp16\log\%LOG_FILE% 2>&1
if %ERRORLEVEL% neq 0 (exit /b 1)
python ..\..\..\test\benchmark\igpu-perf\check_csv_results.py --yaml-file config.yaml --suffix test4
if %ERRORLEVEL% neq 0 (exit /b 1)

pip uninstall trl -y
call conda deactivate

- name: Concat csv and generate html (3072-384 int4+fp16)
shell: cmd
run: |
Expand All @@ -1025,7 +1133,7 @@ jobs:
shell: bash
run: |
sed -i 's/3072-384/4096-512/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i 's/{today}_test3/{today}_test1/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i 's/{today}_test4/{today}_test1/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/4096-512_int4_fp16.yaml

- name: Test on igpu (4096-512 int4+fp16)
Expand Down Expand Up @@ -1099,6 +1207,36 @@ jobs:

call conda deactivate

# NOTE: Gemma2 not working for 4096-512.
# When it works, uncomment this section and remember to change "'s/{today}_test3/{today}_test1/g'" in next section.

#- name: Prepare igpu perf test for transformers 4.43 (4096-512 int4+fp16)
# shell: bash
# run: |
# sed -i 's/{today}_test3/{today}_test4/g' python/llm/dev/benchmark/all-in-one/run.py
# sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/4096-512_int4_fp16_443.yaml

#- name: Test on igpu for transformers 4.43 (4096-512 int4+fp16)
# shell: cmd
# run: |
# call conda activate igpu-perf
# pip install transformers==4.43.1
# pip install trl
#
# set SYCL_CACHE_PERSISTENT=1
# set BIGDL_LLM_XMX_DISABLED=1
#
# cd python\llm\dev\benchmark\all-in-one
# move ..\..\..\test\benchmark\igpu-perf\4096-512_int4_fp16_443.yaml config.yaml
# set PYTHONIOENCODING=utf-8
# python run.py >> %CSV_SAVE_PATH%\4096-512_int4_fp16\log\%LOG_FILE% 2>&1
# if %ERRORLEVEL% neq 0 (exit /b 1)
# python ..\..\..\test\benchmark\igpu-perf\check_csv_results.py --yaml-file config.yaml --suffix test4
# if %ERRORLEVEL% neq 0 (exit /b 1)
#
# pip uninstall trl -y
# call conda deactivate

- name: Concat csv and generate html (4096-512 int4+fp16)
shell: cmd
run: |
Expand Down Expand Up @@ -1195,6 +1333,33 @@ jobs:

call conda deactivate

- name: Prepare igpu perf test for transformers 4.43 (load_low_bit 1024-128 int4+fp16)
shell: bash
run: |
sed -i 's/{today}_test3/{today}_test4/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/1024-128_int4_fp16_loadlowbit_443.yaml

- name: Test on igpu for transformers 4.43 (load_low_bit 1024-128 int4+fp16)
shell: cmd
run: |
call conda activate igpu-perf
pip install transformers==4.43.1
pip install trl

set SYCL_CACHE_PERSISTENT=1
set BIGDL_LLM_XMX_DISABLED=1

cd python\llm\dev\benchmark\all-in-one
move ..\..\..\test\benchmark\igpu-perf\1024-128_int4_fp16_loadlowbit_443.yaml config.yaml
set PYTHONIOENCODING=utf-8
python run.py >> %CSV_SAVE_PATH%\1024-128_int4_fp16_loadlowbit\log\%LOG_FILE% 2>&1
if %ERRORLEVEL% neq 0 (exit /b 1)
python ..\..\..\test\benchmark\igpu-perf\check_csv_results.py --yaml-file config.yaml --suffix test4
if %ERRORLEVEL% neq 0 (exit /b 1)

pip uninstall trl -y
call conda deactivate

- name: Concat csv and generate html (load_low_bit 1024-128 int4+fp16)
shell: cmd
run: |
Expand All @@ -1216,7 +1381,7 @@ jobs:
- name: Prepare igpu perf test (1024-128)
shell: bash
run: |
sed -i 's/{today}_test3/{today}_test1/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i 's/{today}_test4/{today}_test1/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/1024-128.yaml

- name: Test on igpu (1024-128)
Expand Down Expand Up @@ -1290,6 +1455,33 @@ jobs:

call conda deactivate

- name: Prepare igpu perf test for transformers 4.43 (1024-128)
shell: bash
run: |
sed -i 's/{today}_test3/{today}_test4/g' python/llm/dev/benchmark/all-in-one/run.py
sed -i "s/path to your local model hub/$MODEL_HUB_DIR/g" python/llm/test/benchmark/igpu-perf/1024-128_443.yaml

- name: Test on igpu for transformers 4.43 (1024-128)
shell: cmd
run: |
call conda activate igpu-perf
pip install transformers==4.43.1
pip install trl

set SYCL_CACHE_PERSISTENT=1
set BIGDL_LLM_XMX_DISABLED=1

cd python\llm\dev\benchmark\all-in-one
move ..\..\..\test\benchmark\igpu-perf\1024-128_443.yaml config.yaml
set PYTHONIOENCODING=utf-8
python run.py >> %CSV_SAVE_PATH%\1024-128\log\%LOG_FILE% 2>&1
if %ERRORLEVEL% neq 0 (exit /b 1)
python ..\..\..\test\benchmark\igpu-perf\check_csv_results.py --yaml-file config.yaml --suffix test4
if %ERRORLEVEL% neq 0 (exit /b 1)

pip uninstall trl -y
call conda deactivate

- name: Concat csv and generate html (1024-128)
shell: cmd
run: |
Expand Down
2 changes: 1 addition & 1 deletion python/llm/test/benchmark/concat_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def main():

merged_df = pd.concat([pd.read_csv(file, index_col=0) for file in csv_files], ignore_index=True)
merged_df.reset_index(drop=True, inplace=True)
merged_csv = csv_files[0].replace("_test1", "").replace("_test2", "").replace("_test3", "")
merged_csv = csv_files[0].replace("_test1", "").replace("_test2", "").replace("_test3", "").replace("_test4", "")
merged_df.to_csv(merged_csv)

if __name__ == "__main__":
Expand Down
14 changes: 14 additions & 0 deletions python/llm/test/benchmark/igpu-perf/1024-128_443.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repo_id:
- 'google/gemma-2-2b-it'
- 'google/gemma-2-9b-it'
local_model_hub: 'path to your local model hub'
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)
batch_size: 1 # default to 1
in_out_pairs:
- '1024-128'
test_api:
- "transformer_int4_gpu_win" # on Intel GPU for Windows (catch GPU peak memory)
cpu_embedding: True # whether put embedding to CPU (only avaiable now for gpu win related test_api)
14 changes: 14 additions & 0 deletions python/llm/test/benchmark/igpu-perf/1024-128_int4_fp16_443.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repo_id:
- 'google/gemma-2-2b-it'
- 'google/gemma-2-9b-it'
local_model_hub: 'path to your local model hub'
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)
batch_size: 1 # default to 1
in_out_pairs:
- '1024-128'
test_api:
- "transformer_int4_fp16_gpu_win" # on Intel GPU for Windows, use fp16 for non-linear layer
cpu_embedding: True # whether put embedding to CPU (only avaiable now for gpu win related test_api)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repo_id:
- 'google/gemma-2-2b-it'
- 'google/gemma-2-9b-it'
local_model_hub: 'path to your local model hub'
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)
batch_size: 1 # default to 1
in_out_pairs:
- '1024-128'
test_api:
- "transformer_int4_fp16_loadlowbit_gpu_win" # on Intel GPU for Windows (catch GPU peak memory)
cpu_embedding: True # whether put embedding to CPU (only avaiable now for gpu win related test_api)
14 changes: 14 additions & 0 deletions python/llm/test/benchmark/igpu-perf/2048-256_int4_fp16_443.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repo_id:
- 'google/gemma-2-2b-it'
- 'google/gemma-2-9b-it'
local_model_hub: 'path to your local model hub'
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)
batch_size: 1 # default to 1
in_out_pairs:
- '2048-256'
test_api:
- "transformer_int4_fp16_gpu_win" # on Intel GPU for Windows (catch GPU peak memory)
cpu_embedding: True # whether put embedding to CPU (only avaiable now for gpu win related test_api)
14 changes: 14 additions & 0 deletions python/llm/test/benchmark/igpu-perf/3072-384_int4_fp16_443.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repo_id:
- 'google/gemma-2-2b-it'
- 'google/gemma-2-9b-it'
local_model_hub: 'path to your local model hub'
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)
batch_size: 1 # default to 1
in_out_pairs:
- '3072-384'
test_api:
- "transformer_int4_fp16_gpu_win" # on Intel GPU for Windows (catch GPU peak memory)
cpu_embedding: True # whether put embedding to CPU (only avaiable now for gpu win related test_api)
14 changes: 14 additions & 0 deletions python/llm/test/benchmark/igpu-perf/32-32_int4_fp16_443.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repo_id:
- 'google/gemma-2-2b-it'
- 'google/gemma-2-9b-it'
local_model_hub: 'path to your local model hub'
warm_up: 3
num_trials: 5
num_beams: 1 # default to greedy search
low_bit: 'sym_int4' # default to use 'sym_int4' (i.e. symmetric int4)
batch_size: 1 # default to 1
in_out_pairs:
- '32-32'
test_api:
- "transformer_int4_fp16_gpu_win" # on Intel GPU for Windows (catch GPU peak memory)
cpu_embedding: True # whether put embedding to CPU (only avaiable now for gpu win related test_api)
14 changes: 14 additions & 0 deletions python/llm/test/benchmark/igpu-perf/4096-512_int4_fp16_443.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repo_id:
- 'google/gemma-2-2b-it'
- 'google/gemma-2-9b-it'
local_model_hub: 'path to your local model hub'
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)
batch_size: 1 # default to 1
in_out_pairs:
- '4096-512'
test_api:
- "transformer_int4_fp16_gpu_win" # on Intel GPU for Windows (catch GPU peak memory)
cpu_embedding: True # whether put embedding to CPU (only avaiable now for gpu win related test_api)
Loading