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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

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
Co-authored-by: Zecheng Zhang <zecheng@kumo.ai>
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.

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.

3 participants