Skip to content

[core] fa4 support.#13280

Merged
sayakpaul merged 6 commits intomainfrom
fa4
Mar 20, 2026
Merged

[core] fa4 support.#13280
sayakpaul merged 6 commits intomainfrom
fa4

Conversation

@sayakpaul
Copy link
Copy Markdown
Member

@sayakpaul sayakpaul commented Mar 18, 2026

What does this PR do?

Needs kernels to be installed from source for testing. Users might have to update nvidia-cutlass-dsl (or might even do a --force-reinstall).

In this PR, we're just supporting the bare minimum inference support. CP support can be shipped in a subsequent PR.

However, there's an error on H100. Code:

from diffusers import DiffusionPipeline 
import torch 

CKPT_ID = "black-forest-labs/FLUX.1-dev"

pipe = DiffusionPipeline.from_pretrained(
    CKPT_ID, torch_dtype=torch.bfloat16,
).to("cuda")
pipe.transformer.set_attention_backend("flash_4_hub")

prompt = """
cinematic film still of a cat sipping a margarita in a pool in Palm Springs, California
highly detailed, high budget hollywood movie, cinemascope, moody, epic, gorgeous, film grain
"""

image = pipe(
    prompt,
    guidance_scale=3.5,
    num_inference_steps=50,
    generator=torch.manual_seed(0),
).images[0]
image.save("fa4.png")
image

Cc: @danieldk

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

@sayakpaul sayakpaul requested a review from DN6 March 18, 2026 09:53
@sayakpaul sayakpaul marked this pull request as ready for review March 18, 2026 09:53
@sayakpaul sayakpaul changed the title [WIP] [core] fa4 support. [core] fa4 support. Mar 18, 2026
@sayakpaul sayakpaul merged commit 0b35834 into main Mar 20, 2026
11 of 12 checks passed
@sayakpaul sayakpaul deleted the fa4 branch March 20, 2026 11:59
terarachang pushed a commit to terarachang/diffusers that referenced this pull request Apr 30, 2026
* start fa4 support.

* up

* specify minimum version
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