[cute] Persist autotune winner from memory instead of recompiling#2768
[cute] Persist autotune winner from memory instead of recompiling#2768fulvius31 wants to merge 2 commits into
Conversation
The on-disk cache key deliberately excludes CUTE_DSL_CACHE_DIR, so the winner's still-in-memory ir_module can be re-persisted directly into the real cache dir under the exact filename a later process looks up. Replaces finalize's evict-and-recompile: saves one cute.compile per autotune, keeps the winner hot in memory, and persists the artifact even when the tuning process never launches the kernel afterward.
|
@claude review these changes |
|
Claude finished @fulvius31's task in 2m 37s —— View job Review: Persist autotune winner from memory instead of recompiling
Overall this is a clean, well-reasoned change. Replacing the evict-and-recompile dance with a direct re-persist from memory is the right move: it saves one Correctness — the env-var handoff checks outThe flow is sound:
The central correctness assumption — that the on-disk key excludes Main feedback — the test's "no recompile" assertion is tautologicalwith patch.object(cute, "compile", side_effect=AssertionError("winner should not recompile")):
result = kernel(*args_a)This runs in the same process right after The valuable half of the test is solid: Minor
Nice cleanup overall — the only thing I'd genuinely push on before merge is tightening the test so the reload path is actually covered. |
The on-disk cache key deliberately excludes CUTE_DSL_CACHE_DIR, so the winner's still-in-memory ir_module can be re-persisted directly into the real cache dir under the exact filename a later process looks up.
Replaces finalize's evict-and-recompile: saves one cute.compile per autotune, keeps the winner hot in memory, and persists the artifact even when the tuning process never launches the kernel afterward.