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 — perf: reduce CUDA launch overhead in H3 VAE encoding by losewayy · Pull Request #2369 · leejet/stable-diffusion.cpp Conversation
|
| Before | After | |
|---|---|---|
| Reference-image encoding | 19.15 s | 3.04 s |
| Total time, including startup and saving | 80.17 s | 62.44 s |
Encoding is 6.3× faster; total time drops by 22%. Both optimized runs produce the same pixels as the baseline. A separate Nsight Systems capture shows encoder CONCAT launches dropping from 1,375,080 to 72,240.
Also checked CausalConv3d with one- and five-frame inputs on CPU and CUDA. On each backend, the original and modified code produce exactly the same values. The CUDA Release build, changed-line formatting check, and git diff --check pass.
The change is in the shared H3 encoder, also used for video and by Sol-H3-VAE. Full video generation, Metal, and Vulkan were not tested.
The initial change above optimizes CausalConv3d. Downsample3D also pads the right and bottom edges, so this PR now applies the same layout change there.
Measured separately against 3fdcce8, which already includes the CausalConv3d optimization, using the same model, reference image, output size, steps, CFG, and seed listed above, with CPU RNG and a 7.5 GiB VRAM budget. Two runs per version were interleaved in separate processes:
| Before | After | |
|---|---|---|
| Reference-image encoding | 2.94 s | 2.12 s |
This further reduces encoding time by 27.9%, saving 0.82 s. All four generated images are pixel-identical. These are separate measurements from the initial comparison above. End-to-end time varied with offload and memory pressure, so no additional end-to-end speedup is claimed.
Downsample3D checks with single- and multi-frame inputs, including non-contiguous inputs, produce exactly the same values before and after the change on each backend separately (CPU and CUDA). The CUDA Release build, changed-line formatting checks, and git diff --check pass.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…art 1) The last step towards upstream master comes in three parts. This first one takes the commits before the Diffusion Graph Language rewrite: - two unused ggml compat functions removed, so the library links against a shared libggml 1.0.0 (leejet#2363); - asym_w4a8_int8 defaults to group size 16, as in ComfyUI (leejet#2388); - batched spatial padding in the Hunyuan causal convolutions (leejet#2374) and fewer CUDA launches in the H3 VAE encoder (leejet#2369); - documentation: Windows ROCm 0xC0000135, Off Grid AI, the server's browser notification (leejet#2356, leejet#2372, leejet#2318). The merge is clean; no fork code changes. Verified with a CPU build: the library, sd-cli and sd-server build, and all nine unit-test programs pass. Claude-Session: https://claude.ai/code/session_01EhZzDBkuuMp1jBf4WtEySC
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.