Skip to content
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

add a metrics to track persistent cache loading time #7039

Merged
merged 2 commits into from
May 9, 2024

Conversation

JackCaoG
Copy link
Collaborator

@JackCaoG JackCaoG commented May 8, 2024

No description provided.

@JackCaoG JackCaoG requested a review from jonb377 May 8, 2024 20:26
Copy link
Collaborator

@jonb377 jonb377 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -162,6 +162,7 @@ class PersistentCache : public AbstractCache<K, T, H, E> {
// if the key is tracked in memory, and if not it will check for a persisted
// version on disk.
TypePtr Get(const K& key) override {
TORCH_LAZY_TIMED("PersistentCacheGet");
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will also trigger for binaries that are already loaded and cached in-memory, what do you think of moving it to ~L176 to only capture the load+deserialize logic? Maybe renamed to TORCH_LAZY_TIMED("PersistentCacheLoad")

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sg, let me update

@JackCaoG JackCaoG merged commit c1b745e into master May 9, 2024
20 checks passed
@JackCaoG JackCaoG deleted the JackCaoG/cache_metrics branch May 9, 2024 17:22
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.

2 participants