Skip to content

feat: add automatic direct convolution selection - #2134

Merged
leejet merged 1 commit into
masterfrom
feat/conv-direct-auto
Oct 13, 2026
Merged

leejet merged 1 commit into
masterfrom
feat/conv-direct-auto

Conversation

@leejet

@leejet leejet commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add --conv-direct on|off|auto and conv_direct_mode with per-module overrides for diffusion, VAE, and ControlNet.
  • Automatically enable supported implicit GEMM paths using capability probes without benchmarking. Cache 2D/3D decisions per backend and log selection reasons.
  • Deprecate the legacy convolution flags while preserving compatibility, and document the new behavior.

Related Issue / Discussion

N/A

Additional Information

N/A

Checklist

Summary by CodeRabbit

  • New Features
    • Added a --conv-direct on|off|auto setting, with optional per-module overrides for diffusion, VAE, and ControlNet.
    • In auto mode, direct convolution is enabled only when the runtime backend supports it. Mixed backend support is reported, and legacy convolution flags are honored when the new setting is unset.
  • Documentation
    • Updated backend and CLI guides with the new setting, defaults, supported modules, and backend behavior.
  • Compatibility
    • Legacy convolution flags remain available but now produce deprecation warnings.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 751ebaa4-e885-4475-bf28-6a31165607d0
📥 Commits

Reviewing files that changed from the base of the PR and between d763dae and 1b4c27f.

📒 Files selected for processing (15)
  • docs/backend.md
  • docs/backend_probe.md
  • examples/cli/README.md
  • examples/common/common.cpp
  • examples/common/common.h
  • include/stable-diffusion.h
  • src/core/ggml_extend_backend.cpp
  • src/core/ggml_extend_backend.h
  • src/core/probe/conv_direct.cpp
  • src/core/probe/conv_direct.h
  • src/model_manager.cpp
  • src/pipeline/diffusion_engine.cpp
  • src/pipeline/diffusion_engine.h
  • src/pipeline/model_builders.cpp
  • src/stable-diffusion.cpp
 ___________________________
< Clippy has nothing on me. >
 ---------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@leejet
leejet merged commit 46362fc into master Oct 13, 2026
10 of 11 checks passed
@leejet
leejet deleted the feat/conv-direct-auto branch October 13, 2026 15:35
Filve pushed a commit to Filve/diffusione-in-tempo-reale that referenced this pull request Oct 18, 2026
…to_claude

Brings in the 20 upstream commits since 2988060 (2026-10-11): per-module
automatic flash attention (leejet#2132), automatic direct convolution (leejet#2134,
leejet#2141), reclaim before trusting wrapped Vulkan iGPU memory estimates
(leejet#2124), UTF-8 file paths on Windows (leejet#2144, leejet#2145), FP8 CPU crash fix
(leejet#2140), the ggml sync to dc99877 (leejet#2147), FLUX.3 Klein, MOSS-Image, the
MoSR upscaler, MiniMax-H3 LoRAs, Qwen Image 2.1 Turbo preset, ROCm and
MUSA Dockerfiles, documentation.

Conflicts resolved, keeping both sides:

- include/stable-diffusion.h: upstream's flash_attn_mode and
  conv_direct_mode stay right after conditioning_cache_size, so the
  layout up to there is still upstream's; memory_guard,
  disable_backend_fallback and multi_gpu follow.
- src/core/ggml_extend_backend.cpp: upstream's new cuda_compiled_arch()
  keeps asking the compute capability through sd::cuda_driver (the driver
  is looked up at run time, so the engine starts where there is no NVIDIA
  driver), not through <cuda.h>; the HIP include from upstream is kept.
- src/model_manager.cpp: the CPU memory guard and upstream's
  requires_reclamation rule are both applied: a Vulkan iGPU estimate that
  wrapped is reclaimed before it is trusted, and the guard still decides
  for the CPU backend.
- src/model_loader.cpp: includes of both sides; load_worker keeps the
  file handle pool and the open retry.
- examples/server/runtime.cpp: --degradation-cooldown check and
  upstream's u8path for the --serve-html-path check.
- docs/backend.md: the "Several GPUs" section and upstream's "Direct
  convolution" and "Flash attention" sections.

The ggml submodule moves from d25b121 to dc99877 (upstream's pin).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhZzDBkuuMp1jBf4WtEySC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant