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

Alternative weakref #55

Merged
merged 2 commits into from
May 25, 2023
Merged

Alternative weakref #55

merged 2 commits into from
May 25, 2023

Conversation

johncalesp
Copy link
Contributor

@johncalesp johncalesp commented May 23, 2023

  • Weakref alternative implementation by Pytorch
    "This file defines a variant of WeakKeyDictionary that overrides the hashing
    behavior of the key to use object identity, rather than the builtin
    eq/hash functions. This is useful for Tensor weak keys, as their
    eq implementation return a Tensor (elementwise equality), which means
    you can't use them directly with the WeakKeyDictionary in standard library."
    url: https://github.com/pytorch/pytorch/blob/v2.0.1/torch/utils/weak.py
  • Modification in weights.py to use this new implementation.
  • Profiling now works with models that reference the same weights in memory

@johncalesp johncalesp requested a review from jimgao1 May 23, 2023 20:53
@johncalesp johncalesp merged commit 1c5c19d into main May 25, 2023
1 check was pending
@johncalesp johncalesp deleted the alternative-weakref branch May 25, 2023 15:34
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.

None yet

3 participants