From 5cac9dc251063a2521b154c8ce5b304f607cfb58 Mon Sep 17 00:00:00 2001 From: TianYuan Date: Thu, 14 Oct 2021 10:32:16 +0000 Subject: [PATCH] fix pwg gpu memory update too high --- parakeet/models/parallel_wavegan/parallel_wavegan.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parakeet/models/parallel_wavegan/parallel_wavegan.py b/parakeet/models/parallel_wavegan/parallel_wavegan.py index bb214653..dc1d3b53 100644 --- a/parakeet/models/parallel_wavegan/parallel_wavegan.py +++ b/parakeet/models/parallel_wavegan/parallel_wavegan.py @@ -465,6 +465,9 @@ def forward(self, x, c): skips = 0 for f in self.conv_layers: x, s = f(x, c) + # Add depency with x to avoid lanching op too fast that leads + # to GPU memory reach too high value (ugly trick here) + c += paddle.mean(x - x) skips += s skips *= math.sqrt(1.0 / len(self.conv_layers))