Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into main
  • Loading branch information
charliebudd committed Oct 28, 2022
2 parents 7ca8213 + 56d66b9 commit 135bacb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 28 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ jobs:
build-wheels:
name: Build Wheels
uses: charliebudd/torch-extension-builder/.github/workflows/build-pytorch-extension-wheels.yml@main
with:
build-command: "git config --global --add safe.directory ${GITHUB_WORKSPACE} && python setup.py bdist_wheel"

test-wheels-locally:
name: Test Wheels Locally
needs: build-wheels
uses: ./.github/workflows/test.yml
with:
local-wheels: true
wheel-location: final-wheels
python-versions: "[3.6, 3.7, 3.8, 3.9]"
pytorch-versions: "[1.9, '1.10', 1.11]"
cuda-versions: "[10.2, 11.3]"

update-perfromance-stats:
if: ${{ github.base_ref == 'main' }}
Expand Down Expand Up @@ -59,9 +57,6 @@ jobs:
with:
local-wheels: false
wheel-location: https://test.pypi.org/simple/
python-versions: "[3.6, 3.7, 3.8, 3.9]"
pytorch-versions: "[1.9, '1.10', 1.11]"
cuda-versions: "[10.2, 11.3]"

publish-wheels-to-pypi:
if: startsWith(github.ref, 'refs/tags/v')
Expand Down Expand Up @@ -89,6 +84,3 @@ jobs:
with:
local-wheels: false
wheel-location: https://pypi.org/simple/
python-versions: "[3.6, 3.7, 3.8, 3.9]"
pytorch-versions: "[1.9, '1.10', 1.11]"
cuda-versions: "[10.2, 11.3]"
42 changes: 25 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ on:
default: final-wheels
python-versions:
type: string
default: "[3.6, 3.7, 3.8]"
default: "[3.6, 3.7, 3.8, 3.9]"
pytorch-versions:
type: string
default: "[1.9, '1.10']"
default: "[1.9, '1.10', 1.11, 1.12]"
cuda-versions:
type: string
default: "[10.2, 11.3]"
default: "[10.2, 11.3, 11.6]"

jobs:
test-release:
Expand All @@ -26,34 +26,42 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ${{ fromJson(inputs.python-versions) }}
pytorch: ${{ fromJson(inputs.pytorch-versions) }}
cuda: ${{ fromJson(inputs.cuda-versions) }}
python-version: ${{ fromJson(inputs.python-versions) }}
pytorch-version: ${{ fromJson(inputs.pytorch-versions) }}
cuda-version: ${{ fromJson(inputs.cuda-versions) }}
exclude:
- pytorch: 1.9
cuda: 11.3
- python: 3.6
pytorch: 1.11
- pytorch-version: 1.9
cuda-version: 11.3
- python-version: 3.6
pytorch-version: 1.11
- python-version: 3.6
pytorch-version: 1.12
- pytorch-version: 1.9
cuda-version: 11.6
- pytorch-version: '1.10'
cuda-version: 11.6
- pytorch-version: 1.11
cuda-version: 11.6
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
python-version: ${{ matrix.python-version }}

- name: Install Test Requirements
run: |
ENV=../.venv-${{ matrix.python }}-${{ matrix.pytorch }}-${{ matrix.cuda }}
ENV=../.venv-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ matrix.cuda-version }}
if [ ! -d "$ENV" ]; then
python -m venv $ENV
fi
. $ENV/bin/activate
python -m pip install -U --force-reinstall pip
python -m pip install numpy py-cpuinfo ecadataset
python -m pip install torch==${{ matrix.pytorch }} -f https://download.pytorch.org/whl/cu$(echo ${{ matrix.cuda }} | sed 's/\.//')/torch_stable.html
python -m pip install torch==${{ matrix.pytorch-version }} -f https://download.pytorch.org/whl/cu$(echo ${{ matrix.cuda-version }} | sed 's/\.//')/torch_stable.html
ln -s ../eca-data eca-data
Expand All @@ -63,7 +71,7 @@ jobs:
- name: Install torchcontentarea From PyPI Index
if: ${{ !inputs.local-wheels }}
run: |
. ../.venv-${{ matrix.python }}-${{ matrix.pytorch }}-${{ matrix.cuda }}/bin/activate
. ../.venv-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ matrix.cuda-version }}/bin/activate
python -m pip install --force-reinstall --no-deps torchcontentarea -i ${{ inputs.wheel-location }}
- name: Download Cached Wheels
Expand All @@ -76,10 +84,10 @@ jobs:
- name: Install torchcontentarea from Cached Wheels
if: ${{ inputs.local-wheels }}
run: |
. ../.venv-${{ matrix.python }}-${{ matrix.pytorch }}-${{ matrix.cuda }}/bin/activate
python -m pip install --force-reinstall --no-deps ${{ inputs.wheel-location }}/torchcontentarea*cp$(echo ${{ matrix.python }} | sed 's/\.//')*.whl
. ../.venv-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ matrix.cuda-version }}/bin/activate
python -m pip install --force-reinstall --no-deps ${{ inputs.wheel-location }}/torchcontentarea*cp$(echo ${{ matrix.python-version }} | sed 's/\.//')*.whl
- name: Run Tests
run: |
. ../.venv-${{ matrix.python }}-${{ matrix.pytorch }}-${{ matrix.cuda }}/bin/activate
. ../.venv-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-${{ matrix.cuda-version }}/bin/activate
python -m unittest tests
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
packages=["torchcontentarea"],
package_dir={"":"src"},
package_data={'torchcontentarea': ['models/*.pt']},
install_requires=['torch>=0.9,<=1.12'],
ext_modules=[cpp_extension.CUDAExtension("torchcontentareaext", ext_source_files, extra_compile_args=compile_args)],
cmdclass=versioneer.get_cmdclass({"build_ext": cpp_extension.BuildExtension})
)

0 comments on commit 135bacb

Please sign in to comment.