[LLM] Small updates to transformers int4 ut (#8574)

* Small fix to transformers int4 ut

* Small fix
This commit is contained in:
Yuwen Hu 2023-07-20 13:20:25 +08:00 committed by GitHub
parent 7b8d9c1b0d
commit 2266ca7d2b
3 changed files with 8 additions and 9 deletions

View file

@ -76,7 +76,6 @@ jobs:
uses: ./.github/actions/llm/setup-llm-env
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
OMP_NUM_THREADS: 24
- name: Download ckpt models
run: |

View file

@ -15,15 +15,13 @@
#
from bigdl.llm.models import Llama, Bloom, Gptneox, Starcoder
from bigdl.llm.utils import get_avx_flags
import unittest
import os
import time
import torch
from bigdl.llm.transformers import AutoModelForCausalLM, AutoModel
from transformers import LlamaTokenizer, AutoTokenizer
from bigdl.llm.transformers import AutoModel
from transformers import AutoTokenizer
class TestTransformersAPI(unittest.TestCase):

View file

@ -4,16 +4,18 @@ export ANALYTICS_ZOO_ROOT=${ANALYTICS_ZOO_ROOT}
export LLM_HOME=${ANALYTICS_ZOO_ROOT}/python/llm/src
export LLM_INFERENCE_TEST_DIR=${ANALYTICS_ZOO_ROOT}/python/llm/test/inference
source bigdl-nano-init
set -e
echo "# Start testing inference"
start=$(date "+%s")
python -m pytest -s ${LLM_INFERENCE_TEST_DIR} -k "not test_transformers_int4"
export OMP_NUM_THREADS=24
taskset -c 0-23 python -m pytest -s ${LLM_INFERENCE_TEST_DIR} -k test_transformers_int4
if [ -z "$THREAD_NUM" ]; then
THREAD_NUM=2
fi
export OMP_NUM_THREADS=$THREAD_NUM
taskset -c 0-$((THREAD_NUM - 1)) python -m pytest -s ${LLM_INFERENCE_TEST_DIR} -k test_transformers_int4
now=$(date "+%s")
time=$((now-start))