Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Rsg devel #54
base: main
Are you sure you want to change the base?
Rsg devel #54
Changes from 6 commits
53dc350
dfb7adb
fc5cd73
77ba205
94b5b9b
b74ed3a
ef5f04a
0a1a8d0
3a0feed
a9f6ad0
32e35f4
71fe065
18cf67a
64a5b20
71137ea
261b7f8
8aa9d80
8cb66b6
0b7fa01
d6c308a
e23b48b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
interesting, is this a significant performance gain? I don't think this works in the general case but it should always work here as far as I can tell
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.
ohhh I see - torch compile couldn't go through unpack?
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.
Exactly. This is a requirement for the compiler
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.
repeat should be creating a view here and shouldn't be memory intensive even though the tensor is huge - is this not the case?
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.
If I am correct, is expand and not repeat the one that is a view. This change was again a requirement for the compiler.
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.
I think you're right for the torch API but einops it creates a view where possible - regardless, compilation is super important.
I'm a little hesitant to lose the rank polymorphism here and it looks like this unsqueeze/repeat is specific to
b h w 3
rather than... h w 3
-> could you try adding some code to intepret the current shape and unsqueeze/repeat according to that? This should allow us to maintain the current flexibility and have compatibility with the compilerThere 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.
This should work
conjugate_mask.unsqueeze(-1).expand(*[-1] * len(conjugate_mask.shape), 3)
and being more memory efficient, since it is a view.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.
this docstring needs fixing