Commit Graph

14438 Commits

Author SHA1 Message Date
CalamitousFelicitousness 329d69f5df fix(cli): match module paths the way the loader does
Kohya-style files carry an already-underscored base (lora_unet_layers_0_
mlp_gate_proj), which the loader resolves by comparing network_prefix +
path.replace('.', '_') against each module's stamped name, so both sides
are underscored and the file loads. The analyzer instead looked the base
up as a literal dotted module path, so every module of such a file was
reported unmatched: 76 files in a local collection, including 36 of 57
anima and 5 of 10 chroma.

Fall back to a stamped-name index when the direct lookup misses. Dotted
bases are unaffected.
2026-08-25 00:25:22 +01:00
CalamitousFelicitousness 6ea2c50d5d fix(cli): measure every adapter family in the fidelity analyzer
The analyzer only mapped plain-lora groups, so a file carrying no plain
lora (a pure lokr, for example) analyzed zero modules and fell through to
a 1.0 default: it reported perfect fidelity for exactly the files that
degrade most. Measured on the shipped krea 2 uint4 checkpoint, those
files land between 0.04 and 0.34.

Every targeted module is now rebuilt with the loader's own module class
and its delta read from the production calc_updown, so lokr, loha, oft,
full, ia3, glora, norm and the dora / dense-bias / diff_b variants are
measured as they apply; factor-path eligibility is decided by calling the
loader's own predicate. Modules carrying several families sum their
deltas the way the loader stacks them, and a family the tool cannot
rebuild is reported instead of counting as clean.

- report per-module applied fidelity (1.0 on the factor path, measured
  rho on the requantize path) as a median and an energy-weighted mean
- add --dtype bf16 to measure the unquantized reference rather than
  assert it
- drop the per-module empty_cache: it cost 16ms per module against 1ms
  of reuse, and the caching allocator already reuses the buffers
- keep shard handles open across modules
2026-08-25 00:25:22 +01:00
CalamitousFelicitousness 2fcd99a409 test(lora): cover sdnq config matrix in factor path suite
Checkpoints quantized without hadamard must attach factors unrotated;
checkpoints carrying their own svd correction must keep it under apply
and get the original factors back on remove. Both pinned in both svd
layouts.
2026-08-25 00:25:22 +01:00
CalamitousFelicitousness 9906afae08 feat(cli): lora quantization fidelity analyzer
Offline analyzer for a (model, lora) pair: maps lora modules onto the
transformer, measures per-module delta-to-step ratio and requantize
retention, and reports factor-path eligibility. Loads pre-quantized
sdnq repos or simulates quantization on bf16 repos; supports --json
and --fail-under for scripted checks.
2026-08-25 00:25:22 +01:00
CalamitousFelicitousness 9b37a1535c fix(lora): exact lora application on sdnq-quantized layers
Baking a lora into a quantized weight requantizes it, and on low-bit
formats round-to-nearest erases sub-step deltas (uint4 retains roughly
2/group_size of the signal). Plain lora deltas now ride the sdnq svd
side-channel: factors append to svd_up/svd_down with the down factor
hadamard-rotated, applied by the dequantizer at full precision in every
forward mode. Apply and remove are exact and take no weight backup.

- non-factorable families (dora, lokr, loha, oft, cp mid, dense bias)
  fall back to requantize with a per-pass summary warning
- native fuse now honors the quantized-model guard; fuse requantized in
  place on every network swap and accumulated drift
- layers that fell back on a mixed set restore from backup before
  re-entering the factor path; untargeted quantized layers are no
  longer flagged
- test/test-sdnq-lora-factors.py pins the erasure law, factor-path
  exactness, memory accounting and set transitions
2026-08-25 00:25:22 +01:00
Vladimir Mandic 5159e8b1a5 experimental minimax chunking
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-24 18:51:30 +02:00
Vladimir Mandic 1714657cf7 change minimax defaults
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-24 18:51:30 +02:00
Dity0 f6777b168d SDNQ Atten: add quantize_fp32 2026-08-24 19:34:54 +03:00
Vladimir Mandic 3c2236c4ed fix ideogram4
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-24 14:57:58 +02:00
Vladimir Mandic fb5584d3fe error handle vae decode
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-24 10:26:28 +02:00
Vladimir Mandic 8eefb62173 Merge branch 'master' into dev 2026-08-24 09:14:02 +02:00
Vladimir Mandic c2ce67418c fix prompt enhance api
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-24 09:00:02 +02:00
Vladimir Mandic 0543fc185d update kernel autotune reporting
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-23 14:08:21 +02:00
Vladimir Mandic c81cfa1bb9 Merge pull request #5053 from vladmandic/dev
refresh master
2026-08-23 12:02:09 +02:00
Vladimir Mandic 9adccd6188 Merge branch 'master' into dev 2026-08-23 12:01:50 +02:00
Vladimir Mandic 1f1eab3b7a update changelog and todo
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-23 11:52:42 +02:00
Vladimir Mandic 38324a198e more api cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-23 11:40:53 +02:00
Vladimir Mandic f4aa9d1b86 batch processing run register after script
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-23 11:34:34 +02:00
Vladimir Mandic c5e29e3d7b api schema updates
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-23 11:28:50 +02:00
Vladimir Mandic cf3dfebc98 fix file logger traceback
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-23 09:59:38 +02:00
Vladimir Mandic 0325bf517b Merge pull request #5049 from vladmandic/dev
refresh master
2026-08-22 20:10:53 +02:00
Vladimir Mandic b21fb577c9 Merge branch 'master' into dev 2026-08-22 20:10:45 +02:00
Vladimir Mandic e17efc19f7 update upscaler workflow
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 20:10:02 +02:00
Vladimir Mandic 2cafc60e92 Merge pull request #5048 from vladmandic/dev
refresh master
2026-08-22 18:12:10 +02:00
Vladimir Mandic 9b5cf7a73b Merge branch 'master' into dev 2026-08-22 18:11:58 +02:00
Vladimir Mandic 9920004dec update file logger and requirements
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 17:52:49 +02:00
Vladimir Mandic 2fe5049c04 Merge pull request #5047 from vladmandic/dev
refresh master
2026-08-22 16:15:42 +02:00
Vladimir Mandic a6b6a472c9 Merge branch 'master' into dev 2026-08-22 16:15:32 +02:00
Vladimir Mandic 69d8f4f7c4 handle torchsde
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 16:08:58 +02:00
Vladimir Mandic 5c91f58c24 update todo/changelog
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 11:45:06 +02:00
Vladimir Mandic f66650f913 Merge pull request #5046 from vladmandic/dev
fix missing export
2026-08-22 11:39:46 +02:00
Vladimir Mandic 25edd3387f Merge branch 'master' into dev 2026-08-22 11:39:38 +02:00
Vladimir Mandic 87cb999713 fix missing export
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 11:38:51 +02:00
Vladimir Mandic 9053a3d8b9 Downgrade pre-commit CI action version to v1.1.0 2026-08-22 11:36:04 +02:00
Vladimir Mandic 100a4da109 Merge pull request #5045 from vladmandic/master
refresh dev
2026-08-22 11:30:32 +02:00
Vladimir Mandic 864e9a497f Merge branch 'dev' into master 2026-08-22 11:30:18 +02:00
Vladimir Mandic 63a5722429 prepare queue mgmt
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 11:24:41 +02:00
Vladimir Mandic 367f863661 Update GitHub Actions to use latest action versions 2026-08-22 11:24:19 +02:00
Vladimir Mandic dfc399c7af Rename lint workflow to 'Lint Project' 2026-08-22 11:20:56 +02:00
Vladimir Mandic c68d993b75 Rename workflow to 'Build GitHub Pages' 2026-08-22 11:20:31 +02:00
Vladimir Mandic dcdfa5534f Rename workflow to 'Edit Readme Sponsors' 2026-08-22 11:20:07 +02:00
Vladimir Mandic 2ba7f9d1c8 update js deps and submodules
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 09:30:49 +02:00
Vladimir Mandic 8cc52889a3 lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-21 20:35:15 +02:00
Vladimir Mandic 84c1ed66b3 video upscaling
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-21 20:28:44 +02:00
Vladimir Mandic 9dd1d73f6d video upscaling using spandrel
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-21 16:21:12 +02:00
Vladimir Mandic d239bfcde1 placeholder video upscale
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-21 10:26:17 +02:00
Vladimir Mandic 52f5c17435 update spandrel integation
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-21 09:35:15 +02:00
CalamitousFelicitousness 25b7961e4e fix(lora): refuse a network whose deltas do not fit the model
A delta that does not fit its target module cannot apply, and applying only
the layers that do fit leaves the model in a state nothing was trained for,
so try_load_chain drops the whole file when any family reports a mismatch.
Bias deltas were never checked against the target bias and could only surface
at apply time; a module with no bias stays a non-mismatch, since whole
architectures are built bias=False.

- check bias deltas against the module bias in the lora, norm and full loaders
- carry the mismatch count on the network so the chain can refuse the file
- record refused writes in the infotext so a partial apply is not read as clean
- point the krea2 full-diff test at a module that has a bias
2026-08-21 02:12:16 +01:00
CalamitousFelicitousness 6a354cdbc6 fix(lora): apply bias deltas onto the bias, not the weight
network_add_weights defaulted its base tensor to self.weight for the bias
delta as well, so in fuse mode a diff_b was added to the weight matrix and
the result written into the bias. Layers where in and out differ threw a
shape error and had the weight matrix installed as their bias, square layers
broadcast silently, and either way the summary still counted the delta as
applied.

- pick the base tensor from the bias flag
- name the layer, target and both shapes in the mismatch error
- return which of (weight, bias) took a write, count the rest as refused
- report refused= on partially applied and partially removed networks
- cover both apply paths in test/test-lora-apply.py
2026-08-21 01:42:25 +01:00
Dity0 43b739066d Add tensor-wise quantization support with group_size=-2 2026-08-21 00:04:33 +03:00