Skip to content

Commit 50b67ec

Browse files
authored
Merge branch 'main' into fix_syntax_qwenimageEditPlus
2 parents 4702f20 + 041501a commit 50b67ec

18 files changed

+177
-2169
lines changed

.github/workflows/pr_modular_tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ jobs:
110110
run: |
111111
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
112112
python -m uv pip install -e [quality,test]
113-
pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
114-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
113+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
114+
# pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
115+
# pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
115116
116117
- name: Environment
117118
run: |

.github/workflows/pr_tests.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ jobs:
116116
run: |
117117
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
118118
python -m uv pip install -e [quality,test]
119-
pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
120-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
119+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
120+
# pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
121+
# pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
121122
122123
- name: Environment
123124
run: |
@@ -253,9 +254,10 @@ jobs:
253254
python -m uv pip install -e [quality,test]
254255
# TODO (sayakpaul, DN6): revisit `--no-deps`
255256
python -m pip install -U peft@git+https://github.com/huggingface/peft.git --no-deps
256-
python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
257-
python -m uv pip install -U tokenizers
258-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
257+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
258+
# python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
259+
# python -m uv pip install -U tokenizers
260+
# pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git --no-deps
259261
260262
- name: Environment
261263
run: |

.github/workflows/pr_tests_gpu.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ jobs:
132132
run: |
133133
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
134134
python -m uv pip install -e [quality,test]
135-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
136-
pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
135+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
136+
# pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
137+
# pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
137138
138139
- name: Environment
139140
run: |
@@ -203,8 +204,9 @@ jobs:
203204
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
204205
python -m uv pip install -e [quality,test]
205206
python -m uv pip install peft@git+https://github.com/huggingface/peft.git
206-
pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
207-
pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
207+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
208+
# pip uninstall accelerate -y && python -m uv pip install -U accelerate@git+https://github.com/huggingface/accelerate.git
209+
# pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
208210
209211
- name: Environment
210212
run: |
@@ -266,7 +268,8 @@ jobs:
266268
- name: Install dependencies
267269
run: |
268270
python -m venv /opt/venv && export PATH="/opt/venv/bin:$PATH"
269-
pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
271+
# Stopping this update temporarily until the Hub RC is fully shipped and integrated.
272+
# pip uninstall transformers -y && python -m uv pip install -U transformers@git+https://github.com/huggingface/transformers.git --no-deps
270273
python -m uv pip install -e [quality,test,training]
271274
272275
- name: Environment

docs/source/en/optimization/attention_backends.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ specific language governing permissions and limitations under the License. -->
1111

1212
# Attention backends
1313

14-
> [!TIP]
14+
> [!NOTE]
1515
> The attention dispatcher is an experimental feature. Please open an issue if you have any feedback or encounter any problems.
1616
1717
Diffusers provides several optimized attention algorithms that are more memory and computationally efficient through it's *attention dispatcher*. The dispatcher acts as a router for managing and switching between different attention implementations and provides a unified interface for interacting with them.
@@ -33,7 +33,7 @@ The [`~ModelMixin.set_attention_backend`] method iterates through all the module
3333

3434
The example below demonstrates how to enable the `_flash_3_hub` implementation for FlashAttention-3 from the [kernel](https://github.com/huggingface/kernels) library, which allows you to instantly use optimized compute kernels from the Hub without requiring any setup.
3535

36-
> [!TIP]
36+
> [!NOTE]
3737
> FlashAttention-3 is not supported for non-Hopper architectures, in which case, use FlashAttention with `set_attention_backend("flash")`.
3838
3939
```py
@@ -78,10 +78,16 @@ with attention_backend("_flash_3_hub"):
7878
image = pipeline(prompt).images[0]
7979
```
8080

81+
> [!TIP]
82+
> Most attention backends support `torch.compile` without graph breaks and can be used to further speed up inference.
83+
8184
## Available backends
8285

8386
Refer to the table below for a complete list of available attention backends and their variants.
8487

88+
<details>
89+
<summary>Expand</summary>
90+
8591
| Backend Name | Family | Description |
8692
|--------------|--------|-------------|
8793
| `native` | [PyTorch native](https://docs.pytorch.org/docs/stable/generated/torch.nn.attention.SDPBackend.html#torch.nn.attention.SDPBackend) | Default backend using PyTorch's scaled_dot_product_attention |
@@ -104,3 +110,5 @@ Refer to the table below for a complete list of available attention backends and
104110
| `_sage_qk_int8_pv_fp16_cuda` | [SageAttention](https://github.com/thu-ml/SageAttention) | INT8 QK + FP16 PV (CUDA) |
105111
| `_sage_qk_int8_pv_fp16_triton` | [SageAttention](https://github.com/thu-ml/SageAttention) | INT8 QK + FP16 PV (Triton) |
106112
| `xformers` | [xFormers](https://github.com/facebookresearch/xformers) | Memory-efficient attention |
113+
114+
</details>

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
"filelock",
103103
"flax>=0.4.1",
104104
"hf-doc-builder>=0.3.0",
105-
"huggingface-hub>=0.34.0",
105+
"httpx<1.0.0",
106+
"huggingface-hub>=0.34.0,<2.0",
106107
"requests-mock==1.10.0",
107108
"importlib_metadata",
108109
"invisible-watermark>=0.2.0",
@@ -259,6 +260,7 @@ def run(self):
259260
install_requires = [
260261
deps["importlib_metadata"],
261262
deps["filelock"],
263+
deps["httpx"],
262264
deps["huggingface-hub"],
263265
deps["numpy"],
264266
deps["regex"],

src/diffusers/configuration_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
from huggingface_hub import DDUFEntry, create_repo, hf_hub_download
3131
from huggingface_hub.utils import (
3232
EntryNotFoundError,
33+
HfHubHTTPError,
3334
RepositoryNotFoundError,
3435
RevisionNotFoundError,
3536
validate_hf_hub_args,
3637
)
37-
from requests import HTTPError
3838
from typing_extensions import Self
3939

4040
from . import __version__
@@ -419,7 +419,7 @@ def load_config(
419419
raise EnvironmentError(
420420
f"{pretrained_model_name_or_path} does not appear to have a file named {cls.config_name}."
421421
)
422-
except HTTPError as err:
422+
except HfHubHTTPError as err:
423423
raise EnvironmentError(
424424
"There was a specific connection error when trying to load"
425425
f" {pretrained_model_name_or_path}:\n{err}"

src/diffusers/dependency_versions_table.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"filelock": "filelock",
1010
"flax": "flax>=0.4.1",
1111
"hf-doc-builder": "hf-doc-builder>=0.3.0",
12-
"huggingface-hub": "huggingface-hub>=0.34.0",
12+
"httpx": "httpx<1.0.0",
13+
"huggingface-hub": "huggingface-hub>=0.34.0,<2.0",
1314
"requests-mock": "requests-mock==1.10.0",
1415
"importlib_metadata": "importlib_metadata",
1516
"invisible-watermark": "invisible-watermark>=0.2.0",

0 commit comments

Comments
 (0)