Commit Graph

14093 Commits

Author SHA1 Message Date
Vladimir Mandic 8c0cd148be fix seedvr-7b
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-19 12:07:34 +02:00
Vladimir Mandic c39a0ab488 clean and propagate tracebacks to ui
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-19 11:54:45 +02:00
Vladimir Mandic bed5a51f8b fix skip processing
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-19 10:52:55 +02:00
Vladimir Mandic 5d989a6cc6 shared repos match multiple
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-19 10:27:18 +02:00
Vladimir Mandic 42cb4cf489 explicit seedvr implementation
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-18 10:35:07 +02:00
CalamitousFelicitousness 5c47e557c4 fix(te): load flux1 sdnq-uint4 t5 from text_encoder_2 subfolder 2026-07-17 19:11:02 +01:00
CalamitousFelicitousness 3022b1686d feat(sdnq): flux.1 and krea 2 geometry for the dequant and block sections
Every dequant shape and block geometry comes from a real transformer config,
one source of truth per model.

- flux.1: attention linears 3072x3072, feed-forward 12288x3072, block at
  3072 wide, 24 heads, 12288 ff, 4608 joint tokens
- krea 2: standalone wq 6144x6144, swiglu gate 16384x6144, block at 6144
  wide, 48 heads, 4608 joint tokens
- the block section measures every geometry in block_geometries; buyback
  costs are judged at the block matching the reference shape, with the
  geometry named in the reason
- te shape lookup keys on its label instead of a list index
2026-07-17 00:57:47 +01:00
CalamitousFelicitousness 5a99f9c128 feat(sdnq): add a krea 2 shape preset to the attention benchmark
Krea 2 runs joint attention over one text plus image stream with a segment
mask: text is padded to a fixed 512 tokens and the padded tail is masked for
queries and keys both, so fully masked query rows yield nan under sdpa. The
preset carries the transformer's exact (B, 1, L, L) mask, nan-guards the
error path the way the model does, and uses the 48 kernel-level heads left
after gqa expansion at 4608 joint tokens.

- fix the drift fields crashing when save_report rebuilt the run info
2026-07-17 00:36:37 +01:00
CalamitousFelicitousness 0610b9c3d5 fix(sdnq): run the full attention config list on every shape preset
Per-preset include lists trimmed video and masked shapes for runtime, which
left the composition check without its smooth_hadamard row there. Only hard
technical exclusions remain, as an exclusion map: sd15 skips hadamard configs
because compiling hadamard with a non pow2 head dim hangs torch inductor.

- wan22, wan22-cfg, ltx2 and masked gain smooth_hadamard, fp16qk, fp8qk and
  fp8full rows; availability gates and the per-config timeout still apply
2026-07-17 00:21:19 +01:00
CalamitousFelicitousness b159daabc9 feat(sdnq): uncertainty-aware recommendations in the attention benchmark
Repeat-pair runs measured 2-4% between-run drift on one machine, enough to
flip threshold verdicts near the margin on every rerun.

- bench keeps its iteration samples: rows carry a median sigma, and per-shape
  sentinel re-measurements sample run-level clock drift
- on/off verdicts are three-zone at the run's own noise level; too close to
  the margin keeps the current setting and says so
- pv candidates (now including fp16) are tested independently against the
  margin at a sidak-adjusted z instead of min-then-threshold
- unmeasured toggle stacks are estimated additively in the composition check
- per-shape qk verdicts print alongside the reference-shape verdict
- cross-gpu error sanity bands flag corrupted measurements
2026-07-17 00:09:13 +01:00
CalamitousFelicitousness f1ae4c2c1e fix(sdnq): tighten attention quantization verdicts in the benchmark
- on/off verdicts share one speed margin (recommend_speed_margin, 10%) across
  attention, dequant, compile, te and conv rows
- re-check the recommended toggle stack against unquantized; individually passing
  buybacks can eat a marginal qk gain
- judge smooth k and hadamard cost at block scope when measured: kernel rows hand
  the prep contiguous q/k/v, real models hand it strided views from the fused qkv
  projection; reasons cite both scopes
- give bare float8 qk its own shot at the margin before disabling, the verdict
  must not hinge on int8 alone
- compare triton flash against the recommended config, not always int8
- note self-attention shapes that disagree with the reference verdict
2026-07-16 23:30:55 +01:00
Vladimir Mandic 61a509a7af upscaler auto-refresh on fail
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-16 14:09:10 +02:00
CalamitousFelicitousness ff658a9358 fix(sdnq): align benchmark recommendations with matmul mode options
- fold the enable rows into the type rows: disabled, enabled or an explicit dtype
- pv keep-unquantized value is disabled; enabled means int8 pv
- add a text encoder row judged at te geometry
- update locale hints, drop the orphaned checkbox hint
2026-07-16 02:42:00 +01:00
CalamitousFelicitousness 129ed76467 fix(test): repair native-transformer suite after sdnq refactors
- patch is_fp8_compile_supported on kernel_wrappers, its new home
- pin sdnq_quantize_matmul_mode instead of the removed checkbox key
2026-07-16 02:41:51 +01:00
CalamitousFelicitousness 068b23d9f0 style(lora): drop duplicated file path from per-load debug logging
The native loader entry log repeated the name and full file path already
printed one line earlier by network_load. Remove it and fold cache-hit
status into the network_load announce line, so a native load emits one
starting line plus the result line instead of three with a duplicated
path.
2026-07-16 01:30:55 +01:00
CalamitousFelicitousness 1b8c94850f fix(lora): load official diffusers-format Krea 2 LoRAs
The Krea 2 transformer keeps checkpoint-style module names while the
official krea/Krea-2-LoRA releases are saved with upstream-diffusers
names, so all 264 modules failed to bind and the LoRAs silently did
nothing. Krea 2 is the only native-LoRA arch with an sdnext-owned
transformer, so its module names diverge from the diffusers ecosystem.

- native_adapter.resolve_group_targets consults the arch resolver first
  for passthrough prefixes, falling back to verbatim binding; a no-op
  for arches that load the diffusers class
- krea2_lora maps diffusers attn/ff/text_fusion/embedder names onto the
  checkpoint module tree; checkpoint-named LoRAs still bind verbatim
- add test/test-krea2-native-adapters.py
2026-07-16 01:30:55 +01:00
Disty0 00231ab035 cleanup 2026-07-15 22:29:28 +03:00
Vladimir Mandic 5409df20a8 cleanup lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-15 20:30:27 +02:00
Disty0 c5c8502257 remove triton kernels from the torch.compile graph 2026-07-15 20:21:56 +03:00
Disty0 943f9c2f57 check pv_matmul_dtype = "enabled" 2026-07-15 19:46:11 +03:00
Vladimir Mandic 7e8309f2d4 cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-15 18:09:33 +02:00
Disty0 75926e6fc4 Remove sdnq_use_quantized_matmul and use sdnq_quantize_matmul_mode instead 2026-07-15 18:45:30 +03:00
Disty0 875d2b060b cleanup 2026-07-15 17:18:19 +03:00
Disty0 923cd01944 update sdnq kernel configs 2026-07-15 17:15:16 +03:00
Vladimir Mandic f4cd3b17d6 cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-15 15:40:56 +02:00
Vladimir Mandic 7214ee9d42 triton/dynamo/inductor cache location and timer stats
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-15 15:06:40 +02:00
Vladimir Mandic 42c2c6382a update torch==2.13.0+cu132
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-15 09:00:36 +02:00
Disty0 d8a29a68ef Update IPEX and ROCm to Torch 2.13 2026-07-15 04:05:26 +03:00
CalamitousFelicitousness 028e892104 feat(caption): warn when qwen3.5 linear attention kernels are missing
Qwen3.5 runs most of its layers as gated delta linear attention. Without
flash-linear-attention, transformers falls back to a per-token torch loop that
runs sequentially over prefill and decode, so a caption takes minutes with no
indication of why.
2026-07-15 01:36:12 +01:00
CalamitousFelicitousness ccb339bf0f feat(caption): add toriigate 0.5
ToriiGate 0.5 is a Qwen3.5 vision fine-tune trained on a single system prompt
and a single query structure, and it degrades on anything else. The shared qwen
handler strips angle brackets and underscores from the question, which mangles
the model's format templates, and the generic caption instructions are not what
it was trained on.

- hold the model's caption formats, system prompt and query builder in modules/caption/toriigate.py
- build the system prompt and user query from those templates in the qwen handler
- offer the native formats in the task dropdown and in the caption api prompt groups
- drop Normal Caption for this model, which has no format between short and long
2026-07-15 01:36:12 +01:00
Disty0 1cf2c9012d add min block size check to sdnq atten 2026-07-15 03:20:43 +03:00
Disty0 3a0094ef62 remove tl.constexpr use 2026-07-15 00:24:13 +03:00
Disty0 d03d0d7dd1 reduce num_stages options in triton atten 2026-07-14 23:48:55 +03:00
Disty0 39d74cca18 Enable Triton MM on all GPUs 2026-07-14 22:21:53 +03:00
Vladimir Mandic 1ec48189ea Merge pull request #4997 from liutyi/dev
Missing covers: Lumina-DiMOO, Anima-1.0-Turbo-sdnq
2026-07-14 19:57:36 +02:00
Disty0 47cb113b75 cleanup sdnq 2026-07-14 20:55:47 +03:00
CalamitousFelicitousness b1c3578b27 feat(sdnq): name the sage kernel the benchmark actually ran
"sage" is a different kernel per gpu: sageattention dispatches the pv dtype and
accumulator by arch and cuda version, and modules/attention.py forces the fp16-pv
cuda kernel on sm86, so one label across shared reports compares unlike kernels.

- resolve the row label from the dispatch: sm89 with cuda 12.8+ reads
  "sage int8 qk + fp8 pv, fp32+fp16 accum", sm86 reads "fp16 pv, fp32 accum"
- name the sm86-only fp16-accum baseline for what it is
2026-07-14 17:40:01 +01:00
CalamitousFelicitousness ce373df6e5 style(sdnq): tighten the benchmark notes
Notes ran to paragraph length and wrapped in the terminal, burying the numbers.

- lead with the topic, keep the numbers and the fix, drop the restatement
- one line per note at 140 columns, except the sd15 compile warning
2026-07-14 17:39:39 +01:00
CalamitousFelicitousness 101ead9536 fix(sdnq): follow the e4m3 upcast in the benchmark dequant path
sdnq no longer skips compile for fp8 storage, it upcasts e4m3 to the scale dtype
before the compiled dequant, so the tool's mirror of the deleted skip_fp8_compile
gate went dead and fed the raw e4m3 weight to its compiled dequant: on pre-ada gpus
that reports a compile failure for rows the webui runs fine.

- mirror the upcast in dequant_args, keep the hardware probe on the raw weight
- drop dequant_gated_to_eager and the gated-to-eager row, fp8 rows are measured now
- say upcast, not eager fallback, in the environment panel and dequant notes
2026-07-14 17:37:41 +01:00
CalamitousFelicitousness 24276d4157 fix(sdnq): keep the attention benchmark alive on a windows console
Hiding the sdnext startup log by pointing fds 1 and 2 at a file kills the process
when stdout is a real console: sys.stdout writes through the win32 console api on
the handle behind fd 1, so the first bootstrap log line raises OSError 'the handle
is invalid', and with stderr broken the same way the interpreter aborts with no
message, no traceback and no results.

- swap sys.stdout/sys.stderr to a buffer along with the fd redirect
- capture the startup log instead of discarding it to devnull, replay it on failure
- catch SystemExit: loader.py and installer.py exit on fatal startup errors
2026-07-14 16:59:55 +01:00
Oleksandr Liutyi 63aa0adfa8 Missing covers: Lumina-DiMOO, Anima-1.0-Turbo-sdnq 2026-07-14 15:33:43 +00:00
Disty0 6dcdbdc86e upcast fp8 weights instead of disable compile 2026-07-14 17:22:37 +03:00
Disty0 0d15fd1f62 upcast fp8 mm to fp16 on unsupported gpus and disable triton mm on alchemist and igpus 2026-07-14 17:16:25 +03:00
Disty0 e2d3ac5159 ipex check last_level_cache_size for l2 cache 2026-07-14 16:00:03 +03:00
Vladimir Mandic 7d9130aef0 update modules
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-14 10:21:34 +02:00
Vladimir Mandic 3dc7167dfd Merge branch 'master' into dev 2026-07-14 10:20:53 +02:00
Vladimir Mandic 20ccf1d358 update changelog/todo/skill
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-14 09:33:03 +02:00
CalamitousFelicitousness 18bbe288b0 fix(lora): apply full-diff norm targets and map z-image's renamed modules
A full-weight extraction on Z-Image bound 308 modules and applied 172 of
them, silently dropping the rest, and left 71 more unmapped.

assign_network_names_to_compvis_modules puts every transformer module in
network_layer_mapping but skips stamping network_layer_name on norms,
which is the attribute the apply pass keys off. try_load_full bound those
modules through the mapping and they then never applied; stamp them
loader-locally, as try_load_norm already does.

Z-Image also names three module groups differently from the diffusers
tree: the qk-norms (q_norm/k_norm vs norm_q/norm_k), and the patch
embedder and final layer, which live in ModuleDicts keyed by
"{patch_size}-{f_patch_size}" and so carry a key the checkpoint has no
notion of. Read that key from the live model rather than hardcoding it.
The counts close exactly: 68 qk-norms plus 3 non-block targets are the 71
that went unmapped.
2026-07-14 08:06:45 +01:00
CalamitousFelicitousness 2cf5a2f207 feat(sdnq): compare quantized matmul backends in a single run
The linear layers bind their scaled-mm function at import, so
SDNQ_USE_TRITON_MM freezes the backend per process and comparing triton
against the torch fallback meant two runs, carrying clock drift into the
delta. --mm-backends rebinds the function on the consuming modules
between benches, so both rows measure the same quantized layer under the
same clock state.

- swap targets are the four linear modules that from-import a scaled-mm
  function; every swap resets dynamo, since the layer forwards are
  compiled and the traced graph pins the previous function
- the torch row is captured from kernel_wrappers rather than
  reimplemented, so it is unavailable where triton is the device default
  (rerun with SDNQ_USE_TRITON_MM=0) and says so
- rounds alternate order and keep the fastest per row, so drift cancels
  instead of favouring whichever backend runs second
- flag output error when backends disagree past 1e-4: they are meant to
  be numerically equivalent
2026-07-14 08:06:45 +01:00
CalamitousFelicitousness 566c58e58c fix(sdnq): probe fp8 attention support without a dynamo disable window
probe_fp8 and the broken-compile bench path forced eager input prep by
toggling torch._dynamo.config.disable. torch 2.13+ raises 'found no
compiled frames' when a fullgraph-compiled function is called inside a
disable window, so the probe failed before reaching the attention kernel
and reported an environment error instead of the kernel's real verdict,
on fp8-capable gpus too. Swap the module-global prep function for its
eager inner instead, matching the correctness section.
2026-07-14 08:06:45 +01:00