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

remove bigdl-llm test to fix langchain UT #12613

Merged
merged 1 commit into from
Dec 26, 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
25 changes: 12 additions & 13 deletions .github/workflows/llm_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,39 +212,39 @@ jobs:
fi

- name: Run LLM cli test (Linux)
if: runner.os == 'Linux'
if: runner.os == 'Linux'
uses: ./.github/actions/llm/cli-test-linux

- name: Setup Python Path
if: runner.os == 'Windows'
if: runner.os == 'Windows'
shell: bash
run: |
# Get Python interpreter path
python_path=$(python -c 'import sys; print(sys.executable)')
python_dir=$(dirname "$python_path")
scripts_dir="$python_dir/Scripts"

# Set environment variables
echo "PYTHON_DIR=$python_dir" >> $GITHUB_ENV
echo "SCRIPTS_DIR=$scripts_dir" >> $GITHUB_ENV

- name: Run LLM cli test (Windows)
if: runner.os == 'Windows'
if: runner.os == 'Windows'
shell: powershell
run: |
# Retrieve environment variables
$pythonDir = $env:PYTHON_DIR
$scriptsDir = $env:SCRIPTS_DIR

# Update PATH
$env:PATH = "$pythonDir;$scriptsDir;$env:PATH"

# Run tests
llm-cli.ps1 -t $env:THREAD_NUM -n 256 -x llama -m $env:LLAMA_INT4_CKPT_PATH -p 'Once upon a time,'
llm-cli.ps1 -t $env:THREAD_NUM -n 256 -x gptneox -m $env:GPTNEOX_INT4_CKPT_PATH -p 'Once upon a time,'
llm-cli.ps1 -t $env:THREAD_NUM -n 256 -x bloom -m $env:BLOOM_INT4_CKPT_PATH -p 'Once upon a time,'
# llm-cli.ps1 -t $env:THREAD_NUM -x starcoder -m $env:STARCODER_INT4_CKPT_PATH -p 'def check_odd('

- name: Run LLM inference test
shell: bash
run: |
Expand Down Expand Up @@ -399,7 +399,7 @@ jobs:
echo "Directory $VICUNA_7B_1_3_ORIGIN_PATH not found. Downloading from FTP server..."
wget -r -nH --no-verbose --cut-dirs=1 $LLM_FTP_URL/llm/vicuna-7b-v1.3 -P $ORIGIN_DIR
fi

- name: Run LLM inference test
shell: bash
run: |
Expand All @@ -412,7 +412,7 @@ jobs:
fi
fi
python -m pip install datasets librosa soundfile einops tiktoken transformers_stream_generator

bash python/llm/test/run-llm-inference-tests-gpu.sh

- name: Run LLM example tests
Expand All @@ -430,7 +430,7 @@ jobs:
fi
fi
bash python/llm/test/run-llm-example-tests-gpu.sh

- name: Get Langchain version
shell: bash
id: get_langchain_version
Expand All @@ -446,7 +446,7 @@ jobs:
repository: "langchain-ai/langchain"
ref: ${{ join(steps.get_langchain_version.outputs.*, '\n') }}
path: langchain_upstream

- name: Run LLM langchain GPU test
shell: bash
run: |
Expand All @@ -462,10 +462,9 @@ jobs:
fi
fi
bash python/llm/test/run-llm-langchain-tests-gpu.sh

pip install -U langchain
pip install -U langchain-community
pip install --pre --upgrade bigdl-llm[all]
bash python/llm/test/run-langchain-upstream-tests.sh

- name: Run LLM llamaindex GPU test
Expand Down
7 changes: 2 additions & 5 deletions python/llm/test/run-langchain-upstream-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ cp ${ANALYTICS_ZOO_ROOT}/langchain_upstream/libs/community/tests/integration_tes

source ${ANALYTICS_ZOO_ROOT}/python/llm/test/run-llm-check-function.sh

pytest_check_error python -m pytest -s ${ANALYTICS_ZOO_ROOT}/langchain_upstream/test_bigdl_llm.py
# disable this test temporarily
# pytest_check_error python -m pytest -s ${ANALYTICS_ZOO_ROOT}/langchain_upstream/test_ipex_llm.py
pytest_check_error python -m pytest -s ${ANALYTICS_ZOO_ROOT}/langchain_upstream/test_ipex_llm.py

echo ">>> Testing LangChain upstream ipynb"
cp ${ANALYTICS_ZOO_ROOT}/langchain_upstream/docs/docs/integrations/llms/ipex_llm.ipynb ${ANALYTICS_ZOO_ROOT}/langchain_upstream/langchain_example.ipynb
bash ./apps/ipynb2py.sh ${ANALYTICS_ZOO_ROOT}/langchain_upstream/langchain_example
sed -i '/^get_ipython/d' ${ANALYTICS_ZOO_ROOT}/langchain_upstream/langchain_example.py
sed -i "s,model_id=\"[^\"]*\",model_id=\"$TEST_IPEXLLM_MODEL_IDS\",g" ${ANALYTICS_ZOO_ROOT}/langchain_upstream/langchain_example.py
sed -i 's|saved_lowbit_model_path = "./vicuna-7b-1.5-low-bit"|saved_lowbit_model_path = "./langchain_upstream/vicuna-7b-1.5-low-bit"|' ${ANALYTICS_ZOO_ROOT}/langchain_upstream/langchain_example.py
# disable this test temporarily
# ipex_workaround_wrapper python ${ANALYTICS_ZOO_ROOT}/langchain_upstream/langchain_example.py
ipex_workaround_wrapper python ${ANALYTICS_ZOO_ROOT}/langchain_upstream/langchain_example.py
rm -rf ${ANALYTICS_ZOO_ROOT}/langchain_upstream
Loading