Bump torch from 2.1.0 to 2.2.0 in /models #357
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Lint and Test MLAgility | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MLAGILITY_DEBUG: True | |
MLAGILITY_TRACEBACK: True | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
activate-environment: mla | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
shell: bash -el {0} | |
run: | | |
python -m pip install --upgrade pip | |
conda install pylint | |
if [ -f setup.py ]; then pip install -e .; fi | |
pip install transformers timm | |
python -m pip check | |
- name: Lint with PyLint | |
shell: bash -el {0} | |
run: | | |
pylint src/mlagility --rcfile .pylintrc | |
pylint examples --rcfile .pylintrc --ignore-paths examples/onnxflow --disable E0401,E0611 | |
- name: Test with unittest | |
shell: bash -el {0} | |
run: | | |
# Unit tests | |
rm -rf ~/.cache/mlagility | |
python test/database.py | |
# mlagility examples | |
rm -rf ~/.cache/mlagility | |
python examples/model_api/hello_world.py | |
rm -rf ~/.cache/mlagility | |
python examples/script_api/onnx_opset.py --onnx-opset 15 | |
rm -rf ~/.cache/mlagility | |
benchit examples/cli/scripts/hello_world.py | |
rm -rf ~/.cache/mlagility | |
benchit examples/cli/scripts/multiple_invocations.py | |
rm -rf ~/.cache/mlagility | |
benchit examples/cli/scripts/max_depth.py --max-depth 1 | |
rm -rf ~/.cache/mlagility | |
benchit examples/cli/scripts/two_models.py | |
rm -rf ~/.cache/mlagility | |
benchit examples/cli/scripts/hello_world.py --sequence-file examples/cli/extras/example_sequence.py --build-only | |
rm -rf ~/.cache/mlagility | |
benchit examples/cli/onnx/sample.onnx --onnx-opset=14 | |
# E2E tests | |
rm -rf ~/.cache/mlagility | |
python test/cli.py | |
rm -rf ~/.cache/mlagility | |
python test/analysis.py | |
rm -rf ~/.cache/mlagility | |
python test/model_api.py | |
- name: Install and Start Slurm | |
shell: bash -el {0} | |
run: | | |
sudo apt update -y | |
sudo apt install slurm-wlm -y | |
cp test/helpers/slurm.conf test/helpers/slurm_modified.conf | |
sed -i "s/YOUR_HOSTNAME_HERE/$HOSTNAME/" test/helpers/slurm_modified.conf | |
sudo mv test/helpers/slurm_modified.conf /etc/slurm/slurm.conf | |
sudo service slurmd start | |
sudo service slurmctld start | |
sudo service munge start | |
- name: Test benchit on Slurm | |
shell: bash -el {0} | |
run: | | |
# Create conda environment for Slurm using srun (sbatch + wait) | |
export SKIP_REQUIREMENTS_INSTALL="True" | |
srun src/mlagility/cli/setup_venv.sh | |
# Run tests on Slurm | |
export MLAGILITY_SLURM_USE_DEFAULT_MEMORY="True" | |
benchit benchmark models/selftest/linear.py --build-only --use-slurm --cache-dir local_cache | |
bash test/helpers/check_slurm_output.sh slurm-2.out | |
- name: Check installation of requirements.txt and their compatibility with mlagility | |
shell: bash -el {0} | |
run: | | |
bash src/mlagility/cli/setup_venv.sh | |
conda activate tracker_slurm | |
python -m pip check | |
python -c "import torch_geometric" | |
conda deactivate |