From 9658c4bfcf4366daeba3cdd3a5c59f8a6371d9e0 Mon Sep 17 00:00:00 2001 From: 1SAA Date: Wed, 28 Dec 2022 15:05:10 +0800 Subject: [PATCH 1/2] [hotfix] fix bugs in colossalai strategy --- src/pytorch_lightning/strategies/colossalai.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pytorch_lightning/strategies/colossalai.py b/src/pytorch_lightning/strategies/colossalai.py index ffecc17106f13..db4d8b01b0351 100644 --- a/src/pytorch_lightning/strategies/colossalai.py +++ b/src/pytorch_lightning/strategies/colossalai.py @@ -300,7 +300,8 @@ def setup_precision_plugin(self) -> None: min_chunk_size_mb: float = self.chunk_size_search_kwargs.get( "min_chunk_size", 32 * 1024**2 ) # type: ignore[assignment] - min_chunk_size_mb /= 1024**2 + if min_chunk_size_mb is not None: + min_chunk_size_mb /= 1024**2 model = _LightningModuleWrapperBase(self.model) self.model = GeminiDDP( From 9d1fe2aefa290fa447d2b47be202d75c696792eb Mon Sep 17 00:00:00 2001 From: awaelchli Date: Tue, 3 Jan 2023 11:17:16 +0100 Subject: [PATCH 2/2] add changelog --- src/pytorch_lightning/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pytorch_lightning/CHANGELOG.md b/src/pytorch_lightning/CHANGELOG.md index 1a0d6c163cb29..134fe5277e5ae 100644 --- a/src/pytorch_lightning/CHANGELOG.md +++ b/src/pytorch_lightning/CHANGELOG.md @@ -143,6 +143,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Enhanced `reduce_boolean_decision` to accommodate `any`-analogous semantics expected by the `EarlyStopping` callback ([#15253](https://github.com/Lightning-AI/lightning/pull/15253)) +- Fixed a type error when dividing the chunk size in the ColossalAI strategy ([#16212](https://github.com/Lightning-AI/lightning/pull/16212)) + + ## [1.8.6] - 2022-12-21 - minor cleaning