diff --git a/.github/workflows/ci_dockers.yml b/.github/workflows/ci_dockers.yml index 701223c795a3b..02426529574f6 100644 --- a/.github/workflows/ci_dockers.yml +++ b/.github/workflows/ci_dockers.yml @@ -93,7 +93,7 @@ jobs: matrix: # the config used in '.github/workflows/ci_test-conda.yml' python_version: ["3.8"] - pytorch_version: ["1.6", "1.7", "1.8", "1.9", "1.10"] + pytorch_version: ["1.7", "1.8", "1.9", "1.10"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/ci_test-conda.yml b/.github/workflows/ci_test-conda.yml index edae03db7936b..e0808a79fd384 100644 --- a/.github/workflows/ci_test-conda.yml +++ b/.github/workflows/ci_test-conda.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: python-version: ["3.8"] # previous to last Python version as that one is already used in test-full - pytorch-version: ["1.6", "1.7", "1.8", "1.9", "1.10"] + pytorch-version: ["1.7", "1.8", "1.9", "1.10"] # Timeout: https://stackoverflow.com/a/59076067/4521646 timeout-minutes: 35 diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 8be8fd1146864..57aedf68dcb84 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -28,11 +28,6 @@ jobs: - {os: macOS-10.15, python-version: "3.6", requires: "oldest", release: "stable"} # nightly: add when there's a release candidate #- {os: ubuntu-20.04, python-version: "3.10", requires: "latest", release: "pre"} - exclude: - # PyTorch 1.6 is not available with Python 3.9: https://github.com/pytorch/pytorch/issues/46205 - - {os: ubuntu-18.04, python-version: "3.9", requires: "oldest", release: "stable"} - - {os: windows-2019, python-version: "3.9", requires: "oldest", release: "stable"} - - {os: macOS-10.15, python-version: "3.9", requires: "oldest", release: "stable"} # Timeout: https://stackoverflow.com/a/59076067/4521646 # TODO: the macOS is taking too long, probably caching did not work... diff --git a/.github/workflows/events-nightly.yml b/.github/workflows/events-nightly.yml index ce2072e5f45aa..f450e98380f10 100644 --- a/.github/workflows/events-nightly.yml +++ b/.github/workflows/events-nightly.yml @@ -123,7 +123,7 @@ jobs: matrix: # the config used in '.github/workflows/ci_test-conda.yml' python_version: ["3.8"] - pytorch_version: ["1.6", "1.7", "1.8", "1.9", "1.10"] + pytorch_version: ["1.7", "1.8", "1.9", "1.10"] steps: - name: Checkout diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index 92bf62d3c1ead..f7017d35d9e88 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: python_version: ["3.6", "3.7", "3.8", "3.9"] - pytorch_version: ["1.6", "1.7", "1.8", "1.9"] + pytorch_version: ["1.7", "1.8", "1.9"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 50bd9fcaaa783..054089d850c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,6 +84,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed deprecated property `is_slurm_managing_tasks` from AcceleratorConnector ([#10353](https://github.com/PyTorchLightning/pytorch-lightning/pull/10353)) +- Removed PyTorch 1.6 support ([#10367](https://github.com/PyTorchLightning/pytorch-lightning/pull/10367)) + + - Removed deprecated method `master_params` from PrecisionPlugin ([#10372](https://github.com/PyTorchLightning/pytorch-lightning/pull/10372)) diff --git a/environment.yml b/environment.yml index fb21d21c97730..d7d34c387af15 100644 --- a/environment.yml +++ b/environment.yml @@ -29,7 +29,7 @@ dependencies: - python>=3.6 - pip>20.1 - numpy>=1.17.2 - - pytorch>=1.6 + - pytorch>=1.7.* - future>=0.17.1 - PyYAML>=5.1 - tqdm>=4.41.0 @@ -41,9 +41,10 @@ dependencies: - scikit-learn>=0.20.0 - matplotlib>=3.1.1 - omegaconf>=2.0.5 + - torchtext>=0.8.* # Examples - - torchvision>=0.6 + - torchvision>=0.8.* - pip: - test-tube>=0.7.5 diff --git a/requirements.txt b/requirements.txt index 69074cbfb249c..34879d9290acb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # the default package dependencies numpy>=1.17.2 -torch>=1.6 +torch>=1.7.* future>=0.17.1 # required for builtins in setup.py tqdm>=4.41.0 PyYAML>=5.1 diff --git a/requirements/adjust_versions.py b/requirements/adjust_versions.py index 3ebb3c28835b3..8295a726e7873 100644 --- a/requirements/adjust_versions.py +++ b/requirements/adjust_versions.py @@ -14,7 +14,6 @@ dict(torch="1.8.0", torchvision="0.9.0", torchtext="0.9.0"), dict(torch="1.7.1", torchvision="0.8.2", torchtext="0.8.1"), dict(torch="1.7.0", torchvision="0.8.1", torchtext="0.8.0"), - dict(torch="1.6.0", torchvision="0.7.0", torchtext="0.7"), ] @@ -33,28 +32,59 @@ def find_latest(ver: str) -> Dict[str, str]: raise ValueError(f"Missing {ver} in {VERSIONS}") -def main(path_req: str, torch_version: Optional[str] = None) -> None: +def main(req: str, torch_version: Optional[str] = None) -> str: if not torch_version: import torch torch_version = torch.__version__ assert torch_version, f"invalid torch: {torch_version}" - with open(path_req) as fp: - req = fp.read() - # remove comments - req = re.sub(rf"\s*#.*{os.linesep}", os.linesep, req) + # remove comments and strip whitespace + req = re.sub(rf"\s*#.*{os.linesep}", os.linesep, req).strip() latest = find_latest(torch_version) for lib, version in latest.items(): - replace = f"{lib}=={version}" if version else lib - replace += os.linesep - req = re.sub(rf"{lib}[>=]*[\d\.]*{os.linesep}", replace, req) + replace = f"{lib}=={version}" if version else "" + req = re.sub(rf"\b{lib}(?!\w).*", replace, req) - print(req) # on purpose - to debug - with open(path_req, "w") as fp: - fp.write(req) + return req + + +def test(): + requirements = """ + torch>=1.2.* + torch==1.2.3 + torch==1.4 + torch + future>=0.17.1 + pytorch==1.5.6+123dev0 + torchvision + torchmetrics>=0.4.1 + """ + expected = """ + torch==1.9.1 + torch==1.9.1 + torch==1.9.1 + torch==1.9.1 + future>=0.17.1 + pytorch==1.5.6+123dev0 + torchvision==0.10.1 + torchmetrics>=0.4.1 + """.strip() + actual = main(requirements, "1.9") + assert actual == expected, (actual, expected) if __name__ == "__main__": - main(*sys.argv[1:]) + test() # sanity check + + if len(sys.argv) == 3: + requirements_path, torch_version = sys.argv[1:] + else: + requirements_path, torch_version = sys.argv[1], None + + with open(requirements_path, "r+") as fp: + requirements = fp.read() + requirements = main(requirements, torch_version) + print(requirements) # on purpose - to debug + fp.write(requirements) diff --git a/requirements/examples.txt b/requirements/examples.txt index e38f1f92bcb83..8591f9bd509c2 100644 --- a/requirements/examples.txt +++ b/requirements/examples.txt @@ -1,3 +1,3 @@ -torchvision>=0.7 +torchvision>=0.8.* gym>=0.17.0 ipython[all] diff --git a/requirements/extra.txt b/requirements/extra.txt index e3763fcae487b..4aea9dad9cfad 100644 --- a/requirements/extra.txt +++ b/requirements/extra.txt @@ -2,7 +2,7 @@ matplotlib>3.1 horovod>=0.21.2 # no need to install with [pytorch] as pytorch is already installed -torchtext>=0.7 +torchtext>=0.8.* omegaconf>=2.0.5 hydra-core>=1.0.5 jsonargparse[signatures]>=3.19.3