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(moss): reuse shared modulation slices by mirek190 · Pull Request #2208 · leejet/stable-diffusion.cpp Conversation
|
| Application | Native generation (s) | Denoising s/step | Peak VRAM (GiB) |
|---|---|---|---|
| Unmodified application (pinned ggml), two-run mean | 17.925 | 1.7345 | 17.04 |
| modulation only | 18.00 | 1.742 | 17.04 |
| Application | Native generation (s) | Denoising s/step | Peak VRAM (GiB) |
|---|---|---|---|
| Unmodified application (companion ggml), two-run mean | 16.025 | 1.5450 | 17.04 |
| modulation only | 14.91 | 1.433 | 17.04 |
A synthetic 42-layer graph with 3x2 image latents and 11 text tokens reduced shared-modulation slices from 252 to 6 and total nodes from 2910 to 2418. This is a graph-structure result, not the node count of the measured CUDA image graph.
RTX 3090 (SM86), Windows, CUDA 12.4; MOSS-Image-SFT-Q8_0.gguf, Qwen3.5-9B-Q8_0.gguf, FLUX.2 VAE and external tokenizer; 1024x1024, 10 Euler steps, CFG 3, flow shift 5, seed 42, empty negative prompt and batch 1. Flash Attention and automatic placement enabled; SageAttention, CUDA Graphs, profiling and conditioning cache disabled.
Every case used a fresh server process, one warmup and one timed image. Each unmodified-application baseline was tested in two processes; each candidate in one. Native generation excludes startup and HTTP/PNG transfer. Denoising time is divided by ten. These samples do not establish statistical confidence; small timing differences are not claimed as speedups. Device-wide peak VRAM was sampled every 100 ms. Clocks and power settings were not changed.
All generated RGB pixels for this patch match the unmodified CUDA reference: zero changed pixels and zero maximum channel error. This establishes equality for the tested prompt/settings, not every model, GPU, seed, shape or offload configuration. No new Vulkan inference, multi-GPU, other-model or full regression testing is claimed. Local tests, model weights and binaries are excluded from the patch.
Prompt: A Victorian portrait of a closeup Scottish 60 years old man in a kilt, mountain nature and blue sky, sharp focus, DSLR, Fujifilm XT3, full body visible.
Application base: 95ff76230889898e1bf40058ba272a3699b50dc6. Pinned ggml: a5915eb0e47adef21c3f25b889a008925ea838c2. Companion backend, where used: 2b1e3ee0d46213cbaa901d3f97008fc14013c9ff.
Published as an independent split of #2201. The branch was merge-checked against master a85db96aa5ce2c72bd5aec326f6c5c857839a50a; the generation measurements above remain based on 95ff76230889898e1bf40058ba272a3699b50dc6. No additional images were generated for publication.
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 |
|---|---|
Block modulation interface src/model/diffusion/moss_image.hpp |
Block::forward accepts an array of six modulation tensors and uses each entry. |
Model modulation flow src/model/diffusion/moss_image.hpp, docs/moss_image.md |
Model::forward slices the shared modulation tensor, expands each slice into the graph when a graph is present, and passes the array to non-skipped blocks. The runner obtains its context with get_context(gf). The documentation describes the reuse and states that values and consuming arithmetic remain unchanged. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor
Possibly related PRs
Suggested reviewers: leejet
f7877No actionable merge-blocking risk is established for this change.
Explanation
The title "perf(moss): reuse shared modulation slices" names the main change: the model builds six shared modulation slices once per forward graph and reuses them across diffusion blocks. It is short, specific, and matches the changeset in moss_image.hpp and the docs note. It omits the benchmark context, which is not needed for a title.
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. Analyzed 4 functions across 1 files. (1 skipped: 1 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.
| <img src="../assets/moss/sft.png" /> | ||
|
|
||
| Use dimensions divisible by 16. The default discrete scheduler uses the upstream time shift of 5. Use `--flow-shift` to override it. The negative CFG branch skips DiT layer 22 (zero-based), matching the upstream pipeline. | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The changes to the documentation should be removed, as they are unnecessary.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
done
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.