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 new memoization guide #129

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Add new memoization guide #129

merged 1 commit into from
Mar 26, 2024

Conversation

nicholasjng
Copy link
Collaborator

Follows up the artifact guide with an example of a memo. This is work in progress until the cache and eviction policy are implemented and confirmed to work.

@nicholasjng nicholasjng added the documentation Improvements or additions to documentation label Mar 25, 2024
@nicholasjng nicholasjng self-assigned this Mar 25, 2024
Follows up the artifact guide with an example of a memo. This is work in
progress until the cache and eviction policy are implemented and
confirmed to work.
Copy link
Collaborator

@maxmynter maxmynter left a comment

Choose a reason for hiding this comment

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

Nice!
This PR also clears some questions I had regarding the implementation of the Memo. I'll have to adapt #130 a but but will get it in a reviewable state today.

To address this problem, this guide introduces **memos** as a way to reduce memory pressure when benchmarking multiple memory-intensive models and datasets sequentially.

## Using the `nnbench.Memo` class
// TODO: Move the class up into the main export.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Taking care of this in #130

return np.sum(model.apply(data))
```

//TODO: Add tearDown task clearing the memo cache.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can also take care of this in #130

@nicholasjng
Copy link
Collaborator Author

I'm going to address the TODOs after #130 is done, and proceed with this then.

@nicholasjng nicholasjng merged commit d5e033f into main Mar 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants