Skip to content

Commit

Permalink
merge latest
Browse files Browse the repository at this point in the history
  • Loading branch information
ksbrar committed Oct 18, 2022
2 parents bdfe480 + c9a5c0a commit b180f04
Show file tree
Hide file tree
Showing 153 changed files with 4,882 additions and 1,197 deletions.
1 change: 1 addition & 0 deletions .actrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-P ubuntu-latest=ludwigai/ludwig-ray
22 changes: 19 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,27 @@ jobs:
RAY_VERSION: ${{ matrix.ray-version }}
AWS_ACCESS_KEY_ID: ${{ secrets.LUDWIG_TESTS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.LUDWIG_TESTS_AWS_SECRET_ACCESS_KEY }}
EXCLUDED_MARKERS: "benchmark"

name: py${{ matrix.python-version }}, torch-${{ matrix.pytorch-version }}, ${{ matrix.test-markers }}, ${{ matrix.os }}
services:
minio:
image: fclairamb/minio-github-actions
env:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
ports:
- 9000:9000

timeout-minutes: 80
steps:
- name: Setup ludwigai/ludwig-ray container for local testing with act.
if: ${{ env.ACT }}
run: |
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo mkdir -p /opt/hostedtoolcache/
sudo chmod 777 -R /opt/hostedtoolcache/
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down Expand Up @@ -108,10 +124,10 @@ jobs:
if [ "$MARKERS" == "distributed" ]; then
if [ "$RAY_VERSION" == "nightly" ]; then
# NOTE: hardcoded for python 3.9 on Linux
# pip install https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-3.0.0.dev0-cp39-cp39-manylinux2014_x86_64.whl
pip install https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-3.0.0.dev0-cp39-cp39-manylinux2014_x86_64.whl
# NOTE: Pinned Ray nightly version to September 20, 2022 to get tests to pass
pip install https://s3-us-west-2.amazonaws.com/ray-wheels/master/fa182d3c9e478ef4c169ccf7459764768996110f/ray-3.0.0.dev0-cp39-cp39-manylinux2014_x86_64.whl
# pip install https://s3-us-west-2.amazonaws.com/ray-wheels/master/fa182d3c9e478ef4c169ccf7459764768996110f/ray-3.0.0.dev0-cp39-cp39-manylinux2014_x86_64.whl
else
pip install ray==$RAY_VERSION
fi
Expand Down Expand Up @@ -156,7 +172,7 @@ jobs:

- name: Tests
run: |
RUN_PRIVATE=1 LUDWIG_TEST_SUITE_TIMEOUT_S=3600 pytest -v --timeout 300 --durations 100 -m "$MARKERS" --junitxml pytest.xml tests
RUN_PRIVATE=1 LUDWIG_TEST_SUITE_TIMEOUT_S=3600 pytest -v --timeout 300 --durations 100 -m "($MARKERS) and (not $EXCLUDED_MARKERS)" --junitxml pytest.xml tests
- name: Upload Unit Test Results
if: always()
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/pytest_benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# This workflow will install Python dependencies, and run benchmarks on a few datasets
# to test model performance regressions.

name: benchmark

on:
push:
branches: ["master", "release-*"]

# we want an ongoing run of this workflow to be canceled by a later commit
# so that there is only one concurrent run of this workflow for each branch
concurrency:
group: benchmark-${{ github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
benchmark-pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.8]
test-markers: ["benchmark"]
include:
- python-version: 3.8
pytorch-version: 1.12.1
torchscript-version: 1.10.2
ray-version: 2.0.0
env:
PYTORCH: ${{ matrix.pytorch-version }}
MARKERS: ${{ matrix.test-markers }}
TORCHSCRIPT_VERISON: ${{ matrix.torchscript-version }}
RAY_VERSION: ${{ matrix.ray-version }}

name: py${{ matrix.python-version }}, torch-${{ matrix.pytorch-version }}, backend-ray-${{ matrix.ray-version }}

timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup Linux
if: runner.os == 'linux'
run: |
sudo apt-get install -y cmake libsndfile1
- name: Setup macOS
if: runner.os == 'macOS'
run: |
brew install libuv
- name: pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-torch${{ matrix.pytorch-version }}-${{ matrix.test-markers }}-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-torch${{ matrix.pytorch-version }}-${{ matrix.test-markers }}-
- name: Install dependencies
env:
HOROVOD_WITH_PYTORCH: 1
HOROVOD_WITHOUT_MPI: 1
HOROVOD_WITHOUT_TENSORFLOW: 1
HOROVOD_WITHOUT_MXNET: 1
run: |
python --version
pip --version
python -m pip install -U pip
cmake --version
# skip installation of some requirements
echo > requirements-temp && mv requirements-temp requirements_hyperopt.txt
echo > requirements-temp && mv requirements-temp requirements_serve.txt
echo > requirements-temp && mv requirements-temp requirements_viz.txt
echo > requirements-temp && mv requirements-temp requirements_explain.txt
extra_index_url=https://download.pytorch.org/whl/cpu
pip install torch==$PYTORCH torchtext torchvision torchaudio --extra-index-url $extra_index_url
pip install ray==$RAY_VERSION
ray_expected=$(python -c "import ray; print(ray.__version__)")
torch_expected=$(python -c "import torch; print(torch.__version__)")
pip install '.[test]' --extra-index-url $extra_index_url
pip list
python -c "import torch; assert torch.__version__ == \"$torch_expected\", f\"torch {torch.__version__} != $torch_expected\""
python -c "import ray; assert ray.__version__ == \"$ray_expected\", f\"ray {ray.__version__} != $ray_expected\""
shell: bash

- name: Tests
env:
KAGGLE_USERNAME: ${{ secrets.KAGGLE_USERNAME }}
KAGGLE_KEY: ${{ secrets.KAGGLE_KEY }}
run: |
pytest -s -v -m "$MARKERS" --junitxml pytest.xml tests/regression_tests/benchmark
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results (Python ${{ matrix.python-version }} ${{ matrix.test-markers }})
path: pytest.xml
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
- id: trailing-whitespace
- id: mixed-line-ending
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
rev: v3.1.0
hooks:
- id: pyupgrade
args: [--py36-plus]
Expand All @@ -47,7 +47,7 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/psf/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black
name: Format code
Expand Down
3 changes: 3 additions & 0 deletions ludwig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
from ludwig.globals import LUDWIG_VERSION as __version__ # noqa

logging.basicConfig(level=logging.INFO, stream=sys.stdout, format="%(message)s")

# Disable annoying message about NUMEXPR_MAX_THREADS
logging.getLogger("numexpr").setLevel(logging.WARNING)
Loading

0 comments on commit b180f04

Please sign in to comment.