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

Support pin_memory() in Multi{Embedding,Nested}Tensor and TensorFrame #437

Merged
merged 9 commits into from
Dec 30, 2024

Conversation

akihironitta
Copy link
Member

No description provided.

@github-actions github-actions bot added the data label Aug 17, 2024
@akihironitta akihironitta changed the title Add Multi{Embedding,Nested}Tensor.pin_memory() and TensorFrame.pin_memory() Support pin_memory() in Multi{Embedding,Nested}Tensor and TensorFrame Aug 17, 2024
@akihironitta akihironitta marked this pull request as ready for review August 17, 2024 11:34
Copy link
Contributor

@yiweny yiweny left a comment

Choose a reason for hiding this comment

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

What is pin_memory? 🙂‍↔️

@akihironitta akihironitta marked this pull request as draft August 19, 2024 10:21
Copy link
Member Author

@akihironitta akihironitta left a comment

Choose a reason for hiding this comment

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

It's useful for moving data to GPU faster: https://pytorch.org/docs/stable/data.html#memory-pinning :)

Copy link
Member

@zechengz zechengz left a comment

Choose a reason for hiding this comment

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

LGTM.
IMO usually we set pin_memory for the dataloader right?

torch_frame/data/multi_tensor.py Outdated Show resolved Hide resolved
Copy link
Member Author

@akihironitta akihironitta left a comment

Choose a reason for hiding this comment

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

IMO usually we set pin_memory for the dataloader right?

Yes! The dataloader will now call this method on our multi tensors and tensor frame.

@weihua916
Copy link
Contributor

are we merging this? Why there are a lot of test failures?

@akihironitta akihironitta marked this pull request as ready for review December 30, 2024 19:33
@akihironitta
Copy link
Member Author

Will be merging this PR once the CI becomes green 🟢 Let me know if anyone has any review comments on this PR as I'm happy to address any concerns or elaborate on the change in this PR :)

@akihironitta akihironitta merged commit febb5e4 into master Dec 30, 2024
15 checks passed
@akihironitta akihironitta deleted the aki-pin-memory branch December 30, 2024 19:41
Comment on lines +98 to +99
@onlyCUDA
def test_basics(device):
Copy link
Member Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants