diff --git a/.github/workflows/llm_unit_tests_basic_windows.yml b/.github/workflows/llm_unit_tests_basic_windows.yml index f8f6abc9..4909c84f 100644 --- a/.github/workflows/llm_unit_tests_basic_windows.yml +++ b/.github/workflows/llm_unit_tests_basic_windows.yml @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: os: ["windows-latest"] - python-version: ["3.8"] + python-version: ["3.9"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -39,6 +39,7 @@ jobs: python -m pip install --upgrade pip python -m pip install --upgrade setuptools==58.0.4 python -m pip install --upgrade wheel + - name: Run LLM-init test shell: bash run: | @@ -46,3 +47,17 @@ jobs: pip install -i https://pypi.python.org/simple python/llm/dist/bigdl_llm*.whl env: ANALYTICS_ZOO_ROOT: ${{ github.workspace }} + + - name: Run LLM naive installation test + shell: bash + run: | + bash python/llm/dev/release_default_windows.sh default false + pip install -i https://pypi.python.org/simple python/llm/dist/bigdl_llm*.whl + pip install pytest + pip install numpy + pip install torch + pip install transformers + pip install sentencepiece + bash python/llm/test/run-llm-basic-tests.sh + env: + ANALYTICS_ZOO_ROOT: ${{ github.workspace }} diff --git a/python/llm/dev/release.sh b/python/llm/dev/release.sh index 1e664a51..0a743cb5 100644 --- a/python/llm/dev/release.sh +++ b/python/llm/dev/release.sh @@ -43,10 +43,8 @@ echo "The effective version is: ${bigdl_version}" if [ "$platform" == "linux" ]; then verbose_pname="manylinux2010_x86_64" - setup_file="setup-linux.py" elif [ "$platform" == "windows" ]; then verbose_pname="win_amd64" - setup_file="setup.py" else echo "Unsupported platform" fi @@ -55,36 +53,21 @@ if [ -d "${BIGDL_DIR}/python/llm/dist" ]; then rm -r ${BIGDL_DIR}/python/llm/dist fi -if [ -d "${BIGDL_DIR}/python/llm/_skbuild" ]; then - rm -r ${BIGDL_DIR}/python/llm/_skbuild -fi - if [ -d "${BIGDL_DIR}/python/llm/build" ]; then rm -r ${BIGDL_DIR}/python/llm/build fi -if [ -d "${BIGDL_DIR}/python/llm/bigdl_llm.egg-info" ]; then - rm -r ${BIGDL_DIR}/python/llm/bigdl_llm.egg-info -fi - cd $BIGDL_PYTHON_DIR -wheel_command="python ${setup_file} bdist_wheel --plat-name ${verbose_pname} --python-tag py3" +wheel_command="python setup.py clean --all bdist_wheel --plat-name ${verbose_pname} --python-tag py3" + echo "Packing python distribution: $wheel_command" ${wheel_command} -if [ -d "${BIGDL_DIR}/python/llm/_skbuild" ]; then - rm -r ${BIGDL_DIR}/python/llm/_skbuild -fi - if [ -d "${BIGDL_DIR}/python/llm/build" ]; then rm -r ${BIGDL_DIR}/python/llm/build fi -if [ -d "${BIGDL_DIR}/python/llm/bigdl_llm.egg-info" ]; then - rm -r ${BIGDL_DIR}/python/llm/bigdl_llm.egg-info -fi - if [ ${upload} == true ]; then upload_command="twine upload dist/bigdl_llm-${bigdl_version}-*-${verbose_pname}.whl" echo "Please manually upload with this command: $upload_command" diff --git a/python/llm/test/__init__.py b/python/llm/test/__init__.py new file mode 100644 index 00000000..2151a805 --- /dev/null +++ b/python/llm/test/__init__.py @@ -0,0 +1,15 @@ +# +# 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. +# diff --git a/python/llm/test/packaging/test_install.py b/python/llm/test/packaging/test_install.py new file mode 100644 index 00000000..11a35ed0 --- /dev/null +++ b/python/llm/test/packaging/test_install.py @@ -0,0 +1,32 @@ +# +# 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. +# + + +import bigdl.llm +import pytest +from unittest import TestCase + + +class Test_LLM_Basics(TestCase): + + def test_naive(self): + from bigdl.llm.ggml import quantize + from bigdl.llm.utils.common import invalidInputError + pass + + +if __name__ == '__main__': + pytest.main([__file__]) diff --git a/python/llm/test/run-llm-basic-tests.sh b/python/llm/test/run-llm-basic-tests.sh new file mode 100644 index 00000000..a14c9443 --- /dev/null +++ b/python/llm/test/run-llm-basic-tests.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +export ANALYTICS_ZOO_ROOT=${ANALYTICS_ZOO_ROOT} +export LLM_HOME=${ANALYTICS_ZOO_ROOT}/python/llm/src +export LLM_BASIC_TEST_DIR=${ANALYTICS_ZOO_ROOT}/python/llm/test/packaging + +set -e + +# ipex is not installed here. Any tests needs ipex should be moved to next pytest command. +echo "# Start testing" +start=$(date "+%s") +python -m pytest -s ${LLM_BASIC_TEST_DIR} + +now=$(date "+%s") +time=$((now-start)) + +echo "Bigdl-llm tests finished" +echo "Time used:$time seconds" \ No newline at end of file