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: accelerate INT8 diffusion inference with CUDA fusions by leejet · Pull Request #2235 · leejet/stable-diffusion.cpp Conversation
|
| Model | DiT file |
|---|---|
| Qwen Image 2.1 | qwen_image_2.1_int8_convrot.safetensors |
| Krea2 Turbo | krea2_turbo_int8_convrot.safetensors |
Sampling throughput in it/s; higher is better:
| Model | Resolution | sd.cpp before | sd.cpp after | ComfyUI |
|---|---|---|---|---|
| Qwen Image 2.1 | 512×512 | 10.16 | 19.81 | 13.93 |
| Qwen Image 2.1 | 1024×1024 | 2.13 | 5.04 | 4.98 |
| Krea2 Turbo | 512×512 | 7.55 | 11.19 | 9.94 |
| Krea2 Turbo | 1024×1024 | 1.75 | 2.88 | 2.27 |
Configuration:
a lovely cat holding a sign says 'stable-diffusion.cpp'cdf272f351, PyTorch 2.13.0+cu130, comfy-kitchen 0.2.40, PyTorch attention.be486498eadc29dc3cd234d944c2180ed42b1415.Measurements aggregate three runs after excluding the first two steps. Throughput is the reciprocal of mean step latency. ComfyUI receives one additional warmup run per resolution.
Measurements exclude model loading, text encoding, VAE decoding, and image saving. ComfyUI is measured through direct sampling calls, not full workflow execution. Running the full workflow in ComfyUI would be slightly slower.
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.
|
| Layer / File(s) | Summary |
|---|---|
Workspace measurement and allocation src/core/compute_workspace.h, src/core/compute_workspace.cpp |
ComputeWorkspace removes direct gallocr allocation and uses the backend scheduler for graph measurement, allocation, and release. |
Runner execution and compute context src/core/ggml_runner.h, src/core/ggml_runner.cpp |
GGMLRunner measures without direct-buffer estimates, executes segments through the scheduler, and reuses an aligned compute-context buffer. |
Qwen Image 2.1 graph construction
| Layer / File(s) | Summary |
|---|---|
Modulation and MLP graph operations src/model/diffusion/qwen_image_2_1.hpp |
Modulation handles zero and nonzero prefix lengths separately. The MLP paths use ggml_swiglu and ggml_swiglu_split. |
CUDA and repository build setup
| Layer / File(s) | Summary |
|---|---|
Submodule and CUTLASS build instructions docs/build.md, ggml |
The build guide documents recursive submodule operations and CUTLASS configuration. The ggml submodule reference changes. |
CUDA container packaging and instructions docker/Dockerfile.cuda, .github/workflows/build.yml, docs/docker.md, .dockerignore, .gitignore |
CUDA container stages use non-cuDNN images, and CUDA packaging copies the CUTLASS license. Docker instructions cover submodule setup and CUDA build and runtime options. Ignore rules exclude tests/ and logs/. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
sequenceDiagram
participant GGMLRunner
participant ComputeWorkspace
participant BackendScheduler
GGMLRunner->>ComputeWorkspace: measure graph
ComputeWorkspace->>BackendScheduler: reserve scheduler sizes
GGMLRunner->>BackendScheduler: allocate and execute graph
Possibly related issues
leejet/stable-diffusion.cpp#2225 — The PR changes scheduler-based graph execution on a split-device CUDA path, but does not establish a fix for the reported illegal memory access.leejet/stable-diffusion.cpp#2193 — The PR changes Qwen Image 2.1 graph construction, but does not establish a fix for the reported Vulkan artifacts.leejet/stable-diffusion.cpp#2169 — The PR changes scheduler-based workspace measurement and execution, but does not change the reported HIP device-selection mechanism.Suggested reviewers: noctrex, nauscar, robertosw
ce7e2No concrete issue in the graph execution, Qwen graph, or build changes is established that should block merging after normal checks.
Explanation
The title "perf: accelerate INT8 diffusion inference with CUDA fusions" matches the main change. The PR adds CUTLASS INT8 GEMM kernels with fused operations, fuses ConvRot quantization and related ops, adds a CuTe flash attention path, and moves workspace allocation onto the ggml scheduler. The title captures the performance goal and the CUDA fusion focus. It does not mention the scheduler refactor, CUTLASS submodule, or Docker changes, which is acceptable because the title need not list every detail.
Explanation
The description follows the template. It has a Summary section that states the purpose and lists the changes. It has a Related Issue / Discussion section that says N/A. It has an Additional Information section with detailed benchmark data, hardware, configuration, and methodology. The Checklist is present and checked. The template has no dedicated Performance heading, but the Performance subsection sits under Additional Information, which the template allows for verification notes.
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 14 functions across 5 files. (7 skipped: 7 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
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.