1. 15 Jun, 2023 1 commit
  2. 23 May, 2023 1 commit
    • Pedro Cuenca's avatar
      Run `torch.compile` tests in separate subprocesses (#3503) · bde2cb5d
      Pedro Cuenca authored
      * Run ControlNet compile test in a separate subprocess
      
      `torch.compile()` spawns several subprocesses and the GPU memory used
      was not reclaimed after the test ran. This approach was taken from
      `transformers`.
      
      * Style
      
      * Prepare a couple more compile tests to run in subprocess.
      
      * Use require_torch_2 decorator.
      
      * Test inpaint_compile in subprocess.
      
      * Run img2img compile test in subprocess.
      
      * Run stable diffusion compile test in subprocess.
      
      * style
      
      * Temporarily trigger on pr to test.
      
      * Revert "Temporarily trigger on pr to test."
      
      This reverts commit 82d76868ddf9cc634a9f14b2b0aef1d5433cd750.
      bde2cb5d
  3. 11 May, 2023 1 commit
    • Sayak Paul's avatar
      [Tests] better determinism (#3374) · 90f5f3c4
      Sayak Paul authored
      * enable deterministic pytorch and cuda operations.
      
      * disable manual seeding.
      
      * make style && make quality for unet_2d tests.
      
      * enable determinism for the unet2dconditional model.
      
      * add CUBLAS_WORKSPACE_CONFIG for better reproducibility.
      
      * relax tolerance (very weird issue, though).
      
      * revert to torch manual_seed() where needed.
      
      * relax more tolerance.
      
      * better placement of the cuda variable and relax more tolerance.
      
      * enable determinism for 3d condition model.
      
      * relax tolerance.
      
      * add: determinism to alt_diffusion.
      
      * relax tolerance for alt diffusion.
      
      * dance diffusion.
      
      * dance diffusion is flaky.
      
      * test_dict_tuple_outputs_equivalent edit.
      
      * fix two more tests.
      
      * fix more ddim tests.
      
      * fix: argument.
      
      * change to diff in place of difference.
      
      * fix: test_save_load call.
      
      * test_save_load_float16 call.
      
      * fix: expected_max_diff
      
      * fix: paint by example.
      
      * relax tolerance.
      
      * add determinism to 1d unet model.
      
      * torch 2.0 regressions seem to be brutal
      
      * determinism to vae.
      
      * add reason to skipping.
      
      * up tolerance.
      
      * determinism to vq.
      
      * determinism to cuda.
      
      * determinism to the generic test pipeline file.
      
      * refactor general pipelines testing a bit.
      
      * determinism to alt diffusion i2i
      
      * up tolerance for alt diff i2i and audio diff
      
      * up tolerance.
      
      * determinism to audioldm
      
      * increase tolerance for audioldm lms.
      
      * increase tolerance for paint by paint.
      
      * increase tolerance for repaint.
      
      * determinism to cycle diffusion and sd 1.
      
      * relax tol for cycle diffusion 🚲
      
      * relax tol for sd 1.0
      
      * relax tol for controlnet.
      
      * determinism to img var.
      
      * relax tol for img variation.
      
      * tolerance to i2i sd
      
      * make style
      
      * determinism to inpaint.
      
      * relax tolerance for inpaiting.
      
      * determinism for inpainting legacy
      
      * relax tolerance.
      
      * determinism to instruct pix2pix
      
      * determinism to model editing.
      
      * model editing tolerance.
      
      * panorama determinism
      
      * determinism to pix2pix zero.
      
      * determinism to sag.
      
      * sd 2. determinism
      
      * sd. tolerance
      
      * disallow tf32 matmul.
      
      * relax tolerance is all you need.
      
      * make style and determinism to sd 2 depth
      
      * relax tolerance for depth.
      
      * tolerance to diffedit.
      
      * tolerance to sd 2 inpaint.
      
      * up tolerance.
      
      * determinism in upscaling.
      
      * tolerance in upscaler.
      
      * more tolerance relaxation.
      
      * determinism to v pred.
      
      * up tol for v_pred
      
      * unclip determinism
      
      * determinism to unclip img2img
      
      * determinism to text to video.
      
      * determinism to last set of tests
      
      * up tol.
      
      * vq cumsum doesn't have a deterministic kernel
      
      * relax tol
      
      * relax tol
      90f5f3c4
  4. 17 Apr, 2023 1 commit
  5. 13 Apr, 2023 1 commit
  6. 28 Mar, 2023 2 commits
  7. 27 Mar, 2023 1 commit
  8. 22 Mar, 2023 1 commit
  9. 18 Mar, 2023 1 commit
  10. 10 Mar, 2023 1 commit
  11. 01 Mar, 2023 1 commit
  12. 16 Feb, 2023 1 commit
  13. 01 Feb, 2023 1 commit
  14. 19 Jan, 2023 1 commit
  15. 30 Dec, 2022 1 commit
  16. 29 Dec, 2022 1 commit
  17. 30 Nov, 2022 1 commit
  18. 25 Nov, 2022 1 commit
  19. 15 Nov, 2022 1 commit
  20. 17 Oct, 2022 1 commit
    • Anton Lozhkov's avatar
      Add Apple M1 tests (#796) · cca59ce3
      Anton Lozhkov authored
      
      
      * [CI] Add Apple M1 tests
      
      * setup-python
      
      * python build
      
      * conda install
      
      * remove branch
      
      * only 3.8 is built for osx-arm
      
      * try fetching prebuilt tokenizers
      
      * use user cache
      
      * update shells
      
      * Reports and cleanup
      
      * -> MPS
      
      * Disable parallel tests
      
      * Better naming
      
      * investigate worker crash
      
      * return xdist
      
      * restart
      
      * num_workers=2
      
      * still crashing?
      
      * faulthandler for segfaults
      
      * faulthandler for segfaults
      
      * remove restarts, stop on segfault
      
      * torch version
      
      * change installation order
      
      * Use pre-RC version of PyTorch.
      
      To be updated when it is released.
      
      * Skip crashing test on MPS, add new one that works.
      
      * Skip cuda tests in mps device.
      
      * Actually use generator in test.
      
      I think this was a typo.
      
      * make style
      Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
      cca59ce3
  21. 03 Oct, 2022 1 commit
  22. 22 Sep, 2022 1 commit
    • Suraj Patil's avatar
      [UNet2DConditionModel] add gradient checkpointing (#461) · e7120bae
      Suraj Patil authored
      * add grad ckpt to downsample blocks
      
      * make it work
      
      * don't pass gradient_checkpointing to upsample block
      
      * add tests for UNet2DConditionModel
      
      * add test_gradient_checkpointing
      
      * add gradient_checkpointing for up and down blocks
      
      * add functions to enable and disable grad ckpt
      
      * remove the forward argument
      
      * better naming
      
      * make supports_gradient_checkpointing private
      e7120bae
  23. 16 Sep, 2022 1 commit
  24. 15 Sep, 2022 1 commit
  25. 13 Sep, 2022 1 commit
  26. 08 Sep, 2022 1 commit
    • Pedro Cuenca's avatar
      Inference support for `mps` device (#355) · 5dda1735
      Pedro Cuenca authored
      * Initial support for mps in Stable Diffusion pipeline.
      
      * Initial "warmup" implementation when using mps.
      
      * Make some deterministic tests pass with mps.
      
      * Disable training tests when using mps.
      
      * SD: generate latents in CPU then move to device.
      
      This is especially important when using the mps device, because
      generators are not supported there. See for example
      https://github.com/pytorch/pytorch/issues/84288.
      
      In addition, the other pipelines seem to use the same approach: generate
      the random samples then move to the appropriate device.
      
      After this change, generating an image in MPS produces the same result
      as when using the CPU, if the same seed is used.
      
      * Remove prints.
      
      * Pass AutoencoderKL test_output_pretrained with mps.
      
      Sampling from `posterior` must be done in CPU.
      
      * Style
      
      * Do not use torch.long for log op in mps device.
      
      * Perform incompatible padding ops in CPU.
      
      UNet tests now pass.
      See https://github.com/pytorch/pytorch/issues/84535
      
      
      
      * Style: fix import order.
      
      * Remove unused symbols.
      
      * Remove MPSWarmupMixin, do not apply automatically.
      
      We do apply warmup in the tests, but not during normal use.
      This adopts some PR suggestions by @patrickvonplaten.
      
      * Add comment for mps fallback to CPU step.
      
      * Add README_mps.md for mps installation and use.
      
      * Apply `black` to modified files.
      
      * Restrict README_mps to SD, show measures in table.
      
      * Make PNDM indexing compatible with mps.
      
      Addresses #239.
      
      * Do not use float64 when using LDMScheduler.
      
      Fixes #358.
      
      * Fix typo identified by @patil-suraj
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      
      * Adapt example to new output style.
      
      * Restore 1:1 results reproducibility with CompVis.
      
      However, mps latents need to be generated in CPU because generators
      don't work in the mps device.
      
      * Move PyTorch nightly to requirements.
      
      * Adapt `test_scheduler_outputs_equivalence` ton MPS.
      
      * mps: skip training tests instead of ignoring silently.
      
      * Make VQModel tests pass on mps.
      
      * mps ddim tests: warmup, increase tolerance.
      
      * ScoreSdeVeScheduler indexing made mps compatible.
      
      * Make ldm pipeline tests pass using warmup.
      
      * Style
      
      * Simplify casting as suggested in PR.
      
      * Add Known Issues to readme.
      
      * `isort` import order.
      
      * Remove _mps_warmup helpers from ModelMixin.
      
      And just make changes to the tests.
      
      * Skip tests using unittest decorator for consistency.
      
      * Remove temporary var.
      
      * Remove spurious blank space.
      
      * Remove unused symbol.
      
      * Remove README_mps.
      Co-authored-by: default avatarSuraj Patil <surajp815@gmail.com>
      Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> 
      5dda1735
  27. 05 Sep, 2022 1 commit
  28. 24 Aug, 2022 1 commit