mirror of
https://github.com/vladmandic/automatic
synced 2026-09-10 06:48:43 +02:00
82a7e94450
Plain svd truncation of hosted deltas is optimal in weight space but not in output space: activations concentrate energy in a few input channels, so scaling the delta by per-channel input RMS before the svd spends the rank budget on output error instead. Statistics stream from the model's own forwards on sub-8-bit SDNQ checkpoints and cache per checkpoint; measured on real LoKR files this raises output-delta retention by ~0.05 at rank 256 and ~0.09 at rank 64, most on MLP down projections. - modules/lora/lora_calib.py: capture hooks, per-checkpoint cache under data/sdnq-calib, statistics land on layers as sdnq_calib_rms; gated by lora_sdnq_host_calib, skipped when the model is compiled - lora_sdnq.apply_hosted: weighted truncation when statistics exist, calib count in the load summary - cli/sdnq-calibrate.py: complete calibration now against a live server - cli/lora-quant-fidelity.py --calib: hosted rho scored in the activation-weighted norm - test/test-sdnq-lora-factors.py: calibration category, 5 tests