-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganize pipeline tests #963
Conversation
@require_torch | ||
class PipelineTesterMixin: | ||
""" | ||
This mixin is designed to be used with unittest.TestCase classes. | ||
It provides a set of common tests for each PyTorch pipeline, e.g. saving and loading the pipeline, | ||
equivalence of dict and tuple outputs, etc. | ||
""" | ||
|
||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a dummy mixin for now (only @require_torch
is useful), but the purpose is described in the docstring.
@require_onnxruntime | ||
class OnnxPipelineTesterMixin: | ||
""" | ||
This mixin is designed to be used with unittest.TestCase classes. | ||
It provides a set of common tests for each ONNXRuntime pipeline, e.g. saving and loading the pipeline, | ||
equivalence of dict and tuple outputs, etc. | ||
""" | ||
|
||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a dummy mixin for now (only @require_onnxruntime
is useful), but the purpose is described in the docstring.
The documentation is not available anymore as the PR was closed or merged. |
def require_onnxruntime(test_case): | ||
""" | ||
Decorator marking a test that requires onnxruntime. These tests are skipped when onnxruntime isn't installed. | ||
""" | ||
return unittest.skipUnless(is_onnx_available(), "test requires onnxruntime")(test_case) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the ONNX tests can be skipped locally too, when onnxruntime
is not installed.
|
||
torch.backends.cuda.matmul.allow_tf32 = False | ||
|
||
|
||
class PipelineFastTests(unittest.TestCase): | ||
class StableDiffusionPipelineFastTests(PipelineTesterMixin, unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the class name a bit more verbose here, for easier search withing the test logs
Note to self: we'll need a cleaner dummy pipeline creation method, similar to
Something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, let's merge this maybe quickly to prevent merge conflicts :-)
exe should now default to dark theme too
* Reorganize pipeline tests * fix vq
This PR sorts the pipeline-specific tests from
test_pipelines.py
into their individual directories.Partially solves #913
Note: this doesn't touch the flax tests yet