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
f7e5954d
Unverified
Commit
f7e5954d
authored
Mar 08, 2024
by
Sayak Paul
Committed by
GitHub
Mar 08, 2024
Browse files
[Tests] fix: VAE tiling tests when setting the right device (#7246)
* debug * checking * fix more * remove device. * fix-copies
parent
8e19c073
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
tests/pipelines/test_pipelines_common.py
tests/pipelines/test_pipelines_common.py
+2
-3
No files found.
tests/pipelines/test_pipelines_common.py
View file @
f7e5954d
...
@@ -99,14 +99,13 @@ class SDFunctionTesterMixin:
...
@@ -99,14 +99,13 @@ class SDFunctionTesterMixin:
assert
np
.
abs
(
output_2
[
0
].
flatten
()
-
output_1
[
0
].
flatten
()).
max
()
<
1e-2
assert
np
.
abs
(
output_2
[
0
].
flatten
()
-
output_1
[
0
].
flatten
()).
max
()
<
1e-2
def
test_vae_tiling
(
self
):
def
test_vae_tiling
(
self
):
device
=
"cpu"
# ensure determinism for the device-dependent torch.Generator
components
=
self
.
get_dummy_components
()
components
=
self
.
get_dummy_components
()
# make sure here that pndm scheduler skips prk
# make sure here that pndm scheduler skips prk
if
"safety_checker"
in
components
:
if
"safety_checker"
in
components
:
components
[
"safety_checker"
]
=
None
components
[
"safety_checker"
]
=
None
pipe
=
self
.
pipeline_class
(
**
components
)
pipe
=
self
.
pipeline_class
(
**
components
)
pipe
=
pipe
.
to
(
device
)
pipe
=
pipe
.
to
(
torch_
device
)
pipe
.
set_progress_bar_config
(
disable
=
None
)
pipe
.
set_progress_bar_config
(
disable
=
None
)
inputs
=
self
.
get_dummy_inputs
(
torch_device
)
inputs
=
self
.
get_dummy_inputs
(
torch_device
)
...
@@ -126,7 +125,7 @@ class SDFunctionTesterMixin:
...
@@ -126,7 +125,7 @@ class SDFunctionTesterMixin:
# test that tiled decode works with various shapes
# test that tiled decode works with various shapes
shapes
=
[(
1
,
4
,
73
,
97
),
(
1
,
4
,
97
,
73
),
(
1
,
4
,
49
,
65
),
(
1
,
4
,
65
,
49
)]
shapes
=
[(
1
,
4
,
73
,
97
),
(
1
,
4
,
97
,
73
),
(
1
,
4
,
49
,
65
),
(
1
,
4
,
65
,
49
)]
for
shape
in
shapes
:
for
shape
in
shapes
:
zeros
=
torch
.
zeros
(
shape
).
to
(
device
)
zeros
=
torch
.
zeros
(
shape
).
to
(
torch_
device
)
pipe
.
vae
.
decode
(
zeros
)
pipe
.
vae
.
decode
(
zeros
)
def
test_freeu_enabled
(
self
):
def
test_freeu_enabled
(
self
):
...
...
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