Skip to content

Commit

Permalink
Support PyTorch 2.1 and add PyTorch tests for python 3.11 (#854)
Browse files Browse the repository at this point in the history
* Support PyTorch 2.1 and add PyTorch tests for python 3.11
* Remove python 3.8 tests
* Remove python 3.11 torch 1.13 test (doesn't support 3.11)

---------

Co-authored-by: elad cohen <[email protected]>
  • Loading branch information
elad-c and elad cohen authored Nov 8, 2023
1 parent 7e665f5 commit f5aa9ae
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python 3.8, Pytorch 1.12
name: Python 3.10, Pytorch 2.1
on:
workflow_dispatch: # Allow manual triggers
schedule:
Expand All @@ -12,5 +12,5 @@ jobs:
run-tests:
uses: ./.github/workflows/run_pytorch_tests.yml
with:
python-version: "3.8"
torch-version: "1.12.*"
python-version: "3.10"
torch-version: "2.1.*"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python 3.8, Pytorch 2.0
name: Python 3.11, Pytorch 2.0
on:
workflow_dispatch: # Allow manual triggers
schedule:
Expand All @@ -12,5 +12,5 @@ jobs:
run-tests:
uses: ./.github/workflows/run_pytorch_tests.yml
with:
python-version: "3.8"
python-version: "3.11"
torch-version: "2.0.*"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python 3.8, Pytorch 1.13
name: Python 3.11, Pytorch 2.1
on:
workflow_dispatch: # Allow manual triggers
schedule:
Expand All @@ -12,5 +12,5 @@ jobs:
run-tests:
uses: ./.github/workflows/run_pytorch_tests.yml
with:
python-version: "3.8"
torch-version: "1.13.*"
python-version: "3.11"
torch-version: "2.1.*"
16 changes: 0 additions & 16 deletions .github/workflows/run_tests_python38_keras212.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python 3.8, Keras 2.13
name: Python 3.9, Pytorch 2.1
on:
workflow_dispatch: # Allow manual triggers
schedule:
Expand All @@ -10,7 +10,7 @@ on:

jobs:
run-tests:
uses: ./.github/workflows/run_keras_tests.yml
uses: ./.github/workflows/run_pytorch_tests.yml
with:
python-version: "3.8"
tf-version: "2.13.*"
python-version: "3.9"
torch-version: "2.1.*"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ In addition, a set of [notebooks](tutorials/notebooks) are provided for an easy

Currently, MCT is being tested on various Python, Pytorch and TensorFlow versions:

| | PyTorch 1.12 | PyTorch 1.13 | PyTorch 2.0 |
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Python 3.8 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python38_pytorch112.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python38_pytorch112.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python38_pytorch113.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python38_pytorch113.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python38_pytorch20.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python38_pytorch20.yml) |
| Python 3.9 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch112.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch112.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch113.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch113.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch20.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch20.yml) |
| Python 3.10 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch112.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch112.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch113.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch113.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch20.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch20.yml) |
| | PyTorch 1.13 | PyTorch 2.0 | PyTorch 2.1 |
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Python 3.9 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch113.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch113.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch20.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch20.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch21.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch21.yml) |
| Python 3.10 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch112.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch112.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch113.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch113.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch20.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch20.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch21.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch21.yml) |
| Python 3.11 | | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch20.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch20.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch21.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch21.yml) |


| | TensorFlow 2.12 | TensorFlow 2.13 | TensorFlow 2.14 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def run_mct(self, model):
def set_seed(self, seed):
torch.manual_seed(seed)
np.random.seed(seed)
random.seed(seed)
random.seed(float(seed))

def test_sanity(self):
"""
Expand Down

0 comments on commit f5aa9ae

Please sign in to comment.