Skip to content

[docs] typo : corrected 'compile regions' to 'compile_regions' #12199

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Manith-Ratnayake
Copy link

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
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.

1 participant