Skip to content

Fix dependabot issues (#5179) #2

Fix dependabot issues (#5179)

Fix dependabot issues (#5179) #2

name: Nano Unit Tests PyTorch
# Cancel previous runs in the PR when you push new commits
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
paths:
- 'python/nano/**'
- '.github/workflows/nano_unit_tests_pytorch.yml'
pull_request:
branches: [ main ]
paths:
- 'python/nano/**'
- '.github/workflows/nano_unit_tests_pytorch.yml'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
nano-unit-test-pytorch:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
python-version: ["3.8"]
pytorch-version: [
"pytorch_110 neural-compressor==1.13.1 https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/oneccl_bind_pt-1.10.0-cp38-cp38-linux_x86_64.whl",
"pytorch_111 neural-compressor==1.13.1 https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/oneccl_bind_pt-1.11.0-cp38-cp38-linux_x86_64.whl",
"pytorch_112 neural-compressor==1.13.1 https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/oneccl_bind_pt-1.12.100%2Bcpu-cp38-cp38-linux_x86_64.whl",
"pytorch_113 neural-compressor==2.0 https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/oneccl_bind_pt-1.13.0%2Bcpu-cp38-cp38-linux_x86_64.whl",
"pytorch_20 neural-compressor==2.1 https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/oneccl_bind_pt-2.0.0%2Bcpu-cp38-cp38-linux_x86_64.whl",
]
steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools==58.0.4
python -m pip install --upgrade wheel
- name: Run Nano-init test
shell: bash
run: |
$CONDA/bin/conda create -n bigdl-init -y python==3.8.16 setuptools==58.0.4
source $CONDA/bin/activate bigdl-init
$CONDA/bin/conda info
if [ ! -z "${{matrix.pytorch-version}}" ]; then
requirements=(${{matrix.pytorch-version}})
bash python/nano/dev/build_and_install.sh linux default false ${requirements[0]} -f https://developer.intel.com/ipex-whl-stable-cpu
fi
source bigdl-nano-init
if [ 0"$LD_PRELOAD" = "0" ]; then
exit 1
else
echo "Set environment variable successfully."
fi
source $CONDA/bin/deactivate
if [ ! 0"$LD_PRELOAD" = "0" ]; then
exit 1
else
echo "Unset environment variable successfully while deactivating conda environment."
fi
source $CONDA/bin/activate bigdl-init
if [ 0"$LD_PRELOAD" = "0" ]; then
exit 1
else
echo "Setup environment variable successfully while activating conda environment."
fi
pip uninstall -y bigdl-nano
source $CONDA/bin/deactivate
$CONDA/bin/conda remove -n bigdl-init --all
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
- name: Run PyTorch unit tests
shell: bash
run: |
$CONDA/bin/conda create -n pytorch -y python==3.8.16 setuptools=58.0.4 cryptography==39.0.1
source $CONDA/bin/activate pytorch
$CONDA/bin/conda info
bash python/nano/dev/build_and_install.sh linux default false pytorch
pip install pytest six
if [ ! -z "${{matrix.pytorch-version}}" ]; then
requirements=(${{matrix.pytorch-version}})
bash python/nano/dev/build_and_install.sh linux default false ${requirements[0]} -f https://developer.intel.com/ipex-whl-stable-cpu
pip install ${requirements[2]} -f https://developer.intel.com/ipex-whl-stable-cpu
fi
source bigdl-nano-init
bash python/nano/test/run-nano-pytorch-tests.sh
source $CONDA/bin/deactivate
$CONDA/bin/conda remove -n pytorch --all
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
nano-unit-test-pytorch-deps:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
python-version: ["3.8"]
pytorch-version: [
"pytorch_110 neural-compressor==1.13.1 https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/oneccl_bind_pt-1.10.0-cp38-cp38-linux_x86_64.whl",
"pytorch_111 neural-compressor==1.13.1 https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/oneccl_bind_pt-1.11.0-cp38-cp38-linux_x86_64.whl",
"pytorch_112 neural-compressor==1.13.1 https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/oneccl_bind_pt-1.12.100%2Bcpu-cp38-cp38-linux_x86_64.whl",
"pytorch_113 neural-compressor==2.0 https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/oneccl_bind_pt-1.13.0%2Bcpu-cp38-cp38-linux_x86_64.whl",
"pytorch_20 neural-compressor==2.1 https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/cpu/oneccl_bind_pt-2.0.0%2Bcpu-cp38-cp38-linux_x86_64.whl",
]
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
- name: Run PyTorch unit tests(Ray)
shell: bash
run: |
$CONDA/bin/conda create -n ray-pytorch -y python==3.8.16 setuptools=58.0.4
source $CONDA/bin/activate ray-pytorch
$CONDA/bin/conda info
bash python/nano/dev/build_and_install.sh linux default false pytorch
pip install pytest
# fix issue, see https://github.com/intel-analytics/BigDL/blob/main/docs/readthedocs/source/doc/Nano/Overview/known_issues.md#ray-issues
pip install google-api-core==2.8.2
pip install ray[default]==1.11.0 prometheus_client==0.13.0
if [ ! -z "${{matrix.pytorch-version}}" ]; then
requirements=(${{matrix.pytorch-version}})
bash python/nano/dev/build_and_install.sh linux default false ${requirements[0]} -f https://developer.intel.com/ipex-whl-stable-cpu
pip install ${requirements[2]} -f https://developer.intel.com/ipex-whl-stable-cpu
fi
source bigdl-nano-init
bash python/nano/test/run-nano-pytorch-ray-tests.sh
source $CONDA/bin/deactivate
$CONDA/bin/conda remove -n ray-pytorch --all
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
- name: Run PyTorch unit tests (OpenVINO)
shell: bash
run: |
$CONDA/bin/conda create -n openvino-pytorch -y python==3.8.16 setuptools=58.0.4
source $CONDA/bin/activate openvino-pytorch
$CONDA/bin/conda info
bash python/nano/dev/build_and_install.sh linux default false pytorch,inference
pip install pytest
pip install diffusers==0.11.1
if [ ! -z "${{matrix.pytorch-version}}" ]; then
requirements=(${{matrix.pytorch-version}})
bash python/nano/dev/build_and_install.sh linux default false ${requirements[0]} -f https://developer.intel.com/ipex-whl-stable-cpu
fi
source bigdl-nano-init
bash python/nano/test/run-nano-pytorch-openvino-tests.sh
source $CONDA/bin/deactivate
$CONDA/bin/conda remove -n openvino-pytorch --all
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
- name: Run PyTorch unit tests (Automl)
shell: bash
run: |
$CONDA/bin/conda create -n nano-automl-pytorch -y python==3.8.16 setuptools=58.0.4
source $CONDA/bin/activate nano-automl-pytorch
$CONDA/bin/conda info
bash python/nano/dev/build_and_install.sh linux default false pytorch
pip install pytest
pip install ConfigSpace
pip install 'optuna<=3.1.1'
pip install six
source bigdl-nano-init
bash python/nano/test/run-nano-automl-pytorch-tests.sh
source $CONDA/bin/deactivate
$CONDA/bin/conda remove -n nano-automl-pytorch --all
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
- name: Run PyTorch unit tests (INC)
shell: bash
run: |
$CONDA/bin/conda create -n inc-pytorch -y python==3.8.16 setuptools=58.0.4
source $CONDA/bin/activate inc-pytorch
$CONDA/bin/conda info
bash python/nano/dev/build_and_install.sh linux default false pytorch
pip install pytest
if [ ! -z "${{matrix.pytorch-version}}" ]; then
requirements=(${{matrix.pytorch-version}})
bash python/nano/dev/build_and_install.sh linux default false ${requirements[0]} -f https://developer.intel.com/ipex-whl-stable-cpu
pip install ${requirements[1]}
fi
pip install numpy==1.23.4
source bigdl-nano-init
bash python/nano/test/run-nano-pytorch-inc-tests.sh
source $CONDA/bin/deactivate
$CONDA/bin/conda remove -n inc-pytorch --all
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
- name: Run PyTorch unit tests (ONNX)
shell: bash
run: |
$CONDA/bin/conda create -n onnx-pytorch -y python==3.8.16 setuptools=58.0.4
source $CONDA/bin/activate onnx-pytorch
$CONDA/bin/conda info
bash python/nano/dev/build_and_install.sh linux default false pytorch,inference
if [ ! -z "${{matrix.pytorch-version}}" ]; then
requirements=(${{matrix.pytorch-version}})
bash python/nano/dev/build_and_install.sh linux default false ${requirements[0]} -f https://developer.intel.com/ipex-whl-stable-cpu
pip install ${requirements[1]}
fi
pip install pytest
source bigdl-nano-init
bash python/nano/test/run-nano-pytorch-onnx-tests.sh
source $CONDA/bin/deactivate
$CONDA/bin/conda remove -n onnx-pytorch --all
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
nano-unit-test-ipex:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
python-version: ["3.8"]
pytorch-version: [
# The reason why ipex1.10 is not currently supported is that the optimization of ipex1.10
# will change the require_grad attribute of layers, which will make some tests of nano fail.
# The reason why ipex1.11 is not currently supported is that the optimization of ipex
# seems will cause strange behaior of context manager, which will make some tests of nano fail.
"pytorch_112 neural-compressor==1.13.1",
"pytorch_113 neural-compressor==2.0",
"pytorch_20 neural-compressor==2.1",
]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools==58.0.4
python -m pip install --upgrade wheel
- name: Run PyTorch IPEX unit tests
shell: bash
run: |
$CONDA/bin/conda create -n pytorch-ipex -y python==3.8.16 setuptools=58.0.4
source $CONDA/bin/activate pytorch-ipex
$CONDA/bin/conda info
bash python/nano/dev/build_and_install.sh linux default false pytorch,inference
pip install pytest
pip install diffusers==0.11.1
if [ ! -z "${{matrix.pytorch-version}}" ]; then
requirements=(${{matrix.pytorch-version}})
bash python/nano/dev/build_and_install.sh linux default false ${requirements[0]} -f https://developer.intel.com/ipex-whl-stable-cpu
pip install ${requirements[1]}
fi
source bigdl-nano-init
bash python/nano/test/run-nano-pytorch-tests-ipex.sh
source $CONDA/bin/deactivate
$CONDA/bin/conda remove -n pytorch-ipex --all
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
nano-unit-test-optimizer:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
python-version: ["3.8"]
pytorch-version: [
# The reason why ipex1.10 is not currently supported is that the optimization of ipex1.10
# will change the require_grad attribute of layers, which will make some tests of nano fail.
"pytorch_111 neural-compressor==1.13.1",
"pytorch_112 neural-compressor==1.13.1",
"pytorch_113 neural-compressor==2.0",
"pytorch_20 neural-compressor==2.1",
]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools==58.0.4
python -m pip install --upgrade wheel
- name: Run PyTorch InferenceOptimizer unit tests
shell: bash
run: |
$CONDA/bin/conda create -n pytorch-inf -y python==3.8.16 setuptools=58.0.4
source $CONDA/bin/activate pytorch-inf
$CONDA/bin/conda info
bash python/nano/dev/build_and_install.sh linux default false pytorch,inference
pip install pytest
if [ ! -z "${{matrix.pytorch-version}}" ]; then
requirements=(${{matrix.pytorch-version}})
bash python/nano/dev/build_and_install.sh linux default false ${requirements[0]} -f https://developer.intel.com/ipex-whl-stable-cpu
pip install ${requirements[1]}
fi
source bigdl-nano-init
bash python/nano/test/run-nano-pytorch-tests-optimizer.sh
source $CONDA/bin/deactivate
$CONDA/bin/conda remove -n pytorch-inf --all
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}