Commit Graph
522 Commits
Author SHA1 Message Date
EthanfelandClaude Sonnet 4.6 3b4a574355 feat: drop download_only — community cache is upload_and_download only
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>
2026-04-04 15:27:19 +02:00
EthanfelandClaude Sonnet 4.6 5361a18de6 feat: upload config from memory hit path
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>
2026-04-04 15:19:44 +02:00
EthanfelandClaude Sonnet 4.6 a031d7b027 fix: community cache blocked by memory hit — move before memory check
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>
2026-04-04 15:15:19 +02:00
EthanfelandClaude Sonnet 4.6 7f63e610f8 fix: move "will run full analysis" log to after all cache checks
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>
2026-04-04 15:07:46 +02:00
EthanfelandClaude Sonnet 4.6 a4f1a75a33 feat: improve community cache logging verbosity
- 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>
2026-04-04 15:02:48 +02:00
EthanfelandClaude Sonnet 4.6 f1ddd4ae24 refactor: split AUTOTUNER_ALGO_VERSION into two separate versions
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>
2026-04-04 14:59:00 +02:00
EthanfelandClaude Sonnet 4.6 3146aff22e fix: support huggingface-cli login for community cache uploads
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>
2026-04-04 14:02:49 +02:00
EthanfelandClaude Sonnet 4.6 b323d810a3 fix: community hit normalize_keys override user setting
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>
2026-04-04 13:55:22 +02:00
EthanfelandClaude Sonnet 4.6 e5c12561d1 fix: community cache arch key mismatch and misleading banner
- 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>
2026-04-04 13:51:34 +02:00
EthanfelandClaude Sonnet 4.6 620399d3c1 feat: add community_cache — HF-backed shared analysis results
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>
2026-04-04 13:39:56 +02:00
EthanfelandClaude Sonnet 4.6 a6535ef418 chore: bump version to 1.6.0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 12:25:26 +02:00
EthanfelandClaude Sonnet 4.6 23038f7e3c fix: include clip_strength_multiplier in lora cache magnitude unscaling
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>
2026-04-04 12:17:19 +02:00
EthanfelandClaude Sonnet 4.6 453dfc8f04 feat: auto_ignore_strength falls back to highest-strength cached entry
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>
2026-04-03 23:19:36 +02:00
EthanfelandClaude Sonnet 4.6 4fabaf7417 feat: add auto_ignore_strength memory mode to AutoTuner
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>
2026-04-03 23:17:03 +02:00
EthanfelandClaude Sonnet 4.6 91f514e291 docs: document memory_mode, selection, output_mode, and caching infrastructure
- 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>
2026-04-03 20:20:44 +02:00
Ethanfel 490042fc7d fix: don't overwrite valid lora cache entries with None non-participant sentinel 2026-04-03 20:06:52 +02:00
Ethanfel 950c724817 fix: move pair/lora extraction outside cached_analysis guard in CPU path 2026-04-03 19:56:54 +02:00
Ethanfel 5d9e980667 fix: use eff_s for sign-flip check in pair/lora cache reconstruction (clip_strength support) 2026-04-03 19:39:45 +02:00
EthanfelandClaude Sonnet 4.6 e947decc73 feat: wire pair/lora cache load and save through auto_tune
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>
2026-04-03 19:33:06 +02:00
Ethanfel c39b60c006 fix: rename lora_entry to pair_entry in pair cache extraction blocks 2026-04-03 19:31:15 +02:00
EthanfelandClaude Sonnet 4.6 2f29e6e727 feat: wire pair/lora cache hit/miss into _run_group_analysis
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>
2026-04-03 19:28:34 +02:00
Ethanfel df0f20da9b fix: use raw strength for display_l2 in pair/lora cache reconstruction 2026-04-03 19:25:45 +02:00
EthanfelandClaude Sonnet 4.6 d0746aad55 feat: add _reconstruct_from_pair_lora_cache
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 19:22:16 +02:00
Ethanfel b5db2bc6fa fix: remove dead guard and fix test docstring in extraction helpers 2026-04-03 19:20:08 +02:00
EthanfelandClaude Sonnet 4.6 4680f94c3f feat: add per-lora and per-pair cache extraction helpers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 18:34:05 +02:00
EthanfelandClaude Sonnet 4.6 732f684b69 feat: add pair cache I/O methods
Add _pair_cache_path, _pair_cache_load, _pair_cache_save static methods
to LoRAAutoTuner, plus TestPairCacheIO with 6 tests covering path
sorting, missing/stale miss, roundtrip, commutativity, and atomicity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 18:30:23 +02:00
EthanfelandClaude Sonnet 4.6 e20e43b9da feat: add lora identity hash and lora cache I/O methods
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 18:03:07 +02:00
EthanfelandClaude Sonnet 4.6 f91d7ccf9d docs: fix 3 bugs in pair/lora cache plan
- 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>
2026-04-03 17:56:50 +02:00
EthanfelandClaude Sonnet 4.6 3c22d1c0e5 docs: add pair/lora cache implementation plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 17:50:25 +02:00
EthanfelandClaude Sonnet 4.6 810f858ec4 docs: add pair/lora cache design for cross-run analysis reuse
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 17:43:22 +02:00
EthanfelandClaude Sonnet 4.6 27eca3b51f fix: delete partial immediately on load to prevent early-return leaks
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>
2026-04-03 17:10:45 +02:00
EthanfelandClaude Sonnet 4.6 a0e6e1e5f7 fix: reset using_partial on clear_and_run, clean up log messages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 17:06:45 +02:00
EthanfelandClaude Sonnet 4.6 b2dd00c189 fix: ensure clean test state in partial promotion test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 17:03:37 +02:00
EthanfelandClaude Sonnet 4.6 b2bb81ee1e fix: partial log prefix, stuck-state promotion, and resume test
- 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>
2026-04-03 16:54:30 +02:00
EthanfelandClaude Sonnet 4.6 6fe84804f6 feat: wire analysis partial checkpoint lifecycle into auto_tune
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>
2026-04-03 16:49:38 +02:00
EthanfelandClaude Sonnet 4.6 79b8353d51 feat: add on_prefix_done callback to _run_group_analysis
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>
2026-04-03 16:44:56 +02:00
EthanfelandClaude Sonnet 4.6 deb69182ee feat: add analysis partial checkpoint I/O methods
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 16:41:30 +02:00
EthanfelandClaude Sonnet 4.6 4ca73e93e5 docs: add analysis resume implementation plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 16:38:59 +02:00
EthanfelandClaude Sonnet 4.6 90c5f9e774 docs: add analysis resume design and unignore docs/plans
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 16:37:07 +02:00
EthanfelandClaude Sonnet 4.6 c387c94841 fix: analysis cache never written on first run (add track_new_entries flag)
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>
2026-04-02 20:30:13 +02:00
EthanfelandClaude Sonnet 4.6 aec7492e3a fix: correct 9-element early return tuple and clip_strength unscaling in analysis cache
- 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>
2026-04-02 20:15:05 +02:00
EthanfelandClaude Sonnet 4.6 c40f5af458 feat: add raw_analysis field to AutoTuner dataset entries
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 20:07:48 +02:00
EthanfelandClaude Sonnet 4.6 8251581862 feat: wire analysis cache hash and save through auto_tune
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 20:05:17 +02:00
EthanfelandClaude Sonnet 4.6 1b886d9ebc feat: integrate analysis cache into _run_group_analysis
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 20:02:51 +02:00
EthanfelandClaude Sonnet 4.6 2820800c70 feat: add _reconstruct_from_analysis_cache on LoRAOptimizer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 19:59:47 +02:00
EthanfelandClaude Sonnet 4.6 2f70a2b6f9 feat: add _extract_for_analysis_cache on LoRAOptimizer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 19:56:59 +02:00
EthanfelandClaude Sonnet 4.6 18bedcc361 feat: add analysis cache I/O methods (_analysis_cache_path/load/save)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 19:53:19 +02:00
EthanfelandClaude Sonnet 4.6 260fd5c6ad refactor: improve _compute_names_only_hash docstring and remove unused setUp
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 19:51:28 +02:00
EthanfelandClaude Sonnet 4.6 cdfeeb67cc feat: add _compute_names_only_hash for analysis cache key
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 19:46:33 +02:00
EthanfelandClaude Sonnet 4.6 8e955187fa style: fix E702 multiple-statements-on-one-line in kernel.py
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>
2026-04-02 01:01:50 +02:00