Skip to content

[FRONTEND] Add support for using remote cache managers#2934

Merged
jansel merged 2 commits intotriton-lang:mainfrom
andrewjcg:remote_cache
Mar 4, 2024
Merged

[FRONTEND] Add support for using remote cache managers#2934
jansel merged 2 commits intotriton-lang:mainfrom
andrewjcg:remote_cache

Conversation

@andrewjcg
Copy link
Copy Markdown
Contributor

Adds a redis-based one as an initial implementation, but it should be straightforward to extend with more impls.

Comment thread python/triton/runtime/redis.py Outdated

from .cache import RemoteCacheBackend

import redis
Copy link
Copy Markdown
Collaborator

@ptillet ptillet Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to do this.

@andrewjcg andrewjcg force-pushed the remote_cache branch 4 times, most recently from a8624ef to 8fc71ec Compare January 18, 2024 15:33
@oulgen
Copy link
Copy Markdown
Contributor

oulgen commented Mar 2, 2024

@andrewjcg are we planning on merging this?

@jansel
Copy link
Copy Markdown
Contributor

jansel commented Mar 4, 2024

@andrewjcg @oulgen looks like a lint is failing:

 yapf.....................................................................Failed
- hook id: yapf
- duration: 5.86s
- files were modified by this hook

Adds a redis-based one as an initial implementation, but it should be
straightforward to extend with more impls.
auto-merge was automatically disabled March 4, 2024 21:34

Head branch was pushed to by a user without write access

@jansel jansel merged commit 04c0daa into triton-lang:main Mar 4, 2024
jlebar pushed a commit that referenced this pull request Mar 7, 2024
…3302)

#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`.
pawelszczerbuk added a commit that referenced this pull request Mar 11, 2024
…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).
shunting314 pushed a commit to shunting314/triton that referenced this pull request Mar 14, 2024
)

Adds a redis-based one as an initial implementation, but it should be
straightforward to extend with more impls.
ptillet pushed a commit that referenced this pull request Mar 14, 2024
…2934) (#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>
shunting314 added a commit to shunting314/triton that referenced this pull request Mar 19, 2024
ptillet pushed a commit that referenced this pull request Mar 19, 2024
…nagers (#2934) (#3379)"

This reverts commit 996b6c0.

The cherry-pick should be applied to 2.3.x instead.
htyu pushed a commit to htyu/triton that referenced this pull request Mar 20, 2024
…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`.
htyu pushed a commit to htyu/triton that referenced this pull request Mar 20, 2024
…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).
ptillet pushed a commit that referenced this pull request Apr 1, 2024
…nagers (#2934) (#3379)"

This reverts commit be445fb.

The cherry-pick should be applied to 2.3.x instead.
pingzhuu pushed a commit to siliconflow/triton that referenced this pull request Apr 2, 2024
…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>
binarman pushed a commit to binarman/triton that referenced this pull request Apr 2, 2024
)

Adds a redis-based one as an initial implementation, but it should be
straightforward to extend with more impls.
binarman pushed a commit to binarman/triton that referenced this pull request Apr 2, 2024
…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`.
ptillet pushed a commit that referenced this pull request Apr 3, 2024
…2934) (#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>
karupayun pushed a commit to openxla/triton that referenced this pull request Apr 3, 2024
…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants