Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
9a349538
Unverified
Commit
9a349538
authored
Mar 25, 2024
by
Dhruv Nair
Committed by
GitHub
Mar 25, 2024
Browse files
Additional Memory clean up for slow tests (#7436)
* update * update * update
parent
e29f16cf
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
tests/pipelines/text_to_video_synthesis/test_text_to_video_zero.py
...elines/text_to_video_synthesis/test_text_to_video_zero.py
+13
-0
tests/pipelines/text_to_video_synthesis/test_text_to_video_zero_sdxl.py
...s/text_to_video_synthesis/test_text_to_video_zero_sdxl.py
+13
-0
No files found.
tests/pipelines/text_to_video_synthesis/test_text_to_video_zero.py
View file @
9a349538
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
gc
import
unittest
import
unittest
import
torch
import
torch
...
@@ -26,6 +27,18 @@ from ..test_pipelines_common import assert_mean_pixel_difference
...
@@ -26,6 +27,18 @@ from ..test_pipelines_common import assert_mean_pixel_difference
@
nightly
@
nightly
@
require_torch_gpu
@
require_torch_gpu
class
TextToVideoZeroPipelineSlowTests
(
unittest
.
TestCase
):
class
TextToVideoZeroPipelineSlowTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
# clean up the VRAM before each test
super
().
setUp
()
gc
.
collect
()
torch
.
cuda
.
empty_cache
()
def
tearDown
(
self
):
# clean up the VRAM after each test
super
().
tearDown
()
gc
.
collect
()
torch
.
cuda
.
empty_cache
()
def
test_full_model
(
self
):
def
test_full_model
(
self
):
model_id
=
"runwayml/stable-diffusion-v1-5"
model_id
=
"runwayml/stable-diffusion-v1-5"
pipe
=
TextToVideoZeroPipeline
.
from_pretrained
(
model_id
,
torch_dtype
=
torch
.
float16
).
to
(
"cuda"
)
pipe
=
TextToVideoZeroPipeline
.
from_pretrained
(
model_id
,
torch_dtype
=
torch
.
float16
).
to
(
"cuda"
)
...
...
tests/pipelines/text_to_video_synthesis/test_text_to_video_zero_sdxl.py
View file @
9a349538
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
# limitations under the License.
# limitations under the License.
import
contextlib
import
contextlib
import
gc
import
inspect
import
inspect
import
io
import
io
import
re
import
re
...
@@ -381,6 +382,18 @@ class TextToVideoZeroSDXLPipelineFastTests(PipelineTesterMixin, unittest.TestCas
...
@@ -381,6 +382,18 @@ class TextToVideoZeroSDXLPipelineFastTests(PipelineTesterMixin, unittest.TestCas
@
nightly
@
nightly
@
require_torch_gpu
@
require_torch_gpu
class
TextToVideoZeroSDXLPipelineSlowTests
(
unittest
.
TestCase
):
class
TextToVideoZeroSDXLPipelineSlowTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
# clean up the VRAM before each test
super
().
setUp
()
gc
.
collect
()
torch
.
cuda
.
empty_cache
()
def
tearDown
(
self
):
# clean up the VRAM after each test
super
().
tearDown
()
gc
.
collect
()
torch
.
cuda
.
empty_cache
()
def
test_full_model
(
self
):
def
test_full_model
(
self
):
model_id
=
"stabilityai/stable-diffusion-xl-base-1.0"
model_id
=
"stabilityai/stable-diffusion-xl-base-1.0"
pipe
=
TextToVideoZeroSDXLPipeline
.
from_pretrained
(
pipe
=
TextToVideoZeroSDXLPipeline
.
from_pretrained
(
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment