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 dev to master #2897

Merged
merged 136 commits into from
Feb 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
10cab9a
post merge cleanup
vladmandic Feb 7, 2024
8e708e7
Deploying to master from @ vladmandic/automatic@fa7972ff59f2aa4e4cbf3…
vladmandic Feb 7, 2024
8d8815d
Lock tensordict to 0.2.1
Disty0 Feb 7, 2024
d5a4f43
post release jumbo update
vladmandic Feb 8, 2024
f3be294
add deep-cache support
vladmandic Feb 8, 2024
af4da02
update changelog
vladmandic Feb 8, 2024
748ed53
onnx tooltip, olive-ai check
lshqqytiger Feb 8, 2024
ebdabb1
Correction for Diffusers clip_skip math
Disty0 Feb 8, 2024
5b76fc3
update notes
vladmandic Feb 8, 2024
0923a98
Fix diffusers clip_skip math
Disty0 Feb 8, 2024
312f391
add theme cli arg
vladmandic Feb 8, 2024
251373a
Hijacking Compel to enable clip skip
AI-Casanova Feb 8, 2024
e883348
Fix offset
AI-Casanova Feb 8, 2024
f56d210
update clip-skip code
vladmandic Feb 9, 2024
2dbf674
update changelog
vladmandic Feb 9, 2024
c9444c8
cleanup
vladmandic Feb 9, 2024
9a1ce4d
Adjust clip skip to expected range
Disty0 Feb 9, 2024
d867e7a
Diffusers add Dynamic Attention Slicing
Disty0 Feb 9, 2024
96d262b
update img2img mask math
vladmandic Feb 9, 2024
5afd4b8
control unit reuse preview image, handle extensions installing confli…
vladmandic Feb 9, 2024
9150e9f
handle opencv conflict
vladmandic Feb 9, 2024
94a8f41
xyzgrid for ipadapter
vladmandic Feb 9, 2024
12e49ac
OpenVINO update to torch 2.2.0
Disty0 Feb 9, 2024
e8f025f
fix image lazy load
vladmandic Feb 9, 2024
6297a64
add sdxl vae load workaround
vladmandic Feb 9, 2024
5f6ec08
fix typo
vladmandic Feb 9, 2024
33c8285
Experimental clip skip interpolation
AI-Casanova Feb 9, 2024
a069a45
cast clipskip
vladmandic Feb 9, 2024
40feb79
add clip-skip notes
vladmandic Feb 9, 2024
cfb059c
fix onnx sdxl
lshqqytiger Feb 9, 2024
bf14e6e
fix mask missing options and system paths
vladmandic Feb 10, 2024
8ec457c
add allowed paths cli param
vladmandic Feb 10, 2024
19e5062
fix interrogate api
vladmandic Feb 10, 2024
71caa89
onnx fp16 vae
lshqqytiger Feb 10, 2024
43c5be7
Unite attention optimization settings
Disty0 Feb 9, 2024
304caf8
update cross-attention
vladmandic Feb 10, 2024
1c4293a
remove obsolete kohya lora code
vladmandic Feb 10, 2024
12675a0
cleanup repo
vladmandic Feb 10, 2024
3bb8082
Update changelog
Disty0 Feb 10, 2024
bb30a2d
Revert submodules
Disty0 Feb 10, 2024
b76d9ce
cleanup
Disty0 Feb 10, 2024
c528b4b
update todo
vladmandic Feb 10, 2024
0ac2dfb
Dyn Atten don't synchronize if not slicing
Disty0 Feb 10, 2024
ef909cd
HyperTile add swap size and depth options
Disty0 Feb 10, 2024
e731505
refactor ip adapters
vladmandic Feb 10, 2024
132cdb1
update readme
vladmandic Feb 10, 2024
2f73eb1
update changelog
vladmandic Feb 10, 2024
1ff909f
Add option to use HyperTile on only hires pass
Disty0 Feb 10, 2024
c61a92d
fix ipadapter none lookup
vladmandic Feb 10, 2024
fa833a5
Draft: XYZ only
AI-Casanova Feb 11, 2024
3f8da51
Set default atten for ROCm to SDP
Disty0 Feb 11, 2024
3c9a4d5
init values for ip
vladmandic Feb 11, 2024
c9e01b4
OpenVINO fix --device-id with single GPU
Disty0 Feb 11, 2024
a675347
Cleanup
Disty0 Feb 11, 2024
baf42fb
Fix dtype mismatch with vae decode
Disty0 Feb 12, 2024
7021ffb
Add UI controls
AI-Casanova Feb 12, 2024
fd28ec1
Merge branch 'dev' into ipadapter-end
AI-Casanova Feb 12, 2024
c24539b
Fix NNCF compatibility with model cpu offload
Disty0 Feb 12, 2024
d65067a
fix control processor images handling
vladmandic Feb 12, 2024
6c9d35a
new gradio hijacks
vladmandic Feb 12, 2024
52f3683
update changelog
vladmandic Feb 12, 2024
239e3f8
add masking debug
vladmandic Feb 12, 2024
c9fc135
failsafe mask region
vladmandic Feb 12, 2024
9532f89
Fix vae has no post_quant_conv
Disty0 Feb 12, 2024
db1e1cc
update token counter
vladmandic Feb 12, 2024
03094f8
Merge branch 'dev' into ipadapter-end
AI-Casanova Feb 13, 2024
3d9e546
Finish TODO fix script
AI-Casanova Feb 13, 2024
3190e85
OpenVINO fix quant not being applied
Disty0 Feb 13, 2024
75cbe4f
Merge branch 'dev' into ipadapter-end
vladmandic Feb 13, 2024
9e5ade6
Merge branch 'AI-Casanova-ipadapter-end' into dev
vladmandic Feb 13, 2024
943b1c1
fix prompts-from-file
vladmandic Feb 13, 2024
f5c1cb1
ipadapter merge cleanup and add metadata
vladmandic Feb 13, 2024
1bcaa77
error handling
vladmandic Feb 13, 2024
a72a0f4
error messages
vladmandic Feb 13, 2024
e65e841
fix ext updated info
vladmandic Feb 13, 2024
0beb5d5
update requirements
vladmandic Feb 13, 2024
86e8791
Update IPEX Optimize logging
Disty0 Feb 13, 2024
08567b2
refactor and fix embedding registration
AI-Casanova Feb 13, 2024
5fe82c4
Fix model archs with no VAE
Disty0 Feb 13, 2024
ccd6c86
Fix EN embedding refresh
AI-Casanova Feb 13, 2024
c16cd2e
handle dict as pipeline result
vladmandic Feb 13, 2024
935d7ef
new control outpaint
vladmandic Feb 14, 2024
635c071
fix ipadapter check
vladmandic Feb 14, 2024
7d25ba4
Wuerstchen fixes
Disty0 Feb 14, 2024
52efa90
Experimental Stable Cascade support
Disty0 Feb 14, 2024
ae10ae6
Cleanup
Disty0 Feb 14, 2024
0e91c46
cleanup stable cascade
vladmandic Feb 14, 2024
d27295a
fix masking
vladmandic Feb 14, 2024
ae4f7e6
regional prompting
vladmandic Feb 14, 2024
47199e5
update changelog
vladmandic Feb 14, 2024
a956be0
OpenVINO add disable memory cleanup option
Disty0 Feb 14, 2024
cc44386
Initial ZLUDA support.
lshqqytiger Feb 14, 2024
25c6527
for Windows only
lshqqytiger Feb 14, 2024
290bfc8
fix hijack and update script layout
vladmandic Feb 15, 2024
6f52425
update script headings
vladmandic Feb 15, 2024
1b3028b
minor update
vladmandic Feb 15, 2024
d0ceff7
update masking
vladmandic Feb 15, 2024
e631fd8
Stable Cascade previewer and fixes
Disty0 Feb 15, 2024
efbb940
avoid unnecessary mask double resize
vladmandic Feb 15, 2024
b28fd28
lora strict filename matching
vladmandic Feb 15, 2024
cc9d096
ZLUDA loosen attention settings
Disty0 Feb 15, 2024
d76136f
cleanup
vladmandic Feb 16, 2024
00e58c0
add control mask size and outpaint masked only
vladmandic Feb 16, 2024
02336fd
refactor txt2img/img2img api
vladmandic Feb 16, 2024
5ffc692
update theme cli param
vladmandic Feb 16, 2024
1b04494
cleanup theme
vladmandic Feb 16, 2024
8caa822
lint updates
vladmandic Feb 16, 2024
a01b5fc
modularize launch
vladmandic Feb 16, 2024
38c5beb
fix typo
vladmandic Feb 16, 2024
6e412d4
add zluda force sync
lshqqytiger Feb 17, 2024
8ae3b5b
remove zluda force sync
lshqqytiger Feb 17, 2024
2a10875
fix restore pipeline
vladmandic Feb 17, 2024
5f39f80
add callback tracing
vladmandic Feb 17, 2024
2785af1
zluda enable math sdp kernel
lshqqytiger Feb 17, 2024
38421e3
fix #2785
AI-Casanova Feb 18, 2024
bdce5c1
update
vladmandic Feb 18, 2024
50beb21
Diffusers subseeds
AI-Casanova Feb 17, 2024
be81d48
xadapter prototype and placeholder
vladmandic Feb 18, 2024
ee7517d
expose sdp options
vladmandic Feb 19, 2024
0e1fb9c
zluda force sdp_options to math
lshqqytiger Feb 19, 2024
4710688
Update ui_control.py
BinaryQuantumSoul Feb 19, 2024
456af9a
refactor compile out of processing
vladmandic Feb 19, 2024
cf3fbad
gracefully fail onnx imports
vladmandic Feb 19, 2024
0239435
add differential diffusion
vladmandic Feb 20, 2024
02b03d6
update changelog
vladmandic Feb 20, 2024
44dace8
change gradio textbox handler to submit+unfocus instead of keypress
vladmandic Feb 20, 2024
aec8f76
add differential-diffusion support for sd15
vladmandic Feb 20, 2024
cf7118b
refactor stable-cascade, fix taesd bf16, add skip-env cmd flag
vladmandic Feb 21, 2024
ee4413d
Improve scrollbar
MMP0 Feb 21, 2024
d5eb09c
provide more informative logs for zluda
lshqqytiger Feb 22, 2024
f3bf2c2
minor fixes
vladmandic Feb 22, 2024
3604213
legacy cleanups
vladmandic Feb 22, 2024
f7becfb
update changelog
vladmandic Feb 22, 2024
c2eaa04
update changelog
vladmandic Feb 22, 2024
0521f8c
minor updates
vladmandic Feb 22, 2024
9d1a827
Merge branch 'master' into dev
vladmandic Feb 22, 2024
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
Prev Previous commit
Next Next commit
OpenVINO fix --device-id with single GPU
Disty0 committed Feb 11, 2024
commit c9e01b4a324946c9f2fc1a003a9f63d2f4725bdb
12 changes: 6 additions & 6 deletions modules/intel/ipex/attention.py
Original file line number Diff line number Diff line change
@@ -128,9 +128,9 @@ def torch_bmm_32_bit(input, mat2, *, out=None):
return hidden_states

original_scaled_dot_product_attention = torch.nn.functional.scaled_dot_product_attention
def scaled_dot_product_attention_32_bit(query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False):
def scaled_dot_product_attention_32_bit(query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False, **kwargs):
if query.device.type != "xpu":
return original_scaled_dot_product_attention(query, key, value, attn_mask=attn_mask, dropout_p=dropout_p, is_causal=is_causal)
return original_scaled_dot_product_attention(query, key, value, attn_mask=attn_mask, dropout_p=dropout_p, is_causal=is_causal, **kwargs)
do_split, do_split_2, do_split_3, split_slice_size, split_2_slice_size, split_3_slice_size = find_sdpa_slice_sizes(query.shape, query.element_size())

# Slice SDPA
@@ -153,25 +153,25 @@ def scaled_dot_product_attention_32_bit(query, key, value, attn_mask=None, dropo
key[start_idx:end_idx, start_idx_2:end_idx_2, start_idx_3:end_idx_3],
value[start_idx:end_idx, start_idx_2:end_idx_2, start_idx_3:end_idx_3],
attn_mask=attn_mask[start_idx:end_idx, start_idx_2:end_idx_2, start_idx_3:end_idx_3] if attn_mask is not None else attn_mask,
dropout_p=dropout_p, is_causal=is_causal
dropout_p=dropout_p, is_causal=is_causal, **kwargs
)
else:
hidden_states[start_idx:end_idx, start_idx_2:end_idx_2] = original_scaled_dot_product_attention(
query[start_idx:end_idx, start_idx_2:end_idx_2],
key[start_idx:end_idx, start_idx_2:end_idx_2],
value[start_idx:end_idx, start_idx_2:end_idx_2],
attn_mask=attn_mask[start_idx:end_idx, start_idx_2:end_idx_2] if attn_mask is not None else attn_mask,
dropout_p=dropout_p, is_causal=is_causal
dropout_p=dropout_p, is_causal=is_causal, **kwargs
)
else:
hidden_states[start_idx:end_idx] = original_scaled_dot_product_attention(
query[start_idx:end_idx],
key[start_idx:end_idx],
value[start_idx:end_idx],
attn_mask=attn_mask[start_idx:end_idx] if attn_mask is not None else attn_mask,
dropout_p=dropout_p, is_causal=is_causal
dropout_p=dropout_p, is_causal=is_causal, **kwargs
)
torch.xpu.synchronize(query.device)
else:
return original_scaled_dot_product_attention(query, key, value, attn_mask=attn_mask, dropout_p=dropout_p, is_causal=is_causal)
return original_scaled_dot_product_attention(query, key, value, attn_mask=attn_mask, dropout_p=dropout_p, is_causal=is_causal, **kwargs)
return hidden_states
2 changes: 2 additions & 0 deletions modules/intel/openvino/__init__.py
Original file line number Diff line number Diff line change
@@ -91,6 +91,8 @@ def get_device():
device = "CPU"
elif shared.cmd_opts.device_id is not None:
device = f"GPU.{shared.cmd_opts.device_id}"
if device not in available_devices:
device = "GPU.0" if "GPU.0" in available_devices else "GPU" if "GPU" in available_devices else "CPU"
elif "GPU" in core.available_devices:
device = "GPU"
elif "GPU.1" in core.available_devices:
10 changes: 5 additions & 5 deletions modules/sd_hijack_dynamic_atten.py
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ def find_slice_sizes(query_shape, query_element_size, slice_rate=4):
return do_split, do_split_2, do_split_3, split_slice_size, split_2_slice_size, split_3_slice_size


def sliced_scaled_dot_product_attention(query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False):
def sliced_scaled_dot_product_attention(query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False, **kwargs):
do_split, do_split_2, do_split_3, split_slice_size, split_2_slice_size, split_3_slice_size = find_slice_sizes(query.shape, query.element_size(), slice_rate=shared.opts.dynamic_attention_slice_rate)

# Slice SDPA
@@ -72,28 +72,28 @@ def sliced_scaled_dot_product_attention(query, key, value, attn_mask=None, dropo
key[start_idx:end_idx, start_idx_2:end_idx_2, start_idx_3:end_idx_3],
value[start_idx:end_idx, start_idx_2:end_idx_2, start_idx_3:end_idx_3],
attn_mask=attn_mask[start_idx:end_idx, start_idx_2:end_idx_2, start_idx_3:end_idx_3] if attn_mask is not None else attn_mask,
dropout_p=dropout_p, is_causal=is_causal
dropout_p=dropout_p, is_causal=is_causal, **kwargs
)
else:
hidden_states[start_idx:end_idx, start_idx_2:end_idx_2] = F.scaled_dot_product_attention(
query[start_idx:end_idx, start_idx_2:end_idx_2],
key[start_idx:end_idx, start_idx_2:end_idx_2],
value[start_idx:end_idx, start_idx_2:end_idx_2],
attn_mask=attn_mask[start_idx:end_idx, start_idx_2:end_idx_2] if attn_mask is not None else attn_mask,
dropout_p=dropout_p, is_causal=is_causal
dropout_p=dropout_p, is_causal=is_causal, **kwargs
)
else:
hidden_states[start_idx:end_idx] = F.scaled_dot_product_attention(
query[start_idx:end_idx],
key[start_idx:end_idx],
value[start_idx:end_idx],
attn_mask=attn_mask[start_idx:end_idx] if attn_mask is not None else attn_mask,
dropout_p=dropout_p, is_causal=is_causal
dropout_p=dropout_p, is_causal=is_causal, **kwargs
)
if devices.backend != "directml":
getattr(torch, query.device.type).synchronize()
else:
return F.scaled_dot_product_attention(query, key, value, attn_mask=attn_mask, dropout_p=dropout_p, is_causal=is_causal)
return F.scaled_dot_product_attention(query, key, value, attn_mask=attn_mask, dropout_p=dropout_p, is_causal=is_causal, **kwargs)
return hidden_states