From d9a058f54c2eae71b726f157c0d5f083b397c885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Pedersen?= Date: Sun, 21 Jan 2024 21:24:13 +0100 Subject: [PATCH 1/4] Test tf 2.15.0 CI build --- .github/workflows/test.yml | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56450fc..10642c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -142,3 +142,45 @@ jobs: - name: Run tests run: pytest -v tests/test_model_expected_result.py + + tf-2.15: + 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<=4.8.2" + pip install "protobuf<=3.20" --force-reinstall + + - 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 From 6d9ee2cfddd402957f5040a96c959cf33f7bac3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Pedersen?= Date: Sun, 21 Jan 2024 21:41:03 +0100 Subject: [PATCH 2/4] Rename job name for testing tf 2.15 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10642c2..b47a080 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -143,7 +143,7 @@ jobs: - name: Run tests run: pytest -v tests/test_model_expected_result.py - tf-2.15: + latest-tf-compatibility: needs: build runs-on: ${{ matrix.os }} strategy: From 8a9ed3a5a505a9d706588d09ce5e229867ec387a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Pedersen?= Date: Sun, 21 Jan 2024 21:44:33 +0100 Subject: [PATCH 3/4] Remove protobuf fix for tf 2.15 test --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b47a080..52e48fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -163,9 +163,7 @@ jobs: run: pip install wheel setuptools flake8 pytest-cov - name: Install tensorflow-datasets - run: | - pip install tensorflow==${{ matrix.tf-version }} "tensorflow-datasets<=4.8.2" - pip install "protobuf<=3.20" --force-reinstall + run: pip install tensorflow==${{ matrix.tf-version }} tensorflow-datasets - name: Download artifact uses: actions/download-artifact@v3 From 7e6df62e1803889d712b83112177bc1f20ea828c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Pedersen?= Date: Sun, 21 Jan 2024 22:01:23 +0100 Subject: [PATCH 4/4] tf 2.2-2.15 update and tests --- README.md | 6 +++++- setup.py | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 90fc89d..755f214 100644 --- a/README.md +++ b/README.md @@ -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). + ## [Continuous integration](https://github.com/andreped/GradientAccumulator#continuous-integration) | Build Type | Status | @@ -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: diff --git a/setup.py b/setup.py index a1a6b5a..bb68799 100644 --- a/setup.py +++ b/setup.py @@ -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" ],