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
OpenDAS
ColossalAI
Commits
6fa71d65
Unverified
Commit
6fa71d65
authored
Nov 08, 2022
by
Jiarui Fang
Committed by
GitHub
Nov 08, 2022
Browse files
[fx] skip diffusers unitest if it is not installed (#1799)
parent
203ca57a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
requirements/requirements-test.txt
requirements/requirements-test.txt
+0
-1
tests/test_fx/test_tracer/test_hf_model/test_hf_diffuser.py
tests/test_fx/test_tracer/test_hf_model/test_hf_diffuser.py
+9
-2
No files found.
requirements/requirements-test.txt
View file @
6fa71d65
diffusers
fbgemm-gpu==0.2.0
pytest
torchvision
...
...
tests/test_fx/test_tracer/test_hf_model/test_hf_diffuser.py
View file @
6fa71d65
import
diffusers
import
pytest
import
torch
import
transformers
from
torch.fx
import
GraphModule
from
utils
import
trace_model_and_compare_output
import
transformers
from
colossalai.fx
import
ColoTracer
try
:
import
diffusers
HAS_DIFFUSERS
=
True
except
ImportError
:
HAS_DIFFUSERS
=
False
BATCH_SIZE
=
2
SEQ_LENGTH
=
5
HEIGHT
=
224
...
...
@@ -16,6 +21,7 @@ LATENTS_SHAPE = (BATCH_SIZE, IN_CHANNELS, HEIGHT // 8, WIDTH // 8)
TIME_STEP
=
2
@
pytest
.
mark
.
skipif
(
not
HAS_DIFFUSERS
,
reason
=
"diffusers has not been installed"
)
def
test_vae
():
MODEL_LIST
=
[
diffusers
.
AutoencoderKL
,
...
...
@@ -80,6 +86,7 @@ def test_clip():
trace_model_and_compare_output
(
model
,
data_gen
)
@
pytest
.
mark
.
skipif
(
not
HAS_DIFFUSERS
,
reason
=
"diffusers has not been installed"
)
@
pytest
.
mark
.
skip
(
reason
=
'cannot pass the test yet'
)
def
test_unet
():
MODEL_LIST
=
[
...
...
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