From 2a2af7d7c9fe7a8676ad9c8f97c01f3fca1cca94 Mon Sep 17 00:00:00 2001 From: Yuang Liu Date: Thu, 8 Jun 2023 15:39:07 +0800 Subject: [PATCH] add warning to pp (#54448) --- .../distributed/fleet/meta_parallel/pipeline_parallel.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/paddle/distributed/fleet/meta_parallel/pipeline_parallel.py b/python/paddle/distributed/fleet/meta_parallel/pipeline_parallel.py index c08ce5a2549..f898b2bb507 100755 --- a/python/paddle/distributed/fleet/meta_parallel/pipeline_parallel.py +++ b/python/paddle/distributed/fleet/meta_parallel/pipeline_parallel.py @@ -10,6 +10,7 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and +import warnings import paddle from paddle import framework @@ -614,6 +615,10 @@ class PipelineParallelWithInterleave(PipelineParallel): def __init__(self, layers, hcg, strategy): super().__init__(layers=layers, hcg=hcg, strategy=strategy) assert layers.get_num_virtual_stages() > 1 + if self.num_stages <= 2: + warnings.warn( + "Deprecate warning! In the near future the virtual pp will only available when pp degree > 2." + ) assert ( framework.in_dynamic_mode() ), "virtual pipeline stage with interleave only support eager dygraph mode" -- GitLab