GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Resync with upstream master-1056 (packed INT4 convrot, MiniMax-H3 QKV chunking, RelayVSR, SDXL ControlNet Union) by danielhanchen · Pull Request #54 · unslothai/stable-diffusion.cpp Conversation
|
| leg | builds | head bundle | SD1.5 F16 | SD1.5 Q8_0 | SD1.5 Q3_K | Z-Image Q2_K |
|---|---|---|---|---|---|---|
| Linux x86_64 (ubuntu-22.04) | ok / ok | 38.5 MiB | identical, 11.29 / 11.25 | identical, 10.84 / 10.90 | identical, 12.64 / 12.64 | identical, 13.79 / 13.93 |
| Linux x86_64 (ubuntu-latest) | ok / ok | 39.2 MiB | identical, 19.28 / 19.25 | identical, 18.98 / 19.15 | identical, 21.44 / 21.41 | identical, 33.51 / 33.48 |
| Linux aarch64 | ok / ok | 35.6 MiB | identical, 16.62 / 16.66 | identical, 13.94 / 13.95 | identical, 21.02 / 20.93 | identical, 68.59 / 68.61 |
| Linux x86_64 Vulkan build, CPU backend | ok / ok | 58.1 MiB | identical, 16.59 / 16.58 | identical, 16.42 / 16.45 | identical, 18.19 / 18.16 | identical, 27.44 / 27.73 |
| macOS arm64 (Metal build) | ok / ok | 33.2 MiB | identical, 36.85 / 35.54 | identical, 26.27 / 25.25 | identical, 25.54 / 25.09 | identical, 48.65 / 47.83 |
| macOS x86_64 | ok / ok | 39.1 MiB | identical, 73.98 / 60.93 | identical, 49.38 / 40.90 | identical, 33.86 / 28.63 | identical, 65.45 / 51.70 |
| Windows x64 | ok / ok | 31.9 MiB | identical, 19.86 / 19.95 | identical, 20.73 / 20.82 | identical, 24.09 / 24.16 | identical, 35.25 / 35.37 |
| Windows x64 Vulkan build, CPU backend | ok / ok | 53.5 MiB | identical, 16.89 / 16.91 | identical, 17.80 / 17.78 | identical, 20.06 / 20.05 | identical, 28.41 / 28.35 |
| Windows arm64 | ok / ok | 31.3 MiB | identical, 19.62 / 12.90 | identical, 10.82 / 11.02 | identical, 16.62 / 16.58 | identical, 58.01 / 56.94 |
Metal on macOS arm64 (SD1.5 F16 at 512x512, 4 steps, 3 reps): pixel-identical; base 92.4 / 140.4 / 96.6 s, branch 93.9 / 131.3 / 119.9 s. The spread within each side (the hosted M1 runner) is wider than the difference between them. In the first pass it was base 134.2 s vs branch 128.1 s (medians). The macOS x86_64 and Windows arm64 runners are noisy as well (base repeats range from 66 to 105 s and from 14 to 23 s); on those runners the branch is never slower than the base range.
The first pass on e7f4838 (before 71bf552) gave the same picture: every leg built, every pair pixel-identical, and the medians within the base repeats.
Base, the plain merge (e7f4838, what upstream ships) and this branch. Seconds per step; base and branch ran twice, the plain merge once.
| model | flash attention | base | plain merge | this branch | branch pixels |
|---|---|---|---|---|---|
| FLUX.1-schnell Q2_K | auto (on) | 6.97 / 6.81 | 6.80 | 6.78 / 6.92 | identical to base |
| FLUX.1-schnell Q2_K | off | 8.53 / 8.50 | 35.53 | 8.50 / 8.51 | identical to base |
| Qwen-Image Q2_K | auto (on) | 8.53 / 8.36 | 8.40 (total 57.1 s vs 38.9 s) | 8.40 / 8.46 | identical to base |
| Qwen-Image Q2_K | off | 10.44 / 10.41 | 37.14 | 10.36 / 10.40 | identical to base |
| Z-Image Turbo Q2_K | auto (on) | 5.20 / 5.23 | 5.26 | 5.21 / 5.22 | identical to base |
| Z-Image Turbo Q2_K | off | 5.86 / 5.92 | 22.38 | 5.91 / 5.87 | identical to base |
The plain merge is 3.6x to 4.2x slower per step whenever attention scores are materialised, and its images differ from base because those nodes ran on the CPU. This branch matches base in time and pixels in every cell.
--diffusion-fa)e7f4838; 71bf552 does not touch this model's graph): 640x384x25 frames, 4 steps: base and branch give identical decoded frames, and repeats are identical (sampling 49.1 s on both). Forcing chunks of 512 tokens is also identical. At 1024x576x97 frames (18798 tokens) the branch chunks on its own (QKV projection of 18798 tokens runs in chunks of 12483 tokens) and renders frames identical to base, 293 s vs 296 s sampling. Base did not crash at this size; the [Bug] MiniMax-H3 on Vulkan: SIGSEGV in ggml_vk_tensor_subbuffer (ggml_vk_mul) at 1024x1024x192 frames, after #2257 leejet/stable-diffusion.cpp#2275 crash needs a tensor past 4 GiB (1024x1024x192), which was not run.SD_H3_FAST_QKV=0 is identical to the fast path. Forced chunks of 384 and 1024 tokens are identical. Chunks of 256 and 128 differ (PSNR 26.9 / 28.7 dB on this 4-step Q2_K render), and a rounding-only change with no chunking (cuBLAS F32 compute type, or a build that sends every matmul to cuBLAS) moves the output by the same amount (28.9 / 28.3 dB). In the all-cuBLAS build, chunks of 256 are bit-identical, and with the DiT on CPU, chunks of 256 and 128 are bit-identical to unchunked and to base. So the difference is the quantized matmul rounding by row count, not the chunked path.JoaoZaokk/Z-Image-Turbo-W4A4-ConvRot and a MiniMax-H3 W4A8 file keep their per-layer formats only in the safetensors header (_quantization_metadata), and the loader reads per-layer quantization config tensors. Both fail with wrong shape in model metadata on base and on this branch.GGML_CUDA_W4_FORCE_DP4A=1) and on CPU (256x256, about 1200 s per step on 2 threads, so the CPU path is a fallback, not a fast path). MiniMax-H3 W4A8 renders a coherent clip on A100. Base cannot load the converted W4A4 file (W4A8 was not tried on base).c3d6fd5)Tiny safetensors fixtures (2 x 256 packed weights, same bytes in every file), only the config JSON differs. Loader output from read_safetensors_file, then a CPU W4A4 matmul on the loaded tensor (ggml_mul_mat_w4_convrot), before (04e9eb0) and after (c3d6fd5):
| config | before | after |
|---|---|---|
W4A4, top-level convrot_groupsize: 64 |
H64, output [1304.126, -26.906] | H64, output [1304.126, -26.906] |
W4A4, params.convrot_groupsize: 64 |
H256, output [1557.206, 355.765] | H64, output [1304.126, -26.906] |
| W4A4, no group size | H256 | H256 |
W4A4, top level 64 and params 16 |
H64 | H64 (top level wins) |
| W4A8, top-level rotation 64 and group 16 | loads, H64 | loads, H64 |
W4A8, both under params |
rejected | loads, H64 |
| W4A8, no settings | rejected | loads, H256, group 16 |
W4A8, params.group_size: 32 |
rejected | rejected (only group 16 is supported) |
W4A8, top-level 32 and params 16 |
rejected | rejected (top level wins) |
Every top-level config gives the same result before and after; only the nested and default cases change.
package_bundle.py packages it.e7f4838: Linux CUDA 12 and CUDA 13 pass. Windows CUDA 12 and CUDA 13 compile and link sd-cli / sd-server, then stop at the signing check because the staging repository has no signing secrets.71bf552 itself; it changes two small C++ hunks that the CPU, Vulkan and Metal legs compile.pre-allocated tensor ... in a buffer ... that cannot run the operation), so those cells are missing from the table. SD1.5 on Metal is pixel-identical.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: noctrex <[email protected]>
Conflicts: src/model/common/ggml_block.hpp keeps upstream's packed INT4 weight shape and the fork's matmul-only tag for quantized weights. src/model/diffusion/minimax_h3.hpp takes upstream's chunked QKV projection and keeps the fork's packed head-major fast path whenever the projection is not chunked.
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…p the in-place RMSNorm multiply Upstream leejet#2286 moves a node to the CPU when it or an input is larger than the buffer type's max size. On Vulkan that is the 1 GiB suballocation block, not a device limit, so Flux attention at 1024x1024 ran on the CPU (leejet#2291). The threshold is now at least 4 GiB - 1 on Vulkan, the largest range a storage buffer binding can address. RMSNorm goes back to the in-place multiply: ggml patch 0013 already runs in-place ops on the backend that owns the output.
…for other backends The runner gate from upstream leejet#2286 compares a node and its inputs with the buffer type's max size. On Vulkan that is the suballocation block, and the 4 GiB floor added for leejet#2291 still overrode ggml-vulkan's own check, which accepts tensors up to max_buffer_size and past maxStorageBufferRange with 64-bit indexing. Vulkan nodes now go by supports_op alone, as before leejet#2286; the QKV chunking and the gate for other backends stay.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@codex review |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…nslothai#17459) ## Summary Moves Studio's stable-diffusion.cpp prebuilt from `master-982-0518b34-uba6ac30` to `master-982-0518b34-ueb0e729`, the release built from fork master `eb0e729`. That is 36 fork commits on top of the current pin. The tag keeps the `master-982` prefix because the fork's release naming still counts from its last upstream release tag. What the new build brings: - Upstream resync to `master-1056` (unslothai/stable-diffusion.cpp#54): packed INT4 convrot, MiniMax-H3 QKV chunking, RelayVSR, SDXL ControlNet Union. Also Cosmos3-Nano-Sim-Transfer video-to-video (unslothai#53). - x86 CPU: llamafile tinyBLAS GEMM for Q8_0 (unslothai#42), F16 / BF16 (unslothai#47) and Q4_1 / Q5_0 / Q5_1 (unslothai#56) weights; an int8 tiled GEMM for Q8_0 / Q4_0 / Q4_1 / Q5_0 / Q5_1 / IQ4_NL (unslothai#76); AVX512 kernels on Intel and a faster direct convolution by default (unslothai#36, unslothai#70); Q4_K / Q2_K kept on the tiled matmul on AMD (unslothai#57); Q5_0 / Q5_1 / Q4_1 through the Q8_0 GEMM at diffusion batch sizes (unslothai#74); tiled flash attention and SIMD max fixes (unslothai#66, unslothai#68, unslothai#62). - aarch64 CPU: ik_llama.cpp GEMM kernels for K-quant and I-quant weights (unslothai#48, unslothai#75), a NEON + i8mm variant for 128-bit SVE cores (unslothai#58), SVE flash attention on the NEON path (unslothai#69), a 4x4 flash attention register tile (unslothai#67). - Metal: long graphs spread over more command buffers so the GPU watchdog does not fire (unslothai#44), a coalesced im2col kernel (unslothai#45), flash attention `auto` now means on without the timing probe (unslothai#46). - Vulkan: RMS norm for short rows (unslothai#37), direct convolution chosen by an output check instead of a timing race (unslothai#38), no host-buffer import on AMD and MoltenVK (unslothai#60). - HIP: bf16 WMMA operands for gfx11 / gfx12 (unslothai#59), FP32 accumulators in the tile flash attention kernel (unslothai#61). - CUDA: the Q8_1 block sum is computed from the quantized values, which lowers matmul error for Q4_1 / Q5_1 / Q4_K / Q5_K / Q2_K weights (unslothai#63); BF16 cuBLAS for large Q8_0 matmuls on A100, Hopper and datacenter Blackwell (unslothai#39). - Memory: the conditioning cache keeps entries across output sizes and denoiser-only LoRA changes (unslothai#71); auto-fit charges unified-memory devices against the RAM budget (unslothai#73, `SD_AUTOFIT_UMA=0` disables); CPU-resident text-encoder weights are released when the next phase would not fit (unslothai#72, `SD_TE_RELEASE=0` disables); `--mmap` repacks only what the CPU repacks (unslothai#43); Qwen Image 2.1 prefix cache concatenated in F16 (unslothai#64). - Packaging: bundles are smaller (unslothai#41; the Linux CPU bundle is 38.4 to 26.0 MiB, Linux CUDA 12 is 368.5 to 338.3 MiB, Linux Vulkan is 57.9 to 30.5 MiB), the Linux CPU bundles are run on emulated CPUs before shipping (unslothai#49), and there is a new native Windows arm64 CPU bundle (unslothai#55). ## Changes - `studio/install_sd_cpp_prebuilt.py`: `DEFAULT_TAG` now names the new release. - Tests that pin the release name and its asset list now point at the new tag. `test_sd_cpp_args.py` keeps the old pin in its list of builds that support `--mmap`. - The pinned asset lists gain `win-cpu-arm64`, with a test that a Windows ARM64 host gets that bundle for `auto` / `cpu` while an x64 host keeps `win-cpu-x64`, and that ARM64 with `cuda` or `vulkan` still gets no match. No Studio code changes. The existing selector already filters Windows bundles by host architecture, so a Windows arm64 host, which today finds no bundle in the pinned release and falls through to the upstream fallback, now installs the native arm64 CPU build. An x64 Python running under emulation on Windows arm64 reports `AMD64` and keeps the x64 bundle, as before. No option was removed from `sd-cli --help` or `sd-server --help`; the new build only adds `--control-type`, `--input-frames`, `--upscale-factor` and `--vsr-window-size`. ## Testing - The sd.cpp, args, families, install, pin upgrade and download retry tests pass (1406 passed). One test and one fixture error fail on main and on this branch alike on this host, because its huggingface_hub is older than the installed diffusers expects: `test_create_causal_mask_patch_is_self_disabling_and_idempotent` and `test_selection_installs_the_cuda_build`. - Asset names: every bundle the selector can return was enumerated over Linux x86_64 / aarch64, Windows AMD64 / ARM64 and macOS arm64 / x86_64, with `auto`, `cpu`, `cuda` (no major, 12, 13), `vulkan` and `rocm`, against the real asset list of the new release. Every returned name exists in the release. The only change from the current pin is Windows ARM64 `auto` / `cpu`, which goes from no match to `win-cpu-arm64`. - SD1.5 (`v1-5-pruned-emaonly`), 512x512, 8 steps on CPU and 20 steps on CUDA, euler, cfg 7, seed 42, both builds on the same machine. Each arm repeated two or three times; every repeat was pixel-identical to the first run of its arm. LPIPS is AlexNet. Linux x86_64 CPU bundle, Xeon Platinum 8559C, 32 threads, wall time per image: | Weights | current pin | this branch | old vs new LPIPS | max pixel diff | | --- | --- | --- | --- | --- | | f16 | 34.8 / 34.8 s | 16.4 / 17.2 s | 0.0001 | 13 | | q8_0 | 31.3 / 32.4 s | 15.7 / 15.2 s | 0.007 | 118 | | q4_K | 35.5 / 35.0 s | 18.7 / 19.0 s | 0.023 | 211 | VAE decode alone went from 10 to 12 s down to 3.6 to 3.7 s. The quantized CPU renders are not bit-identical to the current pin, but they stay as close to the f16 render as before (q8_0 LPIPS to f16: 0.038 old, 0.046 new; q4_K: 0.163 old, 0.173 new). Linux CUDA 12 bundle, Colab L4, wall time per image: | Weights | current pin | this branch | old vs new LPIPS | max pixel diff | | --- | --- | --- | --- | --- | | f16 | 4.70 / 4.70 / 4.71 s | 4.70 / 4.91 / 4.73 s | 0 | 0 | | q8_0 | 7.42 / 4.92 / 4.90 s | 4.94 / 4.93 / 4.93 s | 0 | 0 | | q4_1 | 18.13 / 17.97 / 17.94 s | 18.02 / 17.97 / 18.01 s | 0.025 | 198 | | q4_K | 19.14 / 17.63 / 17.79 s | 17.74 / 17.63 / 17.61 s | 0.106 | 253 | The current pin's first q8_0 run includes a cold start. f16 and q8_0 are pixel-identical. q4_K moves, as the Q8_1 fix intends, and moves toward the f16 render: LPIPS to f16 drops from 0.240 to 0.176 (q4_1: 0.327 to 0.322). ## Not covered - macOS (Metal) and Windows were not run on hardware yet; the cross-platform staging legs (Ubuntu, macOS 15, Windows) are still to run. - The new Windows arm64 bundle is covered only by the selector test and the asset check. No Windows arm64 host ran it. - No Vulkan, ROCm or HIP render with this build, no aarch64 Linux render, and no Studio HTTP flow run (only `sd-cli` directly). - No MiniMax-H3, MOSS-Image, Qwen-Image or FLUX.2 render with this build; only SD1.5. - CPU timings are from a shared host (both arms ran back to back with the same thread count), and the CUDA timings come from one L4 VM, three runs per arm. No T4 run.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Vulkan: Flux sampling ~6x slower since b1f5a51 (#2286 QKV chunking) - bisected across official release builds, SDXL unaffected
There was an error while loading. Please reload this page.