-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[Tests] Improve unet / vae tests #1018
Conversation
The documentation is not available anymore as the PR was closed or merged. |
Slow tests currently don't work on CPU because of: huggingface/accelerate#796 Think that's fine as they are only run on GPU anyways - device_map="auto" speeds up init from ~25seconds to ~3seconds so this does make a big difference for overall testing - cc @anton-l |
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.
Really like this solution, thank you! I'll run these on different machines once merged, to hopefully add some datapoints for us
1
Outdated
@@ -19,9 +19,10 @@ | |||
|
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.
Looks like accidental renaming here, tests/test_models_vae.py → 1
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.
Thanks!
@@ -397,7 +355,7 @@ def test_from_pretrained_hub(self): | |||
|
|||
@slow | |||
def test_output_pretrained_ve_mid(self): | |||
model = UNet2DModel.from_pretrained("google/ncsnpp-celebahq-256") | |||
model = UNet2DModel.from_pretrained("google/ncsnpp-celebahq-256", device_map="auto") |
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.
Nice to see "auto"
helping the latency!
tests/models/test_models_unet_2d.py
Outdated
) | ||
@require_torch_gpu | ||
def test_compvis_sd_v1_4_fp16(self, seed, timestep, expected_slice): | ||
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.
Is it meant to be skipped for now? 4 more passes in the tests below too
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.
Ups
also fix logo paths
* improve tests * up * finish * upload * add init * up * finish vae * finish * reduce loading time with device_map * remove device_map from CPU * uP
Add aggressive unet, vae single-forward tests with 1e-4 precision.
Using parameterized tests over seeds and timesteps.
@anton-l I'd say we see whether precision holds over the next days (weekend) and then we eventually adapt next week.
@patil-suraj @pcuenca @anton-l - note that tests are now automatically suffixed with
_{0, 1, 2, 4}
when usingparameterized
=> this makes it slightly more unreadable/useable when running locally, e.g.: