Skip to content

Commit

Permalink
Merge pull request #129 from andreped/tf-2.15-support
Browse files Browse the repository at this point in the history
Official tf 2.2-2.15 support update
  • Loading branch information
andreped authored Jan 21, 2024
2 parents fbd93a1 + 7e6df62 commit 2eb285e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,43 @@ jobs:

- name: Run tests
run: pytest -v tests/test_model_expected_result.py

latest-tf-compatibility:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ["3.9", "3.10", "3.11"]
tf-version: ["2.15.0"]

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

- name: Install dependencies
run: pip install wheel setuptools flake8 pytest-cov

- name: Install tensorflow-datasets
run: pip install tensorflow==${{ matrix.tf-version }} tensorflow-datasets

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: "Python wheel"

- name: Install wheel
run: pip install --find-links=. gradient_accumulator-*
shell: bash

- name: Debug pip deps
run: pip list

- name: Test library accessibility
run: python -c "from gradient_accumulator import GradientAccumulateModel, GradientAccumulateOptimizer"

- name: Run tests
run: pytest -v tests/test_model_expected_result.py
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

**GradientAccumulator** was developed by SINTEF Health due to the lack of an easy-to-use method for gradient accumulation in TensorFlow 2.

The package is available on PyPI and is compatible with and have been tested against `TensorFlow 2.2-2.12` and `Python 3.6-3.11`, and works cross-platform (Ubuntu, Windows, macOS).
The package is available on PyPI and is compatible with and have been tested against `TensorFlow 2.2-2.15` and `Python 3.6-3.11`, and works cross-platform (Ubuntu, Windows, macOS).
</div>


## [Continuous integration](https://github.com/andreped/GradientAccumulator#continuous-integration)

| Build Type | Status |
Expand All @@ -34,6 +35,9 @@ Or from source:
pip install git+https://github.com/andreped/GradientAccumulator
```

**Disclaimer:** Note that different `TensorFlow` versions supports different Python versions. Therefore, be sure to check which Python versions are supported when you install a specific `TensorFlow` version. `GradientAccumulator` does not support Python `>3.11`, as `TensorFlow` has yet to add support for them.


## [Getting started](https://github.com/andreped/GradientAccumulator#getting-started)

A simple example to add gradient accumulation to an existing model is by:
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent"
],
Expand Down

0 comments on commit 2eb285e

Please sign in to comment.