-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Implement eviction in persistent cache (#16289)
This PR implements eviction for persistent cache. Eviction is disabled by default and can be controlled by the user via `SYCL_CACHE_MAX_SIZE` variable. Here's how eviction works: 1. File size: A file called, `cache_size.txt`, is stored at the root of persistent cache. Every time a process adds a new entry to cache, it will also update the `cache_size.txt` file. This file is used to track the size of persistent cache. For backwards compatibility, if SYCL RT does not find `cache_size.txt` in the cache root, it will create once. All access to `cache_size.txt` are done using `LockCacheItem`, to prevent data races. 2. When adding a new entry to cache, SYCL RT will check the `cache_size.txt` file and if the cache size exceeds the threshold, eviction is triggered. 3. When a cache entry is created/accessed, SYCL RT create a file in that cache entry to store the access time. This file is later read during eviction. 4. During eviction, SYCL RT will determine the last access time of each cache entry and items are evicted based on the LRU policy.
- Loading branch information
1 parent
cc4dee4
commit 52015d8
Showing
8 changed files
with
604 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.