fix: Add NVIDIA Blackwell (RTX 50xx, sm_120) GPU support#4155
Open
Hasham-dev wants to merge 1 commit into
Open
fix: Add NVIDIA Blackwell (RTX 50xx, sm_120) GPU support#4155Hasham-dev wants to merge 1 commit into
Hasham-dev wants to merge 1 commit into
Conversation
- Use bfloat16 dtype for UNet on Blackwell GPUs (compute major >= 12) which have native bf16 tensor core support - Skip manual_cast for bfloat16 weights to avoid unnecessary casting - Fix numpy TypeError with bfloat16 tensors in patch.py and ip_adapter.py by converting to float32 before .numpy() calls Tested on RTX 5070 (sm_120, CUDA 12.8) with PyTorch nightly (cu128). Generates images at ~3.2 it/s including Image Prompt (IP-Adapter) mode. Fixes lllyasviel#3862, lllyasviel#4123, lllyasviel#4141
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Minimal fixes to support NVIDIA Blackwell architecture GPUs (RTX 5050/5060/5070/5080/5090, compute capability sm_120) on Fooocus.
modules/patch.pyandextras/ip_adapter.py— numpy doesn't support bf16, so we convert to float32 before.numpy()callsChanges (3 files, +13 -2 lines)
ldm_patched/modules/model_management.pymodules/patch.pypatched_unet_forwardextras/ip_adapter.pyTesting
madebyollin/sdxl-vae-fp16-fixVAE for stable bf16 decoding (the default SDXL VAE overflows in bf16)Fixes
Prerequisites
Users with Blackwell GPUs need PyTorch nightly with CUDA 12.8 support: