-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
operator level cache #65
Conversation
lotus/sem_ops/sem_agg.py
Outdated
@@ -14,6 +15,7 @@ def sem_agg( | |||
partition_ids: list[int], | |||
safe_mode: bool = False, | |||
progress_bar_desc: str = "Aggregating", | |||
use_operator_cache: bool = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High level question - should use_operator_cache
be a parameter here or is it better off in Settings
? I think there is an argument for the latter, since I see this pattern being used everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
putting it in settings is better I'd say. I can put it in settings
Looks pretty clean! Can we also add some tests to make sure that the behavior is as intended. |
lotus/settings.py
Outdated
@@ -13,6 +13,7 @@ class Settings: | |||
|
|||
# Cache settings | |||
enable_cache: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can enable_cache
be renamed to enable_messsage_cache
so its clear what the distinction is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea I can do that
lotus/cache.py
Outdated
|
||
cached_result = model.cache.get(cache_key) | ||
if cached_result is not None: | ||
print(f"Cache hit for {cache_key}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use lotus.logger
rather than prints.
Implement operator level caching