Skip to content

Conversation

Manith-Ratnayake
Copy link
Contributor

What does this PR do?

Fixes a small typo in the documentation example
(Source: https://huggingface.co/docs/diffusers/en/optimization/fp16)

# pip install -U accelerate
import torch
from diffusers import StableDiffusionXLPipeline
from accelerate.utils import compile regions

pipeline = StableDiffusionXLPipeline.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16
).to("cuda")
pipeline.unet = compile_regions(pipeline.unet, mode="reduce-overhead", fullgraph=True)

There is a small typo in this line

from accelerate.utils import compile regions

I added an underscore between the word compile and regions to fix it

from accelerate.utils import compile_regions

This makes the import syntax correct and allows the example to run properly.

pipeline.unet = compile_regions(pipeline.unet, mode="reduce-overhead", fullgraph=True)

@Manith-Ratnayake Manith-Ratnayake changed the title [docs] typo : corrected 'compile regions' to 'compile_region' [docs] typo : corrected 'compile regions' to 'compile_regions' Aug 20, 2025
@Manith-Ratnayake Manith-Ratnayake force-pushed the fix/docs-compile-regions-typo branch from d8555aa to d519a3c Compare August 20, 2025 14:15
Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@stevhliu stevhliu merged commit 8f8888a into huggingface:main Aug 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants