Commit Graph
1 Commits
Author SHA1 Message Date
Lei WangandFreebase6912 d098f51b8f [Enhancement] Use atomic directory rename for cache writes (#1982)
* [Enhancement] Use atomic directory rename for cache writes

Replace per-file os.replace with write-to-staging + os.rename to
ensure other processes never see an incomplete cache directory.
Also add cleanup of stale staging dirs on init.

* [Bugfix] Fix atomic cache save: abort on critical file failure and fix staging cleanup

- Let kernel lib and params save failures propagate instead of swallowing
  them, so the staging directory is cleaned up rather than renamed as an
  incomplete cache entry.
- Move autotuner staging directory to TILELANG_CACHE_DIR so that
  _cleanup_stale_staging_dirs() can find and remove stale entries.

* Fix atomic cache save recovery and error handling

* Remove unnecessary blank lines in _FakeAdapter and _FakeKernel classes in autotune and cache test files.

* Tighten atomic cache completeness checks

* Simplify atomic cache save error handling

* submodule update

* remove legacy test

---------

Co-authored-by: Freebase6912 <amid-gauze-racing@duck.com>
2026-04-17 02:27:00 +08:00