You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL] Implement eviction for in-memory program cache (#16062)
Fixes: CMPLRLLVM-27640, #2517
The PR implements LRU cache eviction policy for in-memory program
caches.
The high-level idea is to store programs in a linked-list, called
eviction list. When the program is first added to the cache, it is also
added to the eviction list. When a program is fetched from cache, we
move the program to the end of the eviction list. So, that the programs
at the beginning of the eviction list are always least recently used.
When adding a new program to cache, we check if the size of the program
cache exceeds the threshold, if so, we evict the program from cache and
corresponding kernels from Kernel and fast kernel cache.
This PR also adds a new environment variable,
`SYCL_IN_MEM_CACHE_EVICTION_THRESHOLD` that user can use to control the
size of in-memory cache. By default, cache eviction is disabled.
Copy file name to clipboardExpand all lines: sycl/doc/EnvironmentVariables.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ compiler and runtime.
14
14
|`SYCL_CACHE_DISABLE_PERSISTENT (deprecated)`| Any(\*) | Has no effect. |
15
15
|`SYCL_CACHE_PERSISTENT`| Integer | Controls persistent device compiled code cache. Turns it on if set to '1' and turns it off if set to '0'. When cache is enabled SYCL runtime will try to cache and reuse JIT-compiled binaries. Default is off. |
16
16
|`SYCL_CACHE_IN_MEM`| '1' or '0' | Enable ('1') or disable ('0') in-memory caching of device compiled code. When cache is enabled SYCL runtime will try to cache and reuse JIT-compiled binaries. Default is '1'. |
17
+
|`SYCL_IN_MEM_CACHE_EVICTION_THRESHOLD`| Positive integer |`SYCL_IN_MEM_CACHE_EVICTION_THRESHOLD` accepts an integer that specifies the maximum size of the in-memory program cache in bytes. Eviction is performed when the cache size exceeds the threshold. The default value is 0 which means that eviction is disabled. |
17
18
|`SYCL_CACHE_EVICTION_DISABLE`| Any(\*) | Switches persistent cache eviction off when the variable is set. |
18
19
|`SYCL_CACHE_MAX_SIZE`| Positive integer | Persistent cache eviction is triggered once total size of cached images exceeds the value in megabytes (default - 8 192 for 8 GB). Set to 0 to disable size-based cache eviction. |
19
20
|`SYCL_CACHE_THRESHOLD`| Positive integer | Persistent cache eviction threshold in days (default value is 7 for 1 week). Set to 0 for disabling time-based cache eviction. |
0 commit comments