[FRONTEND] Add support for using remote cache managers#2934
[FRONTEND] Add support for using remote cache managers#2934jansel merged 2 commits intotriton-lang:mainfrom
Conversation
36f58c3 to
4601cbb
Compare
|
|
||
| from .cache import RemoteCacheBackend | ||
|
|
||
| import redis |
There was a problem hiding this comment.
can we import this lazily so we Triton doesn't have to depend on redis?
That said, i guess no other file imports redis.py so maybe it's fine?
There was a problem hiding this comment.
Ah yeah, I was wondering this at the time. I think the only way this file would get loaded is if the user sets e.g. TRITON_CACHE_MANAGER=triton.runtime.cache:RemoteCacheManager TRITON_REMOTE_CACHE_BACKEND=triton.runtime.redis:RedisRemoteCacheBackend, but I didn't know if there was potentially some other setup that was sensitive to top-level imports even the module itself isn't explicitly loaded.
There was a problem hiding this comment.
I think that's fair, but I believe it may be even cleaner to move import redis inside of RedisRemoteCacheBackend.__init__ and define RedisRemoteCacheBackend in cache.py
There was a problem hiding this comment.
Updated to do this.
4601cbb to
2414638
Compare
a8624ef to
8fc71ec
Compare
|
@andrewjcg are we planning on merging this? |
|
@andrewjcg @oulgen looks like a lint is failing: |
Adds a redis-based one as an initial implementation, but it should be straightforward to extend with more impls.
Head branch was pushed to by a user without write access
…terface method (#3336) #2934 have changed some of the FileCacheManager methods into a private interface, while `_has_file` method is still being used by the Override functionality. Exposing the method again. (An alternative is to call private `_has_file` from the override, which would be OK too, since it is debug only thing).
…nagers (triton-lang#2934) (triton-lang#3379)" This reverts commit 996b6c0.
…riton-lang#3302) triton-lang#2934 added `RedisRemoteCacheBackend` but did not add the symbol to `__init__.py`. Let's also add there so that we can refer to it via full path instead of having to `from ... import RedisRemoteCacheBackend`.
…terface method (triton-lang#3336) triton-lang#2934 have changed some of the FileCacheManager methods into a private interface, while `_has_file` method is still being used by the Override functionality. Exposing the method again. (An alternative is to call private `_has_file` from the override, which would be OK too, since it is debug only thing).
…riton-lang#2934) (triton-lang#3379) Adds a redis-based one as an initial implementation, but it should be straightforward to extend with more impls. Co-authored-by: andrewjcg <andrewjcg@gmail.com>
…riton-lang#3302) triton-lang#2934 added `RedisRemoteCacheBackend` but did not add the symbol to `__init__.py`. Let's also add there so that we can refer to it via full path instead of having to `from ... import RedisRemoteCacheBackend`.
…terface method (triton-lang#3336) triton-lang#2934 have changed some of the FileCacheManager methods into a private interface, while `_has_file` method is still being used by the Override functionality. Exposing the method again. (An alternative is to call private `_has_file` from the override, which would be OK too, since it is debug only thing).
Adds a redis-based one as an initial implementation, but it should be straightforward to extend with more impls.