Skip to content
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

Merge hf upstream #6

Closed
wants to merge 276 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
276 commits
Select commit Hold shift + click to select a range
a784be2
Allow resolutions that are not multiples of 64 (#505)
jachiam Sep 30, 2022
877bec8
refactor: update ldm-bert `config.json` url closes #675 (#680)
ryanrussell Sep 30, 2022
daa2205
[docs] fix table in fp16.mdx (#683)
NouamaneTazi Sep 30, 2022
bb0f2a0
Update README.md
patrickvonplaten Sep 30, 2022
552b967
Update README.md
patrickvonplaten Sep 30, 2022
b2cfc7a
Fix slow tests (#689)
NouamaneTazi Sep 30, 2022
5156acc
Fix BibText citation (#693)
osanseviero Oct 1, 2022
2558977
Add callback parameters for Stable Diffusion pipelines (#521)
jamestiotio Oct 2, 2022
14f4af8
[dreambooth] fix applying clip_grad_norm_ (#686)
patil-suraj Oct 3, 2022
500ca5a
Forgot to add the OG!
patrickvonplaten Oct 3, 2022
249b36c
Flax: add shape argument to `set_timesteps` (#690)
pcuenca Oct 3, 2022
7d0ba59
Fix type annotations on StableDiffusionPipeline.__call__ (#682)
tasercake Oct 3, 2022
688031c
Fix import with Flax but without PyTorch (#688)
pcuenca Oct 3, 2022
b35bac4
[Support PyTorch 1.8] Remove inference mode (#707)
patrickvonplaten Oct 3, 2022
1070e1a
[CI] Speed up slow tests (#708)
anton-l Oct 3, 2022
f1484b8
[Utils] Add deprecate function and move testing_utils under utils (#659)
patrickvonplaten Oct 3, 2022
4ff4d4d
Checkpoint conversion script from Diffusers => Stable Diffusion (Comp…
jachiam Oct 4, 2022
f1b9ee7
[Docs] fix docstring for issue #709 (#710)
kashif Oct 4, 2022
09859a3
Update schedulers README.md (#694)
tmabraham Oct 4, 2022
4d1cce2
add accelerate to load models with smaller memory footprint (#361)
piEsposito Oct 4, 2022
7e92c5b
Fix typos (#718)
shirayu Oct 4, 2022
5ac1f61
Add an argument "negative_prompt" (#549)
shirayu Oct 4, 2022
215bb40
Fix import if PyTorch is not installed (#715)
pcuenca Oct 4, 2022
6b22192
Remove comments no longer appropriate (#716)
pcuenca Oct 4, 2022
14b9754
[train_unconditional] fix applying clip_grad_norm_ (#721)
patil-suraj Oct 4, 2022
7265dd8
renamed x to meaningful variable in resnet.py (#677)
i-am-epic Oct 4, 2022
a8a3a20
[Tests] Add accelerate to testing (#729)
patrickvonplaten Oct 5, 2022
08d4fb6
[dreambooth] Using already created `Path` in dataset (#681)
DrInfiniteExplorer Oct 5, 2022
b9eea06
Include CLIPTextModel parameters in conversion (#695)
kanewallmann Oct 5, 2022
60c9634
Avoid negative strides for tensors (#717)
shirayu Oct 5, 2022
726aba0
[Pytorch] pytorch only timesteps (#724)
kashif Oct 5, 2022
6b09f37
[Scheduler design] The pragmatic approach (#719)
anton-l Oct 5, 2022
3dcc75c
Removing `autocast` for `35-25% speedup`. (`autocast` considered harm…
Narsil Oct 5, 2022
78744b6
No more use_auth_token=True (#733)
patrickvonplaten Oct 5, 2022
19e559d
remove use_auth_token from remaining places (#737)
patil-suraj Oct 5, 2022
5493524
Replace messages that have empty backquotes (#738)
pcuenca Oct 5, 2022
4deb16e
[Docs] Advertise fp16 instead of autocast (#740)
patrickvonplaten Oct 5, 2022
916754e
make style
patrickvonplaten Oct 5, 2022
367a671
remove use_auth_token from for TI test (#747)
patil-suraj Oct 6, 2022
c119dc4
allow multiple generations per prompt (#741)
patil-suraj Oct 6, 2022
df9c070
Add back-compatibility to LMS timesteps (#750)
anton-l Oct 6, 2022
3383f77
update the clip guided PR according to the new API (#751)
patil-suraj Oct 6, 2022
6c64741
Raise an error when moving an fp16 pipeline to CPU (#749)
anton-l Oct 6, 2022
0883968
Better steps deprecation for LMS (#753)
anton-l Oct 6, 2022
f3128c8
Actually fix the grad ckpt test (#734)
patil-suraj Oct 6, 2022
d9c449e
Custome Pipelines (#744)
patrickvonplaten Oct 6, 2022
6613a8c
make CI happy
patrickvonplaten Oct 6, 2022
9c9462f
Python 3.7 doesn't like keys() + keys()
patrickvonplaten Oct 6, 2022
2e209c3
[v0.4.0] Temporarily remove Flax modules from the public API (#755)
anton-l Oct 6, 2022
4581f14
Update clip_guided_stable_diffusion.py
patil-suraj Oct 6, 2022
3b1d2ca
Release: v0.4.0
anton-l Oct 6, 2022
0fe59b6
Merge remote-tracking branch 'origin/main'
anton-l Oct 6, 2022
c15cda0
Bump to v0.4.1.dev0
anton-l Oct 6, 2022
970e306
Revert "[v0.4.0] Temporarily remove Flax modules from the public API …
anton-l Oct 6, 2022
435433c
Update clip_guided_stable_diffusion.py
patil-suraj Oct 6, 2022
737195d
Created using Colaboratory
patil-suraj Oct 6, 2022
9531150
Bump to v0.5.0.dev0
anton-l Oct 6, 2022
2fa55fc
Merge remote-tracking branch 'origin/main'
anton-l Oct 6, 2022
ae672d5
[Tests] Lower required memory for clip guided and fix super edge-case…
patrickvonplaten Oct 6, 2022
d3f1a4c
Revert "Bump to v0.5.0.dev0"
anton-l Oct 6, 2022
fdfa7c8
Change fp16 error to warning (#764)
apolinario Oct 7, 2022
91ddd2a
Release: v0.4.1
patrickvonplaten Oct 7, 2022
9a95414
Bump to v0.5.0dev0
patrickvonplaten Oct 7, 2022
c93a8cc
remove bogus folder
patrickvonplaten Oct 7, 2022
7258dc4
remove bogus folder no.2
patrickvonplaten Oct 7, 2022
906e410
Fix push_to_hub for dreambooth and textual_inversion (#748)
YaYaB Oct 7, 2022
75bb6d2
Fix ONNX conversion script opset argument type (#739)
justinchuby Oct 7, 2022
e0fece2
Add final latent slice checks to SD pipeline intermediate state tests…
jamestiotio Oct 7, 2022
cb0bf0b
fix(DDIM scheduler): use correct dtype for noise (#742)
keturn Oct 7, 2022
ec831b6
[schedulers] hanlde dtype in add_noise (#767)
patil-suraj Oct 7, 2022
92d7086
[img2img, inpainting] fix fp16 inference (#769)
patil-suraj Oct 7, 2022
f3983d1
[Tests] Fix tests (#774)
patrickvonplaten Oct 7, 2022
5af6eed
debug an exception (#638)
LowinLi Oct 10, 2022
a73f8b7
Clean up resnet.py file (#780)
Oct 10, 2022
feaa732
add sigmoid betas (#777)
Oct 10, 2022
fab1752
[Low CPU memory] + device map (#772)
patrickvonplaten Oct 10, 2022
22963ed
Fix gradient checkpointing test (#797)
patrickvonplaten Oct 10, 2022
71ca10c
fix typo docstring in unet2d (#798)
Oct 10, 2022
81bdbb5
DreamBooth DeepSpeed support for under 8 GB VRAM training (#735)
Ttl Oct 10, 2022
797b290
support bf16 for stable diffusion (#792)
patil-suraj Oct 11, 2022
66a5279
stable diffusion fine-tuning (#356)
patil-suraj Oct 11, 2022
a124204
Flax: Trickle down `norm_num_groups` (#789)
akash5474 Oct 11, 2022
e895952
Eventually preserve this typo? :) (#804)
spezialspezial Oct 11, 2022
757babf
Fix indentation in the code example (#802)
osanseviero Oct 11, 2022
24b8b5c
`mps`: Alternative implementation for `repeat_interleave` (#766)
pcuenca Oct 11, 2022
c1b6ea3
Update img2img.mdx
patrickvonplaten Oct 11, 2022
6bc1178
[Img2Img] Fix batch size mismatch prompts vs. init images (#793)
patrickvonplaten Oct 12, 2022
966e2fc
Minor package fixes (#809)
anton-l Oct 12, 2022
db47b1e
[Dummy imports] Better error message (#795)
patrickvonplaten Oct 12, 2022
679c77f
Add diffusers version and pipeline class to the Hub UA
anton-l Oct 12, 2022
80be074
Merge remote-tracking branch 'origin/main'
anton-l Oct 12, 2022
9659863
Revert an accidental commit
anton-l Oct 12, 2022
5afc2b6
add or fix license formatting in models directory (#808)
Oct 12, 2022
008b608
[train_text2image] Fix EMA and make it compatible with deepspeed. (#813)
patil-suraj Oct 12, 2022
60c384b
Fix fine-tuning compatibility with deepspeed (#816)
pink-red Oct 12, 2022
323a9e1
Add diffusers version and pipeline class to the Hub UA (#814)
anton-l Oct 12, 2022
f1d4289
[Flax] Add test (#824)
patrickvonplaten Oct 13, 2022
0a09af2
update flax scheduler API (#822)
patil-suraj Oct 13, 2022
e001fed
Fix dreambooth loss type with prior_preservation and fp16 (#826)
anton-l Oct 13, 2022
26c7df5
Fix type mismatch error, add tests for negative prompts (#823)
anton-l Oct 13, 2022
e713346
Give more customizable options for safety checker (#815)
patrickvonplaten Oct 13, 2022
78db11d
Flax safety checker (#825)
pcuenca Oct 13, 2022
7c22626
Align PT and Flax API - allow loading checkpoint from PyTorch configs…
patrickvonplaten Oct 13, 2022
1d51224
[Flax] Complete tests (#828)
patrickvonplaten Oct 13, 2022
0679d09
Release: 5.0.0 (#830)
anton-l Oct 13, 2022
effe9d6
[FlaxStableDiffusionPipeline] fix bug when nsfw is detected (#832)
patil-suraj Oct 13, 2022
e48ca0f
Release 0 5 1 (#833)
patrickvonplaten Oct 13, 2022
d3eb3b3
[Community] One step unet (#840)
patrickvonplaten Oct 14, 2022
b8c4d58
Remove unneeded use_auth_token (#839)
osanseviero Oct 14, 2022
52394b5
Bump to 0.6.0.dev0 (#831)
anton-l Oct 14, 2022
1d3234c
Remove the last of ["sample"] (#842)
anton-l Oct 14, 2022
93a81a3
Fix Flax pipeline: width and height are ignored #838 (#848)
camenduru Oct 14, 2022
2b7d4a5
[DeviceMap] Make sure stable diffusion can be loaded from older trans…
patrickvonplaten Oct 16, 2022
765a446
Update README.md
patrickvonplaten Oct 17, 2022
5b94450
Update README.md
patrickvonplaten Oct 17, 2022
ee9875e
Add Stable Diffusion Interpolation Example (#862)
nateraw Oct 17, 2022
ad0e9ac
Update README.md
patrickvonplaten Oct 17, 2022
146419f
All in one Stable Diffusion Pipeline (#821)
patrickvonplaten Oct 17, 2022
ed6c61c
Fix small community pipeline import bug and finish README (#869)
patrickvonplaten Oct 17, 2022
52e8fdb
Update README.md
patrickvonplaten Oct 17, 2022
4dce374
Fix training push_to_hub (unconditional image generation): models wer…
pcuenca Oct 17, 2022
dff91ee
Fix table in community README.md (#879)
nateraw Oct 17, 2022
fd26624
Add generic inference example to community pipeline readme (#874)
apolinario Oct 17, 2022
627ad6e
Rename frame filename in interpolation community example (#881)
nateraw Oct 17, 2022
cca59ce
Add Apple M1 tests (#796)
anton-l Oct 17, 2022
100e094
Fix autoencoder test (#886)
pcuenca Oct 17, 2022
728a3f3
Rename StableDiffusionOnnxPipeline -> OnnxStableDiffusionPipeline (#887)
anton-l Oct 18, 2022
a3efa43
Fix DDIM on Windows not using int64 for timesteps (#819)
hafriedlander Oct 18, 2022
fbe807b
[dreambooth] allow fine-tuning text encoder (#883)
patil-suraj Oct 18, 2022
a9908ec
Stable Diffusion image-to-image and inpaint using onnx. (#552)
zledas Oct 18, 2022
8eb9d97
Improve ONNX img2img numpy handling, temporarily fix the tests (#899)
anton-l Oct 19, 2022
bd21607
make fix copies
patrickvonplaten Oct 19, 2022
6ea8360
[Stable Diffusion Inpainting] Deprecate inpainting pipeline in favor …
patrickvonplaten Oct 19, 2022
83b696e
[Communit Pipeline] Make sure "mega" uses correct inpaint pipeline (#…
patrickvonplaten Oct 19, 2022
b35d88c
Stable diffusion inpainting. (#904)
patil-suraj Oct 19, 2022
4655712
finish tests (#909)
patrickvonplaten Oct 19, 2022
89d1249
ONNX supervised inpainting (#906)
anton-l Oct 19, 2022
8124863
Initial docs update for new in-painting pipeline (#910)
pcuenca Oct 19, 2022
ad9d7ce
Release: 0.6.0
anton-l Oct 19, 2022
2a0c823
[Community Pipelines] Long Prompt Weighting Stable Diffusion Pipeline…
SkyTNT Oct 19, 2022
83f8a5f
[Stable Diffusion] Add components function (#889)
patrickvonplaten Oct 20, 2022
4a76e5d
[PNDM Scheduler] Make sure list cannot grow forever (#882)
patrickvonplaten Oct 20, 2022
db19a9d
[DiffusionPipeline.from_pretrained] add warning when passing unused k…
patrickvonplaten Oct 20, 2022
ce7d966
DOC Dreambooth Add --sample_batch_size=1 to the 8 GB dreambooth examp…
leszekhanusz Oct 20, 2022
a5eb7f4
[Examples] add speech to image pipeline example (#897)
MikailINTech Oct 20, 2022
7674a36
[dreambooth] dont use safety check when generating prior images (#922)
patil-suraj Oct 20, 2022
4bf675f
Dreambooth class image generation: using unique names to avoid overwr…
leszekhanusz Oct 20, 2022
8be4850
fix test_components (#928)
patil-suraj Oct 20, 2022
6f6eef7
Fix Compatibility with Nvidia NGC Containers (#919)
tasercake Oct 20, 2022
ba74a8b
[Community Pipelines] Fix pad_tokens_and_weights in lpw_stable_diffus…
SkyTNT Oct 20, 2022
cc36f2e
Bump the version to 0.7.0.dev0 (#912)
anton-l Oct 20, 2022
32bf4fd
Introduce the copy mechanism (#924)
anton-l Oct 20, 2022
25dfd0f
[Tests] Move stable diffusion into their own files (#936)
patrickvonplaten Oct 21, 2022
dec18c8
[Flax] dont warn for bf16 weights (#923)
patil-suraj Oct 21, 2022
31af4d1
Support LMSDiscreteScheduler in LDMPipeline (#891)
mkshing Oct 21, 2022
2fdd094
Wildcard stable diffusion pipeline (#900)
shyamsn97 Oct 21, 2022
9bca402
[MPS] fix mps failing tests (#934)
kashif Oct 22, 2022
2d35f67
fix a small typo in pipeline_ddpm.py (#948)
chenguolin Oct 24, 2022
2c82e0c
Reorganize pipeline tests (#963)
anton-l Oct 24, 2022
8aac1f9
v1-5 docs updates (#921)
apolinario Oct 24, 2022
2fb8faf
add community pipeline docs; add minimal text to some empty doc pages…
Oct 24, 2022
8204415
Fix typo: `torch_type` -> `torch_dtype` (#972)
pcuenca Oct 25, 2022
6e099e2
add num_inference_steps arg to DDPM (#935)
tmabraham Oct 25, 2022
38ae5a2
Add Composable diffusion to community pipeline examples (#951)
MarkRich Oct 25, 2022
240abdd
[Flax] added broadcast_to_shape_from_left helper and Scheduler tests …
kashif Oct 25, 2022
28b134e
[Tests] Fix `mps` reproducibility issue when running with pytest-xdis…
anton-l Oct 25, 2022
3d02c92
mps changes for PyTorch 1.13 (#926)
pcuenca Oct 25, 2022
0b42b07
[Onnx] support half-precision and fix bugs for onnx pipelines (#932)
SkyTNT Oct 25, 2022
88fa6b7
[Dance Diffusion] Add dance diffusion (#803)
patrickvonplaten Oct 25, 2022
365ff8f
[Dance Diffusion] FP16 (#980)
patrickvonplaten Oct 25, 2022
59f0ce8
[Dance Diffusion] Better naming (#981)
patrickvonplaten Oct 25, 2022
e2243de
Fix typo in documentation title (#975)
echarlaix Oct 25, 2022
4b9f589
Add --pretrained_model_name_revision option to train_dreambooth.py (#…
shirayu Oct 25, 2022
0343d8f
Do not use torch.float64 on the mps device (#942)
pcuenca Oct 26, 2022
d9cfe32
CompVis -> diffusers script - allow converting from merged checkpoint…
patrickvonplaten Oct 26, 2022
d7d6841
fix a bug in the new version (#957)
xiaohu2015 Oct 26, 2022
cc43608
Fix typos (#978)
shirayu Oct 26, 2022
2f0fcf4
Add missing import (#979)
juliensimon Oct 26, 2022
b2e2d14
minimal stable diffusion GPU memory usage with accelerate hooks (#850)
piEsposito Oct 26, 2022
bd06dd0
[inpaint pipeline] fix bug for multiple prompts inputs (#959)
xiaohu2015 Oct 26, 2022
8332c1a
Enable multi-process DataLoader for dreambooth (#950)
skirsten Oct 26, 2022
d3d22ce
Small modification to enable usage by external scripts (#956)
briancw Oct 26, 2022
a23ad87
[Flax] Add Textual Inversion (#880)
duongna21 Oct 26, 2022
1d04e1b
Continuation of #942: additional float64 failure (#996)
pcuenca Oct 27, 2022
e92a603
fix dreambooth script. (#1017)
patil-suraj Oct 27, 2022
3be9fa9
[Accelerate model loading] Fix meta device and super low memory usage…
patrickvonplaten Oct 27, 2022
abe0582
[Flax] Add finetune Stable Diffusion (#999)
duongna21 Oct 27, 2022
4623f09
[DreamBooth] Set train mode for text encoder (#1012)
duongna21 Oct 27, 2022
90f91ad
[Flax] Add DreamBooth (#1001)
duongna21 Oct 27, 2022
fbcc383
Deprecate `init_git_repo`, refactor `train_unconditional.py` (#1022)
anton-l Oct 27, 2022
52f2128
update readme for flax examples (#1026)
patil-suraj Oct 27, 2022
eceeebd
Update train_dreambooth.py
patil-suraj Oct 27, 2022
939ec17
Probably nicer to specify dependency on tensorboard in the training e…
lukovnikov Oct 27, 2022
a6314a8
Add `--dataloader_num_workers` to the DDPM training example (#1027)
anton-l Oct 27, 2022
de00c63
Document sequential CPU offload method on Stable Diffusion pipeline (…
piEsposito Oct 27, 2022
fb38bb1
Support grayscale images in `numpy_to_pil` (#1025)
anton-l Oct 27, 2022
1e07b6b
[Flax SD finetune] Fix dtype (#1038)
duongna21 Oct 28, 2022
ab079f2
fix `F.interpolate()` for large batch sizes (#1006)
NouamaneTazi Oct 28, 2022
a80480f
[Tests] Improve unet / vae tests (#1018)
patrickvonplaten Oct 28, 2022
d2d9764
[Tests] Speed up slow tests (#1040)
patrickvonplaten Oct 28, 2022
8d6487f
Fix some failing tests (#1041)
patrickvonplaten Oct 28, 2022
c4ef1ef
[Tests] Better prints (#1043)
patrickvonplaten Oct 28, 2022
d37f08d
[Tests] no random latents anymore (#1045)
patrickvonplaten Oct 28, 2022
cbbb293
hot fix
patrickvonplaten Oct 28, 2022
ea01a4c
fix
patrickvonplaten Oct 28, 2022
a7ae808
increase tolerance
patrickvonplaten Oct 28, 2022
81b6fbf
higher precision for vae
patrickvonplaten Oct 28, 2022
6b185b6
Update training and fine-tuning docs (#1020)
pcuenca Oct 28, 2022
fc0ca47
Fix speedup ratio in fp16.mdx (#837)
mwbyeon Oct 29, 2022
12fd073
clean incomplete pages (#1008)
Oct 29, 2022
1fc2088
Add seed resizing to community pipelines (#1011)
MarkRich Oct 29, 2022
a59f999
Tests: upgrade PyTorch cuda to 11.7 to fix examples tests. (#1048)
pcuenca Oct 29, 2022
95414bd
Experimental: allow fp16 in `mps` (#961)
pcuenca Oct 29, 2022
8e4fd68
Move safety detection to model call in Flax safety checker (#1023)
jonatanklosko Oct 30, 2022
707b868
fix slow test
patrickvonplaten Oct 31, 2022
82d56cf
Merge branch 'main' of https://github.com/huggingface/diffusers into …
patrickvonplaten Oct 31, 2022
1606eb9
Fix pipelines user_agent, ignore CI requests (#1058)
anton-l Oct 31, 2022
e4d264e
[GitBot] Automatically close issues after inactivitiy (#1079)
patrickvonplaten Oct 31, 2022
bf7b0bc
Allow `safety_checker` to be `None` when using CPU offload (#1078)
pcuenca Oct 31, 2022
a1ea8c0
k-diffusion-euler (#1019)
hlky Oct 31, 2022
c18941b
[Better scheduler docs] Improve usage examples of schedulers (#890)
patrickvonplaten Oct 31, 2022
010bc4e
incorrect model id
patrickvonplaten Oct 31, 2022
17c2c06
[Tests] Fix slow tests (#1087)
patrickvonplaten Oct 31, 2022
888468d
Remove nn sequential (#1086)
patrickvonplaten Oct 31, 2022
7fb4b88
Remove some unused parameter in CrossAttnUpBlock2D (#1034)
LaurentMazare Oct 31, 2022
ab303e8
Merge branch 'main' of https://github.com/Oneflow-Inc/diffusers into …
jackalcooper Nov 1, 2022
b5118dd
update pipe
jackalcooper Nov 1, 2022
81da7cf
update pndm
jackalcooper Nov 1, 2022
9659489
rename
jackalcooper Nov 1, 2022
8cd3276
rename
jackalcooper Nov 1, 2022
653870f
update resnet
jackalcooper Nov 1, 2022
bcf37fb
update attention
jackalcooper Nov 1, 2022
cf07252
update
jackalcooper Nov 1, 2022
d2c16a2
update safety checker
jackalcooper Nov 1, 2022
2c2b3d4
Merge branch 'main' of https://github.com/Oneflow-Inc/diffusers into …
jackalcooper Nov 1, 2022
b770126
rm todo
jackalcooper Nov 1, 2022
6b967ba
tryfix
jackalcooper Nov 1, 2022
923b5d9
fix
jackalcooper Nov 1, 2022
eedeacb
rm
jackalcooper Nov 1, 2022
498f22b
fix
jackalcooper Nov 1, 2022
9807fa3
fix
jackalcooper Nov 1, 2022
cbc8df3
add
jackalcooper Nov 2, 2022
85ff49f
refine log
jackalcooper Nov 2, 2022
f6ac84a
set env
jackalcooper Nov 3, 2022
f429954
Debug sd conv gn geglu (#7)
jackalcooper Nov 7, 2022
dc01404
Add arg compile_unet (#17)
jackalcooper Nov 8, 2022
1aa67aa
stable-diffusion support multiple shapes (#13)
yuantailing Nov 9, 2022
d6c7a54
Support DPMsolver (#21)
jackalcooper Nov 9, 2022
e866174
Image to image (#25)
jackalcooper Nov 10, 2022
c057826
Merge branch 'oneflow-fork' of https://github.com/Oneflow-Inc/diffuse…
jackalcooper Nov 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions .github/actions/setup-miniconda/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Set up conda environment for testing

description: Sets up miniconda in your ${RUNNER_TEMP} environment and gives you the ${CONDA_RUN} environment variable so you don't have to worry about polluting non-empeheral runners anymore

inputs:
python-version:
description: If set to any value, dont use sudo to clean the workspace
required: false
type: string
default: "3.9"
miniconda-version:
description: Miniconda version to install
required: false
type: string
default: "4.12.0"
environment-file:
description: Environment file to install dependencies from
required: false
type: string
default: ""

runs:
using: composite
steps:
# Use the same trick from https://github.com/marketplace/actions/setup-miniconda
# to refresh the cache daily. This is kind of optional though
- name: Get date
id: get-date
shell: bash
run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')d"
- name: Setup miniconda cache
id: miniconda-cache
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/miniconda
key: miniconda-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }}-${{ steps.get-date.outputs.today }}
- name: Install miniconda (${{ inputs.miniconda-version }})
if: steps.miniconda-cache.outputs.cache-hit != 'true'
env:
MINICONDA_VERSION: ${{ inputs.miniconda-version }}
shell: bash -l {0}
run: |
MINICONDA_INSTALL_PATH="${RUNNER_TEMP}/miniconda"
mkdir -p "${MINICONDA_INSTALL_PATH}"
case ${RUNNER_OS}-${RUNNER_ARCH} in
Linux-X64)
MINICONDA_ARCH="Linux-x86_64"
;;
macOS-ARM64)
MINICONDA_ARCH="MacOSX-arm64"
;;
macOS-X64)
MINICONDA_ARCH="MacOSX-x86_64"
;;
*)
echo "::error::Platform ${RUNNER_OS}-${RUNNER_ARCH} currently unsupported using this action"
exit 1
;;
esac
MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-py39_${MINICONDA_VERSION}-${MINICONDA_ARCH}.sh"
curl -fsSL "${MINICONDA_URL}" -o "${MINICONDA_INSTALL_PATH}/miniconda.sh"
bash "${MINICONDA_INSTALL_PATH}/miniconda.sh" -b -u -p "${MINICONDA_INSTALL_PATH}"
rm -rf "${MINICONDA_INSTALL_PATH}/miniconda.sh"
- name: Update GitHub path to include miniconda install
shell: bash
run: |
MINICONDA_INSTALL_PATH="${RUNNER_TEMP}/miniconda"
echo "${MINICONDA_INSTALL_PATH}/bin" >> $GITHUB_PATH
- name: Setup miniconda env cache (with env file)
id: miniconda-env-cache-env-file
if: ${{ runner.os }} == 'macOS' && ${{ inputs.environment-file }} != ''
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/conda-python-${{ inputs.python-version }}
key: miniconda-env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }}-${{ steps.get-date.outputs.today }}-${{ hashFiles(inputs.environment-file) }}
- name: Setup miniconda env cache (without env file)
id: miniconda-env-cache
if: ${{ runner.os }} == 'macOS' && ${{ inputs.environment-file }} == ''
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/conda-python-${{ inputs.python-version }}
key: miniconda-env-${{ runner.os }}-${{ runner.arch }}-${{ inputs.python-version }}-${{ steps.get-date.outputs.today }}
- name: Setup conda environment with python (v${{ inputs.python-version }})
if: steps.miniconda-env-cache-env-file.outputs.cache-hit != 'true' && steps.miniconda-env-cache.outputs.cache-hit != 'true'
shell: bash
env:
PYTHON_VERSION: ${{ inputs.python-version }}
ENV_FILE: ${{ inputs.environment-file }}
run: |
CONDA_BASE_ENV="${RUNNER_TEMP}/conda-python-${PYTHON_VERSION}"
ENV_FILE_FLAG=""
if [[ -f "${ENV_FILE}" ]]; then
ENV_FILE_FLAG="--file ${ENV_FILE}"
elif [[ -n "${ENV_FILE}" ]]; then
echo "::warning::Specified env file (${ENV_FILE}) not found, not going to include it"
fi
conda create \
--yes \
--prefix "${CONDA_BASE_ENV}" \
"python=${PYTHON_VERSION}" \
${ENV_FILE_FLAG} \
cmake=3.22 \
conda-build=3.21 \
ninja=1.10 \
pkg-config=0.29 \
wheel=0.37
- name: Clone the base conda environment and update GitHub env
shell: bash
env:
PYTHON_VERSION: ${{ inputs.python-version }}
CONDA_BASE_ENV: ${{ runner.temp }}/conda-python-${{ inputs.python-version }}
run: |
CONDA_ENV="${RUNNER_TEMP}/conda_environment_${GITHUB_RUN_ID}"
conda create \
--yes \
--prefix "${CONDA_ENV}" \
--clone "${CONDA_BASE_ENV}"
# TODO: conda-build could not be cloned because it hardcodes the path, so it
# could not be cached
conda install --yes -p ${CONDA_ENV} conda-build=3.21
echo "CONDA_ENV=${CONDA_ENV}" >> "${GITHUB_ENV}"
echo "CONDA_RUN=conda run -p ${CONDA_ENV} --no-capture-output" >> "${GITHUB_ENV}"
echo "CONDA_BUILD=conda run -p ${CONDA_ENV} conda-build" >> "${GITHUB_ENV}"
echo "CONDA_INSTALL=conda install -p ${CONDA_ENV}" >> "${GITHUB_ENV}"
- name: Get disk space usage and throw an error for low disk space
shell: bash
run: |
echo "Print the available disk space for manual inspection"
df -h
# Set the minimum requirement space to 4GB
MINIMUM_AVAILABLE_SPACE_IN_GB=4
MINIMUM_AVAILABLE_SPACE_IN_KB=$(($MINIMUM_AVAILABLE_SPACE_IN_GB * 1024 * 1024))
# Use KB to avoid floating point warning like 3.1GB
df -k | tr -s ' ' | cut -d' ' -f 4,9 | while read -r LINE;
do
AVAIL=$(echo $LINE | cut -f1 -d' ')
MOUNT=$(echo $LINE | cut -f2 -d' ')
if [ "$MOUNT" = "/" ]; then
if [ "$AVAIL" -lt "$MINIMUM_AVAILABLE_SPACE_IN_KB" ]; then
echo "There is only ${AVAIL}KB free space left in $MOUNT, which is less than the minimum requirement of ${MINIMUM_AVAILABLE_SPACE_IN_KB}KB. Please help create an issue to PyTorch Release Engineering via https://github.com/pytorch/test-infra/issues and provide the link to the workflow run."
exit 1;
else
echo "There is ${AVAIL}KB free space left in $MOUNT, continue"
fi
fi
done
17 changes: 17 additions & 0 deletions .github/workflows/pr_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,20 @@ jobs:
isort --check-only examples tests src utils scripts
flake8 examples tests src utils scripts
doc-builder style src/diffusers docs/source --max_len 119 --check_only --path_to_docs docs/source

check_repository_consistency:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[quality]
- name: Check quality
run: |
python utils/check_copies.py
python utils/check_dummies.py
67 changes: 61 additions & 6 deletions .github/workflows/pr_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run non-slow tests
name: Run fast tests

on:
pull_request:
Expand All @@ -10,18 +10,19 @@ concurrency:
cancel-in-progress: true

env:
HF_HOME: /mnt/cache
DIFFUSERS_IS_CI: yes
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
PYTEST_TIMEOUT: 60
MPS_TORCH_VERSION: 1.13.0

jobs:
run_tests_cpu:
name: Diffusers tests
name: CPU tests on Ubuntu
runs-on: [ self-hosted, docker-gpu ]
container:
image: python:3.7
options: --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
options: --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache/

steps:
- name: Checkout diffusers
Expand All @@ -34,12 +35,15 @@ jobs:
python -m pip install --upgrade pip
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
python -m pip install -e .[quality,test]
python -m pip install git+https://github.com/huggingface/accelerate

- name: Environment
run: |
python utils/print_env.py

- name: Run all non-slow selected tests on CPU
- name: Run all fast tests on CPU
env:
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
run: |
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile -s -v --make-reports=tests_torch_cpu tests/

Expand All @@ -51,5 +55,56 @@ jobs:
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: pr_torch_test_reports
name: pr_torch_cpu_test_reports
path: reports

run_tests_apple_m1:
name: MPS tests on Apple M1
runs-on: [ self-hosted, apple-m1 ]

steps:
- name: Checkout diffusers
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Clean checkout
shell: arch -arch arm64 bash {0}
run: |
git clean -fxd

- name: Setup miniconda
uses: ./.github/actions/setup-miniconda
with:
python-version: 3.9

- name: Install dependencies
shell: arch -arch arm64 bash {0}
run: |
${CONDA_RUN} python -m pip install --upgrade pip
${CONDA_RUN} python -m pip install -e .[quality,test]
${CONDA_RUN} python -m pip install --pre torch==${MPS_TORCH_VERSION} --extra-index-url https://download.pytorch.org/whl/test/cpu
${CONDA_RUN} python -m pip install git+https://github.com/huggingface/accelerate

- name: Environment
shell: arch -arch arm64 bash {0}
run: |
${CONDA_RUN} python utils/print_env.py

- name: Run all fast tests on MPS
shell: arch -arch arm64 bash {0}
env:
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
run: |
${CONDA_RUN} python -m pytest -n 1 -s -v --make-reports=tests_torch_mps tests/

- name: Failure short reports
if: ${{ failure() }}
run: cat reports/tests_torch_mps_failures_short.txt

- name: Test suite reports artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: pr_torch_mps_test_reports
path: reports
25 changes: 9 additions & 16 deletions .github/workflows/push_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main

env:
DIFFUSERS_IS_CI: yes
HF_HOME: /mnt/cache
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
Expand All @@ -15,14 +16,10 @@ env:
jobs:
run_tests_single_gpu:
name: Diffusers tests
strategy:
fail-fast: false
matrix:
machine_type: [ single-gpu ]
runs-on: [ self-hosted, docker-gpu, '${{ matrix.machine_type }}' ]
runs-on: [ self-hosted, docker-gpu, single-gpu ]
container:
image: nvcr.io/nvidia/pytorch:22.07-py3
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache

steps:
- name: Checkout diffusers
Expand All @@ -38,8 +35,9 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip uninstall -y torch torchvision torchtext
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu116
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu117
python -m pip install -e .[quality,test]
python -m pip install git+https://github.com/huggingface/accelerate

- name: Environment
run: |
Expand All @@ -62,18 +60,12 @@ jobs:
name: torch_test_reports
path: reports



run_examples_single_gpu:
name: Examples tests
strategy:
fail-fast: false
matrix:
machine_type: [ single-gpu ]
runs-on: [ self-hosted, docker-gpu, '${{ matrix.machine_type }}' ]
runs-on: [ self-hosted, docker-gpu, single-gpu ]
container:
image: nvcr.io/nvidia/pytorch:22.07-py3
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/hf_cache:/mnt/cache

steps:
- name: Checkout diffusers
Expand All @@ -89,8 +81,9 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip uninstall -y torch torchvision torchtext
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu116
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu117
python -m pip install -e .[quality,test,training]
python -m pip install git+https://github.com/huggingface/accelerate

- name: Environment
run: |
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include LICENSE
include src/diffusers/utils/model_card_template.md
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ fixup: modified_only_fixup extra_style_checks autogenerate_code repo-consistency
# Make marked copies of snippets of codes conform to the original

fix-copies:
python utils/check_copies.py --fix_and_overwrite
python utils/check_dummies.py --fix_and_overwrite

# Run tests for the library
Expand Down
Loading