From abdf9fdb3e9a351dee5fbf6271a7d40da953ce14 Mon Sep 17 00:00:00 2001 From: Jason Senthil Date: Wed, 26 Jul 2023 12:28:03 -0700 Subject: [PATCH] fix torch compile tests in OSS (#479) Summary: Pull Request resolved: https://github.com/pytorch/tnt/pull/479 module.compile is only in pytorch nightlies, and it seems the nightly pytorch is being overrided by the stable torch package in `requirements.txt`, so filtering out torch in the github workflows Reviewed By: ananthsub Differential Revision: D47803991 fbshipit-source-id: a560c49ec92f561e9a2e6516dec3a4a548d0aa75 --- .github/workflows/build_docs.yaml | 4 ++-- .github/workflows/nightly_build_cpu.yaml | 4 ++-- .github/workflows/release_build.yaml | 8 ++++---- .github/workflows/test.yaml | 2 +- tests/framework/test_auto_unit.py | 1 - 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml index 2e4433f93f..8f740cdef2 100644 --- a/.github/workflows/build_docs.yaml +++ b/.github/workflows/build_docs.yaml @@ -26,7 +26,7 @@ jobs: set -eux conda activate test conda install pytorch cpuonly -c pytorch-nightly - pip install -r requirements.txt + pip install $(grep -v '^ *#\|^torch' requirements.txt | grep .) pip install -r dev-requirements.txt python setup.py sdist bdist_wheel pip install dist/*.whl @@ -36,7 +36,7 @@ jobs: set -eux conda activate test cd docs - pip install -r requirements.txt + pip install $(grep -v '^ *#\|^torch' requirements.txt | grep .) make html touch build/html/.nojekyll cd .. diff --git a/.github/workflows/nightly_build_cpu.yaml b/.github/workflows/nightly_build_cpu.yaml index 4efe2e1e0d..6b3cce4075 100644 --- a/.github/workflows/nightly_build_cpu.yaml +++ b/.github/workflows/nightly_build_cpu.yaml @@ -32,7 +32,7 @@ jobs: set -eux conda activate test conda install pytorch cpuonly -c pytorch-nightly - pip install -r requirements.txt + pip install $(grep -v '^ *#\|^torch' requirements.txt | grep .) python setup.py sdist bdist_wheel pip install dist/*.whl pip install -r dev-requirements.txt @@ -61,7 +61,7 @@ jobs: set -eux conda activate test conda install pytorch cpuonly -c pytorch-nightly - pip install -r requirements.txt + pip install $(grep -v '^ *#\|^torch' requirements.txt | grep .) pip install --no-build-isolation -e ".[dev]" - name: Upload to PyPI shell: bash -l {0} diff --git a/.github/workflows/release_build.yaml b/.github/workflows/release_build.yaml index c4a31220d9..abc2a15c2b 100644 --- a/.github/workflows/release_build.yaml +++ b/.github/workflows/release_build.yaml @@ -24,7 +24,7 @@ jobs: set -eux conda activate test conda install pytorch cpuonly -c pytorch-nightly - pip install -r requirements.txt + pip install $(grep -v '^ *#\|^torch' requirements.txt | grep .) python setup.py sdist bdist_wheel pip install dist/*.whl pip install -r dev-requirements.txt @@ -53,7 +53,7 @@ jobs: set -eux conda activate test conda install pytorch cpuonly -c pytorch-nightly - pip install -r requirements.txt + pip install $(grep -v '^ *#\|^torch' requirements.txt | grep .) pip install --no-build-isolation -e ".[dev]" - name: Upload to PyPI shell: bash -l {0} @@ -82,7 +82,7 @@ jobs: set -eux conda activate test conda install pytorch cpuonly -c pytorch-nightly - pip install -r requirements.txt + pip install $(grep -v '^ *#\|^torch' requirements.txt | grep .) pip install -r dev-requirements.txt python setup.py sdist bdist_wheel pip install dist/*.whl @@ -92,7 +92,7 @@ jobs: set -eux conda activate test cd docs - pip install -r requirements.txt + pip install $(grep -v '^ *#\|^torch' requirements.txt | grep .) RELEASE_BUILD=1 make html touch build/html/.nojekyll cd .. diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2bc3bbef60..c51d9dc000 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -26,7 +26,7 @@ jobs: set -eux conda activate test conda install pytorch cpuonly -c pytorch-nightly - pip install -r requirements.txt + pip install $(grep -v '^ *#\|^torch' requirements.txt | grep .) pip install -r dev-requirements.txt pip install --no-build-isolation -e . - name: Run unit tests with coverage diff --git a/tests/framework/test_auto_unit.py b/tests/framework/test_auto_unit.py index 4b43fc07be..7d911a440a 100644 --- a/tests/framework/test_auto_unit.py +++ b/tests/framework/test_auto_unit.py @@ -16,7 +16,6 @@ COMPILE_AVAIL = False if is_torch_version_geq_1_13(): COMPILE_AVAIL = True - import torch._dynamo from torch.distributed import GradBucket, launcher from torch.distributed.fsdp import FullyShardedDataParallel as FSDP