Skip to content

Commit

Permalink
Pytorch Version 1.8.1 (#162)
Browse files Browse the repository at this point in the history
* add rtolerance

* add codecov action

* add pytorch version to test suit

* add readme note

* env var
  • Loading branch information
ferrine committed Mar 28, 2021
1 parent 0f813cf commit 9a06d94
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ jobs:
strategy:
matrix:
python-version: [3.7]
env:
- PYTORCH_CHANNEL='pytorch' PYTORCH_VERSION='=1.7.1'
- PYTORCH_CHANNEL='pytorch' PYTORCH_VERSION='=1.6.0'
- PYTORCH_CHANNEL='pytorch' PYTORCH_VERSION='=1.5.1'
- PYTORCH_CHANNEL='pytorch-nightly' PYTORCH_VERSION=''

pytorch-version: ['1.8.1', '1.7.1', '1.6.0']
env:
PYTORCH_VERSION: ${{ matrix.pytorch-version }}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
Expand All @@ -32,9 +29,8 @@ jobs:
- name: Install deps with conda
shell: bash -l {0}
run: |
export ${{ matrix.env }}
conda install --yes numpy mkl-service
conda install --yes pytorch${PYTORCH_VERSION} cpuonly -c ${PYTORCH_CHANNEL}
conda install --yes pytorch==${{ matrix.pytorch-version }} cpuonly -c pytorch
conda install --yes --file requirements-dev.txt
conda install --yes conda-build
conda develop .
Expand All @@ -48,20 +44,9 @@ jobs:
- name: Run Tests
shell: bash -l {0}
run: |
export ${{ matrix.env }}
pytest -v geoopt tests --durations=0 --doctest-modules --cov geoopt
pytest -v geoopt tests --durations=0 --doctest-modules --cov geoopt --cov-report=xml --cov-report term
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${PYTORCH_CHANNEL}-${PYTORCH_VERSION}
parallel: true
finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls GitHub Action
uses: AndreMiras/coveralls-python-action@develop
uses: codecov/codecov-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
github-token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTORCH_VERSION
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Methods”`_ ICLR2019 and more.

Installation
------------
Make sure you have pytorch>=1.4.0 installed
Make sure you have pytorch>=1.6.0 installed

There are two ways to install geoopt:

Expand Down
4 changes: 2 additions & 2 deletions tests/test_gyrovector_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def test_matvec_via_equiv_fn_apply(a, negative, manifold, strict, dtype):
mat = a.new(3, a.shape[-1]).normal_()
y = manifold.mobius_fn_apply(lambda x: x @ mat.transpose(-1, -2), a)
y1 = manifold.mobius_matvec(mat, a)
tolerance = {torch.float32: dict(atol=1e-5), torch.float64: dict()}
tolerance = {torch.float32: dict(atol=1e-5, rtol=1e-5), torch.float64: dict()}

tolerant_allclose_check(y, y1, strict=strict, **tolerance[dtype])
y.sum().backward()
Expand All @@ -448,7 +448,7 @@ def matvec(x):

y = matvec(a, k=-c)
y1 = stereographic.math.mobius_matvec(mat, a, k=-c)
tolerance = {torch.float32: dict(atol=1e-5), torch.float64: dict()}
tolerance = {torch.float32: dict(atol=1e-5, rtol=1e-5), torch.float64: dict()}

tolerant_allclose_check(y, y1, strict=strict, **tolerance[dtype])
y.sum().backward()
Expand Down

0 comments on commit 9a06d94

Please sign in to comment.