Removes the passive download_only option to encourage contribution.
Users who want community results need to also contribute back.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Memory hits had content_hashes and the cached config available but
never uploaded. Now uploads the winning config to community cache on
memory hits too. lora/pair analysis entries are still only uploaded
after a full sweep (they require _run_group_analysis output).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Community download block was inside Pass 1, after the memory check's
early return. Runs with memory_mode=auto never reached the community
code, so nothing was downloaded or uploaded despite community_cache
being set to upload_and_download.
Moved lora/pair cache init + community download block to before the
persistent memory lookup so community hits and uploads work regardless
of memory cache state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously fired before memory/community checks, causing misleading
"MISS — will run full analysis" followed by "Memory HIT". Now logs
"No cached results — running full sweep" only when all caches miss.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Show mode, LoRA count, and arch at start of check
- Report lora/pair cache hits as X/N (e.g. "2/3 lora hit, 2/3 pair hit")
- Log "No config found — will run full sweep" on config miss
- Log config version mismatch with both versions
- Log "Config HIT" with score and arch on success
- Log "COMMUNITY CACHE HIT" with score on replay
- Track and report upload counts (N lora, M pair, config score)
- Log when config not uploaded due to community score being higher
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AUTOTUNER_ALGO_VERSION = "1.5.0" — scoring formula, memory/config format
ANALYSIS_CACHE_VERSION = "1.6.0" — per-prefix conflict math (lora/pair/analysis caches)
The clip_strength_multiplier fix only affects CLIP prefix entries.
Models without CLIP (Wan, etc.) had valid lora/pair caches that were
being incorrectly invalidated by the version bump. Now only analysis
caches are invalidated when conflict math changes, and only memory/
community configs are invalidated when scoring changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fall back to huggingface_hub stored token so users who ran
'huggingface-cli login' can upload without setting HF_TOKEN manually.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Hardcoded "normalize_keys": "enabled" in reconstructed community
tuner_data was always overriding the user's normalize_keys param.
Removed the field so the fallback correctly uses the user's setting.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Download and upload now both resolve arch via _resolve_arch_preset,
so config filenames are consistent (e.g. "dit" not "flux")
- Upload reuses _arch_key_for_community instead of tuner_preset_key
- Community hit banner no longer shows memory_mode hint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces dead record_dataset param with community_cache dropdown
(disabled / download_only / upload_and_download).
Downloads are anonymous via urllib; uploads require HF_TOKEN and
huggingface_hub. LoRA filenames are never shared — content hashes
(SHA256[:16]) are used as keys. Per-LoRA/pair conflict metrics and
winning merge configs are shared; network errors fall back silently to
the full local sweep.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
magnitude_samples in _analyze_target_group are built with eff_s =
strength * clip_strength_multiplier for CLIP prefixes without a per-LoRA
clip_strength. The extraction function was dividing by raw strength only,
so stored samples were off by csm. Reconstruction then rescaled without
csm, causing wrong magnitudes if csm changed between runs.
Fix: pass clip_strength_multiplier through _extract_for_lora_cache and
_reconstruct_from_pair_lora_cache, and use the same eff_s formula as
_prepare_group_diffs. Non-CLIP prefixes and models without CLIP are
unaffected (csm is never applied to them).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When auto_ignore_strength misses on the names-only hash, scan existing
strength-sensitive entries with the same LoRA names and settings, and
use the one made with the highest total absolute strength (most reliable
strategy rankings). The result is then promoted to the names-only key
so future runs hit directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New memory_mode option that caches tuning results keyed by LoRA names
only (ignoring strengths). Useful when sweeping strengths on orthogonal
LoRAs where the optimal config (strategy, sparsification, refinement)
doesn't change with strength — avoids full Phase 2 re-run on each
strength change while still replaying the merge with current strengths.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add memory_mode, selection, output_mode to AutoTuner entries in Nodes.md
- Add output_mode, memory_mode, selection sections to Configuration-Guide
- Add AutoTuner Caching Infrastructure section covering all three cache types
(.memory.json, .analysis.json, .analysis.partial.json) and how to clear them
- Add 3 troubleshooting entries for cache-related issues in Tips-and-Troubleshooting
- Update speed tip to mention memory_mode=auto
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Loads lora/pair caches before _run_group_analysis and merges new entries
back into on-disk cache files after successful analysis, completing the
analysis cache feature end-to-end.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add lora_caches/pair_caches/lora_hashes params to _run_group_analysis,
skip _analyze_target_group on full cache hit via _pair_lora_cache_hit,
and populate new_lora_entries/new_pair_entries in the return dict on miss.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Task 4: guard min(participating) against empty set
- Task 5: add CPU path hit check before executor.submit
- Task 5/6: guard pair extraction with entry is not None
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously the partial file was only deleted at post-analysis cleanup,
so early returns (memory-cache hit, no target groups) left it on disk
permanently. Now the partial is deleted as soon as its contents are
absorbed into cached_analysis; the on_prefix_done callback recreates
it incrementally for any new prefixes computed in the same run.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Correct log prefix in _analysis_partial_save except block from
[AutoTuner Analysis Cache] to [AutoTuner Analysis Partial]
- Add using_partial flag so partial is promoted to full cache even
when all prefixes were already cached (stuck-state fix)
- Move _analysis_partial_delete outside the new_entries guard so it
is always called (safe no-op when file doesn't exist)
- Add test_partial_promoted_to_full_cache_when_all_prefixes_already_done
to TestAnalysisPartialLifecycle exercising the stuck-state fix
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On startup, fall back to partial checkpoint when no full cache exists.
Define _on_prefix_done callback that writes partial file after each
fresh prefix. Pass callback to _run_group_analysis. Delete partial on
successful full cache write. Delete partial on clear_and_run. Also fix
log prefixes in _analysis_partial_load/save (carry-forward from Task 1
review).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Callers can now pass on_prefix_done=lambda prefix, entry: ... to receive
a callback after each freshly-computed prefix is extracted. The callback
fires only on cache misses and only when track_new_entries=True, so all
existing call sites (which pass neither argument) are unaffected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On first run cached_analysis is None, causing new_analysis_entries to
stay empty and the cache to never be saved. Replace the
'cached_analysis is not None' guard with an explicit 'track_new_entries'
flag so auto_tune opts in while other callers of _run_group_analysis
avoid the extraction overhead.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove trailing {} from _analyze_target_group early return (was 9 elements,
_collect_analysis_result only unpacks 8)
- Use clip_strength as effective strength in _extract_for_analysis_cache when
is_clip is True, matching the scaling used in _analyze_target_group
- Remove unused _strength_signs variable in auto_tune
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Split all semicolon-separated statements onto individual lines
throughout the Triton SVD kernels (_svd2_kernel, _svd3_kernel).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>