From dbcb2ad22c3a829dba6af1e7b56b98b9acaa56a5 Mon Sep 17 00:00:00 2001 From: Akihiro Nitta Date: Sun, 29 May 2022 06:30:42 +0900 Subject: [PATCH 1/4] Pin protobuf version (#13177) --- pytorch_lightning/setup_tools.py | 3 ++- requirements/base.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pytorch_lightning/setup_tools.py b/pytorch_lightning/setup_tools.py index 95ca568bf87b6..2df3c7946b4d9 100644 --- a/pytorch_lightning/setup_tools.py +++ b/pytorch_lightning/setup_tools.py @@ -32,9 +32,10 @@ def _load_requirements( reqs = [] for ln in lines: # filer all comments + comment = "" if comment_char in ln: + comment = ln[ln.index(comment_char) :] ln = ln[: ln.index(comment_char)] - comment = ln[ln.index(comment_char) :] if comment_char in ln else "" req = ln.strip() # skip directly installed dependencies if not req or req.startswith("http") or "@http" in req: diff --git a/requirements/base.txt b/requirements/base.txt index c26c199115dbc..555997c6576e6 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -8,3 +8,4 @@ torchmetrics>=0.4.1, <=0.7.2 pyDeprecate>=0.3.1, <=0.3.2 packaging>=17.0, <=21.3 typing-extensions>=4.0.0, <4.2.1 +protobuf<=3.20.1 # strict. TODO: Remove after tensorboard gets compatible https://github.com/tensorflow/tensorboard/issues/5708 From 017df61e9655be5214f6e3624e42d0119808c5b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Mon, 30 May 2022 20:23:12 +0200 Subject: [PATCH 2/4] xfail flaky quantization test blocking CI (#13177) --- tests/callbacks/test_quantization.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/callbacks/test_quantization.py b/tests/callbacks/test_quantization.py index dd39ddb35d200..efd1b6d2f4dcf 100644 --- a/tests/callbacks/test_quantization.py +++ b/tests/callbacks/test_quantization.py @@ -20,6 +20,7 @@ from torchmetrics.functional import mean_absolute_percentage_error as mape from pytorch_lightning import seed_everything, Trainer +from pytorch_lightning.accelerators import GPUAccelerator from pytorch_lightning.callbacks import QuantizationAwareTraining from pytorch_lightning.utilities.exceptions import MisconfigurationException from pytorch_lightning.utilities.memory import get_model_size_mb @@ -35,9 +36,14 @@ @RunIf(quantization=True) def test_quantization(tmpdir, observe: str, fuse: bool, convert: bool): """Parity test for quant model.""" + cuda_available = GPUAccelerator.is_available() + + if observe == "average" and not fuse and GPUAccelerator.is_available(): + pytest.xfail("TODO: flakiness in GPU CI") + seed_everything(42) dm = RegressDataModule() - accelerator = "gpu" if torch.cuda.is_available() else "cpu" + accelerator = "gpu" if cuda_available else "cpu" trainer_args = dict(default_root_dir=tmpdir, max_epochs=7, accelerator=accelerator, devices=1) model = RegressionModel() qmodel = copy.deepcopy(model) From b9ff2276a114ad6f3aa1d951a95f81a0ad1f614e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Tue, 31 May 2022 00:14:33 +0200 Subject: [PATCH 3/4] Fix standalone test collection (#13177) --- tests/standalone_tests.sh | 6 +++--- tests/utilities/test_warnings.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/standalone_tests.sh b/tests/standalone_tests.sh index 7b7dd361ab0b1..10892e4ab40a5 100755 --- a/tests/standalone_tests.sh +++ b/tests/standalone_tests.sh @@ -28,14 +28,14 @@ files=$(echo "$grep_output" | cut -f1 -d: | sort | uniq) # get the list of parametrizations. we need to call them separately. the last two lines are removed. # note: if there's a syntax error, this will fail with some garbled output if [[ "$OSTYPE" == "darwin"* ]]; then - parametrizations=$(pytest $files --collect-only --quiet "$@" | tail -r | sed -e '1,3d' | tail -r) + parametrizations=$(python -m pytest $files --collect-only --quiet "$@" | tail -r | sed -e '1,3d' | tail -r) else - parametrizations=$(pytest $files --collect-only --quiet "$@" | head -n -2) + parametrizations=$(python -m pytest $files --collect-only --quiet "$@" | head -n -2) fi parametrizations_arr=($parametrizations) # tests to skip - space separated -blocklist='tests/profiler/test_profiler.py::test_pytorch_profiler_nested_emit_nvtx' +blocklist='tests/profiler/test_profiler.py::test_pytorch_profiler_nested_emit_nvtx tests/utilities/test_warnings.py' report='' for i in "${!parametrizations_arr[@]}"; do diff --git a/tests/utilities/test_warnings.py b/tests/utilities/test_warnings.py index 45a0d5f8bbac6..3f770ffe2d86f 100644 --- a/tests/utilities/test_warnings.py +++ b/tests/utilities/test_warnings.py @@ -23,7 +23,7 @@ from pytorch_lightning.utilities.warnings import WarningCache standalone = os.getenv("PL_RUN_STANDALONE_TESTS", "0") == "1" -if standalone: +if standalone and __name__ == "__main__": stderr = StringIO() # recording From 03b1fd552e7ef659c545b39a9d726f91302e3631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Tue, 31 May 2022 19:12:46 +0200 Subject: [PATCH 4/4] Revert "Update deepspeed requirement from <0.6.0 to <0.7.0 in /requirements (#13048)" (#13177) This reverts commit e19babc9869a9de584731d0106bee41f02c71584. --- requirements/strategies.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/strategies.txt b/requirements/strategies.txt index 3b1a3a1e645e3..78268a9fbb6f1 100644 --- a/requirements/strategies.txt +++ b/requirements/strategies.txt @@ -1,5 +1,5 @@ fairscale>=0.4.5, <=0.4.6 -deepspeed<0.7.0 +deepspeed<0.6.0 # no need to install with [pytorch] as pytorch is already installed horovod>=0.21.2,!=0.24.0, <=0.24.3 hivemind>=1.0.1, <=1.0.1; sys_platform == 'linux'